| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136 |
- hardwareHotList = {}
- //热点 设备控制
- $("#hotPannel .close").on('click',()=>{
- $("#hotPannel>div").css("display","");
- window.hotNeedUpdatePanel = null;
-
- })
- $("#hotPannel input.mui-switch").on('change',()=>{
- var ifOn = $('#hotPannel input.mui-switch').is(':checked');
-
- })
- var dom = {
- getOffset: function(e, t, i) {
- for (left = "left" == e ? t.offsetLeft : t.offsetTop,
- i = i || $("body")[0]; (t = t.offsetParent) && t != i; )
- left += "left" == e ? t.offsetLeft : t.offsetTop;
- return left
- }
- };
- if (function() {
- "use strict";
- function o(e, t) {
- return typeof e === t
- }
- function a(e, t) {
- return e instanceof t
- }
- function s(e) {
- return e && e.nodeType
- }
- function l(e) {
- return s(e) ? e : a(e, y) ? e[0] : void 0
- }
- function e(e, i, n) {
- return y.each(e, function(e, t) {
- n = i.call(t, n, e, t)
- }),
- n
- }
- function t(e, t, i) {
- var n, r, o;
- if (e === t)
- return !0;
- if (!e || !t || e.constructor !== t.constructor)
- return !1;
- for (n = 0,
- r = i.length; n < r; n += 1) {
- if (e[o = i[n]] && E(e[o].equals) && !e[o].equals(t[o]))
- return !1;
- if (e[o] !== t[o])
- return !1
- }
- return !0
- }
- function c(e, t, i, n) {
- this.left = w(e),
- this.top = w(t),
- this.width = w(i),
- this.height = w(n),
- this.right = this.left + this.width,
- this.bottom = this.top + this.height
- }
- function h(e, t, i, n) {
- this.visible = e || 0,
- this.viewport = t || 0,
- this.possible = i || 0,
- this.rects = n && I({}, n) || null
- }
- function r(e, t) {
- this.els = e,
- this.viewport = t
- }
- function n(e, t) {
- return e.val - t.val
- }
- function u(e, t) {
- return t.val - e.val
- }
- function d(e) {
- var t = c.ofContent(e, !0)
- , i = c.ofViewport(e, !0)
- , n = t.width - i.width
- , r = t.height - i.height;
- this.content = t,
- this.viewport = i,
- this.width = n <= 0 ? null : i.left / n,
- this.height = r <= 0 ? null : i.top / r,
- this.left = i.left,
- this.top = i.top,
- this.right = t.right - i.right,
- this.bottom = t.bottom - i.bottom
- }
- function p(e) {
- this.el = e || window
- }
- function f(e, t) {
- this.context = e,
- this.viewport = t,
- this.init()
- }
- function g(e, t, i, n) {
- this.context = new r(e,t),
- this.property = i,
- this.descending = n,
- this.init()
- }
- function m(e) {
- e && e !== window && e !== document ? (this.context = e,
- this.$autoTarget = y(e)) : this.context = window,
- this.init()
- }
- 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 = {},
- v = 1,
- function(e) {
- return e ? (i[e] || (i[e] = v,
- v += 1),
- i[e]) : 0
- }
- );
- I(c.prototype, {
- equals: function(e) {
- return t(this, e, ["left", "top", "width", "height"])
- },
- area: function() {
- return this.width * this.height
- },
- relativeTo: function(e) {
- return new c(this.left - e.left,this.top - e.top,this.width,this.height)
- },
- intersection: function(e) {
- if (!a(e, c))
- return null;
- var t = _(this.left, e.left)
- , i = b(this.right, e.right)
- , n = _(this.top, e.top)
- , r = i - t
- , o = b(this.bottom, e.bottom) - n;
- return 0 <= r && 0 <= o ? new c(t,n,r,o) : null
- },
- envelope: function(e) {
- if (!a(e, c))
- return this;
- var t = b(this.left, e.left)
- , i = _(this.right, e.right)
- , n = b(this.top, e.top);
- return new c(t,n,i - t,_(this.bottom, e.bottom) - n)
- }
- }),
- I(c, {
- ofContent: function(e, t) {
- 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())
- },
- ofViewport: function(e, t) {
- 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())
- },
- ofElement: function(e) {
- var t = y(e);
- if (!t.is(":visible"))
- return null;
- var i = t.offset();
- return new c(i.left,i.top,t.outerWidth(),t.outerHeight())
- }
- }),
- I(h.prototype, {
- equals: function(e) {
- return this.fracsEqual(e) && this.rectsEqual(e)
- },
- fracsEqual: function(e) {
- return t(this, e, ["visible", "viewport", "possible"])
- },
- rectsEqual: function(e) {
- return t(this.rects, e.rects, ["document", "element", "viewport"])
- }
- }),
- I(h, {
- of: function(e, t) {
- var i, n, r;
- return e = s(e) && c.ofElement(e) || e,
- t = s(t) && c.ofViewport(t) || t || c.ofViewport(),
- e instanceof c && (i = e.intersection(t)) ? (n = i.area(),
- r = b(e.width, t.width) * b(e.height, t.height),
- new h(n / e.area(),n / t.area(),n / r,{
- document: i,
- element: i.relativeTo(e),
- viewport: i.relativeTo(t)
- })) : new h
- }
- });
- var x = ["width", "height", "left", "right", "top", "bottom"]
- , S = ["possible", "visible", "viewport"];
- I(r.prototype, {
- sorted: function(t, e) {
- var i = this.viewport;
- return y.map(this.els, function(e) {
- return {
- el: e,
- val: function(e, t, i) {
- var n;
- return 0 <= y.inArray(i, x) ? n = c.ofElement(e) : 0 <= y.inArray(i, S) && (n = h.of(e, t)),
- n ? n[i] : 0
- }(e, i, t)
- }
- }).sort(e ? u : n)
- },
- best: function(e, t) {
- return this.els.length ? this.sorted(e, t)[0] : null
- }
- }),
- I(d.prototype, {
- equals: function(e) {
- return t(this, e, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
- }
- }),
- I(p.prototype, {
- equals: function(e) {
- return t(this, e, ["el"])
- },
- scrollState: function() {
- return new d(this.el)
- },
- scrollTo: function(e, t, i) {
- var n = y(this.el === window ? "html,body" : this.el);
- e = e || 0,
- t = t || 0,
- i = isNaN(i) ? 1e3 : i,
- n.stop(!0).animate({
- scrollLeft: e,
- scrollTop: t
- }, i)
- },
- scroll: function(e, t, i) {
- var n = this.el === window ? A : y(this.el);
- e = e || 0,
- t = t || 0,
- this.scrollTo(n.scrollLeft() + e, n.scrollTop() + t, i)
- },
- scrollToRect: function(e, t, i, n) {
- t = t || 0,
- i = i || 0,
- this.scrollTo(e.left - t, e.top - i, n)
- },
- scrollToElement: function(e, t, i, n) {
- var r = c.ofElement(e).relativeTo(c.ofContent(this.el));
- this.scrollToRect(r, t, i, n)
- }
- });
- var M = {
- init: function() {
- this.callbacks = y.Callbacks("memory unique"),
- this.currVal = null,
- this.prevVal = null,
- this.checkProxy = y.proxy(this.check, this),
- this.autoCheck()
- },
- bind: function(e) {
- this.callbacks.add(e)
- },
- unbind: function(e) {
- e ? this.callbacks.remove(e) : this.callbacks.empty()
- },
- trigger: function() {
- this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
- },
- check: function(e) {
- var t = this.updatedValue(e);
- return void 0 !== t && (this.prevVal = this.currVal,
- this.currVal = t,
- this.trigger(),
- !0)
- },
- $autoTarget: A,
- autoEvents: "load resize scroll",
- autoCheck: function(e) {
- this.$autoTarget[!1 === e ? "off" : "on"](this.autoEvents, this.checkProxy)
- }
- };
- I(f.prototype, M, {
- updatedValue: function() {
- var e = h.of(this.context, this.viewport);
- return this.currVal && this.currVal.equals(e) ? void 0 : e
- }
- }),
- I(g.prototype, M, {
- updatedValue: function() {
- var e = this.context.best(this.property, this.descending);
- return e && (e = 0 < e.val ? e.el : null,
- this.currVal !== e) ? e : void 0
- }
- }),
- I(m.prototype, M, {
- updatedValue: function() {
- var e = new d(this.context);
- return this.currVal && this.currVal.equals(e) ? void 0 : e
- }
- });
- var R, P, O, L, D, N, F, B, V, k, U = "fracs";
- function H(e, t, i, n) {
- return i = N(i) ? i.apply(e, t) : i,
- N(n[i]) ? n[i].apply(e, t) : void L.error('Method "' + i + '" does not exist on jQuery.' + R)
- }
- R = U,
- P = {
- statics: {
- version: "0.15.0",
- Rect: c,
- Fractions: h,
- Group: r,
- ScrollState: d,
- Viewport: p,
- FracsCallbacks: f,
- GroupCallbacks: g,
- ScrollStateCallbacks: m,
- fracs: function(e, t) {
- return h.of(e, t)
- }
- },
- methods: {
- content: function(e) {
- return this.length ? c.ofContent(this[0], e) : null
- },
- envelope: function() {
- return e(this, function(e) {
- var t = c.ofElement(this);
- return e ? e.envelope(t) : t
- })
- },
- fracs: function(e, i, n) {
- o(e, "string") || (n = i,
- i = e,
- e = null),
- E(i) || (n = i,
- i = null),
- n = l(n);
- var r = U + ".fracs." + T(n);
- return "unbind" === e ? this.each(function() {
- var e = y(this).data(r);
- e && e.unbind(i)
- }) : "check" === e ? this.each(function() {
- var e = y(this).data(r);
- e && e.check()
- }) : E(i) ? this.each(function() {
- var e = y(this)
- , t = e.data(r);
- t || (t = new f(this,n),
- e.data(r, t)),
- t.bind(i)
- }) : this.length ? h.of(this[0], n) : null
- },
- intersection: function() {
- return e(this, function(e) {
- var t = c.ofElement(this);
- return e ? e.intersection(t) : t
- })
- },
- max: function(e, t, i) {
- return E(t) || (i = t,
- t = null),
- i = l(i),
- t ? (new g(this,i,e,!0).bind(t),
- this) : this.pushStack(new r(this,i).best(e, !0).el)
- },
- min: function(e, t, i) {
- return E(t) || (i = t,
- t = null),
- i = l(i),
- t ? (new g(this,i,e).bind(t),
- this) : this.pushStack(new r(this,i).best(e).el)
- },
- rect: function() {
- return this.length ? c.ofElement(this[0]) : null
- },
- scrollState: function(e, i) {
- var n = U + ".scrollState";
- return o(e, "string") || (i = e,
- e = null),
- "unbind" === e ? this.each(function() {
- var e = y(this).data(n);
- e && e.unbind(i)
- }) : "check" === e ? this.each(function() {
- var e = y(this).data(n);
- e && e.check()
- }) : E(i) ? this.each(function() {
- var e = y(this)
- , t = e.data(n);
- t || (t = new m(this),
- e.data(n, t)),
- t.bind(i)
- }) : this.length ? new d(this[0]) : null
- },
- scroll: function(e, t, i) {
- return this.each(function() {
- new p(this).scroll(e, t, i)
- })
- },
- scrollTo: function(e, t, i, n) {
- return y.isNumeric(e) && (n = i,
- i = t,
- t = e,
- e = null),
- e = l(e),
- this.each(function() {
- e ? new p(this).scrollToElement(e, t, i, n) : new p(this).scrollTo(t, i, n)
- })
- },
- scrollToThis: function(e, t, i, n) {
- return (n = new p(l(n))).scrollToElement(this[0], e, t, i),
- this
- },
- softLink: function(t, i, n, r) {
- return r = new p(l(r)),
- this.filter("a[href^=#]").each(function() {
- var e = y(this);
- e.on("click", function() {
- r.scrollToElement(y(e.attr("href"))[0], t, i, n)
- })
- })
- },
- sort: function(e, t, i) {
- return o(t, "boolean") || (i = t,
- t = null),
- i = l(i),
- this.pushStack(y.map(new r(this,i).sorted(e, !t), function(e) {
- return e.el
- }))
- },
- viewport: function(e) {
- return this.length ? c.ofViewport(this[0], e) : null
- }
- },
- defaultStatic: "fracs",
- defaultMethod: "fracs"
- },
- O = [].slice,
- L = jQuery,
- D = L.extend,
- N = L.isFunction,
- F = D({}, P),
- B = function() {
- return H(this, O.call(arguments), F.defaultStatic, B)
- }
- ,
- V = function(e) {
- return N(V[e]) ? V[e].apply(this, O.call(arguments, 1)) : H(this, O.call(arguments), F.defaultMethod, V)
- }
- ,
- (k = function(e) {
- e && (D(B, e.statics),
- D(V, e.methods)),
- B.modplug = k
- }
- ).prev = {
- statics: L[R],
- methods: L.fn[R]
- },
- k(P),
- L[R] = B,
- L.fn[R] = V
- }(),
- "undefined" == typeof jQuery)
- throw new Error("Bootstrap's JavaScript requires jQuery");
- !function(m) {
- "use strict";
- function r(e, t) {
- this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
- this.init("tooltip", e, t)
- }
- r.VERSION = "3.2.0",
- r.DEFAULTS = {
- animation: !0,
- placement: "top",
- selector: !1,
- template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
- trigger: "hover focus",
- title: "",
- delay: 0,
- html: !1,
- container: !1,
- viewport: {
- selector: "body",
- padding: 0
- }
- },
- r.prototype.init = function(e, t, i) {
- this.enabled = !0,
- this.type = e,
- this.$element = m(t),
- this.options = this.getOptions(i),
- this.$viewport = this.options.viewport && m(this.options.viewport.selector || this.options.viewport);
- for (var n = this.options.trigger.split(" "), r = n.length; r--; ) {
- var o = n[r];
- if ("click" == o)
- this.$element.on("click." + this.type, this.options.selector, m.proxy(this.toggle, this));
- else if ("manual" != o) {
- var a = "hover" == o ? "mouseenter" : "focusin"
- , s = "hover" == o ? "mouseleave" : "focusout";
- this.$element.on(a + "." + this.type, this.options.selector, m.proxy(this.enter, this)),
- this.$element.on(s + "." + this.type, this.options.selector, m.proxy(this.leave, this))
- }
- }
- this.options.selector ? this._options = m.extend({}, this.options, {
- trigger: "manual",
- selector: ""
- }) : this.fixTitle()
- }
- ,
- r.prototype.getDefaults = function() {
- return r.DEFAULTS
- }
- ,
- r.prototype.getOptions = function(e) {
- return (e = m.extend({}, this.getDefaults(), this.$element.data(), e)).delay && "number" == typeof e.delay && (e.delay = {
- show: e.delay,
- hide: e.delay
- }),
- e
- }
- ,
- r.prototype.getDelegateOptions = function() {
- var i = {}
- , n = this.getDefaults();
- return this._options && m.each(this._options, function(e, t) {
- n[e] != t && (i[e] = t)
- }),
- i
- }
- ,
- r.prototype.enter = function(e) {
- var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
- return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
- m(e.currentTarget).data("bs." + this.type, t)),
- clearTimeout(t.timeout),
- t.hoverState = "in",
- t.options.delay && t.options.delay.show ? void (t.timeout = setTimeout(function() {}, t.options.delay.show)) : t.show()
- }
- ,
- r.prototype.leave = function(e) {
- var t = e instanceof this.constructor ? e : m(e.currentTarget).data("bs." + this.type);
- return t || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
- m(e.currentTarget).data("bs." + this.type, t)),
- clearTimeout(t.timeout),
- t.hoverState = "out",
- t.options.delay && t.options.delay.hide ? void (t.timeout = setTimeout(function() {
- "out" == t.hoverState && t.hide()
- }, t.options.delay.hide)) : t.hide()
- }
- ,
- r.prototype.show = function() {
- var e = m.Event("show.bs." + this.type);
- if (this.hasContent() && this.enabled) {
- this.$element.trigger(e);
- var t = m.contains(document.documentElement, this.$element[0]);
- if (e.isDefaultPrevented() || !t)
- return;
- var i = this
- , n = this.tip()
- , r = this.getUID(this.type);
- this.setContent(),
- n.attr("id", r),
- this.$element.attr("aria-describedby", r),
- this.options.animation && n.addClass("fade");
- var o = "function" == typeof this.options.placement ? this.options.placement.call(this, n[0], this.$element[0]) : this.options.placement
- , a = /\s?auto?\s?/i
- , s = a.test(o);
- s && (o = o.replace(a, "") || "top"),
- n.detach().css({
- top: 0,
- left: 0,
- display: "block"
- }).addClass(o).data("bs." + this.type, this),
- this.options.container ? n.appendTo(this.options.container) : n.insertAfter(this.$element);
- var l = this.getPosition()
- , c = n[0].offsetWidth
- , h = n[0].offsetHeight;
- if (s) {
- var u = o
- , d = this.$element.parent()
- , p = this.getPosition(d);
- 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,
- n.removeClass(u).addClass(o)
- }
- var f = this.getCalculatedOffset(o, l, c, h);
- this.applyPlacement(f, o);
- var g = function() {
- i.$element.trigger("shown.bs." + i.type),
- i.hoverState = null
- };
- m.support.transition && this.$tip.hasClass("fade") ? n.one("bsTransitionEnd", g).emulateTransitionEnd(150) : g()
- }
- }
- ,
- r.prototype.applyPlacement = function(e, t) {
- var i = this.tip()
- , n = i[0].offsetWidth
- , r = i[0].offsetHeight
- , o = parseInt(i.css("margin-top"), 10)
- , a = parseInt(i.css("margin-left"), 10);
- isNaN(o) && (o = 0),
- isNaN(a) && (a = 0),
- e.top = e.top + o,
- e.left = e.left + a,
- m.offset.setOffset(i[0], m.extend({
- using: function(e) {
- i.css({
- top: Math.round(e.top),
- left: Math.round(e.left)
- })
- }
- }, e), 0),
- i.addClass("in");
- var s = i[0].offsetWidth
- , l = i[0].offsetHeight;
- "top" == t && l != r && (e.top = e.top + r - l);
- var c = this.getViewportAdjustedDelta(t, e, s, l);
- c.left ? e.left += c.left : e.top += c.top;
- var h = c.left ? 2 * c.left - n + s : 2 * c.top - r + l
- , u = c.left ? "left" : "top"
- , d = c.left ? "offsetWidth" : "offsetHeight";
- i.offset(e),
- this.replaceArrow(h, i[0][d], u)
- }
- ,
- r.prototype.replaceArrow = function(e, t, i) {
- this.arrow().css(i, e ? 50 * (1 - e / t) + "%" : "")
- }
- ,
- r.prototype.setContent = function() {
- var e = this.tip()
- , t = this.getTitle();
- e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
- e.removeClass("fade in top bottom left right")
- }
- ,
- r.prototype.hide = function() {
- function e() {
- "in" != t.hoverState && i.detach(),
- t.$element.trigger("hidden.bs." + t.type)
- }
- var t = this
- , i = this.tip()
- , n = m.Event("hide.bs." + this.type);
- if (this.$element.removeAttr("aria-describedby"),
- this.$element.trigger(n),
- !n.isDefaultPrevented())
- return i.removeClass("in"),
- m.support.transition && this.$tip.hasClass("fade") ? i.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
- this.hoverState = null,
- this
- }
- ,
- r.prototype.fixTitle = function() {
- var e = this.$element;
- !e.attr("title") && "string" == typeof e.attr("data-original-title") || e.attr("data-original-title", e.attr("title") || "").attr("title", "")
- }
- ,
- r.prototype.hasContent = function() {
- return this.getTitle()
- }
- ,
- r.prototype.getPosition = function(e) {
- var t = (e = e || this.$element)[0]
- , i = "BODY" == t.tagName;
- return m.extend({}, "function" == typeof t.getBoundingClientRect ? t.getBoundingClientRect() : null, {
- scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
- width: i ? m(window).width() : e.outerWidth(),
- height: i ? m(window).height() : e.outerHeight()
- }, i ? {
- top: 0,
- left: 0
- } : e.offset())
- }
- ,
- r.prototype.getCalculatedOffset = function(e, t, i, n) {
- return "bottom" == e ? {
- top: t.top + t.height,
- left: t.left + t.width / 2 - i / 2
- } : "top" == e ? {
- top: t.top - n,
- left: t.left + t.width / 2 - i / 2
- } : "left" == e ? {
- top: t.top + t.height / 2 - n / 2,
- left: t.left - i
- } : {
- top: t.top + t.height / 2 - n / 2,
- left: t.left + t.width
- }
- }
- ,
- r.prototype.getViewportAdjustedDelta = function(e, t, i, n) {
- var r = {
- top: 0,
- left: 0
- };
- if (!this.$viewport)
- return r;
- var o = this.options.viewport && this.options.viewport.padding || 0
- , a = this.getPosition(this.$viewport);
- if (/right|left/.test(e)) {
- var s = t.top - o - a.scroll
- , l = t.top + o - a.scroll + n;
- s < a.top ? r.top = a.top - s : l > a.top + a.height && (r.top = a.top + a.height - l)
- } else {
- var c = t.left - o
- , h = t.left + o + i;
- c < a.left ? r.left = a.left - c : h > a.width && (r.left = a.left + a.width - h)
- }
- return r
- }
- ,
- r.prototype.getTitle = function() {
- var e = this.$element
- , t = this.options;
- return e.attr("data-original-title") || ("function" == typeof t.title ? t.title.call(e[0]) : t.title)
- }
- ,
- r.prototype.getUID = function(e) {
- for (; e += ~~(1e6 * Math.random()),
- document.getElementById(e); )
- ;
- return e
- }
- ,
- r.prototype.tip = function() {
- return this.$tip = this.$tip || m(this.options.template)
- }
- ,
- r.prototype.arrow = function() {
- return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
- }
- ,
- r.prototype.validate = function() {
- this.$element[0].parentNode || (this.hide(),
- this.$element = null,
- this.options = null)
- }
- ,
- r.prototype.enable = function() {
- this.enabled = !0
- }
- ,
- r.prototype.disable = function() {
- this.enabled = !1
- }
- ,
- r.prototype.toggleEnabled = function() {
- this.enabled = !this.enabled
- }
- ,
- r.prototype.toggle = function(e) {
- var t = this;
- e && ((t = m(e.currentTarget).data("bs." + this.type)) || (t = new this.constructor(e.currentTarget,this.getDelegateOptions()),
- m(e.currentTarget).data("bs." + this.type, t))),
- t.tip().hasClass("in") ? t.leave(t) : t.enter(t)
- }
- ,
- r.prototype.destroy = function() {
- clearTimeout(this.timeout),
- this.hide().$element.off("." + this.type).removeData("bs." + this.type)
- }
- ;
- var e = m.fn.tooltip;
- m.fn.tooltip = function(n) {
- return this.each(function() {
- var e = m(this)
- , t = e.data("bs.tooltip")
- , i = "object" == typeof n && n;
- !t && "destroy" == n || (t || e.data("bs.tooltip", t = new r(this,i)),
- "string" == typeof n && t[n]())
- })
- }
- ,
- m.fn.tooltip.Constructor = r,
- m.fn.tooltip.noConflict = function() {
- return m.fn.tooltip = e,
- this
- }
- }(jQuery),
- function(e, t, i) {
- "undefined" != typeof module && module.exports ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : t.Keen = i()
- }(0, this, function() {
- "use strict";
- function Keen() {
- return _init.apply(this, arguments)
- }
- function _init(e) {
- if (_isUndefined(e))
- throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
- if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
- throw new Error("Please provide a projectId");
- this.configure(e)
- }
- function _extend(e) {
- for (var t = 1; t < arguments.length; t++)
- for (var i in arguments[t])
- e[i] = arguments[t][i];
- return e
- }
- function _isUndefined(e) {
- return void 0 === e
- }
- function _type(e) {
- var t = e && e.constructor ? e.constructor.toString() : void 0;
- return t ? t.match(/function (.*)\(/)[1] : "Null"
- }
- function _each(e, t, i) {
- var n;
- if (!e)
- return 0;
- if (i = i || e,
- "array" === _type(e)) {
- for (n = 0; n < e.length; n++)
- if (!1 === t.call(i, e[n], n, e))
- return 0
- } else
- for (n in e)
- if (e.hasOwnProperty(n) && !1 === t.call(i, e[n], n, e))
- return 0;
- return 1
- }
- function _parse_params(e) {
- for (var t, i = {}, n = /\+/g, r = /([^&=]+)=?([^&]*)/g, o = function(e) {
- return decodeURIComponent(e.replace(n, " "))
- }, a = e.split("?")[1]; t = r.exec(a); )
- i[o(t[1])] = o(t[2]);
- return i
- }
- function _set_protocol(e) {
- switch (e) {
- case "http":
- return "http";
- case "auto":
- return location.protocol.replace(/:/g, "");
- case "https":
- case void 0:
- default:
- return "https"
- }
- }
- function _set_request_type(e) {
- var t = e || "jsonp"
- , i = !1;
- return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (i = !0),
- null == t || "xhr" == t ? i ? "xhr" : "jsonp" : t
- }
- function _build_url(e) {
- return this.client.endpoint + "/projects/" + this.client.projectId + e
- }
- function _uploadEvent(e, t, i, n, r) {
- var o = _build_url.apply(this, ["/events/" + e])
- , a = {};
- for (var s in i = !1 !== i,
- this.client.globalProperties && (a = this.client.globalProperties(e)),
- t)
- t.hasOwnProperty(s) && (a[s] = t[s]);
- switch (this.client.requestType) {
- case "xhr":
- _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, i, n, r]);
- break;
- case "jsonp":
- var l = JSON.stringify(a)
- , c = Keen.Base64.encode(l);
- o = (o = (o = o + "?api_key=" + this.client.writeKey) + "&data=" + c) + "&modified=" + (new Date).getTime(),
- _request.jsonp.apply(this, [o, this.client.writeKey, n, r]);
- break;
- case "beacon":
- l = JSON.stringify(a),
- c = Keen.Base64.encode(l);
- o = (o = (o = o + "?api_key=" + encodeURIComponent(this.client.writeKey)) + "&data=" + encodeURIComponent(c)) + "&modified=" + encodeURIComponent((new Date).getTime()),
- o += "&c=clv1",
- _request.beacon.apply(this, [o, null, n, r])
- }
- }
- Keen.prototype.configure = function(e) {
- return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
- e.protocol = _set_protocol(e.protocol),
- e.requestType = _set_request_type(e.requestType),
- this.client = {
- projectId: e.projectId,
- writeKey: e.writeKey,
- readKey: e.readKey,
- globalProperties: null,
- endpoint: e.protocol + "://" + e.host,
- requestType: e.requestType
- },
- Keen.trigger("client", this, e),
- this.trigger("ready"),
- this
- }
- ;
- var _request = {
- xhr: function(e, t, i, n, r, o, a, s) {
- if (!r)
- return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
- var l = new XMLHttpRequest;
- if (l.onreadystatechange = function() {
- if (4 == l.readyState)
- if (200 <= l.status && l.status < 300) {
- var e;
- try {
- e = JSON.parse(l.responseText)
- } catch (e) {
- Keen.log("Could not JSON parse HTTP response: " + l.responseText),
- s && s(l, e)
- }
- a && e && a(e)
- } else
- Keen.log("HTTP request failed."),
- s && s(l, null)
- }
- ,
- l.open(e, t, o),
- r && l.setRequestHeader("Authorization", r),
- n && l.setRequestHeader("Content-Type", "application/json"),
- i)
- for (var c in i)
- i.hasOwnProperty(c) && l.setRequestHeader(c, i[c]);
- var h = n ? JSON.stringify(n) : null;
- l.send(h)
- },
- jsonp: function(e, t, i, n) {
- if (!t)
- return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
- if (t && e.indexOf("api_key") < 0) {
- var r = 0 < e.indexOf("?") ? "&" : "?";
- e = e + r + "api_key=" + t
- }
- for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
- o += "a";
- var a = !1;
- window[o] = function(e) {
- a = !0,
- i && e && i(e),
- window[o] = void 0
- }
- ,
- e = e + "&jsonp=" + o;
- var s = document.createElement("script");
- s.id = "keen-jsonp",
- s.src = e,
- document.getElementsByTagName("head")[0].appendChild(s),
- s.onreadystatechange = function() {
- !1 === a && "loaded" === this.readyState && (a = !0,
- n && n())
- }
- ,
- s.onerror = function() {
- !1 === a && (a = !0,
- n && n())
- }
- },
- beacon: function(e, t, i, n) {
- if (t && e.indexOf("api_key") < 0) {
- var r = 0 < e.indexOf("?") ? "&" : "?";
- e = e + r + "api_key=" + t
- }
- var o = document.createElement("img");
- o.onload = function() {
- if (!0,
- "naturalHeight"in this) {
- if (this.naturalHeight + this.naturalWidth === 0)
- return void this.onerror()
- } else if (this.width + this.height === 0)
- return void this.onerror();
- i && i({
- created: !0
- })
- }
- ,
- o.onerror = function() {
- !0,
- n && n()
- }
- ,
- o.src = e
- }
- }
- , Events = Keen.Events = {
- on: function(e, t) {
- return this.listeners || (this.listeners = {}),
- (this.listeners[e] || (this.listeners[e] = [])).push({
- callback: t
- }),
- this
- },
- off: function(e, t) {
- if (!e && !t)
- return this.listeners = void 0,
- delete this.listeners,
- this;
- for (var i = this.listeners[e] || [], n = i.length; n--; )
- t && t == i[n].callback && this.listeners[e].splice(n, 1),
- t && 0 != i.length || (this.listeners[e] = void 0,
- delete this.listeners[e]);
- return this
- },
- trigger: function(e) {
- if (!this.listeners)
- return this;
- for (var t = Array.prototype.slice.call(arguments, 1), i = this.listeners[e] || [], n = 0; n < i.length; n++)
- i[n].callback.apply(this, t);
- return this
- }
- };
- _extend(Keen.prototype, Events),
- _extend(Keen, Events),
- Keen.loaded = !0,
- Keen.utils = {
- each: _each,
- extend: _extend,
- parseParams: _parse_params
- },
- Keen.ready = function(e) {
- Keen.loaded ? e() : Keen.on("ready", e)
- }
- ,
- Keen.log = function(e) {
- "object" == typeof console && console.log("[Keen IO]", e)
- }
- ;
- var Plugins = Keen.Plugins = {}, Hh, Ih;
- Keen.prototype.addEvent = function() {
- _uploadEvent.apply(this, arguments)
- }
- ,
- Keen.prototype.addEventSync = function(e, t, i, n) {
- _uploadEvent.apply(this, [e, t, !1, i, n])
- }
- ,
- Keen.prototype.trackExternalLink = function(e, t, i, n, r) {
- var o = e
- , a = o.metaKey
- , s = o.target
- , l = !1
- , c = function() {};
- return void 0 === n && (n = 500),
- "A" === s.nodeName ? c = function() {
- a || l || (l = !0,
- window.location = s.href)
- }
- : "FORM" === s.nodeName && (c = function() {
- l || (l = !0,
- s.submit())
- }
- ),
- r && (c = function() {
- l || (l = !0,
- r())
- }
- ),
- _uploadEvent.call(this, t, i, c, c),
- setTimeout(function() {
- c()
- }, n),
- !!a && void 0
- }
- ,
- Keen.prototype.setGlobalProperties = function(e) {
- if (!this.client)
- return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
- if (!e || "function" != typeof e)
- throw new Error("Invalid value for global properties: " + e);
- this.client.globalProperties = e
- }
- ,
- Keen.Base64 = {
- map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
- encode: function(e) {
- var t, i, n, r, o, a, s, l = "", c = 0, h = this.map;
- for (e = this.utf8.encode(e); c < e.length; )
- t = e.charCodeAt(c++),
- i = e.charCodeAt(c++),
- n = e.charCodeAt(c++),
- r = t >> 2,
- o = (3 & t) << 4 | i >> 4,
- a = isNaN(i) ? 64 : (15 & i) << 2 | n >> 6,
- s = isNaN(i) || isNaN(n) ? 64 : 63 & n,
- l = l + h.charAt(r) + h.charAt(o) + h.charAt(a) + h.charAt(s);
- return l
- },
- decode: function(e) {
- var t, i, n, r, o, a, s = "", l = 0, c = this.map, h = String.fromCharCode;
- for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
- t = c.indexOf(e.charAt(l++)),
- o = (15 & (i = c.indexOf(e.charAt(l++)))) << 4 | (n = c.indexOf(e.charAt(l++))) >> 2,
- a = (3 & n) << 6 | (r = c.indexOf(e.charAt(l++))),
- s = s + (h(t << 2 | i >> 4) + (64 != n ? h(o) : "")) + (64 != r ? h(a) : "");
- return this.utf8.decode(s)
- },
- utf8: {
- encode: function(e) {
- for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
- 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);
- return i
- },
- decode: function(e) {
- for (var t, i = "", n = 0, r = String.fromCharCode; n < e.length; )
- 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];
- return i
- }
- }
- },
- "object" != typeof JSON && (JSON = {}),
- function() {
- function f(e) {
- return e < 10 ? "0" + e : e
- }
- function quote(e) {
- return escapable.lastIndex = 0,
- escapable.test(e) ? '"' + e.replace(escapable, function(e) {
- var t = meta[e];
- return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
- }) + '"' : '"' + e + '"'
- }
- function str(e, t) {
- var i, n, r, o, a, s = gap, l = t[e];
- switch (l && "object" == typeof l && "function" == typeof l.toJSON && (l = l.toJSON(e)),
- "function" == typeof rep && (l = rep.call(t, e, l)),
- typeof l) {
- case "string":
- return quote(l);
- case "number":
- return isFinite(l) ? String(l) : "null";
- case "boolean":
- case "null":
- return String(l);
- case "object":
- if (!l)
- return "null";
- if (gap += indent,
- a = [],
- "[object Array]" === Object.prototype.toString.apply(l)) {
- for (o = l.length,
- i = 0; i < o; i += 1)
- a[i] = str(i, l) || "null";
- return r = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + s + "]" : "[" + a.join(",") + "]",
- gap = s,
- r
- }
- if (rep && "object" == typeof rep)
- for (o = rep.length,
- i = 0; i < o; i += 1)
- "string" == typeof rep[i] && ((r = str(n = rep[i], l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
- else
- for (n in l)
- Object.prototype.hasOwnProperty.call(l, n) && ((r = str(n, l)) && a.push(quote(n) + (gap ? ": " : ":") + r));
- return r = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + s + "}" : "{" + a.join(",") + "}",
- gap = s,
- r
- }
- }
- "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
- 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
- }
- ,
- String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
- return this.valueOf()
- }
- );
- 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 = {
- "\b": "\\b",
- "\t": "\\t",
- "\n": "\\n",
- "\f": "\\f",
- "\r": "\\r",
- '"': '\\"',
- "\\": "\\\\"
- }, rep;
- "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, i) {
- var n;
- if (indent = gap = "",
- "number" == typeof i)
- for (n = 0; n < i; n += 1)
- indent += " ";
- else
- "string" == typeof i && (indent = i);
- if ((rep = t) && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
- throw new Error("JSON.stringify");
- return str("", {
- "": e
- })
- }
- ),
- "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
- function walk(e, t) {
- var i, n, r = e[t];
- if (r && "object" == typeof r)
- for (i in r)
- Object.prototype.hasOwnProperty.call(r, i) && (void 0 !== (n = walk(r, i)) ? r[i] = n : delete r[i]);
- return reviver.call(e, t, r)
- }
- var j;
- if (text = String(text),
- cx.lastIndex = 0,
- cx.test(text) && (text = text.replace(cx, function(e) {
- return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
- })),
- /^[\],:{}\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, "")))
- return j = eval("(" + text + ")"),
- "function" == typeof reviver ? walk({
- "": j
- }, "") : j;
- throw new SyntaxError("JSON.parse")
- }
- )
- }(),
- Hh = Keen.utils,
- Ih = function(i) {
- function e(e) {
- for (u = 1; e = n.shift(); )
- e()
- }
- 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]);
- return r[l] && r[l](s, t = function() {
- r.removeEventListener(s, t, !1),
- e()
- }
- , !1),
- a && r.attachEvent(c, t = function() {
- /^c/.test(r[h]) && (r.detachEvent(c, t),
- e())
- }
- ),
- i = a ? function(t) {
- self != top ? u ? t() : n.push(t) : function() {
- try {
- o.doScroll("left")
- } catch (e) {
- return setTimeout(function() {
- i(t)
- }, 50)
- }
- t()
- }()
- }
- : function(e) {
- u ? e() : n.push(e)
- }
- }
- ,
- "undefined" != typeof module && module.exports ? module.exports = Ih() : "function" == typeof define && define.amd ? define(Ih) : Hh.domready = Ih();
- var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
- if (loaded && cached) {
- for (var instance in clients = cached.clients || {},
- ready = cached.ready || [],
- clients)
- if (clients.hasOwnProperty(instance)) {
- var client = clients[instance];
- for (var method in Keen.prototype)
- Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
- if (loaded.Query = Keen.Query ? Keen.Query : function() {}
- ,
- loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
- ,
- client._config && (client.configure.call(client, client._config),
- delete client._config),
- client._setGlobalProperties) {
- for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
- client.setGlobalProperties.apply(client, globals[i]);
- delete client._setGlobalProperties
- }
- if (client._addEvent) {
- for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
- client.addEvent.apply(client, queue[i]);
- delete client._addEvent
- }
- var callback = client._on || [];
- if (client._on) {
- for (var i = 0; i < callback.length; i++)
- client.on.apply(client, callback[i]);
- client.trigger("ready"),
- delete client._on
- }
- }
- for (var i = 0; i < ready.length; i++) {
- var callback = ready[i];
- Keen.on("ready", function() {
- callback()
- })
- }
- }
- return Keen.loaded && setTimeout(function() {
- Keen.utils.domready(function() {
- Keen.trigger("ready")
- })
- }, 0),
- Keen
- }),
- function() {
- var i = window.analytics = window.analytics || [];
- if (!i.initialize) {
- if (i.invoked)
- return window.console && console.error && console.error("Segment snippet included twice.");
- i.invoked = !0,
- i.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
- i.factory = function(t) {
- return function() {
- var e = Array.prototype.slice.call(arguments);
- return e.unshift(t),
- i.push(e),
- i
- }
- }
- ;
- for (var e = 0; e < i.methods.length; e++) {
- var t = i.methods[e];
- i[t] = i.factory(t)
- }
- i.load = function(e) {
- var t = document.createElement("script");
- t.type = "text/javascript",
- t.async = !0,
- t.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + e + "/analytics.min.js";
- var i = document.getElementsByTagName("script")[0];
- i.parentNode.insertBefore(t, i)
- }
- ,
- i.SNIPPET_VERSION = "4.0.0"
- }
- }(),
- function(i, u) {
- "use strict";
- var d = "function"
- , p = "undefined"
- , f = "object"
- , e = "major"
- , t = "model"
- , n = "name"
- , r = "type"
- , o = "vendor"
- , a = "version"
- , s = "architecture"
- , l = "console"
- , c = "mobile"
- , h = "tablet"
- , g = {
- has: function(e, t) {
- return -1 !== t.toLowerCase().indexOf(e.toLowerCase())
- },
- lowerize: function(e) {
- return e.toLowerCase()
- }
- }
- , m = {
- rgx: function() {
- for (var e, t, i, n, r, o, a, s = 0, l = arguments; s < l.length; s += 2) {
- var c = l[s]
- , h = l[s + 1];
- if (typeof e == p)
- for (n in e = {},
- h)
- typeof (r = h[n]) == f ? e[r[0]] = u : e[r] = u;
- for (t = i = 0; t < c.length; t++)
- if (o = c[t].exec(this.getUA())) {
- for (n = 0; n < h.length; n++)
- a = o[++i],
- 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;
- break
- }
- if (o)
- break
- }
- return e
- },
- str: function(e, t) {
- for (var i in t)
- if (typeof t[i] == f && 0 < t[i].length) {
- for (var n = 0; n < t[i].length; n++)
- if (g.has(t[i][n], e))
- return "?" === i ? u : i
- } else if (g.has(t[i], e))
- return "?" === i ? u : i;
- return e
- }
- }
- , v = {
- browser: {
- oldsafari: {
- major: {
- 1: ["/8", "/1", "/3"],
- 2: "/4",
- "?": "/"
- },
- version: {
- "1.0": "/8",
- 1.2: "/1",
- 1.3: "/3",
- "2.0": "/412",
- "2.0.2": "/416",
- "2.0.3": "/417",
- "2.0.4": "/419",
- "?": "/"
- }
- }
- },
- device: {
- sprint: {
- model: {
- "Evo Shift 4G": "7373KT"
- },
- vendor: {
- HTC: "APA",
- Sprint: "Sprint"
- }
- }
- },
- os: {
- windows: {
- version: {
- ME: "4.90",
- "NT 3.11": "NT3.51",
- "NT 4.0": "NT4.0",
- 2e3: "NT 5.0",
- XP: ["NT 5.1", "NT 5.2"],
- Vista: "NT 6.0",
- 7: "NT 6.1",
- 8: "NT 6.2",
- 8.1: "NT 6.3",
- RT: "ARM"
- }
- }
- }
- }
- , y = {
- 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]],
- 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]],
- 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]],
- 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]],
- 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]]
- }
- , A = function(e) {
- var t = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : "");
- return this instanceof A ? (this.getBrowser = function() {
- return m.rgx.apply(this, y.browser)
- }
- ,
- this.getCPU = function() {
- return m.rgx.apply(this, y.cpu)
- }
- ,
- this.getDevice = function() {
- return m.rgx.apply(this, y.device)
- }
- ,
- this.getEngine = function() {
- return m.rgx.apply(this, y.engine)
- }
- ,
- this.getOS = function() {
- return m.rgx.apply(this, y.os)
- }
- ,
- this.getResult = function() {
- return {
- ua: this.getUA(),
- browser: this.getBrowser(),
- engine: this.getEngine(),
- os: this.getOS(),
- device: this.getDevice(),
- cpu: this.getCPU()
- }
- }
- ,
- this.getUA = function() {
- return t
- }
- ,
- this.setUA = function(e) {
- return t = e,
- this
- }
- ,
- void this.setUA(t)) : new A(e).getResult()
- };
- if (typeof exports != p)
- typeof module != p && module.exports && (exports = module.exports = A),
- exports.UAParser = A;
- else if (i.UAParser = A,
- typeof define == d && define.amd && define(function() {
- return A
- }),
- typeof i.jQuery != p) {
- var C = i.jQuery
- , I = new A;
- C.ua = I.getResult(),
- C.ua.get = function() {
- return I.getUA()
- }
- ,
- C.ua.set = function(e) {
- I.setUA(e);
- var t = I.getResult();
- for (var i in t)
- C.ua[i] = t[i]
- }
- }
- }(this),
- window.Modernizr = function(e, t) {
- function i(e, t) {
- return typeof e === t
- }
- var n, r, o, a = {}, s = t.documentElement, l = t.createElement("modernizr"), c = l.style, h = {}, u = [], d = u.slice, p = {}.hasOwnProperty;
- for (var f in r = i(p, "undefined") || i(p.call, "undefined") ? function(e, t) {
- return t in e && i(e.constructor.prototype[t], "undefined")
- }
- : function(e, t) {
- return p.call(e, t)
- }
- ,
- Function.prototype.bind || (Function.prototype.bind = function(n) {
- var r = this;
- if ("function" != typeof r)
- throw new TypeError;
- var o = d.call(arguments, 1)
- , a = function() {
- if (this instanceof a) {
- function e() {}
- e.prototype = r.prototype;
- var t = new e
- , i = r.apply(t, o.concat(d.call(arguments)));
- return Object(i) === i ? i : t
- }
- return r.apply(n, o.concat(d.call(arguments)))
- };
- return a
- }
- ),
- h.webgl = function() {
- return !!e.WebGLRenderingContext
- }
- ,
- h)
- r(h, f) && (n = f.toLowerCase(),
- a[n] = h[f](),
- u.push((a[n] ? "" : "no-") + n));
- return a.addTest = function(e, t) {
- if ("object" == typeof e)
- for (var i in e)
- r(e, i) && a.addTest(i, e[i]);
- else {
- if (e = e.toLowerCase(),
- void 0 !== a[e])
- return a;
- t = "function" == typeof t ? t() : t,
- "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (t ? "" : "no-") + e),
- a[e] = t
- }
- return a
- }
- ,
- o = "",
- c.cssText = o,
- l = null,
- a._version = "2.8.2",
- a
- }(this, this.document),
- function(xe, e, Se) {
- "use strict";
- function Me(s, e, n) {
- function a(e) {
- var t = Q.length;
- if (G.old = xe.extend({}, G),
- H = V ? 0 : k[F.horizontal ? "width" : "height"](),
- Y = W[F.horizontal ? "width" : "height"](),
- z = V ? s : U[F.horizontal ? "outerWidth" : "outerHeight"](),
- Q.length = 0,
- G.start = 0,
- G.end = nt(z - H, 0),
- le) {
- $.length,
- J = U.children(F.itemSelector),
- $.length = 0;
- 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;
- z = 0,
- J.each(function(e, t) {
- var i = xe(t)
- , n = t.getBoundingClientRect()
- , r = it(F.horizontal ? n.width || n.right - n.left : n.height || n.bottom - n.top)
- , o = Ne(i, F.horizontal ? "marginLeft" : "marginTop")
- , a = Ne(i, F.horizontal ? "marginRight" : "marginBottom")
- , s = r + o + a
- , l = !o || !a
- , c = {};
- c.el = t,
- c.size = l ? r : s,
- c.half = c.size / 2,
- c.start = z + (l ? o : 0),
- c.center = c.start - it(H / 2 - c.size / 2),
- c.end = c.start - H + c.size,
- e || (z += u),
- z += s,
- F.horizontal || p || a && o && 0 < e && (z -= rt(o, a)),
- e === g && (c.end += d,
- z += d,
- f = l ? a : 0),
- $.push(c),
- h = c
- }),
- U[0].style[F.horizontal ? "width" : "height"] = (i ? z : z - u - d) + "px",
- z -= f,
- $.length ? (G.start = $[0][ae ? "center" : "start"],
- G.end = ae ? h.center : H < z ? h.end : G.start) : G.start = G.end = 0
- }
- if (G.center = it(G.end / 2 + G.start / 2),
- v(),
- j.length && 0 < Y && (F.dynamicHandle ? (q = Fe(q = G.start === G.end ? Y : it(Y * H / z), F.minHandleSize, Y),
- j[0].style[F.horizontal ? "width" : "height"] = q + "px") : q = j[F.horizontal ? "outerWidth" : "outerHeight"](),
- X.end = Y - q,
- _e || c()),
- !V && 0 < H) {
- var n = G.start
- , r = "";
- if (le)
- xe.each($, function(e, t) {
- ae ? Q.push(t.center) : t.start + t.size > n && n <= G.end && (n = t.start,
- Q.push(n),
- (n += H) > G.end && n < G.end + H && Q.push(G.end))
- });
- else
- for (; n - H < G.end; )
- Q.push(n),
- n += H;
- if (Z[0] && t !== Q.length) {
- for (var o = 0; o < Q.length; o++)
- r += F.pageBuilder.call(B, o);
- (K = Z.html(r).children()).eq(ee.activePage).addClass(F.activeClass)
- }
- }
- if (ee.slideeSize = z,
- ee.frameSize = H,
- ee.sbSize = Y,
- ee.handleSize = q,
- le) {
- e && null != F.startAt && (m(F.startAt),
- B[se ? "toCenter" : "toStart"](F.startAt));
- var a = $[ee.activeItem];
- l(se && a ? a.center : Fe(G.dest, G.start, G.end))
- } else
- e ? null != F.startAt && l(F.startAt, 1) : l(Fe(G.dest, G.start, G.end));
- L("load")
- }
- function l(e, t, i) {
- if (le && Ie.released && !i) {
- var n = d(e)
- , r = e > G.start && e < G.end;
- se ? (r && (e = $[n.centerItem].center),
- ae && F.activateMiddle && m(n.centerItem)) : r && (e = $[n.firstItem].start)
- }
- 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),
- Ae.start = +new Date,
- Ae.time = 0,
- Ae.from = G.cur,
- Ae.to = e,
- Ae.delta = e - G.cur,
- Ae.tweesing = Ie.tweese || Ie.init && !Ie.slidee,
- Ae.immediate = !Ae.tweesing && (t || Ie.init && Ie.slidee || !F.speed),
- Ie.tweese = 0,
- e !== G.dest && (G.dest = e,
- L("change"),
- _e || o()),
- g(),
- v(),
- p(),
- K[0] && ye.page !== ee.activePage && (ye.page = ee.activePage,
- K.removeClass(F.activeClass).eq(ee.activePage).addClass(F.activeClass),
- L("activePage", ye.page))
- }
- function o() {
- if (B.initialized) {
- if (!_e)
- return _e = Ge(o),
- void (Ie.released && L("moveStart"));
- Ae.immediate ? G.cur = Ae.to : Ae.tweesing ? (Ae.tweeseDelta = Ae.to - G.cur,
- $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),
- G.cur = Ae.from + Ae.delta * xe.easing[F.easing](Ae.time / F.speed, Ae.time, 0, 1, F.speed)),
- Ae.to === G.cur ? (G.cur = Ae.to,
- Ie.tweese = _e = 0) : _e = Ge(o),
- L("move"),
- 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"),
- !_e && Ie.released && L("moveEnd"),
- c()
- }
- }
- function c() {
- 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,
- X.cur = Fe(it(X.cur), X.start, X.end),
- ye.hPos !== X.cur && (ye.hPos = X.cur,
- Ve ? j[0].style[Ve] = ke + (F.horizontal ? "translateX" : "translateY") + "(" + X.cur + "px)" : j[0].style[F.horizontal ? "left" : "top"] = X.cur + "px"))
- }
- function t() {
- Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) || B.stop(),
- Te = Ie.init ? Ge(t) : 0,
- Ce.now = +new Date,
- Ce.pos = G.cur + (Ce.now - Ce.lastTime) / 1e3 * Ce.speed,
- l(Ie.init ? Ce.pos : it(Ce.pos)),
- Ie.init || G.cur !== G.dest || L("moveEnd"),
- Ce.lastTime = Ce.now
- }
- function i(e, t, i) {
- if ("boolean" === Re(t) && (i = t,
- t = Se),
- t === Se)
- l(G[e], i);
- else {
- if (se && "center" !== e)
- return;
- var n = B.getPos(t);
- n && l(n[e], i, !se)
- }
- }
- function h(e) {
- return null != e ? De(e) ? 0 <= e && e < $.length ? e : -1 : J.index(e) : -1
- }
- function u(e) {
- return h(De(e) && e < 0 ? e + $.length : e)
- }
- function m(e, t) {
- var i = h(e);
- return !(!le || i < 0) && (ye.active === i && !t || (J.eq(ee.activeItem).removeClass(F.activeClass),
- J.eq(i).addClass(F.activeClass),
- ye.active = ee.activeItem = i,
- p(),
- L("active", i)),
- i)
- }
- function d(e) {
- e = Fe(De(e) ? e : G.dest, G.start, G.end);
- var t = {}
- , i = ae ? 0 : H / 2;
- if (!V)
- for (var n = 0, r = Q.length; n < r; n++) {
- if (e >= G.end || n === Q.length - 1) {
- t.activePage = Q.length - 1;
- break
- }
- if (e <= Q[n] + i) {
- t.activePage = n;
- break
- }
- }
- if (le) {
- for (var o = !1, a = !1, s = !1, l = 0, c = $.length; l < c; l++)
- if (!1 === o && e <= $[l].start + $[l].half && (o = l),
- !1 === s && e <= $[l].center + $[l].half && (s = l),
- l === c - 1 || e <= $[l].end + $[l].half) {
- a = l;
- break
- }
- t.firstItem = De(o) ? o : 0,
- t.centerItem = De(s) ? s : t.firstItem,
- t.lastItem = De(a) ? a : t.centerItem
- }
- return t
- }
- function v(e) {
- xe.extend(ee, d(e))
- }
- function p() {
- var e = G.dest <= G.start
- , t = G.dest >= G.end
- , i = (e ? 1 : 0) | (t ? 2 : 0);
- if (ye.slideePosState !== i && (ye.slideePosState = i,
- ge.is("button,input") && ge.prop("disabled", e),
- me.is("button,input") && me.prop("disabled", t),
- ge.add(de)[e ? "addClass" : "removeClass"](F.disabledClass),
- me.add(ue)[t ? "addClass" : "removeClass"](F.disabledClass)),
- ye.fwdbwdState !== i && Ie.released && (ye.fwdbwdState = i,
- de.is("button,input") && de.prop("disabled", e),
- ue.is("button,input") && ue.prop("disabled", t)),
- le && null != ee.activeItem) {
- var n = 0 === ee.activeItem
- , r = ee.activeItem >= $.length - 1
- , o = (n ? 1 : 0) | (r ? 2 : 0);
- ye.itemsButtonState !== o && (ye.itemsButtonState = o,
- pe.is("button,input") && pe.prop("disabled", n),
- fe.is("button,input") && fe.prop("disabled", r),
- pe[n ? "addClass" : "removeClass"](F.disabledClass),
- fe[r ? "addClass" : "removeClass"](F.disabledClass))
- }
- }
- function r(e, t, i) {
- if (e = u(e),
- t = u(t),
- -1 < e && -1 < t && e !== t && (!i || t !== e - 1) && (i || t !== e + 1)) {
- J.eq(e)[i ? "insertAfter" : "insertBefore"]($[t].el);
- var n = e < t ? e : i ? t : t - 1
- , r = t < e ? e : i ? t + 1 : t
- , o = t < e;
- 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)),
- a()
- }
- }
- function f(e, t) {
- for (var i = 0, n = ve[e].length; i < n; i++)
- if (ve[e][i] === t)
- return i;
- return -1
- }
- function g() {
- Ie.released && !B.isPaused && B.resume()
- }
- function y(e) {
- return it(Fe(e, X.start, X.end) / X.end * (G.end - G.start)) + G.start
- }
- function A() {
- Ie.history[0] = Ie.history[1],
- Ie.history[1] = Ie.history[2],
- Ie.history[2] = Ie.history[3],
- Ie.history[3] = Ie.delta
- }
- function C(e) {
- Ie.released = 0,
- Ie.source = e,
- Ie.slidee = "slidee" === e
- }
- function I(e) {
- var t = "touchstart" === e.type
- , i = e.data.source
- , n = "slidee" === i;
- 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),
- C(i),
- Ie.init = 0,
- Ie.$source = xe(e.target),
- Ie.touch = t,
- Ie.pointer = t ? e.originalEvent.touches[0] : e,
- Ie.initX = Ie.pointer.pageX,
- Ie.initY = Ie.pointer.pageY,
- Ie.initPos = n ? G.cur : X.cur,
- Ie.start = +new Date,
- Ie.time = 0,
- Ie.path = 0,
- Ie.delta = 0,
- Ie.locked = 0,
- Ie.history = [0, 0, 0, 0],
- Ie.pathToLock = n ? t ? 30 : 10 : 0,
- We.on(t ? qe : Ye, E),
- B.pause(1),
- (n ? U : j).addClass(F.draggedClass),
- L("moveStart"),
- n && (be = setInterval(A, 10)))
- }
- function E(e) {
- if (Ie.released = "mouseup" === e.type || "touchend" === e.type,
- Ie.pointer = Ie.touch ? e.originalEvent[Ie.released ? "changedTouches" : "touches"][0] : e,
- Ie.pathX = Ie.pointer.pageX - Ie.initX,
- Ie.pathY = Ie.pointer.pageY - Ie.initY,
- Ie.path = et(tt(Ie.pathX, 2) + tt(Ie.pathY, 2)),
- Ie.delta = F.horizontal ? Ie.pathX : Ie.pathY,
- Ie.released || !(Ie.path < 1)) {
- if (!Ie.init) {
- if (!(F.horizontal ? $e(Ie.pathX) > $e(Ie.pathY) : $e(Ie.pathX) < $e(Ie.pathY)))
- return _();
- Ie.init = 1
- }
- Pe(e),
- !Ie.locked && Ie.path > Ie.pathToLock && Ie.slidee && (Ie.locked = 1,
- Ie.$source.on(Ze, Oe)),
- Ie.released && (_(),
- F.releaseSwing && Ie.slidee && (Ie.swing = (Ie.delta - Ie.history[0]) / 40 * 300,
- Ie.delta += Ie.swing,
- Ie.tweese = 10 < $e(Ie.swing))),
- l(Ie.slidee ? it(Ie.initPos - Ie.delta) : y(Ie.initPos + Ie.delta))
- }
- }
- function _() {
- clearInterval(be),
- Ie.released = !0,
- We.off(Ie.touch ? qe : Ye, E),
- (Ie.slidee ? U : j).removeClass(F.draggedClass),
- setTimeout(function() {
- Ie.$source.off(Ze, Oe)
- }),
- G.cur === G.dest && Ie.init && L("moveEnd"),
- B.resume(1),
- Ie.init = 0
- }
- function b(e) {
- return ~xe.inArray(e.nodeName, Qe) || xe(e).is(F.interactive)
- }
- function w() {
- B.stop(),
- We.off("mouseup", w)
- }
- function T(e) {
- switch (Pe(e),
- this) {
- case ue[0]:
- case de[0]:
- B.moveBy(ue.is(this) ? F.moveBy : -F.moveBy),
- We.on("mouseup", w);
- break;
- case pe[0]:
- B.prev();
- break;
- case fe[0]:
- B.next();
- break;
- case ge[0]:
- B.prevPage();
- break;
- case me[0]:
- B.nextPage()
- }
- }
- function x(e) {
- e.originalEvent[He] = B;
- var t = +new Date;
- if (ot + F.scrollHijack > t && ce[0] !== document && ce[0] !== window)
- ot = t;
- else if (F.scrollBy && G.start !== G.end) {
- var i = function(e) {
- return Ee.curDelta = (F.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
- Ee.curDelta /= 1 === e.deltaMode ? 3 : 100,
- le ? (Ue = +new Date,
- Ee.last < Ue - Ee.resetTime && (Ee.delta = 0),
- Ee.last = Ue,
- Ee.delta += Ee.curDelta,
- $e(Ee.delta) < 1 ? Ee.finalDelta = 0 : (Ee.finalDelta = it(Ee.delta / 1),
- Ee.delta %= 1),
- Ee.finalDelta) : Ee.curDelta
- }(e.originalEvent);
- (F.scrollTrap || 0 < i && G.dest < G.end || i < 0 && G.dest > G.start) && Pe(e, 1),
- B.slideBy(F.scrollBy * i)
- }
- }
- function S(e) {
- F.clickBar && e.target === W[0] && (Pe(e),
- l(y((F.horizontal ? e.pageX - W.offset().left : e.pageY - W.offset().top) - q / 2)))
- }
- function M(e) {
- if (F.keyboardNavBy)
- switch (e.which) {
- case F.horizontal ? 37 : 38:
- Pe(e),
- B["pages" === F.keyboardNavBy ? "prevPage" : "prev"]();
- break;
- case F.horizontal ? 39 : 40:
- Pe(e),
- B["pages" === F.keyboardNavBy ? "nextPage" : "next"]()
- }
- }
- function R(e) {
- return b(this) ? void (e.originalEvent[He + "ignore"] = !0) : void (this.parentNode !== U[0] || e.originalEvent[He + "ignore"] || B.activate(this))
- }
- function P() {
- this.parentNode === Z[0] && B.activatePage(K.index(this))
- }
- function O(e) {
- F.pauseOnHover && B["mouseenter" === e.type ? "pause" : "resume"](2)
- }
- function L(e, t) {
- if (ve[e]) {
- for (N = ve[e].length,
- Je.length = 0,
- D = 0; D < N; D++)
- Je.push(ve[e][D]);
- for (D = 0; D < N; D++)
- Je[D].call(B, e, t)
- }
- }
- 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 = {
- start: 0,
- center: 0,
- end: 0,
- cur: 0,
- dest: 0
- }, W = xe(F.scrollBar).eq(0), j = W.children().eq(0), Y = 0, q = 0, X = {
- start: 0,
- end: 0,
- cur: 0
- }, Z = xe(F.pagesBar), K = 0, Q = [], J = 0, $ = [], ee = {
- firstItem: 0,
- lastItem: 0,
- centerItem: 0,
- activeItem: null,
- activePage: 0
- }, 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 = {
- released: 1
- }, Ee = {
- last: 0,
- delta: 0,
- resetTime: 200
- }, _e = 0, be = 0, we = 0, Te = 0;
- V || (s = k[0]),
- B.initialized = 0,
- B.frame = s,
- B.slidee = U[0],
- B.pos = G,
- B.rel = ee,
- B.items = $,
- B.pages = Q,
- B.isPaused = 0,
- B.options = F,
- B.dragging = Ie,
- B.reload = function() {
- a()
- }
- ,
- B.getPos = function(e) {
- if (le) {
- var t = h(e);
- return -1 !== t && $[t]
- }
- var i = U.find(e).eq(0);
- if (i[0]) {
- var n = F.horizontal ? i.offset().left - U.offset().left : i.offset().top - U.offset().top
- , r = i[F.horizontal ? "outerWidth" : "outerHeight"]();
- return {
- start: n,
- center: n - H / 2 + r / 2,
- end: n - H + r,
- size: r
- }
- }
- return !1
- }
- ,
- B.moveBy = function(e) {
- Ce.speed = e,
- !Ie.init && Ce.speed && G.cur !== (0 < Ce.speed ? G.end : G.start) && (Ce.lastTime = +new Date,
- Ce.startPos = G.cur,
- C("button"),
- Ie.init = 1,
- L("moveStart"),
- ze(Te),
- t())
- }
- ,
- B.stop = function() {
- "button" === Ie.source && (Ie.init = 0,
- Ie.released = 1)
- }
- ,
- B.prev = function() {
- B.activate(null == ee.activeItem ? 0 : ee.activeItem - 1)
- }
- ,
- B.next = function() {
- B.activate(null == ee.activeItem ? 0 : ee.activeItem + 1)
- }
- ,
- B.prevPage = function() {
- B.activatePage(ee.activePage - 1)
- }
- ,
- B.nextPage = function() {
- B.activatePage(ee.activePage + 1)
- }
- ,
- B.slideBy = function(e, t) {
- e && (le ? B[se ? "toCenter" : "toStart"](Fe((se ? ee.centerItem : ee.firstItem) + F.scrollBy * e, 0, $.length)) : l(G.dest + e, t))
- }
- ,
- B.slideTo = function(e, t) {
- l(e, t)
- }
- ,
- B.toStart = function(e, t) {
- i("start", e, t)
- }
- ,
- B.toEnd = function(e, t) {
- i("end", e, t)
- }
- ,
- B.toCenter = function(e, t) {
- i("center", e, t)
- }
- ,
- B.getIndex = h,
- B.activate = function(e, t) {
- var i = m(e);
- F.smart && !1 !== i && (se ? B.toCenter(i, t) : i >= ee.lastItem ? B.toStart(i, t) : i <= ee.firstItem ? B.toEnd(i, t) : g())
- }
- ,
- B.activatePage = function(e, t) {
- De(e) && l(Q[Fe(e, 0, Q.length - 1)], t)
- }
- ,
- B.resume = function(e) {
- F.cycleBy && F.cycleInterval && ("items" !== F.cycleBy || $[0] && null != ee.activeItem) && !(e < B.isPaused) && (B.isPaused = 0,
- we ? we = clearTimeout(we) : L("resume"),
- we = setTimeout(function() {
- switch (L("cycle"),
- F.cycleBy) {
- case "items":
- B.activate(ee.activeItem >= $.length - 1 ? 0 : ee.activeItem + 1);
- break;
- case "pages":
- B.activatePage(ee.activePage >= Q.length - 1 ? 0 : ee.activePage + 1)
- }
- }, F.cycleInterval))
- }
- ,
- B.pause = function(e) {
- e < B.isPaused || (B.isPaused = e || 100,
- we && (we = clearTimeout(we),
- L("pause")))
- }
- ,
- B.toggle = function() {
- B[we ? "pause" : "resume"]()
- }
- ,
- B.set = function(e, t) {
- xe.isPlainObject(e) ? xe.extend(F, e) : F.hasOwnProperty(e) && (F[e] = t)
- }
- ,
- B.add = function(e, t) {
- var i = xe(e);
- le ? (null == t || !$[0] || t >= $.length ? i.appendTo(U) : $.length && i.insertBefore($[t].el),
- null != ee.activeItem && t <= ee.activeItem && (ye.active = ee.activeItem += i.length)) : U.append(i),
- a()
- }
- ,
- B.remove = function(e) {
- if (le) {
- var t = u(e);
- if (-1 < t) {
- J.eq(t).remove();
- var i = t === ee.activeItem;
- null != ee.activeItem && t < ee.activeItem && (ye.active = --ee.activeItem),
- a(),
- i && (ye.active = null,
- B.activate(ee.activeItem))
- }
- } else
- xe(e).remove(),
- a()
- }
- ,
- B.moveAfter = function(e, t) {
- r(e, t, 1)
- }
- ,
- B.moveBefore = function(e, t) {
- r(e, t)
- }
- ,
- B.on = function(e, t) {
- if ("object" === Re(e))
- for (var i in e)
- e.hasOwnProperty(i) && B.on(i, e[i]);
- else if ("function" === Re(t))
- for (var n = e.split(" "), r = 0, o = n.length; r < o; r++)
- ve[n[r]] = ve[n[r]] || [],
- -1 === f(n[r], t) && ve[n[r]].push(t);
- else if ("array" === Re(t))
- for (var a = 0, s = t.length; a < s; a++)
- B.on(e, t[a])
- }
- ,
- B.one = function(t, i) {
- B.on(t, function e() {
- i.apply(B, arguments),
- B.off(t, e)
- })
- }
- ,
- B.off = function(e, t) {
- if (t instanceof Array)
- for (var i = 0, n = t.length; i < n; i++)
- B.off(e, t[i]);
- else
- for (var r = e.split(" "), o = 0, a = r.length; o < a; o++)
- if (ve[r[o]] = ve[r[o]] || [],
- null == t)
- ve[r[o]].length = 0;
- else {
- var s = f(r[o], t);
- -1 !== s && ve[r[o]].splice(s, 1)
- }
- }
- ,
- B.destroy = function() {
- return ce.add(j).add(W).add(Z).add(ue).add(de).add(pe).add(fe).add(ge).add(me).off("." + He),
- We.off("keydown", M),
- pe.add(fe).add(ge).add(me).removeClass(F.disabledClass),
- J && null != ee.activeItem && J.eq(ee.activeItem).removeClass(F.activeClass),
- Z.empty(),
- V || (k.off("." + He),
- te.restore(),
- ie.restore(),
- ne.restore(),
- re.restore(),
- xe.removeData(s, He)),
- $.length = Q.length = 0,
- ye = {},
- B.initialized = 0,
- B
- }
- ,
- B.init = function() {
- if (!B.initialized) {
- B.on(n);
- var e = ["overflow", "position"]
- , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
- te.save.apply(te, e),
- ne.save.apply(ne, e),
- ie.save.apply(ie, t),
- re.save.apply(re, t);
- var i = j;
- return V || (i = i.add(U),
- k.css("overflow", "hidden"),
- Ve || "static" !== k.css("position") || k.css("position", "relative")),
- Ve ? ke && i.css(Ve, ke) : ("static" === W.css("position") && W.css("position", "relative"),
- i.css({
- position: "absolute"
- })),
- F.forward && ue.on(Ke, T),
- F.backward && de.on(Ke, T),
- F.prev && pe.on(Ze, T),
- F.next && fe.on(Ze, T),
- F.prevPage && ge.on(Ze, T),
- F.nextPage && me.on(Ze, T),
- ce.on(Xe, x),
- W[0] && W.on(Ze, S),
- le && F.activateOn && k.on(F.activateOn + "." + He, "*", R),
- Z[0] && F.activatePageOn && Z.on(F.activatePageOn + "." + He, "*", P),
- he.on(je, {
- source: "slidee"
- }, I),
- j && j.on(je, {
- source: "handle"
- }, I),
- We.on("keydown", M),
- V || (k.on("mouseenter." + He + " mouseleave." + He, O),
- k.on("scroll." + He, Le)),
- B.initialized = 1,
- a(!0),
- F.cycleBy && !V && B[F.startPaused ? "pause" : "resume"](),
- B
- }
- }
- }
- function Re(e) {
- 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
- }
- function Pe(e, t) {
- e.preventDefault(),
- t && e.stopPropagation()
- }
- function Oe(e) {
- Pe(e, 1),
- xe(this).off(e.type, Oe)
- }
- function Le() {
- this.scrollLeft = 0,
- this.scrollTop = 0
- }
- function De(e) {
- return !isNaN(parseFloat(e)) && isFinite(e)
- }
- function Ne(e, t) {
- return 0 | it(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
- }
- function Fe(e, t, i) {
- return e < t ? t : i < e ? i : e
- }
- function Be(t) {
- var i = {
- style: {},
- save: function() {
- if (t && t.nodeType) {
- for (var e = 0; e < arguments.length; e++)
- i.style[arguments[e]] = t.style[arguments[e]];
- return i
- }
- },
- restore: function() {
- if (t && t.nodeType) {
- for (var e in i.style)
- i.style.hasOwnProperty(e) && (t.style[e] = i.style[e]);
- return i
- }
- }
- };
- return i
- }
- 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;
- function t(e) {
- for (var t = 0, i = r.length; t < i; t++) {
- var n = r[t] ? r[t] + e.charAt(0).toUpperCase() + e.slice(1) : e;
- if (null != o.style[n])
- return n
- }
- }
- We.on(Xe, function(e) {
- var t = e.originalEvent[He]
- , i = +new Date;
- (!t || t.options.scrollHijack < i - ot) && (ot = i)
- }),
- function(t) {
- Ge = t.requestAnimationFrame || t.webkitRequestAnimationFrame || function(e) {
- var t = (new Date).getTime()
- , i = Math.max(0, 16 - (t - r))
- , n = setTimeout(e, i);
- return r = t,
- n
- }
- ;
- var r = (new Date).getTime()
- , i = t.cancelAnimationFrame || t.webkitCancelAnimationFrame || t.clearTimeout;
- ze = function(e) {
- i.call(t, e)
- }
- }(window),
- r = ["", "webkit", "moz", "ms", "o"],
- o = document.createElement("div"),
- Ve = t("transform"),
- ke = t("perspective") ? "translateZ(0) " : "",
- e.Sly = Me,
- xe.fn.sly = function(n, r) {
- var o, a;
- return xe.isPlainObject(n) || ("string" !== Re(n) && !1 !== n || (o = !1 === n ? "destroy" : n,
- a = Array.prototype.slice.call(arguments, 1)),
- n = {}),
- this.each(function(e, t) {
- var i = xe.data(t, He);
- i || o ? i && o && i[o] && i[o].apply(i, a) : i = xe.data(t, He, new Me(t,n,r).init())
- })
- }
- ,
- Me.defaults = {
- slidee: null,
- horizontal: !1,
- itemNav: null,
- itemSelector: null,
- smart: !1,
- activateOn: null,
- activateMiddle: !1,
- scrollSource: null,
- scrollBy: 0,
- scrollHijack: 300,
- scrollTrap: !1,
- dragSource: null,
- mouseDragging: !1,
- touchDragging: !1,
- releaseSwing: !1,
- swingSpeed: .2,
- elasticBounds: !1,
- interactive: null,
- scrollBar: null,
- dragHandle: !1,
- dynamicHandle: !1,
- minHandleSize: 50,
- clickBar: !1,
- syncSpeed: .5,
- pagesBar: null,
- activatePageOn: null,
- pageBuilder: function(e) {
- return "<li>" + (e + 1) + "</li>"
- },
- forward: null,
- backward: null,
- prev: null,
- next: null,
- prevPage: null,
- nextPage: null,
- cycleBy: null,
- cycleInterval: 5e3,
- pauseOnHover: !1,
- startPaused: !1,
- moveBy: 300,
- speed: 0,
- easing: "swing",
- startAt: null,
- keyboardNavBy: null,
- draggedClass: "dragged",
- activeClass: "active",
- disabledClass: "disabled"
- }
- }(jQuery, window),
- function o(a, s, l) {
- function c(i, e) {
- if (!s[i]) {
- if (!a[i]) {
- var t = "function" == typeof require && require;
- if (!e && t)
- return t(i, !0);
- if (h)
- return h(i, !0);
- var n = new Error("Cannot find module '" + i + "'");
- throw n.code = "MODULE_NOT_FOUND",
- n
- }
- var r = s[i] = {
- exports: {}
- };
- a[i][0].call(r.exports, function(e) {
- var t = a[i][1][e];
- return c(t || e)
- }, r, r.exports, o, a, s, l)
- }
- return s[i].exports
- }
- for (var h = "function" == typeof require && require, e = 0; e < l.length; e++)
- c(l[e]);
- return c
- }({
- 1: [function(p, f, e) {
- (function(e) {
- "use strict";
- function t(e) {
- this.player = null,
- this.director = null,
- this.modelManager = null,
- this.container = null,
- this.tagManager = null,
- this.fadeInSpeed = e,
- null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
- }
- var r = p("three")
- , i = p("./util/logger")
- , n = (p("./util/common"),
- p("./enum/PlayerEvents"))
- , o = p("./enum/DirectorEvents")
- , a = p("./settings")
- , s = p("./enum/Viewmode")
- , l = (p("./enum/WarpStyle"),
- p("./enum/BlackoutStyle"),
- p("./enum/ModelManagerEvents"))
- , c = p("./enum/tagEvents")
- , h = p("./util/transitions")
- , u = p("./util/lerp")
- , d = new i(e);
- window.THREE = r,
- t.prototype.init = function(e, t, i, n, r) {
- (window.app = this).player = t,
- this.director = e,
- this.modelManager = i,
- this.tagManager = n,
- this.container = r,
- this.updateModel(),
- this.bindEvents()
- }
- ,
- t.prototype.bindEvents = function() {
- this.modelManager.on(l.ActiveModelChanged, this.updateModel.bind(this)),
- this.player.on(n.ModeChanging, this.handlePlayerModeChanging.bind(this)),
- this.player.on(n.ModeChanged, this.handlePlayerModeChanged.bind(this)),
- this.player.on(n.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
- this.player.on(n.StartInside, this.handleStartInside.bind(this)),
- this.player.on(n.StartOutside, this.handleStartOutside.bind(this)),
- this.player.on(n.WarpStarted, this.handleWarpStarted.bind(this)),
- this.director.on(o.ActionInterrupted, this.handleActionInterruption.bind(this)),
- this.tagManager.on(c.TagActivated, this.ontagActivated.bind(this)),
- this.tagManager.on(c.TagNavigation, this.onNavigationTotag.bind(this))
- }
- ,
- t.prototype.updateModel = function() {
- this.model = this.modelManager.getActiveModel()
- }
- ,
- t.prototype.handleWarpStarted = function() {
- this.hidePlayerReticule()
- }
- ,
- t.prototype.ontagActivated = function() {
- this.hidePlayerReticule()
- }
- ,
- t.prototype.onNavigationTotag = function() {
- this.hidePlayerReticule()
- }
- ,
- t.prototype.handlePlayerModeChanging = function(e, t, i) {
- var n = this.modelManager.getActiveModel()
- , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : a[t].markerOpacity;
- n.fadePanoMarkers(r),
- n.setMode(t)
- }
- ,
- t.prototype.handlePlayerModeChanged = function(e, t) {
- var i = this.modelManager.getActiveModel()
- , n = t === s.PANORAMA ? r.DoubleSide : r.FrontSide;
- i.setSide(n),
- i.setMode(t)
- }
- ,
- t.prototype.handleClosestPanoChanging = function(e, t, i) {
- i !== s.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
- t && !this.director.tourIsPlaying && t.hoverOn(i))
- }
- ,
- t.prototype.handleActionInterruption = function() {}
- ,
- t.prototype.handleStartInside = function(e) {
- var t = a[this.player.mode]
- , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
- this.fadeIn(this.fadeInSpeed),
- this.model.alpha = 0,
- this.model.skybox.material.uniforms.opacity.value = 1,
- this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
- var n = this.player.reticule;
- h.start(u.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
- }
- ,
- t.prototype.handleStartOutside = function(e) {
- this.fadeIn(e)
- }
- ,
- t.prototype.fadeIn = function(e) {
- null != e || (e = 2e3,
- d.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
- $(this.container).fadeIn(e)
- }
- ,
- t.prototype.hidePlayerReticule = function() {
- this.player.reticule.hide()
- }
- ,
- f.exports = t
- }
- ).call(this, "/js/DisplayController.js")
- }
- , {
- "./enum/BlackoutStyle": 18,
- "./enum/DirectorEvents": 23,
- "./enum/tagEvents": 32,
- "./enum/ModelManagerEvents": 33,
- "./enum/PlayerEvents": 40,
- "./enum/Viewmode": 51,
- "./enum/WarpStyle": 52,
- "./settings": 166,
- "./util/common": 185,
- "./util/lerp": 188,
- "./util/logger": 189,
- "./util/transitions": 195,
- three: 217
- }],
- 2: [function(e, t, i) {
- "use strict";
- function n() {
- this.baseStartTime = performance.timing.navigationStart,
- this.loadingStartTime = null,
- this.waitingStartTime = null,
- this.appReadyTime = null
- }
- n.prototype.setBaseStartTime = function(e) {
- this.baseStartTime = e || Date.now()
- }
- ,
- n.prototype.setWaitingStartTime = function(e) {
- this.waitingStartTime = e || Date.now()
- }
- ,
- n.prototype.setLoadingStartTime = function(e) {
- this.loadingStartTime = e || Date.now()
- }
- ,
- n.prototype.setAppReadyTime = function(e) {
- this.appReadyTime = e || Date.now()
- }
- ,
- n.prototype.calcFullLoadingTime = function() {
- var e = this.appReadyTime - this.baseStartTime;
- return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
- e
- }
- ,
- t.exports = n
- }
- , {}],
- 3: [function(i, n, e) {
- (function(e) {
- "use strict";
- function a() {
- return 100 * Math.random()
- }
- var t = i("./util/logger")
- , s = i("./util/browser")
- , l = new t(e)
- , c = window.MP_AB_TESTS = window.MP_AB_TESTS || {
- initialized: !1,
- init: function(e, t) {
- if (t = t || {},
- !this.initialized) {
- for (var i in this.initialized = !0,
- s.valueFromHash("tilegen") && (t.tilegen = 1 === s.valueFromHash("tilegen", 0)),
- s.valueFromHash("imgopt") && (t.imgopt = 1 === s.valueFromHash("imgopt", 0)),
- e) {
- var n = i.match("^sc_tilegen_([0-9]+)$");
- n && (c.tilegen = a() < parseInt(n[1]));
- var r = i.match("^sc_imgopt_([0-9]+)$");
- r && (c.imgopt = a() < parseInt(r[1]))
- }
- for (var o in t)
- c[o] = t[o],
- l.debug("A/B override:", o, c[o])
- }
- },
- changeIfTileGenerating: function(e) {
- return c.tilegen && (e += -1 === e.indexOf("?") ? "?" : "&",
- e += ""),
- e
- },
- changeIfImageOptimzing: function(e) {
- if(e.includes("blob:http"))return e;//add
- return c.imgopt && -1 === e.indexOf("imgopt=1") && (e += -1 === e.indexOf("?") ? "?" : "&",
- e += ""),
- e
- },
- tilegen: !1,
- imgopt: !1
- };
- n.exports = c
- }
- ).call(this, "/js/ab.js")
- }
- , {
- "./util/browser": 182,
- "./util/logger": 189
- }],
- 4: [function(u, d, e) {
- (function(e) {
- "use strict";
- function r(n, e, t, i) {
- function r(e) {
- a[e.sid] = !0;
- var t = e.billboard.media && e.billboard.media.type
- , i = {
- tag_id: e.sid,
- tags_visited: Object.keys(a).length,
- tag_count: Object.keys(n.tags).length,
- tag_view_count: ++d,
- has_media: !!t
- };
- t && (i.media_type = t),
- g("tag_opened", i)
- }
- var o, a = {}, s = Date.now() - P, l = null;
- i && (l = Date.now() - window.navigationStart);
- try {
- o = /* n.data.player_options.highlight_reel && */ 0 < n.heroLocations.length
- } catch (n) {
- o = !1
- }
- var c, h = n.supportsVR;
- h || (c = "VR disabled at the model/account level",
- 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"))),
- g("model_loaded", {
- duration: s,
- duration_from_navigation_start: l,
- has_hlr: o,
- has_vr: h,
- vr_reason: c
- });
- var u = 0;
- n.panos.forEach(function(e) {
- e.on("enter", function() {
- f("pano_viewed", {
- pano_id: e.id,
- pano_view_count: ++u,
- alignment_type: e.alignmentType,
- interaction_source: R,
- navigation_source: v
- })
- })
- });
- var d = 0;
- for (var p in n.tags)
- n.tags[p].billboard.on(M.OPENED, r.bind(this, n.tags[p]));
- e.on("tour_auto", function(e) {
- v = "tour_" + e
- }),
- e.on("tour_manual", function(e) {
- R = "gui-" + e,
- v = "tour_manual"
- }),
- t.on(C.InteractionKey, function() {
- e.mode === A.TRANSITIONING || e.flying || m(C.InteractionKey)
- }),
- t.on(C.InteractionDirect, function() {
- e.mode === A.TRANSITIONING || e.flying || m(C.InteractionDirect)
- }),
- function(t) {
- I.on(T.OPENED, function() {
- f("showcase_share_intent", {
- pano_id: t.currentPano && t.currentPano.id
- })
- }),
- I.on(T.LINK_CLICKED, function(e) {
- f("showcase_share_action", {
- channel: e.channel,
- pano_id: t.currentPano && t.currentPano.id
- })
- }),
- E.on(x.ORIGIN_LINK_CLICKED, function() {
- f("showcase_share_origin_link_clicked")
- })
- }(e),
- function() {
- _.on(S.OPENED, f.bind(this, "showcase_gui", {
- gui_action: "click_vr_button"
- })),
- _.on(S.LAUNCH, function(e) {
- f("showcase_gui", {
- gui_action: "launch_vr",
- vr_platform: e.vr_platform,
- vr_app: e.vr_app
- })
- }),
- _.on(S.PREV, f.bind(this, "showcase_gui", {
- gui_action: "vr_modal_prev"
- })),
- _.on(S.NEXT, function(e) {
- f("showcase_gui", {
- gui_action: e.nextAction
- })
- }),
- _.on(S.CLOSED, f.bind(this, "showcase_gui", {
- gui_action: "vr_modal_close"
- })),
- _.on(S.falseICECHOSEN, function(e) {
- f("showcase_gui", {
- gui_action: e.name + " "
- })
- }),
- _.on(S.STORE, function(e) {
- f("showcase_gui", {
- gui_action: "launch_store",
- store: e
- })
- })
- }()
- }
- function f(e, t) {
- if (t = t || {},
- i)
- try {
- window.analytics.track(e, s.extendObject(t, c), {
- context: {
- app: {
- name: "showcase",
- version: "2.25.6-0-gd87e5b1"
- },
- screen: {
- width: window.screen.width,
- height: window.screen.height,
- density: window.devicePixelRatio
- }
- }
- })
- } catch (t) {
- console.warn("Failed to send data to segment for " + e)
- }
- }
- function g(e, t) {
- f(e, t = t || {})
- }
- function m(e, t) {
- R = e === C.InteractionGui ? "gui-" + t : e,
- v = "self_guided"
- }
- var v, o, a = (u("three"),
- u("./util/ajax"),
- u("./ab")), y = u("./util/browser"), s = u("./util/common"), t = u("./settings"), A = (u("./localization/localize"),
- 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"),
- "direct"), i = null, n = !1, P = null, c = null, h = s.uuid4();
- d.exports = {
- report: function(e, t, i, n) {
- !function(e, t) {
- if (o)
- try {
- o.addEvent(e, s.extendObject({
- host: window.location.host,
- keen: {
- addons: [{
- name: "keen:ua_parser",
- input: {
- ua_string: "user_agent"
- },
- output: "parsed_user_agent"
- }]
- },
- user_agent: "${keen.user_agent}",
- referrer: {
- url: s.normalizeUrl(document.referrer),
- domain: s.domainFromUrl(document.referrer),
- url_original: document.referrer
- },
- embedded: y.inIframe(),
- is_mobile: y.isMobile(),
- version: "2.25.6-0-gd87e5b1"
- }, t))
- } catch (e) {
- l.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
- }
- }("Session starts", {
- model: e,
- status: t,
- loadtime: Date.now() - (P || Date.now()),
- loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
- autoplay: i,
- quickstart: n,
- ab_tilegen: a.tilegen,
- ab_imgopt: a.imgopt
- })
- },
- impression: function(e) {
- g("impression", {
- visible: void 0 === (e = e || {}).isVisible || e.isVisible,
- url_params: (void 0 !== e.immediate && e.immediate,
- window.location.search.substr(1).split("&"))
- })
- },
- initKeen: function(e) {
- return e.token && e.appId ? void (o = new Keen({
- projectId: e.appId,
- writeKey: e.token,
- readKey: "",
- requestType: "xhr"
- })) : void l.warn("no keen token/appId")
- },
- initSegment: function(e) {
- return e.token ? (i = e.token,
- window.analytics.load(e.token),
- c = {
- model_id: e.model,
- start_source: e.startSource,
- autoplay: e.autoplay,
- quickstart: e.quickstart,
- language_tag: t.languageTag,
- is_mobile: y.isMobile(),
- iframe: y.inIframe(),
- aspect_ratio: y.aspectRatio(),
- session_id: h,
- window: {
- width: $("#player").width(),
- height: $("#player").height()
- },
- platform: {
- browser: {
- name: $.ua.browser.name,
- major: $.ua.browser.major,
- version: $.ua.browser.version
- },
- os: {
- name: $.ua.os.name,
- version: $.ua.os.version
- },
- device: {
- vendor: $.ua.device.vendor,
- model: $.ua.device.model,
- type: $.ua.device.type
- }
- }
- },
- n = Math.random() < t.analytics.sessionTrackingRate,
- l.debug("tracking sample rate = " + t.analytics.sessionTrackingRate),
- void l.debug("tracking this session = " + n)) : void l.warn("no segment token")
- },
- sessionStart: function(e) {
- l.debug("analytics user_session_start"),
- f("session_started"),
- P = Date.now(),
- window.addEventListener("unload", function() {
- !function(e, t) {
- if (t = t || {},
- navigator.sendBeacon && i)
- try {
- navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
- event: e,
- anonymousId: window.analytics.user().anonymousId(),
- properties: s.extendObject(t, c),
- writeKey: i,
- sentAt: Date.now(),
- type: "track",
- context: {
- userAgent: y.userAgent(),
- library: {
- name: "showcase-beacon",
- version: "2.25.6-0-gd87e5b1"
- },
- app: {
- name: "showcase",
- version: "2.25.6-0-gd87e5b1"
- }
- }
- }))
- } catch (e) {
- console.warn("Failed to send async segment request")
- }
- }("session_ended", {
- duration: Date.now() - P
- })
- })
- },
- modelLoaded: function(e, t, i, n) {
- r(e, t, i, n)
- },
- loadComplete: function(e) {
- f("load_times", {
- time_to_app_start: e
- })
- },
- track: function(e, t) {
- n && (l.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
- f(e, t))
- },
- trackAlways: function(e, t) {
- l.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
- f(e, t)
- },
- getSessionId: function() {
- return h
- },
- updateInteraction: m
- }
- }
- ).call(this, "/js/analytics.js")
- }
- , {
- "./ab": 3,
- "./enum/ControlEvents": 21,
- "./enum/PlayerEvents": 40,
- "./enum/VROption": 47,
- "./enum/VRPlatforms": 49,
- "./enum/Viewmode": 51,
- "./gui/sharing/ShareEvents": 76,
- "./gui/sharing/modal": 77,
- "./gui/title/TitleEvents": 80,
- "./gui/title/titleBar": 82,
- "./gui/vr/vrEvent": 85,
- "./gui/vr/vrModal": 87,
- "./localization/localize": 108,
- "./tag/Billboard/BillboardEvent": 120,
- "./settings": 166,
- "./util/ajax": 181,
- "./util/browser": 182,
- "./util/common": 185,
- "./util/logger": 189,
- three: 217
- }],
- 5: [function(e, t, i) {
- "use strict";
- function n() {
- r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
- this.controls = null
- }
- var r = e("three")
- , o = e("../constants")
- , a = e("../util/cameraLight");
- (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
- this.aspect = e,
- this.updateProjectionMatrix()
- }
- ,
- t.exports = n
- }
- , {
- "../constants": 8,
- "../util/cameraLight": 184,
- three: 217
- }],
- 6: [function(e, t, i) {
- "use strict";
- function n() {
- var e = $("#player").width() / $("#player").height();
- r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
- this.controls = null,
- this.updateAspect(e)
- }
- var r = e("three")
- , o = e("../constants");
- (n.prototype = Object.create(r.OrthographicCamera.prototype)).updateAspect = function(e) {
- this.aspect = e,
- this.top = o.orthoBase / e,
- this.bottom = -o.orthoBase / e,
- this.updateProjectionMatrix()
- }
- ,
- t.exports = n
- }
- , {
- "../constants": 8,
- three: 217
- }],
- 7: [function(e, t, i) {
- "use strict";
- function n() {
- r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
- this.controls = null
- }
- var r = e("three")
- , o = e("../settings")
- , a = e("../util/cameraLight");
- (n.prototype = Object.create(r.PerspectiveCamera.prototype)).updateAspect = function(e) {
- this.aspect = e,
- this.updateProjectionMatrix()
- }
- ,
- t.exports = n
- }
- , {
- "../settings": 166,
- "../util/cameraLight": 184,
- three: 217
- }],
- 8: [function(e, t, i) {
- "use strict";
- t.exports = {
- signedUrlDefaultExpireTime: 24e4,
- signedUrlCheckInterval: 1e4,
- signedUrlRefreshBuffer: 15e3,
- dollhouseFOV: 70,
- dollhouseNear: .1,//1,
- dollhouseFar: 5e3,
- insideFOV: 70,
- insideFOVMax: 120,
- insideNear: .1,
- insideFar: 5e3,
- insideLookSpeed: .12,
- insideLookLimitUp: 40,
- insideLookLimitDown: -40,
- orthoNear: 1,
- orthoFar: 5e3,
- orthoBase: 10,
- narrowLandscapeHeight: 290,
- reallyNarrowLandscapeHeight: 250,
- visionTilingStartDate: new Date("8/26/2016"),
- visionTilingStartVersion: "1.1.407.13667",
- windowHeightHighQualityThreshold: 900,
- tourStepDelayDefault: 3500,
- tourStepDelaySlideShow: 5e3,
- workshopApsect: 9 / 16,
- highQualityMaxZoom: 2,
- ultraHighQualityMaxZoom: 3
- }
- }
- , {}],
- 9: [function(e, t, i) {
- "use strict";
- function n() {
- this.activeControl = null,
- this.controls = {},
- this.cameras = {}
- }
- var a = e("./PanoramaControls")
- , s = e("./DollhouseControls")
- , l = e("./FloorplanControls")
- , c = e("../cameras/PanoramaCamera")
- , h = e("../cameras/DollhouseCamera")
- , u = e("../cameras/FloorplanCamera")
- , r = e("events").EventEmitter
- , d = e("../enum/ControlEvents")
- , o = e("../enum/ModelManagerEvents")
- , p = e("../enum/Viewmode")
- , f = e("../settings");
- (n.prototype = Object.create(r.prototype)).init = function(e, t) {
- this.setUpControls(),
- this.bindEvents(e, t)
- }
- ,
- n.prototype.activateControls = function(e) {
- this.activeControl && (this.activeControl.reset(),
- this.activeControl.enabled = !1),
- this.controls[e] && (this.controls[e].enabled = !0),
- this.activeControl = this.controls[e]
- }
- ,
- n.prototype.setUpControls = function() {
- var i = {}
- , n = {}
- , e = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
- , r = [c, h, u]
- , o = [a, s, l];
- e.forEach(function(e, t) {
- i[e] = new r[t],
- n[e] = new o[t](i[e]),
- n[e].on(d.Move, this.emit.bind(this, d.Move)),
- n[e].on(d.InputStart, this.emit.bind(this, d.InputStart)),
- n[e].on(d.InteractionDirect, this.emit.bind(this, d.InteractionDirect)),
- n[e].on(d.InteractionKey, this.emit.bind(this, d.InteractionKey)),
- n[e].on(d.Pinch, this.emit.bind(this, d.Pinch)),
- n[e].on(d.Scroll, this.emit.bind(this, d.Scroll))
- }
- .bind(this)),
- this.controls = n,
- this.cameras = i
- }
- ,
- n.prototype.bindEvents = function(e, t) {
- e.addEventListener("mousemove", this.onMouseMove.bind(this)),
- e.addEventListener("mousedown", this.onMouseDown.bind(this)),
- e.addEventListener("mouseup", this.onMouseUp.bind(this)),
- e.addEventListener("mouseover", this.onMouseOver.bind(this)),
- f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this), {
- passive: !1
- }),
- e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
- e.addEventListener("touchstart", this.onTouchStart.bind(this)),
- e.addEventListener("touchmove", this.onTouchMove.bind(this)),
- e.addEventListener("touchend", this.onTouchEnd.bind(this)),
- e.addEventListener("contextmenu", function(e) {
- e.preventDefault()
- }),
- e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
- e.addEventListener("pointermove", this.onPointerMove.bind(this)),
- e.addEventListener("pointerup", this.onPointerUp.bind(this)),
- e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
- e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
- document.addEventListener("keydown", this.onKeyDown.bind(this)),
- document.addEventListener("keyup", this.onKeyUp.bind(this)),
- t.on(o.ActiveModelChanged, function(e) {
- this.setModelForControls(e.model)
- }
- .bind(this))
- }
- ,
- n.prototype.setModelForControls = function(e) {
- this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
- var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
- [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
- this.controls[e].setBounds(t)
- }
- .bind(this))
- }
- ,
- n.prototype.onMouseDown = function(e) {
- e.preventDefault(),
- this.activeControl && this.activeControl.onMouseDown(e)
- }
- ,
- n.prototype.onMouseMove = function(e) {
- e.preventDefault(),
- this.activeControl && this.activeControl.onMouseMove(e)
- }
- ,
- n.prototype.onMouseUp = function(e) {
- e.preventDefault(),
- this.activeControl && this.activeControl.onMouseUp(e)
- }
- ,
- n.prototype.onMouseOver = function(e) {
- e.preventDefault(),
- this.activeControl && this.activeControl.onMouseOver(e)
- }
- ,
- n.prototype.onMouseWheel = function(e) {
- e.preventDefault(),
- this.activeControl && this.activeControl.onMouseWheel(e)
- }
- ,
- n.prototype.onTouchStart = function(e) {
- e.preventDefault(),
- this.activeControl && this.activeControl.onTouchStart(e),
- $("#hotListWrap")[0].classList.remove("hotListActive"),
- $("#hotListContent ul .active").removeClass("active"),
- $("#hotList")[0].classList.remove("active")
- }
- ,
- n.prototype.onTouchMove = function(e) {
- e.preventDefault(),
- this.activeControl && this.activeControl.onTouchMove(e)
- }
- ,
- n.prototype.onTouchEnd = function(e) {
- e.preventDefault(),
- this.activeControl && this.activeControl.onTouchEnd(e)
- }
- ,
- n.prototype.onPointerDown = function(e) {
- if (e.preventDefault(),
- this.activeControl)
- switch (e.pointerType) {
- case "mouse":
- this.activeControl.onMouseDown(e);
- break;
- default:
- this.activeControl.onPointerDown(e)
- }
- }
- ,
- n.prototype.onPointerMove = function(e) {
- if (e.preventDefault(),
- this.activeControl)
- switch (e.pointerType) {
- case "mouse":
- this.activeControl.onMouseMove(e);
- break;
- default:
- this.activeControl.onPointerMove(e)
- }
- }
- ,
- n.prototype.onPointerUp = function(e) {
- if (e.preventDefault(),
- this.activeControl)
- switch (e.pointerType) {
- case "mouse":
- this.activeControl.onMouseUp(e);
- break;
- default:
- this.activeControl.onPointerUp(e)
- }
- }
- ,
- n.prototype.onPointerCancel = function(e) {
- e.preventDefault(),
- this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
- }
- ,
- n.prototype.onKeyDown = function(e) {
- e.metaKey || e.ctrlKey || (e.preventDefault(),
- this.activeControl && this.activeControl.onKeyDown(e))
- }
- ,
- n.prototype.onKeyUp = function(e) {
- e.preventDefault(),
- this.activeControl && this.activeControl.onKeyUp(e)
- }
- ,
- t.exports = n
- }
- , {
- "../cameras/DollhouseCamera": 5,
- "../cameras/FloorplanCamera": 6,
- "../cameras/PanoramaCamera": 7,
- "../enum/ControlEvents": 21,
- "../enum/ModelManagerEvents": 33,
- "../enum/Viewmode": 51,
- "../settings": 166,
- "./DollhouseControls": 10,
- "./FloorplanControls": 11,
- "./PanoramaControls": 13,
- events: 202
- }],
- 10: [function(e, t, i) {
- "use strict";
- function n(e) {
- a.call(this, e),
- this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
- this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
- this.minDistance = o.dollhouseDefault.minDistance,
- this.maxDistance = o.dollhouseDefault.maxDistance,
- this.adjustedMinDistance = this.minDistance,
- this.adjustedMaxDistance = this.maxDistance
- }
- var r = e("three")
- , o = e("../settings")
- , a = e("./OutsideControls");
- (n.prototype = Object.create(a.prototype)).pan = function(e, t) {
- this.camera.updateMatrix();
- var i = this.camera.position.clone().sub(this.target).length();
- i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
- this.panLeft(2 * e * i / $("#player").height()),
- this.panUp(-2 * t * i / $("#player").height())
- }
- ,
- n.prototype.updateZoom = function() {
- return this.offset.length() * this.scale
- }
- ,
- n.prototype.setZoomBounds = function(e) {
- var t = e.min.distanceTo(e.max);
- this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
- this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
- this.minDistance = this.adjustedMinDistance,
- this.maxDistance = this.adjustedMaxDistance
- }
- ,
- n.prototype.resetRanges = function(e, t) {
- e ? (this.minDistance = Math.min(e, this.minDistance),
- this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
- this.maxDistance = this.adjustedMaxDistance),
- t ? (this.minPolarAngle = r.Math.degToRad(-15),
- this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
- this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
- }
- ,
- n.prototype.toJSON = function() {
- return a.prototype.toJSON.call(this)
- }
- ,
- t.exports = n
- }
- , {
- "../settings": 166,
- "./OutsideControls": 12,
- three: 217
- }],
- 11: [function(e, t, i) {
- "use strict";
- function n(e) {
- c.call(this, e),
- this.minDistance = 15,
- this.maxDistance = 50,
- this.noRotateUpDown = !0,
- this.minPolarAngle = 0,
- this.maxPolarAngle = 0,
- this.mouseActions[u.LEFT] = h.PAN,
- this.mouseActions[u.MIDDLE] = h.DOLLY,
- this.mouseActions[u.RIGHT] = h.ROTATE,
- this.touchActions[1] = h.PAN,
- this.touchActions[2] = h.ROTATE_DOLLY,
- this.absoluteScale = 1,
- this.currentScale = 1
- }
- 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");
- (n.prototype = Object.create(c.prototype)).zoomToContain = function(e) {
- this.absoluteScale = this.getDefaultAbsoluteScale(e);
- this.currentScale = this.absoluteScale
- }
- ,
- n.prototype.getDefaultAbsoluteScale = function(modelSize) {
- var t = Math.max(modelSize.x, modelSize.z)
- , i = Math.min(modelSize.x, modelSize.z)
- , n = Math.max(t, i * this.camera.aspect)
- , r = Math.max(i, t * this.camera.aspect);
- var absoluteScale = (p.aspectRatio() < 1 ? r : n) / 2 / l.orthoBase * 1.2
- return absoluteScale
- },
- n.prototype.rotateToView = function(e, t) {
- var i = 0;
- p.aspectRatio() < 1 == e.x < e.z ? 0 < t.z && (i = Math.PI) : i = 0 < t.x ? Math.PI / 2 : -Math.PI / 2,
- this.rotateLeft(i),
- this.update(0)
- }
- ,
- n.prototype.pan = function(e, t) {
- this.camera.updateMatrix(),
- this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
- this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
- }
- ,
- n.prototype.updateZoom = function() {
- return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
- this.absoluteScale = Math.max(l.zoomNearLimit, Math.min(this.absoluteScale, l.zoomFarLimit)),
- this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
- this.camera.left = -l.orthoBase * this.currentScale,
- this.camera.right = l.orthoBase * this.currentScale,
- this.camera.top = l.orthoBase * this.currentScale / this.camera.aspect,
- this.camera.bottom = -l.orthoBase * this.currentScale / this.camera.aspect,
- this.camera.updateProjectionMatrix(),
- this.offset.length()
- }
- ,
- n.prototype.toJSON = (r = new s.Quaternion,
- o = (new s.Quaternion).setFromAxisAngle(new s.Vector3(0,1,0), s.Math.degToRad(90)),
- a = new s.Quaternion,
- function() {
- var e = c.prototype.toJSON.call(this);
- return r.copy(e.camera_quaternion),
- a.copy(o),
- a.multiply(r),
- e.camera_quaternion.x = d.toPrecision(a.x, 4),
- e.camera_quaternion.y = d.toPrecision(a.y, 4),
- e.camera_quaternion.z = d.toPrecision(a.z, 4),
- e.camera_quaternion.w = d.toPrecision(a.w, 4),
- e.ortho_zoom = d.toPrecision(this.currentScale * this.camera.aspect, 4),
- e
- }
- ),
- t.exports = n
- }
- , {
- "../enum/ControlActions": 20,
- "../enum/MouseButton": 34,
- "../settings": 166,
- "../util/browser": 182,
- "../util/math": 190,
- "./OutsideControls": 12,
- three: 217
- }],
- 12: [function(e, t, i) {
- "use strict";
- function n(e) {
- this.camera = e,
- (this.camera.controls = this).enabled = !1,
- this.target = new a.Vector3,
- this.targetBounds = new a.Box3,
- this.zoomSpeed = 2,//编辑时缩放快一些
- this.minDistance = 0,
- this.maxDistance = 1 / 0,
- this.noRotateUpDown = !1,
- this.rotateSpeed = 1,
- this.keyboardZoomSpeed = 0,
- this.keyPanSpeed = 7,
- this.autoRotate = !1,
- this.autoRotateSpeed = 2,
- this.autoPan = !1,
- this.autoPanPosition = new a.Vector3,
- this.minPolarAngle = a.Math.degToRad(25),
- this.maxPolarAngle = a.Math.degToRad(65),
- this.rotationAcceleration = new a.Vector2,
- this.rotationSpeed = new a.Vector2,
- this.panAcceleration = new a.Vector2,
- this.panSpeed = new a.Vector2,
- this.rotateStart = new a.Vector2,
- this.rotateEnd = new a.Vector2,
- this.rotateDelta = new a.Vector2,
- this.panStart = new a.Vector2,
- this.panEnd = new a.Vector2,
- this.panDelta = new a.Vector2,
- this.panOffset = new a.Vector3,
- this.offset = new a.Vector3,
- this.dollyStart = new a.Vector2,
- this.dollyEnd = new a.Vector2,
- this.dollyDelta = new a.Vector2,
- this.phiDelta = 0,
- this.thetaDelta = 0,
- this.scale = 1,
- this.panVector = new a.Vector3,
- this.lastPosition = new a.Vector3,
- this.state = u.NONE,
- this.mouseActions = {},
- this.mouseActions[d.LEFT] = u.ROTATE,
- this.mouseActions[d.MIDDLE] = u.DOLLY,
- this.mouseActions[d.RIGHT] = u.PAN,
- this.touchActions = {},
- this.touchActions[1] = u.ROTATE,
- this.touchActions[2] = u.PAN_DOLLY,
- this.lastMoveTime = 0,
- this.pointersLimit = 2,
- this.pointers = []
- }
- 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;
- (n.prototype = Object.create(g.prototype)).setBounds = function(e) {
- this.targetBounds = e
- }
- ,
- n.prototype.isEngaged = function() {
- return this.state !== u.NONE
- }
- ,
- n.prototype.rotateLeft = function(e) {
- void 0 === e && (e = this.getAutoRotationAngle()),
- this.thetaDelta -= e
- }
- ,
- n.prototype.rotateUp = function(e) {
- this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
- this.phiDelta -= e)
- }
- ,
- n.prototype.panLeft = function(e) {
- var t = this.camera.matrix.elements;
- this.panOffset.set(t[0], 0, t[2]).normalize(),
- this.panOffset.multiplyScalar(-e),
- this.panVector.add(this.panOffset)
- }
- ,
- n.prototype.panUp = function(e) {
- var t = this.camera.matrix.elements;
- this.panOffset.set(t[4], 0, t[6]).normalize(),
- this.panOffset.multiplyScalar(-e),
- this.panVector.add(this.panOffset)
- }
- ,
- n.prototype.startRotating = function(e, t) {
- e && this.navRotationAcc("x", e),
- t && this.navRotationAcc("y", t)
- }
- ,
- n.prototype.stopRotating = function(e) {
- e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
- this.navRotationAcc("x", 0),
- this.navRotationAcc("y", 0)
- }
- ,
- n.prototype.setAutoPanPosition = (r = new a.Vector3,
- o = new a.Vector3,
- function(e, t) {
- r.copy(this.camera.position),
- void 0 === e && null === e || r.setX(e),
- void 0 === t && null === t || r.setZ(t);
- var i = this.camera.position.distanceTo(this.target)
- , n = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
- this.targetClamped = !1,
- o.copy(r).addScaledVector(n, i),
- this.targetBounds.containsPoint(o) || (this.targetBounds.clampPoint(o, o),
- r.copy(o).addScaledVector(n, -i),
- this.targetClamped = !0),
- this.autoPanPosition.x = r.x,
- this.autoPanPosition.z = r.z,
- this.autoPan && this.stopAutoPanning()
- }
- ),
- n.prototype.stopAutoPanning = function() {
- var e = this.autoPan;
- this.autoPan = !1,
- this.emit(this.targetClamped ? f.AutoPanClamped : e ? f.AutoPanInterrupt : f.AutoPanComplete)
- }
- ,
- n.prototype.dollyIn = function(e) {
- void 0 === e && (e = this.getZoomScale()),
- this.scale /= e
- }
- ,
- n.prototype.dollyOut = function(e) {
- void 0 === e && (e = this.getZoomScale()),
- this.scale *= e
- }
- ,
- n.prototype.updatePan = function(e) {
- if (this.panSpeed.multiplyScalar(1 - c.panFriction).addScaledVector(this.panAcceleration, c.panAccelerationOutside * e),
- this.pan(-this.panSpeed.x, this.panSpeed.y),
- this.autoPan) {
- var t = (new a.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
- t.setY(0).clampLength(0, 50 * e),
- this.target.add(t),
- this.camera.position.add(t),
- this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
- this.stopAutoPanning())
- }
- }
- ,
- n.prototype.update = function(e) {
- e = e || 1 / 60,
- this.rotationSpeed.multiplyScalar(1 - c.rotationFriction).addScaledVector(this.rotationAcceleration, c.rotationAccelerationOutside * e),
- this.rotateLeft(-this.rotationSpeed.x),
- this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
- this.updatePan(e);
- var t = this.camera.position;
- this.offset.copy(t).sub(this.target);
- var i = Math.atan2(this.offset.x, this.offset.z)
- , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
- this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
- i += this.thetaDelta,
- n += this.phiDelta,
- n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
- n = Math.max(1e-6, Math.min(Math.PI - 1e-6, n));
- var r = this.updateZoom();
- r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
- this.target.add(this.panVector),
- this.targetBounds.clampPoint(this.target, this.target),
- this.offset.x = r * Math.sin(n) * Math.sin(i),
- this.offset.y = r * Math.cos(n),
- this.offset.z = r * Math.sin(n) * Math.cos(i),
- t.copy(this.target).add(this.offset),
- this.camera.lookAt(this.target),
- this.thetaDelta = 0,
- this.phiDelta = 0,
- this.scale = 1,
- this.panVector.set(0, 0, 0),
- 0 < this.lastPosition.distanceTo(this.camera.position) && this.lastPosition.copy(this.camera.position)
- }
- ,
- n.prototype.getAutoRotationAngle = function() {
- return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
- }
- ,
- n.prototype.getZoomScale = function() {
- return Math.pow(.95, this.zoomSpeed)
- }
- ,
- n.prototype.onMouseDown = function(e) {
- if (this.enabled) {
- switch (e.preventDefault(),
- this.stopAutoPanning(),
- this.mouseDown = !0,
- this.state = this.mouseActions[e.button],
- this.state) {
- case u.ROTATE:
- this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
- this.rotationSpeed.set(0, 0);
- break;
- case u.DOLLY:
- this.dollyStart.set(e.clientX, e.clientY);
- break;
- case u.PAN:
- this.panStart.set(e.clientX, e.clientY)
- }
- this.emit(f.InputStart, "mouse")
- }
- }
- ,
- n.prototype.onMouseMove = function(e) {
- if (this.enabled && this.mouseDown && 0 !== e.buttons) {
- switch (e.preventDefault(),
- this.state) {
- case u.ROTATE:
- this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
- this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
- this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
- this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
- this.rotateStart.copy(this.rotateEnd);
- break;
- case u.DOLLY:
- this.dollyEnd.set(e.clientX, e.clientY),
- this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart),
- (0 < this.dollyDelta.y ? this.dollyIn : this.dollyOut).call(this),
- this.dollyStart.copy(this.dollyEnd);
- break;
- case u.PAN:
- this.panEnd.set(e.clientX, e.clientY),
- this.panDelta.subVectors(this.panEnd, this.panStart),
- this.pan(this.panDelta.x, this.panDelta.y),
- this.panStart.copy(this.panEnd)
- }
- this.emit(f.Move, "mouse"),
- this.lastMoveTime = e.timeStamp,
- this.update()
- }
- }
- ,
- n.prototype.onMouseUp = function(e) {
- this.enabled && (this.mouseDown = !1,
- this.state = u.NONE,
- "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
- this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
- this.update(),
- this.rotationAcceleration.set(0, 0),
- this.rotateDelta.set(0, 0)))
- }
- ,
- n.prototype.onMouseOver = function(e) {
- 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
- }
- ,
- n.prototype.onMouseWheel = function(e) {
- this.enabled && c.useWheel && (this.emit(f.Move, "wheel"),
- (0 < (e.wheelDelta || -e.detail) ? this.dollyOut : this.dollyIn).call(this),
- this.update())
- }
- ,
- n.prototype.onKeyDown = function(e) {
- this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
- this.handleKeyDown(e.which)))
- }
- ,
- n.prototype.navRotationAcc = function(e, t) {
- "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
- }
- ,
- n.prototype.navPanAcc = function(e, t) {
- this.stopAutoPanning(),
- this.panAcceleration[e] = t
- }
- ,
- n.prototype.handleKeyDown = function(e) {
- var t = !0;
- switch (e) {
- case p.UPARROW:
- case p.I:
- this.navRotationAcc("y", 1);
- break;
- case p.DOWNARROW:
- case p.K:
- this.navRotationAcc("y", -1);
- break;
- case p.LEFTARROW:
- case p.J:
- this.navRotationAcc("x", -1);
- break;
- case p.RIGHTARROW:
- case p.L:
- this.navRotationAcc("x", 1);
- break;
- case p.W:
- this.navPanAcc("y", 1);
- break;
- case p.S:
- this.navPanAcc("y", -1);
- break;
- case p.A:
- this.navPanAcc("x", -1);
- break;
- case p.D:
- this.navPanAcc("x", 1);
- break;
- default:
- t = !1
- }
- t && this.emit(f.Move, "key")
- }
- ,
- n.prototype.onKeyUp = function(e) {
- this.enabled && (e.preventDefault(),
- e.stopPropagation(),
- this.handleKeyUp(e.which))
- }
- ,
- n.prototype.handleKeyUp = function(e) {
- switch (e) {
- case p.I:
- case p.K:
- case p.UPARROW:
- case p.DOWNARROW:
- this.keyboardZoomSpeed = 0,
- this.rotationAcceleration.y = 0;
- break;
- case p.J:
- case p.L:
- case p.LEFTARROW:
- case p.RIGHTARROW:
- this.rotationAcceleration.x = 0;
- break;
- case p.S:
- case p.W:
- this.panAcceleration.y = 0;
- break;
- case p.A:
- case p.D:
- this.panAcceleration.x = 0
- }
- }
- ,
- n.prototype.onTouchStart = function(i) {
- if (this.enabled || this.state === u.NONE) {
- i.preventDefault(),
- i.stopPropagation(),
- this.stopAutoPanning();
- var e = function() {
- if (2 === i.touches.length) {
- var e = i.touches[0].pageX - i.touches[1].pageX
- , t = i.touches[0].pageY - i.touches[1].pageY;
- this.dollyStart.set(e, t)
- }
- }
- .bind(this)
- , t = function() {
- this.panStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
- }
- .bind(this)
- , n = function() {
- this.rotateStart.set(h.average(i.touches, "pageX"), h.average(i.touches, "pageY"))
- }
- .bind(this);
- switch (this.state = this.touchActions[i.touches.length],
- this.state) {
- case u.PAN_DOLLY:
- e();
- case u.PAN:
- t();
- break;
- case u.ROTATE_DOLLY:
- e();
- case u.ROTATE:
- n()
- }
- this.rotationSpeed.set(0, 0),
- this.emit(f.InputStart, "touch")
- }
- }
- ,
- n.prototype.onTouchMove = function(a) {
- if (this.enabled && this.state !== u.NONE) {
- a.preventDefault(),
- a.stopPropagation();
- var s = function() {
- var e = a.touches[0].pageX - a.touches[1].pageX
- , t = a.touches[0].pageY - a.touches[1].pageY;
- this.dollyEnd.set(e, t);
- var i = this.dollyStart.length() - this.dollyEnd.length();
- 0 < i ? this.dollyOut(1 + i / 500) : this.dollyIn(1 - i / 500),
- this.dollyStart.copy(this.dollyEnd)
- }
- .bind(this)
- , e = function() {
- this.panEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
- this.panDelta.subVectors(this.panEnd, this.panStart),
- this.pan(this.panDelta.x, this.panDelta.y),
- this.panStart.copy(this.panEnd),
- this.rotateDelta.set(0, 0)
- }
- .bind(this)
- , l = function() {
- this.rotateEnd.set(h.average(a.touches, "pageX"), h.average(a.touches, "pageY")),
- this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
- this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
- this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
- this.rotateStart.copy(this.rotateEnd)
- }
- .bind(this)
- , t = function() {
- if (2 === a.touches.length) {
- var e = window.devicePixelRatio || 1
- , t = a.touches[1].pageX - a.touches[0].pageX
- , i = a.touches[1].pageY - a.touches[0].pageY
- , n = Math.sqrt(t * t + i * i);
- if (Math.abs(this.dollyStart.length() - n) > c.input.touchMoveThreshold * e)
- this.state = u.DOLLY,
- s();
- else {
- var r = h.average(a.touches, "pageX")
- , o = h.average(a.touches, "pageY");
- this.rotateDelta.set(r, o).sub(this.rotateStart).length() > c.input.touchMoveThreshold && (this.state = u.ROTATE,
- this.rotateStart.set(r, o),
- l())
- }
- }
- }
- .bind(this);
- switch (this.state) {
- case u.PAN_DOLLY:
- s();
- case u.PAN:
- e();
- break;
- case u.ROTATE_DOLLY:
- t();
- break;
- case u.DOLLY:
- s();
- break;
- case u.ROTATE:
- l();
- break;
- default:
- this.state = u.NONE
- }
- this.lastMoveTime = a.timeStamp,
- this.emit(f.Move, "touch")
- }
- }
- ,
- n.prototype.onTouchEnd = function(e) {
- this.enabled && (this.state === u.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
- this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
- this.state = u.NONE,
- this.update(),
- this.rotationAcceleration.set(0, 0),
- this.rotateDelta.set(0, 0))
- }
- ,
- n.prototype.onPointerDown = function(e) {
- this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
- id: e.pointerId,
- pageX: e.pageX,
- pageY: e.pageY
- }),
- e.touches = this.pointers,
- this.onTouchStart(e)),
- this.emit(f.InputStart, "pointer"))
- }
- ,
- n.prototype.onPointerMove = function(t) {
- this.enabled && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
- t.pointerId === e.id && (e.pageX = t.pageX,
- e.pageY = t.pageY)
- }),
- t.touches = this.pointers,
- this.onTouchMove(t))
- }
- ,
- n.prototype.onPointerUp = function(i) {
- this.enabled && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
- i.pointerId === e.id && this.pointers.splice(t, 1)
- }
- .bind(this)),
- i.touches = this.pointers,
- this.onTouchEnd(i))
- }
- ,
- n.prototype.reset = function() {
- this.state = u.NONE,
- this.stopAutoPanning(),
- this.rotationSpeed.set(0, 0),
- this.rotationAcceleration.set(0, 0),
- this.panSpeed.set(0, 0),
- this.panAcceleration.set(0, 0)
- }
- ,
- n.prototype.toJSON = function() {
- return {
- camera_position: {
- x: s.toPrecision(this.camera.position.x, 4),
- y: s.toPrecision(this.camera.position.y, 4),
- z: s.toPrecision(this.camera.position.z, 4)
- },
- camera_quaternion: {
- x: s.toPrecision(this.camera.quaternion.x, 4),
- y: s.toPrecision(this.camera.quaternion.y, 4),
- z: s.toPrecision(this.camera.quaternion.z, 4),
- w: s.toPrecision(this.camera.quaternion.w, 4)
- }
- }
- }
- ,
- t.exports = n
- }
- , {
- "../enum/ControlActions": 20,
- "../enum/ControlEvents": 21,
- "../enum/Keys": 30,
- "../enum/MouseButton": 34,
- "../enum/Vectors": 50,
- "../settings": 166,
- "../util/common": 185,
- "../util/math": 190,
- events: 202,
- three: 217
- }],
- 13: [function(u, d, e) {
- (function(e) {
- "use strict";
- function t(e) {
- this.camera = e,
- (this.camera.controls = this).target = new s.Vector3(0,0,0),
- this.lookVector = new s.Vector3,
- this.lookSpeed = .05,
- this.rotationAcc = new s.Vector2,
- this.rotationSpeed = new s.Vector2,
- this.lat = 0,
- this.lon = 0,
- this.phi = 0,
- this.theta = 0,
- this.enabled = !1,
- this.locked = !1,
- this.pointer = new s.Vector2(0,0),
- this.rotationHistory = [],
- this.rotationDifference = new s.Vector2,
- this.pointerDragOn = !1,
- this.pointerDragStart = new s.Vector2(0,0),
- this.pinchDistance = 0,
- this.moveStart = new s.Vector2,
- this.moveTolerance = .01,
- this.pointersLimit = 2,
- this.pointers = []
- }
- var s = u("three")
- , i = u("../util/logger")
- , n = u("../settings")
- , r = u("../util/common")
- , o = u("../util/math")
- , a = (u("../enum/Vectors"),
- u("../enum/MouseButton"))
- , l = u("../enum/Keys")
- , c = u("../enum/ControlEvents")
- , h = u("events").EventEmitter;
- new i(e),
- (t.prototype = Object.create(h.prototype)).usable = function() {
- return this.enabled && !this.locked
- }
- ,
- t.prototype.lookAt = function(e) {
- var t = this.camera.position.clone().sub(e)
- , i = Math.atan(t.z / t.x);
- i += t.x < 0 ? Math.PI : 0,
- i += 0 < t.x && t.z < 0 ? 2 * Math.PI : 0,
- this.lon = s.Math.radToDeg(i) + 180;
- var n = Math.sqrt(t.x * t.x + t.z * t.z)
- , r = Math.atan(t.y / n);
- this.lat = -s.Math.radToDeg(r)
- }
- ,
- t.prototype.startRotationFrom = function(e, t) {
- o.convertScreenPositionToNDC(e, t, this.pointer),
- this.pointerDragOn = !0,
- this.pointerDragStart.copy(this.pointer),
- this.moveStart.copy(this.pointer),
- this.rotationHistory = [],
- this.rotationSpeed.set(0, 0)
- }
- ,
- t.prototype.onMouseOver = function(e) {
- !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
- }
- ,
- t.prototype.onTouchStart = function(e) {
- if (this.usable()) {
- switch (e.preventDefault(),
- e.stopPropagation(),
- e.touches.length) {
- case 1:
- this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
- break;
- case 2:
- var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
- , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
- this.pinchDistance = Math.sqrt(t * t + i * i)
- }
- this.emit(c.InputStart, "touch")
- }
- }
- ,
- t.prototype.onPointerDown = function(e) {
- this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
- id: e.pointerId,
- clientX: e.clientX,
- clientY: e.clientY
- }),
- e.touches = this.pointers,
- this.onTouchStart(e),
- this.emit(c.InputStart, "pointer"))
- }
- ,
- t.prototype.onMouseDown = function(e) {
- if (this.usable()) {
- switch (e.preventDefault(),
- e.stopPropagation(),
- e.button) {
- case a.LEFT:
- this.startRotationFrom(e.clientX, e.clientY)
- }
- this.emit(c.InputStart, "mouse")
- }
- }
- ,
- t.prototype.updateRotation = function() {
- if (this.usable() && this.pointerDragOn) {
- var e = new s.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
- , t = new s.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
- , i = Math.sqrt(e.x * e.x + e.z * e.z)
- , n = Math.sqrt(t.x * t.x + t.z * t.z)
- , r = Math.atan2(e.y, i)
- , o = Math.atan2(t.y, n);
- this.rotationDifference.y = s.Math.radToDeg(r - o),
- e.y = 0,
- t.y = 0;
- var a = Math.acos(e.dot(t) / e.length() / t.length());
- isNaN(a) || (this.rotationDifference.x = s.Math.radToDeg(a),
- this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
- this.pointerDragStart.copy(this.pointer)
- }
- }
- ,
- t.prototype.onMouseMove = function(e) {
- this.usable() && (o.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
- 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"))
- }
- ,
- t.prototype.onTouchMove = function(e) {
- if (this.usable())
- switch (this.emit(c.Move, "touch"),
- e.touches.length) {
- case 1:
- o.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
- break;
- case 2:
- var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
- , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
- , n = this.pinchDistance - Math.sqrt(t * t + i * i);
- .01 < Math.abs(n) && (this.emit(c.InteractionDirect),
- this.emit(c.Pinch, n),
- this.pinchDistance -= n)
- }
- }
- ,
- t.prototype.onPointerMove = function(t) {
- this.usable() && "touch" === t.pointerType && (this.pointers.forEach(function(e) {
- t.pointerId === e.id && (e.clientX = t.clientX,
- e.clientY = t.clientY)
- }),
- t.touches = this.pointers,
- this.onTouchMove(t))
- }
- ,
- t.prototype.endRotation = function() {
- this.pointerDragOn = !1;
- var e = r.averageVectors(this.rotationHistory);
- this.rotationSpeed.set(e.x * n.rotationAfterMoveMultiplier, e.y * n.rotationAfterMoveMultiplier)
- }
- ,
- t.prototype.onTouchEnd = function(e) {
- this.usable() && (e.preventDefault(),
- e.stopPropagation(),
- this.endRotation())
- }
- ,
- t.prototype.onMouseUp = function(e) {
- this.usable() && (e.preventDefault(),
- e.stopPropagation(),
- this.endRotation())
- }
- ,
- t.prototype.onPointerUp = function(i) {
- this.usable() && "touch" === i.pointerType && (this.pointers.forEach(function(e, t) {
- i.pointerId === e.id && this.pointers.splice(t, 1)
- }
- .bind(this)),
- i.touches = this.pointers,
- this.onTouchEnd(i))
- }
- ,
- t.prototype.update = function(e) {
- for (this.lon,
- this.lat,
- this.updateRotation(),
- this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > n.rotationAfterMoveHistoryCount; )
- this.rotationHistory.shift();
- this.lon += this.rotationDifference.x,
- this.lat += this.rotationDifference.y,
- this.rotationDifference.set(0, 0),
- this.rotationSpeed.x = this.rotationSpeed.x * (1 - n.rotationFriction) + this.rotationAcc.x * n.rotationAccelerationInside,
- this.rotationSpeed.y = this.rotationSpeed.y * (1 - n.rotationFriction) + this.rotationAcc.y * n.rotationAccelerationInside,
- this.lon += this.rotationSpeed.x * e,
- this.lat += this.rotationSpeed.y * e,
- this.lat = Math.max(n.insideLookLimitDown, Math.min(n.insideLookLimitUp, this.lat)),
- this.phi = s.Math.degToRad(90 - this.lat),
- this.theta = s.Math.degToRad(this.lon),
- this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
- this.lookVector.y = Math.cos(this.phi),
- this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
- this.target.copy(this.lookVector).add(this.camera.position),
- this.camera.lookAt(this.target)
- }
- ,
- t.prototype.onMouseWheel = function(e) {
- if (this.usable()) {
- var t = e.wheelDelta || -e.detail;
- this.emit(c.InteractionDirect),
- this.emit(c.Scroll, t)
- }
- }
- ,
- t.prototype.onKeyDown = function(e) {
- this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
- this.handleKeyDown(e.which)))
- }
- ,
- t.prototype.handleKeyDown = function(e) {
- var t = function(e, t) {
- this.rotationAcc[e] = t
- }
- .bind(this);
- this.emit(c.InteractionKey);
- var i = !0;
- switch (e) {
- case l.LEFTARROW:
- case l.J:
- t("x", -1);
- break;
- case l.RIGHTARROW:
- case l.L:
- t("x", 1);
- break;
- case l.I:
- t("y", 1);
- break;
- case l.K:
- t("y", -1);
- break;
- default:
- i = !1
- }
- i && this.emit(c.Move, "key")
- }
- ,
- t.prototype.onKeyUp = function(e) {
- this.usable() && (e.preventDefault(),
- e.stopPropagation(),
- this.handleKeyUp(e.which))
- }
- ,
- t.prototype.handleKeyUp = function(e) {
- switch (e) {
- case l.LEFTARROW:
- case l.J:
- case l.RIGHTARROW:
- case l.L:
- this.rotationAcc.x = 0;
- break;
- case l.I:
- case l.K:
- this.rotationAcc.y = 0
- }
- }
- ,
- t.prototype.startRotating = function(e, t) {
- e && (this.rotationAcc.x = e),
- t && (this.rotationAcc.y = t)
- }
- ,
- t.prototype.stopRotating = function(e) {
- e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
- this.rotationAcc.set(0, 0)
- }
- ,
- t.prototype.reset = function() {
- this.pointerDragOn = !1,
- this.rotationAcc.set(0, 0),
- this.rotationSpeed.set(0, 0),
- this.pointers = []
- }
- ,
- t.prototype.toJSON = function() {
- return {
- camera_position: {
- x: o.toPrecision(this.camera.position.x, 4),
- y: o.toPrecision(this.camera.position.y, 4),
- z: o.toPrecision(this.camera.position.z, 4)
- },
- camera_quaternion: {
- x: o.toPrecision(this.camera.quaternion.x, 4),
- y: o.toPrecision(this.camera.quaternion.y, 4),
- z: o.toPrecision(this.camera.quaternion.z, 4),
- w: o.toPrecision(this.camera.quaternion.w, 4)
- }
- }
- }
- ,
- t.prototype.setStateFromJSON = function(e) {
- this.camera.position.copy(e.camera_position),
- this.camera.quaternion.copy(e.camera_quaternion)
- }
- ,
- d.exports = t
- }
- ).call(this, "/js/controls/PanoramaControls.js")
- }
- , {
- "../enum/ControlEvents": 21,
- "../enum/Keys": 30,
- "../enum/MouseButton": 34,
- "../enum/Vectors": 50,
- "../settings": 166,
- "../util/common": 185,
- "../util/logger": 189,
- "../util/math": 190,
- events: 202,
- three: 217
- }],
- 14: [function(t, i, e) {
- (function(e) {
- "use strict";
- var c = t("three")
- , h = t("../enum/Viewmode")
- , u = new (t("../util/logger"))(e);
- i.exports = {
- serialize: function(e) {
- return encodeURI(JSON.stringify(e))
- },
- deserialize: function(e) {
- function t(e) {
- return e.reduce(function(e, t) {
- return e && "number" == typeof t && !isNaN(t)
- }, !0)
- }
- try {
- var i = JSON.parse(decodeURI(e))
- , n = {
- mode: h.fromInt(i.camera_mode),
- panoId: i.scan_id,
- position: (new c.Vector3).copy(i.camera_position),
- quaternion: (new c.Quaternion).copy(i.camera_quaternion),
- zoom: i.ortho_zoom,
- floorVisibility: i.floor_visibility
- }
- , r = n.position;
- t([r.x, r.y, r.z]) || n.position.set(0, 0, 0);
- var o = n.quaternion;
- return t([o.x, o.y, o.z, o.w]) || n.quaternion.set(0, 0, 0, 1),
- n
- } catch (i) {
- u.debug("Not able to parse start location as JSON; falling back to old array style parsing");
- try {
- var a = e.split(",")
- , s = {
- x: parseFloat(a[2]),
- y: parseFloat(a[3]),
- z: parseFloat(a[4])
- }
- , l = {
- x: parseFloat(a[5]),
- y: parseFloat(a[6]),
- z: parseFloat(a[7]),
- w: parseFloat(a[8])
- };
- return t([s.x, s.y, s.z]) || (s.x = 0,
- s.y = 0,
- s.z = 0),
- t([l.x, l.y, l.z, l.w]) || (l.x = 0,
- l.y = 0,
- l.z = 0,
- l.w = 1),
- {
- mode: h.fromInt(a[0]),
- panoId: a[1],
- position: (new c.Vector3).copy(s),
- quaternion: (new c.Quaternion).copy(l)
- }
- } catch (t) {
- u.warn('Invalid start override, ignoring: "' + e + '"', t.message)
- }
- }
- return null
- }
- }
- }
- ).call(this, "/js/controls/serializer.js")
- }
- , {
- "../enum/Viewmode": 51,
- "../util/logger": 189,
- three: 217
- }],
- 15: [function(C, I, e) {
- (function(e) {
- "use strict";
- function t() {
- this.endlessLoop = r.warp.loop,
- this.clock = new i.Clock(!0),
- this.model = null,
- this.player = null,
- this.currentItem = null,
- this.destinationItem = null,
- this.tourIsPlaying = !1,
- this.transitionStage = v.None,
- this.nextFunc = null,
- this.onTheBus = !1,
- this.tourInProgress = !1,
- this.reachSource = null,
- this.interrupted = !1,
- this.nItems = 0,
- this.walkingSectionPaused = !1
- }
- var i = C("three")
- , n = C("./util/logger")
- , r = C("./settings")
- , o = C("./util/transitions")
- , a = C("events").EventEmitter
- , s = C("./enum/Viewmode")
- , l = C("./analytics")
- , c = C("./enum/WarpStyle")
- , h = (o = C("./util/transitions"),
- C("./model/ModelManager"),
- C("./enum/ModelManagerEvents"))
- , u = C("./enum/DirectorEvents")
- , d = C("./enum/PlayerEvents")
- , p = (C("./enum/ControlEvents"),
- C("./enum/BlackoutStyle"))
- , f = C("./enum/PathDiscardMode")
- , g = C("./enum/PathDisplayMode")
- , m = (C("./player"),
- new n(e))
- , v = Object.freeze({
- None: 0,
- Moving: 1,
- Aiming: 2,
- Interlude: 3
- })
- , y = Object.freeze({
- Forward: 1,
- NoChange: 0,
- Backwards: -1
- })
- , A = o.getUniqueId();
- (t.prototype = Object.create(a.prototype)).init = function(e, t) {
- this.player = e,
- this.modelManager = t,
- this.updateModel(),
- this.resetAll(),
- this.bindEvents()
- }
- ,
- t.prototype.resetAll = function() {
- if (this.currentItem = null,
- this.destinationItem = null,
- this.tourIsPlaying = !1,
- this.bgmReplay(),
- this.transitionStage = v.None,
- this.nextFunc = null,
- this.onTheBus = !1,
- this.reachSource = null,
- this.interrupted = !1,
- this.model) {
- var e = r.path.typ === c.WALK ? c.WALK : c.STD;
- this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && !1 === this.model.data.player_options.fast_transitions ? e : c.BLACK
- } else
- this.defaultWarpStyle = c.BLACK,
- m.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
- this.resetSpecialTransition()
- }
- ,
- t.prototype.updateModel = function() {
- this.model = this.modelManager.getActiveModel(),
- this.nItems = this.model.heroLocations.length
- }
- ,
- t.prototype.bindEvents = function() {
- this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
- this.player.on(d.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
- this.player.on(d.Move, this.handlePlayerMove.bind(this)),
- this.player.on(d.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
- this.player.on(d.ModeChanged, this.handlePlayerModeChanged.bind(this)),
- this.player.on(d.InputStart, this.handlePlayerInputStart.bind(this)),
- this.player.on(d.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
- this.player.once(d.Move, function() {
- o.cancelById(A)
- })
- }
- ,
- t.prototype.checkAndHandleWalkingtourInterruption = function(e) {
- return e === c.WALK && (this.interrupt(p.NONE),
- this.pauseWalkingSection(),
- this.player.fastForwardActivePanoFlight(),
- !0)
- }
- ,
- t.prototype.handlePlayerMove = function(e) {
- this.transitionStage === v.Interlude && this.interrupt(p.NONE),
- this.emit("update.controls")
- }
- ,
- t.prototype.handlePlayerPanoChosen = function(e, t) {
- this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
- this.emit("update.controls"))
- }
- ,
- t.prototype.handlePlayerModeChanged = function(e, t) {
- this.intermediateState() || e === t || (this.onTheBus = !1,
- this.emit("update.controls"))
- }
- ,
- t.prototype.handlePlayerInputStart = function(e) {
- this.transitionStage === v.Interlude && this.interrupt(p.NONE)
- }
- ,
- t.prototype.handlePlayerFlyingStarted = function() {
- this.clearWalkingSectionPaused()
- }
- ,
- t.prototype.describe = function() {
- return {
- nItems: this.nItems,
- currentItem: this.currentItem,
- destinationItem: this.destinationItem,
- tourIsPlaying: this.tourIsPlaying,
- onTheBus: this.onTheBus,
- endlessLoop: this.endlessLoop,
- viewMode: this.player.mode,
- inTransition: this._inTransition(),
- transitionStage: this.transitionStage,
- tourInProgress: this.tourInProgress
- }
- }
- ,
- t.prototype._inTransition = function() {
- return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === s.TRANSITIONING || this.tourIsPlaying
- }
- ,
- t.prototype.bounceable = function() {
- var e = this.clock.getDelta();
- return this.isInterrupted() || e < .9 && .01 < e || this.player.flying && !this.player.isWarping()
- }
- ,
- t.prototype.currentMoveDirection = function() {
- return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
- }
- ,
- t.prototype.clearPath = function() {
- this._inTransition() || this.player.path.discardPathObject()
- }
- ,
- t.prototype.allFloors = function() {
- this.model.toggleAllFloors()
- }
- ,
- t.prototype.actionComplete = function(e) {
- if (this.interrupted = !1,
- this.transitionStage = v.None,
- this.resetSpecialTransition(),
- null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
- this.tourIsPlaying || (this.player.disablePreRendering(),
- this.player.mode === s.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
- this.emit("update.controls"),
- this.nextFunc) {
- var t = this.nextFunc;
- this.nextFunc = null,
- t()
- }
- }
- ,
- t.prototype.awaitCompletion = function(e, t) {
- this.nextFunc = t,
- e()
- }
- ,
- t.prototype.updateSuccessFunction = function(e) {
- this.nextFunc = e
- }
- ,
- t.prototype.interrupt = function(e, t) {
- return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
- this.tourIsPlaying = !1,
- this.bgmReplay(),
- this.interrupted = !0,
- this.nextFunc = null,
- this.emit(u.ActionInterrupted),
- null != e || (e = p.BEGINNING),
- this.player.interruptAndFastForward(e, t),
- !0)
- }
- ,
- t.prototype.wouldInterrupt = function() {
- return this.transitionStage !== v.None
- }
- ,
- t.prototype.intermediateState = function() {
- return this.transitionStage !== v.None
- }
- ,
- t.prototype.isInterrupted = function() {
- return this.interrupted
- }
- ,
- t.prototype.pauseWalkingSection = function() {
- this.walkingSectionPaused = !0
- }
- ,
- t.prototype.clearWalkingSectionPaused = function() {
- this.walkingSectionPaused = !1
- }
- ,
- t.prototype.autoTour = function() {
- var i = Date.now();
- this.model.auxDataPromise.then(function() {
- i = Date.now() - i;
- var e = r.warp.auto
- , t = this.model.data && this.model.data.player_options/* && this.model.data.player_options.highlight_reel */;
- 0 <= e && 1 < this.model.heroCount() && t && o.trigger({
- duration: Math.max(1e3 * Math.min(300, e) - i, 0),
- done: function() {
- this.playTour()
- }
- .bind(this),
- name: "_atr",
- id: A
- })
- }
- .bind(this))
- }
- ,
- t.prototype.atDestinationPano = function() {
- if (!this.player.currentPano || null === this.destinationItem)
- return !1;
- var e = this.player.currentPano.id;
- if (void 0 === e)
- return !1;
- var t = this.model.heroLocations;
- return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
- }
- ,
- t.prototype.redirectToItem = function(e, t) {
- if (null != e)
- if (this.wouldInterrupt())
- if (this.player.mode !== s.TRANSITIONING) {
- m.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
- var i = function() {
- o.setTimeout(function() {
- this.setDestinationItem(e),
- this.goToDestination(!0, p.BEGINNING, r.warp.warpInterruptionRedirectTime, !1)
- }
- .bind(this), 0)
- }
- .bind(this);
- this.interrupt(p.END, 0),
- this.updateSuccessFunction(i)
- } else
- m.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
- else
- m.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
- else
- m.warn("Director.redirectToItem() -> Redirecting to null item.")
- }
- ,
- t.prototype.useSpecialTransition = function(e) {
- void 0 !== e && this.defaultWarpStyle !== c.BLACK && m.debug("useSpecialTransition(): " + e),
- this.nextWarpStyle = c.BLACK
- }
- ,
- t.prototype.resetSpecialTransition = function() {
- this.nextWarpStyle = this.defaultWarpStyle
- }
- ,
- t.prototype.arrivedAtDestination = function(e) {
- if (this.player.flying || this.player.isWarping())
- m.warn("Cannot advance to interlude or aiming while player is flying or warping.");
- else {
- this.transitionStage = v.Aiming;
- var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
- this.player.model.fadePanoMarkers(0),
- this.awaitCompletion(function() {
- this.resetSpecialTransition(),
- e ? this.player.aimTourCamera(this.destinationItem, g.Retain, g.Slow, this.actionComplete.bind(this)) : this.actionComplete()
- }
- .bind(this), t)
- }
- }
- ,
- t.prototype.goToDestination = function(e, t, i, n) {
- if (void 0 !== g_data2.tourAudio && null !== g_data2.tourAudio) {
- var r = g_data2.tourAudio[this.model.heroLocations[this.destinationItem].sid];
- if (r && 0 < r.music.length) {
-
- var o = r.music.includes(g_Prefix.slice(-10)) ? r.music : g_Prefix + r.music;
- g_tourAudio.src = manage.dealURL(o);
- g_tourAudio.load(),
- g_tourAudio.crossOrigin = "anonymous",
- g_tourAudio.oncanplaythrough = function() {
- g_tourAudio.play();
- if(g_bgAudio && !g_bgAudio.paused){
- manage.switchBgmState(false);
- g_bgAudio.pauseByTour = true
- }
- g_playAudio = g_tourAudio;
- }
- }
- }
- if (this.onTheBus = !0,
- this.emit("update.controls"),
- this.player.updateLastView(),
- n || !this.atDestinationPano())
- if (this.player.flying || this.player.isWarping())
- m.warn("Cannot go to new destination while player is flying or warping.");
- else {
- var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
- , s = null
- , l = null;
- if (a.isPano()) {
- o = window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
- l = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, g.Show, f.Slow, o, !0, i, this.actionComplete.bind(this)),
- s = this.arrivedAtDestination.bind(this, !0)
- } else
- l = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
- s = this.arrivedAtDestination.bind(this, !1);
- this.transitionStage = v.Moving,
- this.model.fadePanoMarkers(0),
- this.awaitCompletion(function() {
- l()
- }
- .bind(this), s),
- this.emit("update.controls")
- }
- else
- this.arrivedAtDestination(!0)
- }
- ,
- t.prototype.tourInterlude = function() {
- if (l.trackAlways("reach_highlight", {
- reach_source: this.reachSource
- }),
- this.model.fadePanoMarkers(0),
- this.emit("update.controls"),
- this.tourIsPlaying)
- return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
- this.stopTour(),
- this.emit(u.TourEnd),
- void (this.player.mode === s.PANORAMA && this.model.fadePanoMarkers(r.panorama.markerOpacity))) : void this.awaitCompletion(function() {
- this.transitionStage = v.Interlude,
- this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
- }
- .bind(this), this.goNext.bind(this))
- }
- ,
- t.prototype.playTour = function() {
- if (!this.bounceable())
- return this.tourIsPlaying ? void m.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
- this.tourInProgress = !0,
- this.reachSource = "play",
- this.tourIsPlaying = !0,
- this.wasZoomEnabled = this.player.zoomEnabled,
- this.player.zoomEnabled = !1,
- this.resetSpecialTransition(),
- this.emit("update.controls"),
- this.emit(u.TourStart),
- this.player.enablePreRendering(),
- this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
- this.goToDestination()) : this.goNext()))
- }
- ,
- t.prototype.bgmReplay = function() {
- if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
- g_playAudio = g_bgAudio;
- g_tourAudio && g_tourAudio.pause();
- //window.tourAudio && window.tourAudio.pause();
- manage.switchBgmState(true);
- }
- }
- ,
- t.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
- this.isInterrupted() || this.transitionStage === v.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
- this.tourIsPlaying = !1,
- (!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
- this.interrupt(),
- this.clearWalkingSectionPaused(),
- this.resetSpecialTransition(),
- this.emit("update.controls"))
-
-
- if(!isAutoStop && g_tourAudio && g_tourAudio.paused == false )
- {
- g_tourAudio.pause();
- g_tourAudio.src = ""
- }
- }
- ,
- t.prototype.endTourProgress = function() {
- this.tourInProgress = !1,
- this.emit("update.controls"),
- this.emit(u.TourEnd)
- }
- ,
- t.prototype.goToHighlight = function(e) {
- if (this.wouldInterrupt())
- e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
- else {
- if (m.debug("<tour.goto " + e + ">"),
- this.isInterrupted())
- return;
- this.clearWalkingSectionPaused(),
- this.setDestinationItem(e),
- this.useSpecialTransition("Hilight"),
- this.goToDestination(),
- l.trackAlways("reach_highlight", {
- reach_source: "thumb"
- })
- }
- }
- ,
- t.prototype.prevHighlight = function() {
- this.bounceable() || (this.player.emit("tour_manual", "prev"),
- this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
- this.reachSource = "prev",
- this.goPrev()))
- }
- ,
- t.prototype.nextHighlight = function() {
- this.bounceable() || (this.player.emit("tour_manual", "next"),
- this.interrupt(p.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
- this.reachSource = "next",
- this.goNext()))
- }
- ,
- t.prototype.changeMode = function(e) {
- var t = $.Deferred()
- , i = t.resolve.bind(t)
- , n = t.reject.bind(t);
- if (this.emit(u.StartModeChange),
- !function() {
- return this.clearWalkingSectionPaused(),
- !!this.wouldInterrupt() && (this.interrupt(),
- !0)
- }
- .bind(this)()) {
- switch (e) {
- case s.PANORAMA:
- 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);
- break;
- case s.DOLLHOUSE:
- case s.FLOORPLAN:
- this.player.flyToNewMode({
- mode: e
- }).done(i).fail(n);
- break;
- case s.OUTDOOR:
- 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)
- }
- return t.promise()
- }
- }
- ,
- t.prototype.atEndOfTour = function() {
- return this.currentItem >= this.nItems - 1
- }
- ,
- t.prototype.firstDestination = function() {
- return 0 < this.nItems ? 0 : null
- }
- ,
- t.prototype.finalDestination = function() {
- return 0 < this.nItems ? this.nItems - 1 : null
- }
- ,
- t.prototype.goPrev = function() {
- this.tourAdvance(-1)
- }
- ,
- t.prototype.goNext = function() {
- this.tourAdvance(1)
- }
- ,
- t.prototype.setDestinationItem = function(e) {
- this.destinationItem = e,
- this.emit("update.controls")
- }
- ,
- t.prototype.setCurrentItem = function(e) {
- this.currentItem = e,
- this.emit("update.controls")
- }
- ,
- t.prototype.nextItem = function(e) {
- return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
- }
- ,
- t.prototype.prevItem = function(e) {
- return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
- }
- ,
- t.prototype.tourAdvance = function(e) {
- if (m.debug("tourAdvance(" + e + ")"),
- null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e),
- this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()),
- this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()),
- this.useSpecialTransition("looping back to start")),
- "black" === window.MP_PREFETCHED_MODELDATA.momentTour) {
- var i = this.player.zoomLevel;
- this.player.zoomEnabled = !0;
- var t = function(e, t) {
- this.player.zoomTo((1 - e) * i, !0)
- }
- .bind(this);
- o.start(t, 1500, function() {}, 0, h.easeOutQuad, "zoom")
- }
- this.goToDestination()
- }
- ,
- I.exports = t
- }
- ).call(this, "/js/director.js")
- }
- , {
- "./analytics": 4,
- "./enum/BlackoutStyle": 18,
- "./enum/ControlEvents": 21,
- "./enum/DirectorEvents": 23,
- "./enum/ModelManagerEvents": 33,
- "./enum/PathDiscardMode": 38,
- "./enum/PathDisplayMode": 39,
- "./enum/PlayerEvents": 40,
- "./enum/Viewmode": 51,
- "./enum/WarpStyle": 52,
- "./model/ModelManager": 140,
- "./player": 155,
- "./settings": 166,
- "./util/logger": 189,
- "./util/transitions": 195,
- events: 202,
- three: 217
- }],
- 16: [function(e, t, i) {
- "use strict";
- var n = e("three")
- , r = e("./enum/Viewmode")
- , o = (e("./settings"),
- e("./util/transitions"))
- , a = e("./enum/PlayerEvents")
- , s = new n.ShaderPass(n.HorizontalBlurShader)
- , l = new n.ShaderPass(n.VerticalBlurShader);
- l.renderToScreen = !0;
- var c = $("#player").width() / $("#player").height();
- isNaN(c) && (c = 1);
- var h = {
- currentBlur: 0,
- aspect: c,
- blurStrength: 1,
- hblurPass: s,
- vblurPass: l,
- bindEvents: function(e) {
- e.on(a.ModeChanged, function(e, t) {
- e === r.PANORAMA && (o.cancel(h.blur),
- o.cancel(h.addBlur),
- o.start(h.removeBlur, 500, null, 0, null, "deblur"))
- })
- },
- blur: function(e) {
- var t = (h.currentBlur = e) * h.blurStrength;
- l.uniforms.v.value = t / 512 * h.aspect,
- s.uniforms.h.value = t / 512
- },
- addBlur: function(e) {
- e = Math.max(e, h.currentBlur),
- h.blur(e)
- },
- removeBlur: function(e) {
- e = Math.min(1 - e, h.currentBlur),
- h.blur(e)
- }
- };
- h.blur(0),
- t.exports = h
- }
- , {
- "./enum/PlayerEvents": 40,
- "./enum/Viewmode": 51,
- "./settings": 166,
- "./util/transitions": 195,
- three: 217
- }],
- 17: [function(e, t, i) {
- "use strict";
- t.exports = {
- UNKNOWN: 0,
- ALIGNED: 1,
- UNALIGNED: 2,
- PLACED: 3
- }
- }
- , {}],
- 18: [function(e, t, i) {
- "use strict";
- t.exports = {
- NONE: 0,
- MIDDLE: 1,
- END: 2,
- BEGINNING: 3,
- FADEIN: 4
- }
- }
- , {}],
- 19: [function(e, t, i) {
- "use strict";
- var r = e("three");
- t.exports = {
- newBlue: new r.Color(4967932),
- altBlue: new r.Color(47355),
- tagDefault: new r.Color(223357),
- classicBlue: new r.Color(53759),
- mpYellow: new r.Color(16502016),
- mpOrange: new r.Color(16428055),
- mpBlue: new r.Color(12096),
- mpLtGrey: new r.Color(13751252),
- mpDkGrey: new r.Color(10000019),
- mpRed: new r.Color(12525854),
- mpOrangeDesat: new r.Color(16764529),
- mpBlueDesat: new r.Color(4034734),
- mpRedDesat: new r.Color(14705505),
- white: new r.Color(16777215),
- black: new r.Color(0),
- _desat: function(e, t) {
- var i = t || .3
- , n = (new r.Color).copy(e).getHSL();
- return (new r.Color).setHSL(n.h, n.s * (1 - i), n.l)
- },
- _darken: function(e, t) {
- var i = t || .2
- , n = e.getHSL();
- return (new r.Color).setHSL(n.h, n.s, n.l * (1 - i))
- }
- }
- }
- , {
- three: 217
- }],
- 20: [function(e, t, i) {
- "use strict";
- t.exports = {
- NONE: -1,
- ROTATE: 0,
- DOLLY: 1,
- PAN: 2,
- ROTATE_DOLLY: 3,
- PAN_DOLLY: 4
- }
- }
- , {}],
- 21: [function(e, t, i) {
- "use strict";
- t.exports = {
- Move: "move",
- InteractionDirect: "interaction.direct",
- InteractionKey: "interaction.key",
- InteractionGui: "interaction.gui",
- FlyInDirection: "fly.direction",
- InputStart: "input.start",
- Pinch: "input.pinch",
- Scroll: "input.scroll",
- AutoPanInterrupt: "autopan.interrupt",
- AutoPanComplete: "autopan.complete",
- AutoPanClamped: "autopan.clamped",
- LongTap: "longtap"
- }
- }
- , {}],
- 22: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- FORWARD: "FORWARD",
- LEFT: "LEFT",
- RIGHT: "RIGHT",
- BACK: "BACK",
- UP: "UP",
- DOWN: "DOWN"
- })
- }
- , {}],
- 23: [function(e, t, i) {
- "use strict";
- t.exports = {
- ActionInterrupted: "action.interrupted",
- TourStart: "tour.start",
- TourEnd: "tour.end",
- StartModeChange: "mode.startChange"
- }
- }
- , {}],
- 24: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- None: 0,
- Queued: 1,
- ForceQueued: 2,
- Downloading: 3,
- Downloaded: 4,
- DownloadFailed: 5
- })
- }
- , {}],
- 25: [function(e, t, i) {
- "use strict";
- t.exports = {
- GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
- GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
- GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
- GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
- GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
- GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
- }
- }
- , {}],
- 26: [function(e, t, i) {
- "use strict";
- t.exports = {
- Texture2D: 0,
- TextureCube: 1
- }
- }
- , {}],
- 27: [function(e, t, i) {
- "use strict";
- t.exports = {
- SMALL: "small",
- LARGE: "large"
- }
- }
- , {}],
- 28: [function(e, t, i) {
- "use strict";
- var n = e("./Viewmode")
- , r = {
- LANDING: {},
- NAVIGATION: "navigation",
- MORE_HELP: "moreHelp",
- TOUR_INTERACTION: {}
- };
- r.LANDING[n.PANORAMA] = "panorama.landing",
- r.LANDING[n.OUTDOOR] = "outdoor.landing",
- r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
- r.LANDING[n.FLOORPLAN] = "floorplan.landing",
- r.TOUR_INTERACTION.standard = "standard.tour",
- r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
- r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
- t.exports = r
- }
- , {
- "./Viewmode": 51
- }],
- 29: [function(e, t, i) {
- "use strict";
- var n = {
- UP: 1,
- DOWN: -1,
- LEFT: "L",
- RIGHT: "R",
- FORWARD: "F",
- BACK: "B",
- reverse: {},
- opposite: function(e) {
- return this.reverse[e.toString()]
- }
- };
- n.reverse[n.UP] = n.DOWN,
- n.reverse[n.DOWN] = n.UP,
- n.reverse[n.LEFT] = n.RIGHT,
- n.reverse[n.RIGHT] = n.LEFT,
- n.reverse[n.FORWARD] = n.BACK,
- n.reverse[n.BACK] = n.FORWARD,
- t.exports = n
- }
- , {}],
- 30: [function(e, t, i) {
- "use strict";
- var n = {
- ZERO: 48,
- ONE: 49,
- TWO: 50,
- THREE: 51,
- FOUR: 52,
- FIVE: 53,
- SIX: 54,
- SEVEN: 55,
- EIGHT: 56,
- NINE: 57,
- LEFTARROW: 37,
- UPARROW: 38,
- RIGHTARROW: 39,
- DOWNARROW: 40,
- A: 65,
- B: 66,
- C: 67,
- D: 68,
- E: 69,
- F: 70,
- G: 71,
- H: 72,
- I: 73,
- J: 74,
- K: 75,
- L: 76,
- M: 77,
- N: 78,
- O: 79,
- P: 80,
- Q: 81,
- R: 82,
- S: 83,
- T: 84,
- U: 85,
- V: 86,
- W: 87,
- X: 88,
- Y: 89,
- Z: 90,
- SPACE: 32,
- RETURN: 13,
- SEMICOLON: 186,
- PLUSEQUALS: 187,
- DASHUNDERSCORE: 189,
- OPENBRACKET: 219
- };
- e("../util/browser").detectFirefox() && (n.SEMICOLON = 59,
- n.PLUSEQUALS = 61,
- n.DASHUNDERSCORE = 173),
- t.exports = n
- }
- , {
- "../util/browser": 182
- }],
- 31: [function(e, t, i) {
- "use strict";
- t.exports = {
- EN_US: "en-US",
- ES_MX: "es-MX",
- FR_FR: "fr-FR",
- DE_DE: "de-DE",
- RU_RU: "ru-RU",
- CN_CN: "cn-CN",
- JP_JP: "jp-JP"
- }
- }
- , {}],
- 32: [function(e, t, i) {
- "use strict";
- t.exports = {
- TagActivated: "tag.activated",
- TagDismissed: "tag.dismissed",
- TagNavigation: "tag.navigation"
- }
- }
- , {}],
- 33: [function(e, t, i) {
- "use strict";
- t.exports = {
- ModelAdded: "model-added",
- ActiveModelChanged: "active-model-changed"
- }
- }
- , {}],
- 34: [function(e, t, i) {
- "use strict";
- t.exports = {
- LEFT: 0,
- MIDDLE: 1,
- RIGHT: 2
- }
- }
- , {}],
- 35: [function(e, t, i) {
- "use strict";
- t.exports = {
- PanoRenderComplete: "panorama.render.complete",
- TileRenderFailure: "panorama.tile.render.failed",
- TileRenderSuccess: "panorama.tile.render.success",
- TileUploadAttempted: "panorama.tile.upload.attempted",
- UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
- ZoomLevelRenderStarted: "panorama.zoom.render.started"
- }
- }
- , {}],
- 36: [function(e, t, i) {
- "use strict";
- t.exports = {
- BASE: 1,
- STANDARD: 2,
- HIGH: 3,
- ULTRAHIGH: 4
- }
- }
- , {}],
- 37: [function(e, t, i) {
- "use strict";
- t.exports = {
- LoadComplete: "panorama.load.complete",
- LoadFailed: "panorama.load.failed",
- TileLoaded: "panorama.tile.loaded"
- }
- }
- , {}],
- 38: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- Standard: 0,
- Slow: 1,
- Retain: 2
- })
- }
- , {}],
- 39: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- Show: 0,
- Hide: 1,
- Retain: 2
- })
- }
- , {}],
- 40: [function(e, t, i) {
- "use strict";
- t.exports = {
- Move: "move",
- MoveComplete: "move.complete",
- ModeChanged: "mode.changed",
- ModeChanging: "mode.changing",
- PanoChosen: "pano.chosen",
- ClosestPanoChanging: "closest.pano.changing",
- WarpStarted: "warp.started",
- WarpInterrupted: "warp.interrupted",
- WarpEnded: "warp.ended",
- FlyinFinished: "flyin.finished",
- FlyingStarted: "flying.started",
- FlyingInterrupted: "flying.interrupted",
- FlyingEnded: "flying.ended",
- Ready: "ready",
- StartInside: "start.inside",
- StartOutside: "start.outside",
- ViewChanged: "view.changed",
- WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
- InputStart: "input.start"
- }
- }
- , {}],
- 41: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- DEFAULT: 0,
- PANOMARKERS: 1,
- RETICULE: 2,
- TAG: 3
- })
- }
- , {}],
- 42: [function(e, t, i) {
- "use strict";
- t.exports = {
- visibleFloor: 1,
- ghostFloor: 3,
- boundingSkybox: 1,
- panoMarker: 2,
- reticule: 3,
- tagStem: 4,
- tagDisc: 5,
- ribbon: 100
- }
- }
- , {}],
- 43: [function(e, t, i) {
- "use strict";
- t.exports = {
- ContextCreated: "scene-renderer-context-created",
- AfterRender: "after-render",
- MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
- }
- }
- , {}],
- 44: [function(e, t, i) {
- "use strict";
- t.exports = {
- IDLE: "idle",
- BROWSE: "browse",
- EXAMINE: "examine"
- }
- }
- , {}],
- 45: [function(e, t, i) {
- "use strict";
- t.exports = {
- TileDownloadSuccess: "tiledownloader.download.success",
- TileDownloadFailure: "tiledownloader.download.failure",
- PanoDownloadComplete: "tiledownloader.pano.download.complete"
- }
- }
- , {}],
- 46: [function(e, t, i) {
- "use strict";
- t.exports = {
- CardboardAndroid: "googlevr",
- GearVR: "gearvr",
- CardboardIOS: "googlevrios",
- Cardboard: "googlevr"
- }
- }
- , {}],
- 47: [function(e, t, i) {
- "use strict";
- t.exports = {
- NONE: 0,
- CONTEXTUAL: 1,
- ANDROID: 2
- }
- }
- , {}],
- 48: [function(e, t, i) {
- "use strict";
- var n = {
- Title: 0,
- Cardboard: 1
- }
- , r = {
- Title: 0,
- Cardboard: 1,
- Gear: 2
- };
- [n, r].forEach(function(e) {
- e.pageCount = Object.keys(e).length
- }),
- t.exports.ios = n,
- t.exports.standard = r
- }
- , {}],
- 49: [function(e, t, i) {
- "use strict";
- t.exports = {
- Android: "android",
- IOS: "ios",
- Desktop: "desktop",
- UnsupportedAndroid: "android-unsupported"
- }
- }
- , {}],
- 50: [function(e, t, i) {
- "use strict";
- var n = e("three");
- t.exports = {
- UP: new n.Vector3(0,1,0),
- DOWN: new n.Vector3(0,-1,0),
- LEFT: new n.Vector3(-1,0,0),
- RIGHT: new n.Vector3(1,0,0),
- FORWARD: new n.Vector3(0,0,-1),
- BACK: new n.Vector3(0,0,1)
- }
- }
- , {
- three: 217
- }],
- 51: [function(e, t, i) {
- "use strict";
- var n = e("../exception/ViewmodeConvertException")
- , r = e("./coreViewmodes")
- , o = {
- MESH: "mesh",
- OUTDOOR: "outdoor",
- TRANSITIONING: "transitioning",
- toInt: function(e) {
- switch (e) {
- case this.PANORAMA:
- return 1;
- case this.DOLLHOUSE:
- return 2;
- case this.FLOORPLAN:
- return 3;
- case this.OUTDOOR:
- return 4;
- case this.TRANSITIONING:
- return -1
- }
- throw new n("No known conversion for Viewmode to int for mode: " + e)
- },
- fromInt: function(e) {
- switch (e) {
- case "1":
- case 1:
- return this.PANORAMA;
- case "2":
- case 2:
- return this.DOLLHOUSE;
- case "3":
- case 3:
- return this.FLOORPLAN;
- case "4":
- case 4:
- return this.OUTDOOR
- }
- throw new n("No known conversion for int to viewmode for int: " + e)
- },
- convertWorkshopModeInt: function(e) {
- switch (e) {
- case "0":
- case 0:
- case void 0:
- return this.PANORAMA;
- case "1":
- case 1:
- return this.FLOORPLAN;
- case "2":
- case 2:
- return this.DOLLHOUSE;
- case "3":
- case 3:
- return this.MESH
- }
- throw new n("No known conversion for Workshop int to viewmode for int: " + e)
- }
- };
- e("../util/common").extendObject(o, r),
- t.exports = o
- }
- , {
- "../exception/ViewmodeConvertException": 58,
- "../util/common": 185,
- "./coreViewmodes": 54
- }],
- 52: [function(e, t, i) {
- "use strict";
- t.exports = {
- BLACK: "black",
- STD: "std",
- WALK: "walk"
- }
- }
- , {}],
- 53: [function(e, t, i) {
- "use strict";
- t.exports = {
- ZoomIn: "zoom.in",
- ZoomOut: "zoom.out",
- ZoomMax: "zoom.max",
- ZoomMin: "zoom.min"
- }
- }
- , {}],
- 54: [function(e, t, i) {
- "use strict";
- t.exports = {
- PANORAMA: "panorama",
- DOLLHOUSE: "dollhouse",
- FLOORPLAN: "floorplan"
- }
- }
- , {}],
- 55: [function(e, t, i) {
- "use strict";
- t.exports = function(e) {
- this.message = e
- }
- }
- , {}],
- 56: [function(e, t, i) {
- "use strict";
- function n(e) {
- r.call(this, e)
- }
- var r = e("./BasicException");
- n.prototype = Object.create(r.prototype),
- t.exports = n
- }
- , {
- "./BasicException": 55
- }],
- 57: [function(e, t, i) {
- "use strict";
- function n(e) {
- r.call(this, e)
- }
- var r = e("./BasicException");
- n.prototype = Object.create(r.prototype),
- t.exports = n
- }
- , {
- "./BasicException": 55
- }],
- 58: [function(e, t, i) {
- "use strict";
- function n(e) {
- r.call(this, e)
- }
- var r = e("./BasicException");
- n.prototype = Object.create(r.prototype),
- t.exports = n
- }
- , {
- "./BasicException": 55
- }],
- 59: [function(a, s, e) {
- (function(e) {
- "use strict";
- var i = a("./util/ajax")
- , n = a("./util/showcase")
- , t = a("./util/logger")
- , r = new t(e)
- , o = {};
- s.exports = {
- loadFeatureFlags: function(e) {
- var t = $.Deferred();
- return i.get(e.urlBase + "", {
- responseType: "json",
- prefetchFrom: "user",
- auth: n.getAuthorizationHeader()
- }).done(function(e) {
- (o = function(e) {
- var t = {};
- if (e) {
- var i = e.flags;
- if (i)
- for (var n in i)
- i.hasOwnProperty(n) && (t[i[n]] = !0);
- return t
- }
- return r.debug("Feature flags -> parseFeatureFlags: rawData is null."),
- null
- }(e)) ? t.resolve(o) : t.reject("loading-failed")
- }).fail(function() {
- r.debug("Retrieval of feature flags failed."),
- t.reject("loading-failed")
- }),
- t.promise()
- },
- getFlags: function() {
- return o
- },
- updateDependentSettings: function(e, t) {
- (e = e || o).labels && (t.labels.enabled = !0),
- e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
- e.showcase_sdk && (t.sdkInit = !0),
- e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
- e.showcase_webvr && (t.vr.allowWebVR = !0),
- e.uhql && (t.tiling.allowUltraHighResolution = !0),
- e.hide_sc_sharing && (t.share.enabled = !1)
- }
- }
- }
- ).call(this, "/js/featureflags.js")
- }
- , {
- "./util/ajax": 181,
- "./util/logger": 189,
- "./util/showcase": 193
- }],
- 60: [function(e, t, i) {
- "use strict";
- var n = (e("../util/common"),
- {
- status: 0,
- set: function(e) {
- if (isNaN(e))
- return !1;
- var t = $(".progressbar");
- e < 0 && (e = 0),
- 100 < e && (e = 100);
- var i = e * (parseInt(t.css("width").replace("px", "")) / 100)
- , n = Math.round(e)
- , r = parseInt(i) - 15;
- t.find(".bar").css("width", i),
- t.find(".label").css("left", r),
- t.find(".perc").text(n + "%"),
- this.status = e
- },
- done: function(e) {
- return e || this.status ? (this.status = null,
- this.set(100)) : this
- }
- });
- t.exports.circleLoader = n
- }
- , {
- "../util/common": 185
- }],
- 61: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- CLOSE: "modal.closer.close"
- })
- }
- , {}],
- 62: [function(e, t, i) {
- "use strict";
- function n(t, e) {
- function i() {
- var e = t.offsetHeight >= $("#player").height() && t.offsetWidth >= $("#player").width();
- e !== p && ((p = e) ? (t.classList.add("closeByFooter"),
- c.classList.add("closeByFooter")) : (t.classList.remove("closeByFooter"),
- c.classList.remove("closeByFooter")))
- }
- e ? setTimeout(i, r.guiAnimationSpeed) : i()
- }
- var r = e("../../settings")
- , o = (e("../../tag/Media/MediaEvent"),
- e("../../util/browser"))
- , a = e("../../util/common")
- , s = e("./ModalCloserEvent")
- , l = e("events").EventEmitter
- , c = document.getElementsByClassName("footer")[0]
- , h = c.querySelectorAll(".close")[0]
- , u = null
- , d = null
- , p = null
- , f = (o.isMobile(),
- {
- open: function(e) {
- e && (n(e),
- u && h.removeEventListener("click", u, !0),
- u = function(e, t) {
- t && (t.stopPropagation(),
- t.preventDefault()),
- e && this.emit(s.CLOSE, e),
- f.reset()
- }
- .bind(this, e.id),
- h.addEventListener("click", u, !0),
- d && window.removeEventListener("resize", d, !0),
- d = n.bind(this, e),
- window.addEventListener("resize", d, !0))
- },
- reset: function() {
- c.classList.remove("closeByFooter"),
- h.removeEventListener("click", u, !0),
- window.removeEventListener("resize", d, !0),
- u = d = p = null
- }
- });
- a.extendObject(f, l.prototype),
- t.exports = f
- }
- , {
- "../../tag/Media/MediaEvent": 131,
- "../../settings": 166,
- "../../util/browser": 182,
- "../../util/common": 185,
- "./ModalCloserEvent": 61,
- events: 202
- }],
- 63: [function(e, t, i) {
- "use strict";
- var A = e("../lib/dat.gui")
- , C = e("three")
- , I = e("../util/easing")
- , E = e("../enum/Viewmode")
- , _ = e("../enum/Colors")
- , b = e("../enum/WarpStyle")
- , w = e("../settings");
- e("../tag/tag"),
- A.GUI.prototype.removeFolder = function(e) {
- var t = this.__folders[e];
- t && (t.close(),
- this.__ul.removeChild(t.domElement.parentNode),
- delete this.__folders[e],
- this.onResize())
- }
- ,
- t.exports.toggle = function(t, e, i) {
- var n = new A.GUI({
- width: 400
- })
- , r = n.addFolder("Flydown from Dollhouse");
- r.add(w.flydown, "movementEasing", Object.keys(I)),
- r.add(w.flydown, "movementDelay", 0, 1).step(.01),
- r.add(w.flydown, "rotationEasing", Object.keys(I)),
- r.add(w.flydown, "rotationDelay", 0, 1).step(.01),
- r.add(w.flydown, "modelTextureDelay", 0, 1).step(.01),
- r.add(w.flydown, "skyboxDelay", 0, 1).step(.01),
- r.add(w.dollhouseDefault, "minPolarAngle", 0, C.Math.degToRad(50)),
- r.add(w.dollhouseDefault, "maxPolarAngle", C.Math.degToRad(50), C.Math.degToRad(170));
- var o = n.addFolder("Transition between panos");
- o.add(w.transition, "blur", 0, 10).onFinishChange(function() {}),
- o.add(w.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
- w.transition.flyTime = 0,
- o.__controllers.forEach(function(e) {
- e.updateDisplay()
- })
- }),
- o.add(w.transition, "flyTime", 0, 5e3).onFinishChange(function() {
- w.transition.flySpeed = 0,
- o.__controllers.forEach(function(e) {
- e.updateDisplay()
- })
- }),
- o.add(w.transition, "aimTime", 500, 2500).step(50),
- o.add(w.transition, "aimSlowFactor", 1, 3).step(.1),
- o.add(w.transition, "movementEasing", Object.keys(I));
- var a = n.addFolder("Path Display");
- a.add(w.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
- a.add(w.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
- a.add(w.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
- a.add(w.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
- a.add(w.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
- a.add(w.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
- a.add(w.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
- a.add(w.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
- a.add(w.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
- a.add(w.path, "color", Object.keys(_)).onFinishChange(function() {
- w.path.color = _[w.path.color],
- w.path.colorUp = _._desat(w.path.color),
- w.path.colorDown = _.darken(w.path.color)
- }),
- a.add(w, "reticuleColor", Object.keys(_)).onFinishChange(function() {
- w.reticuleColor = _[w.reticuleColor]
- });
- var s = n.addFolder("Warping")
- , l = s.addFolder("Warp/Teleport");
- l.add(w.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
- l.add(w.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
- l.add(w.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
- l.add(w.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
- l.add(w.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
- l.add(w.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
- l.add(w.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
- l.add(w.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
- l.add(w.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
- l.add(w.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
- l.add(w.path, "mapGuides").onFinishChange(function() {}),
- l.add(w.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
- l.add(w.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
- l.add(w.path, "typ", Object.keys(b)).onFinishChange(function() {
- w.path.typ = b[w.path.typ]
- }),
- l.add(w.warp, "loop").onChange(function() {}).onFinishChange(function() {
- e.endlessLoop = w.warp.loop
- }),
- l.add(w.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
- l.add(w.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
- l.add(w.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
- var c = s.addFolder("Long Warp Only");
- c.add(w.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
- w.warp.flySpeed = 0,
- c.__controllers.forEach(function(e) {
- e.updateDisplay()
- })
- }),
- c.add(w.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
- c.add(w.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
- c.add(w.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
- c.add(w.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
- c.add(w.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
- c.add(w.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
- c.add(w.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
- c.add(w.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
- c.add(w.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
- var h = n.addFolder("Warp Esoterica");
- h.add(w.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
- h.add(w.warp, "blur", .01, 1).onFinishChange(function() {}),
- h.add(w.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
- w.warp.minWarpTime = 0,
- h.__controllers.forEach(function(e) {
- e.updateDisplay()
- })
- }),
- h.add(w.warp, "showBunny").onFinishChange(function() {}),
- h.add(w.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
- h.add(w.warp, "movementEasing", Object.keys(I));
- var u = n.addFolder("Misc");
- u.add(w, "dollhouseFOV", 10, 180).onChange(function() {
- i.cameras[E.DOLLHOUSE].fov = w.dollhouseFOV
- }),
- u.add(w, "insideFOV", 10, 180).onChange(function() {
- i.cameras[E.PANORAMA].fov = w.insideFOV
- }),
- u.add(w, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
- u.add(w, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
- u.add(w, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
- var d = n.addFolder("Navigation");
- d.add(w.navigation, "panoScores").onFinishChange(function() {
- w.navigation.panoScores || t.panos.forEach(function(e) {
- e.floor.remove(e.text3d),
- e.text3d = null
- })
- }),
- d.add(w.navigation, "mouseDirection"),
- d.add(w.navigation, "filterStrictness", 0, 1),
- d.add(w.navigation, "angleFactor", -60, 0),
- d.add(w.navigation, "directionFactor", 1, 20),
- d.add(w.navigation, "distanceFactor", -5, 5),
- d.add(w.navigation, "optionalityFactor", .1, 10);
- var p = n.addFolder("tags")
- , f = p.addFolder("Tag Creation");
- f.add(w.tags.pole, "enabled").name("poleEnabled"),
- f.add(w.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
- f.add(w.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
- f.add(w.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
- var g = p.addFolder("Visibility");
- g.add(w.tags.visibility, "anyDistance"),
- g.add(w.tags.visibility, "visibleDistance", .1, 30).step(.1),
- g.add(w.tags.visibility, "cameraClearance", 0, 1).step(.01),
- g.add(w.tags.visibility, "hideViaFloor"),
- g.add(w.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
- g.add(w.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
- var m = p.addFolder("Disc Parameters");
- m.add(w.tags.disc.scale, "nearBound", .1, 10).step(.1),
- m.add(w.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
- m.add(w.tags.disc.scale, "linkFarBound").onChange(function(e) {
- e && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - w.tags.disc.scale.linkPercent / 100))
- }),
- m.add(w.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
- w.tags.disc.scale.linkFarBound && (w.tags.disc.scale.farBound = w.tags.visibility.visibleDistance * (1 - e / 100))
- }),
- m.add(w.tags.disc.scale, "maxSize", 40, 200).step(1),
- m.add(w.tags.disc.scale, "minSize", 20, 100).step(1),
- m.add(w.tags.disc.scale, "responsiveness", 0, 100).step(1);
- var v = p.addFolder("Navigate");
- v.add(w.tags.navigate, "nearestPano").name("nearestPano"),
- v.add(w.tags.navigate, "lineOfSight").name("lineOfSight"),
- v.add(w.tags.navigate, "reactivate").name("reactivate"),
- v.add(w.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
- v.add(w.tags.navigate, "tiltTolerance", 0, 50).step(1),
- v.add(w.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
- var y = n.addFolder("Debug");
- y.add(w, "wireframe").onFinishChange(function() {
- t.chunks.forEach(function(e) {
- e.material && (e.wireframeTwin || (e.wireframeTwin = new C.WireframeHelper(e),
- e.wireframeTwin.material.depthWrite = !1,
- e.wireframeTwin.material.depthTest = !1,
- e.wireframeTwin.material.opacity = .5,
- e.wireframeTwin.material.transparent = !0),
- w.wireframe ? t.add(e.wireframeTwin) : t.remove(e.wireframeTwin))
- })
- }),
- y.add(w, "skyboxWireframe").onFinishChange(function() {
- w.skyboxWireframe ? (t.skybox.wireframe = new C.WireframeHelper(t.skybox),
- t.add(t.skybox.wireframe)) : (t.remove(t.skybox.wireframe),
- t.skybox.wireframe = null)
- }),
- y.add(w, "showSweeps").onFinishChange(function() {
- t.setSweepVisibility(w.showSweeps)
- }),
- y.add(w, "showMesh").onFinishChange(function() {
- t.chunks.forEach(function(e) {
- e.visible = w.showMesh
- })
- }),
- y.add(w, "showFloors").onFinishChange(function() {
- t.floors.forEach(function(e) {
- e.collider.children.forEach(function(e) {
- e.material.visible = w.showFloors
- })
- })
- }),
- y.add(w, "showSkyboxes").onFinishChange(function() {
- t.panos.forEach(function(e) {
- e.skyboxMesh.visible = w.showSkyboxes
- })
- }),
- y.add(w, "showNeighbors").onChange(function() {}),
- y.add(t, "alpha", 0, 1)
- }
- }
- , {
- "../enum/Colors": 19,
- "../enum/Viewmode": 51,
- "../enum/WarpStyle": 52,
- "../lib/dat.gui": 93,
- "../tag/tag": 123,
- "../settings": 166,
- "../util/easing": 186,
- three: 217
- }],
- 64: [function(c, h, e) {
- (function(e) {
- "use strict";
- function i(e, t, i, n) {
- $(".gui-error .error-problem-text").text(e),
- $(".gui-error .error-solution-text").text(t),
- $(".gui-error .error-explanation").text(i),
- $(".gui-error .error-actions").html(n),
- $(window).resize(),
- $(".gui-error").fadeIn(),
- $("#bottom-logo").fadeIn()
- }
- function n(e) {
- 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("");
- i(e, s.ERROR_BROWSER_SOLUTION, s.ERROR_BROWSER_EXPLANATION, t),
- r.isMobile() || $("[rel=tiletip]").tooltip({
- placement: "bottom",
- delay: {
- show: 50,
- hide: 0
- },
- trigger: "hover",
- viewport: {
- selector: "body",
- padding: 10
- }
- })
- }
- function t() {
- var e = r.isMobile() ? "" : '<span class="link install-browser">' + s.ERROR_GENERIC_ACTIONS_2 + "</span>" + s.ERROR_GENERIC_ACTIONS_3
- , t = [s.ERROR_GENERIC_ACTIONS_1, e].join("");
- i(s.ERROR_GENERIC_PROBLEM, s.ERROR_GENERIC_SOLUTION, "", t),
- r.isMobile() || $(".install-browser").on("click touchstart", function(e) {
- e.preventDefault(),
- e.stopPropagation(),
- n(" ")
- })
- }
- var r = c("./../util/browser")
- , o = c("./../analytics")
- , a = c("./../settings")
- , s = c("../localization/localize")
- , l = new (c("./../util/logger"))(e);
- h.exports.error = function(e) {
- if ($("head title").text(a.pageTitle),
- $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
- $("#gui-loading").fadeOut(250),
- $("#quick-blackout").hide(),
- o.track("showcase_error", {
- error_key: e
- }),
- s.locale || s.init(),
- "webgl-unsupported" === e)
- r.isMobile() ? t() : n(s.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
- else if ("webgl-ios" === e)
- 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>.");
- else if ("webgl-safari" === e)
- 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>.");
- else if ("webgl-generic" === e)
- t();
- else if ("missing-urls" === e)
- i(s.ERROR_MISSING_URLS_PROBLEM, "", s.ERROR_MISSING_URLS_EXPLANATION);
- else if ("loading-failed" === e)
- 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>.");
- else {
- if ("loading-failed-maintenance" !== e)
- return void l.error("Unhandled error: " + e);
- i(s.ERROR_MAINTENANCE_PROBLEM, s.ERROR_MAINTENANCE_SOLUTION)
- }
- }
- }
- ).call(this, "/js/gui/error.js")
- }
- , {
- "../localization/localize": 108,
- "./../analytics": 4,
- "./../settings": 166,
- "./../util/browser": 182,
- "./../util/logger": 189
- }],
- 65: [function(Oe, Le, e) {
- (function(e) {
- "use strict";
- function c() {
- for (var e in Ce)
- if (Ce.hasOwnProperty(e)) {
- var t = Ce[e];
- if (!t.visible)
- for (var i = 0; i < t.elements.length; i++)
- $(t.elements[i]).hide()
- }
- Ce.highlight.visible && $(".pinBottom").addClass("highlightExists"),
- !1 === Ce.tourControls.visible && $("#drawer").addClass("fullWidth"),
- ge = [],
- Ce.floors.visible && ge.push(".gui-floor", ".gui-floor-title"),
- ge.push(".hideTarget", ".pinTop.right")
- }
- function v(e, t) {
- var i = !S.isMobile() && M.zoom.enabled && t.mode === ie.PANORAMA && !e.tourIsPlaying;
- $("#gui-zoomin").toggle(i),
- $("#gui-zoomout").toggle(i)
- }
- function l() {
- n(),
- $(".pinBottom").toggleClass("open"),
- $("#drawer").toggleClass("open"),
- $(".footer").toggleClass("open"),
- $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", se.CLOSE_HIGHLIGHTS),
- _e("highlights")) : ($("#pullTab .icon").attr("data-original-title", se.OPEN_HIGHLIGHTS),
- O.resetDrawer()),
- setTimeout(function() {
- $("#pullTab").toggleClass("opened")
- }, $("#drawer").hasClass("open") ? 0 : M.highlightAnimationDuration),
- $(".pinBottom").hasClass("open") && t($(".vr-popup")) && $(".vr-popup").is(":visible") && X.dismiss()
- }
- function t(e) {
- var t;
- return "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
- t = e.position().top + e.outerHeight(),
- e.attr("style", "display: none")),
- $("#player").outerHeight() - 130 < t + 25
- }
- function y(e) {
- "touchstart" === e.type && e.preventDefault(),
- e.stopPropagation()
- }
- function n() {
- w && (w.reload(),
- w.init())
- }
- function r() {
- $("#gui-spinner").stop(!0, !0),
- $("#gui-spinner").fadeOut(1e3),
- !(Ae = !0)
- }
- function A(e, t) {
- var i = e.mode
- , n = t || e.currentPano;
- $("#gui-modes-dollhouse").toggleClass("active", i === ie.DOLLHOUSE),
- $("#gui-modes-floorplan").toggleClass("active", i === ie.FLOORPLAN),
- $("#gui-modes-inside").toggleClass("active", i === ie.PANORAMA),
- i === ie.PANORAMA ? ($("#view-controllers").slideUp(500),
- M.show360Views.enabled && !n.isAligned() ? ($(".gui-floor").addClass("hidden"),
- $("#gui-modes-outside").addClass("desktop-only")) : ($(".gui-floor").removeClass("hidden"),
- $("#gui-modes-outside").removeClass("desktop-only")),
- $("#gui-modes-outside").removeClass("hidden")) : i !== ie.TRANSITIONING && (r(),
- pe = i,
- $("#gui-modes-outside").addClass("hidden"),
- e.model.has360Views && $(".gui-floor").removeClass("hidden"),
- $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(M.guiAnimationSpeed))
- }
- function C(t, i) {
- function e() {
- document.getElementById("vr").classList.remove("hidden"),
- M.vr.allowWebVR ? S.getVRDisplay().then(function(e) {
- S.supportsFullscreen() ? function(e) {
- ue.info(e.displayName + " detected, VR button activates WebVR experience"),
- Q.init(t.data, i, e, x),
- Q.on(J.OPENED, _e.bind(gui, "vr")),
- Q.on(J.SHOW_TERMS, W.show.bind(W))
- }(e) : (ue.warn("Unable to use WebVR when full screen is not supported"),
- $(".improper-embed").toggleClass("hidden", !1),
- n())
- }, function(e) {
- n()
- }) : n()
- }
- function n() {
- var e;
- ue.info("WebVR support not found, VR button activates native app VR modal"),
- X.init(t.data, x),
- X.on(Z.OPENED, (e = document.getElementById("vr-modal"),
- function() {
- _e("vr"),
- V.open(e)
- }
- )),
- X.on(Z.CLOSED, V.reset)
- }
- if (M.vr.enabled && t.supportsVR && !S.valueFromHash("mls", 0))
- switch (M.vr.option) {
- case le.CONTEXTUAL:
- e();
- break;
- case le.ANDROID:
- S.detectAndroid() && e();
- break;
- case le.NONE:
- }
- }
- function h(e, i) {
- for (var n = $(".gui-floor"), t = 0; t < e.floors.length; t++)
- if ("372" !== getQueryVariable("m")) {
- var r = $('<div class="floorChoice" data-index="' + t + '"></div>').text(e.floors.get(t).name);
- $(".gui-floor").find(".container").prepend(r)
- }
- n.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + se.FLOOR_ALL + "</div>"),
- n.on("click", function(e) {
- y(e),
- _e("floor"),
- n.toggleClass("open")
- }),
- $(".floorChoice").on("click", function(e) {
- y(e);
- var t = $(this).data("index");
- "all" !== t ? (R.updateInteraction(oe.InteractionGui, "floor-control"),
- i.player.gotoFloor(t),
- R.track("showcase_gui", {
- gui_action: "click_floor_select_button",
- interaction_source: "gui"
- })) : (R.updateInteraction(oe.InteractionGui, "floor-control"),
- _e("move"),
- i.allFloors(),
- R.track("showcase_gui", {
- gui_action: "click_toggle_all_floors_button",
- interaction_source: "gui"
- })),
- n.removeClass("open")
- })
- }
- function I(e, t) {
- e && (t === ie.DOLLHOUSE || t === ie.FLOORPLAN ? ($(".allFloorBtn").show(),
- $(".gui-floor-icon").hide(),
- $(".gui-floor-title").show()) : ($(".allFloorBtn").hide(),
- $(".gui-floor-icon").show(),
- $(".gui-floor-title").hide()),
- e.model.allFloorsVisible ? ($(".gui-floor-title").text(se.FLOOR_ALL),
- $(".gui-floor-number").text(se.FLOOR_ALL),
- $(".floorChoice").removeClass("active"),
- $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
- $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
- $(".floorChoice").removeClass("active"),
- $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
- }
- function E() {
- var e = $("#player").width() - 20
- , t = $("#scroller")
- , i = $("#drawer")
- , n = $(".pinBottom");
- $("#player").width() < 488 || $("#player").height() < 488 ? (t.addClass("hidden"),
- i.addClass("noScroll"),
- n.addClass("noScroll")) : e < T != !i.hasClass("noScroll") && (t.toggleClass("hidden"),
- i.toggleClass("noScroll"),
- n.toggleClass("noScroll"))
- }
- function _(e) {
- e.waitQueue.length <= 0 ? r() : ye || function(e) {
- e = e || 0,
- Ae = !1,
- window.setTimeout(function() {
- Ae || (!0,
- $("#gui-spinner").stop(!0, !0).show())
- }
- .bind(this), e)
- }(M.modelComponentLoadSpinnerDelay)
- }
- function b(e, t) {
- for (var i = []; e; )
- i.push(e),
- e = e.parentNode;
- for (; t && -1 === i.indexOf(t); )
- t = t.parentNode;
- return t
- }
- var w, T, o, a, x, i, s, u, d, p, f, g, S = (Oe("three"),
- Oe("../util/ajax"),
- Oe("../util/browser")), M = Oe("../settings"), R = Oe("../analytics"), m = (Oe("../util/transitions"),
- Oe("../util/camera"),
- Oe("../util/logger")), P = (Oe("../objects/Snapshot"),
- 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"),
- Oe("../tag/Media/MediaEvent")), re = (Oe("../enum/PathDiscardMode"),
- Oe("../enum/PathDisplayMode"),
- Oe("../enum/DirectorEvents"),
- Oe("../enum/PlayerEvents")), oe = Oe("../enum/ControlEvents"), ae = Oe("./sharing/ShareEvents"), se = Oe("../localization/localize"), le = (Oe("../enum/Vectors"),
- Oe("../enum/WarpStyle"),
- Oe("../enum/AlignmentType"),
- Oe("../enum/VROption")), ce = Oe("./konami"), he = Oe("../lib/dat.gui"), ue = new m(e), de = (Oe("../util/showcase"),
- Oe("../enum/ZoomEvents")), pe = ie.DOLLHOUSE, fe = 0, ge = [".hideTarget"], me = null, ve = null, ye = !1, Ae = !1, Ce = {
- coBrand: {
- visible: !0,
- elements: [".co-brand", "#loaderCoBrand"]
- },
- help: {
- visible: !0,
- elements: [".nav-help", "#nav-help"]
- },
- tourControls: {
- visible: !0,
- elements: [".next", ".previous", "#play"]
- },
- highlight: {
- visible: !0,
- elements: ["#drawer", "#pullTab"]
- },
- share: {
- visible: !0,
- elements: [".socialButton", "#share"]
- },
- fullScreen: {
- visible: !0,
- elements: ["#gui-fullscreen"]
- },
- floors: {
- visible: !0,
- elements: [".gui-floor"]
- }
- }, Ie = (g = document.getElementById("drawer"),
- function() {
- $("#player").height() < 400 && g.classList.contains("open") && l()
- }
- ), Ee = (f = document.getElementById("meta-info"),
- function() {
- $("#player").height() < 400 && f.classList.contains("expand") && z.toggleMeta(!0)
- }
- ), _e = (i = document.getElementById("meta-info"),
- s = document.getElementById("interaction-modal"),
- u = $("#drawer").eq(0),
- d = $(".gui-floor").eq(0),
- p = $(".vr-popup").eq(0),
- function(e) {
- switch (e) {
- case "info":
- we(),
- Te(),
- Ie(),
- Me(),
- Re(),
- xe(),
- Pe();
- break;
- case "terms":
- be(),
- Te(),
- Se(),
- Me(),
- Re(),
- xe(),
- Pe();
- break;
- case "help":
- be(),
- we(),
- Me(),
- Re(),
- xe(),
- Pe();
- break;
- case "vr":
- be(),
- we(),
- Me(),
- Re(),
- Te(),
- Pe(),
- t(p) && Se();
- break;
- case "highlights":
- Ee(),
- we(),
- Me(),
- Re();
- break;
- case "share":
- be(),
- we(),
- Te(),
- Re(),
- xe(),
- Pe();
- break;
- case "floor":
- we(),
- Me(),
- xe();
- break;
- case "view":
- Re(),
- Me(),
- we(),
- xe();
- break;
- case "tour":
- case "move":
- we(),
- Me(),
- Re(),
- xe();
- break;
- case "resize":
- be(),
- Ie(),
- Re();
- break;
- case "tag":
- we(),
- Te(),
- Me(),
- Re(),
- xe()
- }
- }
- );
- function be() {
- i.classList.contains("expand") && z.toggleMeta(!0)
- }
- function we() {
- W.hide()
- }
- function Te() {
- U.close()
- }
- function xe() {
- X.dismiss()
- }
- function Se() {
- u.hasClass("open") && l()
- }
- function Me() {
- K.hide()
- }
- function Re() {
- d.hasClass("open") && d.removeClass("open")
- }
- function Pe() {
- s.classList.contains("fadeIn") && (s.classList.contains("landing") ? D.dismissModal() : s.classList.contains("tour") && q.dismissModal())
- }
- $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
- $("#gui-fullscreen").toggle(!S.isFullscreen()),
- $("#gui-fullscreen-exit").toggle(!!S.isFullscreen()),
- setTimeout(function() {
- $(".icon:visible").hide().show(0)
- }, 100)
- }),
- $("#gui-fullscreen").find("a").on("click", function(e) {
- y(e),
- S.requestFullscreen($("body")[0]),
- R.track("showcase_gui", {
- gui_action: "click_enter_fullscreen",
- interaction_source: "gui"
- })
- }),
- $("#gui-fullscreen-exit").find("a").on("click", function(e) {
- y(e),
- S.exitFullscreen(),
- R.track("showcase_gui", {
- gui_action: "click_exit_fullscreen",
- interaction_source: "gui"
- })
- }),
-
- $(window).on("resize", function(e) {
- var t = e.target.innerHeight
- , i = e.target.innerWidth;
- t === o && i === a || (Ce.highlight.visible && E(),
- _e("resize"),
- $(".pinTop.right").removeClass("hideUnderMeta"),
- n(),
- o = t,
- a = i)
- }).resize(),
- S.supportsFullscreen() || $("#gui-fullscreen").hide(),
- $("#pullTab").on("click", function(e) {
- y(e),
- $("#drawer").hasClass("open") ? (R.trackAlways("showcase_gui", {
- gui_action: "hide_highlight_reel"
- }),
- $(this).addClass("open").children("img").attr("src", "images/auto.png")) : (R.trackAlways("showcase_gui", {
- gui_action: "show_highlight_reel"
- }),
- $(this).removeClass("open").children("img").attr("src", "images/auto-suspend.png")),
- l()
- }),
- window.MP_PREFETCHED_MODELDATA.showHotListSta && ($("#hotList").css("display", ""),
- $("#hotList").on("click", function(e) {
- y(e);
- var t = $("#hotListWrap")[0];
- t.classList.contains("hotListActive") ? (t.classList.remove("hotListActive"),
- this.classList.remove("active")) : (t.classList.add("hotListActive"),
- this.classList.add("active"))
- }),
- $("#hotListContent ul").on("mouseover", function(e) {
- y(e);
- var t = e.target
- , i = document.getElementById("hotListWrap");
- if ("SPAN" === t.tagName) {
- var n = t.parentElement.parentElement;
- t.offsetWidth + 116 >= n.clientWidth ? i.style.width = t.offsetWidth + 116 + "px" : i.style.width = ""
- } else if ("LI" === t.tagName) {
- n = t.parentElement;
- t.children[0].offsetWidth + 116 >= n.clientWidth ? i.style.width = t.children[0].offsetWidth + 116 + "px" : i.style.width = ""
- } else
- i.style.width = ""
- }),
- $("#hotListContent ul").on("click", function(e) {
- y(e),
- this.preElem && this.preElem.classList.remove("active"),
- "SPAN" === e.target.tagName ? (e.target.parentElement.classList.add("active"),
- e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player, !0),
- this.preElem = e.target.parentElement) : (e.target.classList.add("active"),
- e.target.hot && e.target.hot.examine(window.player, !0),
- this.preElem = e.target)
- }),
- $("#hotListClose").on("click", function(e) {
- y(e),
- $("#hotListWrap")[0].classList.remove("hotListActive"),
- $("#hotListContent ul .active").removeClass("active"),
- $("#hotList")[0].classList.remove("active")
- })),
- "true" === window.MP_PREFETCHED_MODELDATA.supportsVR && $("#vr").css("display", ""),
- $("#more-menu-button").on("click", function(e) {
- y(e),
- $("#more-menu").toggleClass("open")
- }),
- Le.exports.init = function(s, l, c, e, t, i, n) {
- var r;
- x = n,
- s.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
- s.supportedModes[ie.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
- F.init(),
- D.init(s, i),
- ce.init(s, l, e),
- $(".icon").on("mouseover", function() {
- l.player && l.player.reticule.hide()
- }),
- function(e, t) {
- var i = t.player;
- $("#gui-modes-inside").on("mousedown touchstart", function(e) {
- y(e),
- R.updateInteraction(oe.InteractionGui, "inside-button"),
- R.track("USER", {
- event_type: "showcase_gui",
- gui_action: "click_inside_mode_button"
- }),
- t.changeMode(ie.PANORAMA)
- }),
- $("#gui-modes-outside").find("a").on("click", function(e) {
- y(e),
- R.track("showcase_gui", {
- gui_action: "click_outside_mode_button"
- }),
- t.changeMode(pe)
- }),
- $("#gui-modes-floorplan").on("click", function(e) {
- y(e),
- i.mode !== ie.FLOORPLAN && (R.track("showcase_gui", {
- gui_action: "click_floorplan_mode_button"
- }),
- t.changeMode(ie.FLOORPLAN))
- }),
- $("#gui-modes-dollhouse").on("click", function(e) {
- y(e),
- i.mode !== ie.DOLLHOUSE && (R.track("showcase_gui", {
- gui_action: "click_dollhouse_mode_button"
- }),
- t.changeMode(ie.DOLLHOUSE))
- })
- }(0, l),
- function(e, t) {
- $("#play").on("mousedown touchstart", function(e) {
- y(e),
- _e("tour"),
- q.play(),
- R.trackAlways("showcase_gui", {
- gui_action: "play_highlights"
- })
- }),
- window.startAndPlay = function(e) {
- _e("tour"),
- q.play(),
- R.trackAlways("showcase_gui", {
- gui_action: "play_highlights"
- })
- }
- ,
- $("#pause").on("mousedown touchstart", function(e) {
- y(e),
- q.pause(),
- R.trackAlways("showcase_gui", {
- gui_action: "pause_highlights"
- })
- }),
- $("#gui-zoomin").find("a").on("click", function(e) {
- y(e),
- t.player.zoomInIncrementally()
- }),
- $("#gui-zoomout").find("a").on("click", function(e) {
- y(e),
- t.player.zoomOutIncrementally()
- })
- }(0, l),
- s.data.enable_social_sharing && s.data.is_public && M.share.enabled && (K.init(MP_PREFETCHED_MODELDATA.name/* s.data.name */),
- K.on(ae.OPENED, (r = document.getElementById("share-modal"),
- function() {
- _e("share"),
- V.open(r)
- }
- )),
- K.on(ae.CLOSED, V.reset)),
- //1 < s.heroLocations.length ? function(e, i, t) {
- 0 < s.heroLocations.length ? function(e, i, t) {
- var n = 100 / (fe = e.heroLocations.length) + "%"
- , r = $("#thumb-container")
- , o = $("#progressBar");
- $("#status").find(".totalSteps").text(fe);
- for (var a = 0; a < fe; a++) {
- var s = e.heroLocations[a]
- , l = $('<li class="thumbImg" data-index=""><img src=""></li>');
- var tmp = s.thumbUrl.replace('https://','').replace('http://','')
- if (l.attr("data-index", a),
- //Ce.highlight.visible && l.find("img").attr("src",'https://'+tmp),
- Ce.highlight.visible && l.find("img").attr("src", 'http://'+tmp),// xzw改 导览图片 https在某些服务器打不开
- s.name) {
- var c = $('<div class="overlay"></div>').text(s.name);
- l.prepend(c)
- }
- if (e.has360Views && s.cameraMode === ie.PANORAMA) {
- var h = e.panos.get(s.panoId)
- , 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>';
- l.prepend(u)
- }
- r.append(l),
- o.append('<div class="step" data-idx="' + a + '" style="width:' + n + '"></div>')
- }
- T = 144 * fe,
- 111 * fe,
- $(".thumbImg").on("mouseover", function() {
- !function(e) {
- return e.describe().inTransition
- }(i) && t.showPathToHeroLocation($(this).data("index"))
- }),
- $(".thumbImg").on("mouseout", function() {
- i.clearPath()
- }),
- $(".thumbImg").on("click", function(e) {
- y(e);
- var t = $(this);
- R.updateInteraction(oe.InteractionGui, "thumbnail"),
- R.trackAlways("showcase_gui", {
- gui_action: "click_highlight"
- }),
- i.goToHighlight(t.data("index"))
- }),
- $(".previous").find("a").on("click", function(e) {
- y(e),
- R.trackAlways("showcase_gui", {
- gui_action: "prev_highlight"
- }),
- i.prevHighlight()
- }),
- $(".next").find("a").on("click", function(e) {
- y(e),
- R.trackAlways("showcase_gui", {
- gui_action: "next_highlight"
- }),
- i.nextHighlight()
- }),
- $("#drawer").on("mouseleave", function(t) {
- var i;
- y(t);
- try {
- i = new MouseEvent("mouseup",{
- clientX: t.clientX,
- clientY: t.clientY,
- screenX: t.screenX,
- screenY: t.screenY
- })
- } catch (e) {
- (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)
- }
- document.dispatchEvent(i)
- }),
- (w = new Sly($("#scrollFrame"),{
- horizontal: !0,
- itemNav: "centered",
- smart: !0,
- scrollTrap: !0,
- scrollBy: 1,
- mouseDragging: !0,
- touchDragging: !0,
- speed: 300,
- dragHandle: !0,
- dynamicHandle: !0,
- clickBar: !0,
- scrollBar: $("#scroller"),
- activateOn: null
- }).init()).on("active", function(e, t) {
- t,
- _e("tour"),
- $(".step").removeClass("active"),
- $("#status").find(".curIdx").text(t + 1);
- for (var i = 0; i <= t; i++)
- $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
- }),
- E()
- }(s, l, c) : (Ce.highlight.visible = !1,
- Ce.tourControls.visible = !1),
- z.on(G.OPEN_INFO, _e.bind(this, "info")),
- function() {
- var n;
- document.body.addEventListener("mousedown", function(e) {
- n = 0 === e.button || 1 === e.which ? e.target : null
- }, !0),
- document.body.addEventListener("mouseup", function(t) {
- n !== t.target && (n = b(n, t.target));
- var e = document.getElementById("gui-parent");
- if (b(e, n) !== e && (n = null),
- n) {
- var i;
- try {
- i = new MouseEvent("click",t)
- } catch (e) {
- (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)
- }
- i.syntheticClick = !0,
- n.dispatchEvent(i),
- n = null
- }
- }, !0),
- document.getElementById("gui-parent").addEventListener("click", function(e) {
- e.syntheticClick || (e.stopPropagation(),
- "A" === e.target.nodeName && e.preventDefault())
- }, !0)
- }(),
- A(c),
- C(s, t),
- s.on("floor.changed", I),
- s.on("waiting", function(e) {
- _(e)
- }
- .bind(this, s)),
- s.on("waiting-done", function(e) {
- _(e)
- }
- .bind(this, s)),
- c.on(re.ModeChanged, function(e, t) {
- A(c),
- v(l, c),
- t === ie.PANORAMA && c.currentPano && !c.currentPano.isAligned() && (t = ie.OUTDOOR),
- U.updateMode(t)
- }),
- e.on(oe.Move, _e.bind(this, "move")),
- c.on(re.Ready, function() {
- O.init(e, c, c.tagManager, l),
- c.on(re.ModeChanged, function(e, t) {
- e !== t && $(".vr-popup").is(":visible") && X.dismiss()
- })
- }),
- c.on(re.PanoChosen, function(e, t) {
- A(c, t),
- U.updateMode(t && !t.isAligned() ? ie.OUTDOOR : ie.PANORAMA)
- }),
- V.on(k.CLOSE, function(e) {
- switch (e) {
- case "vr-modal":
- X.dismiss();
- break;
- case "share-modal":
- K.hide();
- break;
- case "terms-modal":
- W.hide()
- }
- });
- 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();
- l.on("update.controls", function() {
- var e, t, i, n = l.describe();
- if (n.tourIsPlaying || c.isWarping() ? (Ce.tourControls.visible && (h.hide(),
- u.show()),
- n.tourInProgress && (d.forEach(function(e) {
- e.classList.add("playing")
- }),
- p.addClass("playing"),
- f.addClass("playing"))) : (Ce.tourControls.visible && (h.show(),
- u.hide()),
- n.tourInProgress || (q.stopTour(),
- d.forEach(function(e) {
- e.classList.remove("playing")
- }),
- p.removeClass("playing"),
- f.removeClass("playing"))),
- null !== n.currentItem) {
- var r, o;
- $("#status").find(".curIdx").text(n.currentItem + 1),
- n.onTheBus ? (r = "active",
- o = "recent") : (o = "active",
- r = "recent");
- var a = null === n.destinationItem || n.currentItem === n.destinationItem;
- for (e = 0; e < s.heroLocations.length; e += 1)
- i = g.eq(e),
- t = m.eq(e),
- i.removeClass(o),
- t.removeClass(o),
- n.onTheBus && e === n.destinationItem ? (i.addClass(r),
- t.addClass(r),
- w.activate(e)) : n.onTheBus && a && e === n.currentItem ? (i.addClass(r),
- t.addClass(r)) : (i.removeClass(r),
- t.removeClass(r))
- } else
- for (e = 0; e < s.heroLocations.length; e += 1)
- i = g.eq(e),
- t = m.eq(e),
- i.removeClass("active recent"),
- t.removeClass("active recent");
- v(l, c)
- }),
- document.addEventListener("keydown", function(e) {
- switch (R.updateInteraction(oe.InteractionKey),
- e.which) {
- case te.ZERO:
- M.debug && s.toggleAlpha();
- break;
- case te.NINE:
- M.debug && B.toggle();
- break;
- case te.ONE:
- c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.PANORAMA);
- break;
- case te.TWO:
- s.outsideAllowed() && !c.isInMode(ie.DOLLHOUSE, ie.TRANSITIONING) && l.changeMode(ie.DOLLHOUSE);
- break;
- case te.THREE:
- s.outsideAllowed() && !c.isInMode(ie.FLOORPLAN, ie.TRANSITIONING) && l.changeMode(ie.FLOORPLAN);
- break;
- case te.FOUR:
- c.isInMode(ie.TRANSITIONING) || l.changeMode(ie.OUTDOOR);
- break;
- case te.SPACE:
- Ce.tourControls.visible && ($("#playHead").hasClass("playing") || _e("tour"));
- break;
- case te.RETURN:
- M.debug && s.toggleExplodeUp();
- break;
- case te.P:
- !function(e) {
- me.gui || (me.gui = function(e) {
- var t = new he.GUI;
- return t.add(M, "showSweeps").name("Show sweeps").onFinishChange(function() {
- e.setSweepVisibility(M.showSweeps)
- }),
- t.add(M, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
- t.add(M.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
- M.transition.flySpeed = 0,
- t.__controllers.forEach(function(e) {
- e.updateDisplay()
- })
- }),
- t.add(M.path, "opacity", 0, 1).name("Path opacity"),
- $(t.__closeButton).hide(),
- t
- }(me.model)),
- (me.visible = e) ? $(me.gui.domElement).show() : $(me.gui.domElement).hide()
- }(!me.visible);
- break;
- case te.U:
- !function(e) {
- ve.gui || (ve.gui = function(t, i) {
- function e() {
- var e = i.toJSON();
- n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + t.sid + "&start=" + ee.serialize(e),
- i.tagManager.activeTag && (n.linkToLocation += "&tag=" + i.tagManager.activeTag.sid)
- }
- var n = {}
- , r = new he.GUI({
- autoPlace: !0,
- width: "60%"
- });
- return e(),
- i.on(re.ViewChanged, e),
- r.add(n, "linkToLocation").name(se.LINK_TO_LOCATION).listen(),
- r.domElement.id = "datLinks",
- [].slice.call(r.domElement.querySelectorAll(".property-name")).forEach(function(e) {
- if (!S.detectSafari()) {
- var t = document.createElement("button");
- t.classList.add("btn-deep-link"),
- t.innerText = se.MENU_COPY,
- e.nextSibling.appendChild(t);
- var n = function() {
- alert(se.LINK_ALERT_COPY),
- t.hide()
- };
- t.addEventListener("click", function(e) {
- try {
- var t = e.target.parentNode.childNodes[0];
- t.select();
- var i = document.execCommand("copy");
- t.blur(),
- i || n()
- } catch (e) {
- n()
- }
- })
- }
- }),
- $(r.__closeButton).hide(),
- r
- }(ve.model, ve.player)),
- (ve.visible = e) ? $(ve.gui.domElement).show() : $(ve.gui.domElement).hide()
- }(!ve.visible);
- break;
- case te.X:
- M.debug && s.toggleExplode();
- break;
- case te.PLUSEQUALS:
- l.player.activatePersistentZooming(!0),
- O.hideUi();
- break;
- case te.DASHUNDERSCORE:
- l.player.activatePersistentZooming(!1),
- O.hideUi();
- break;
- case te.SEVEN:
- ue.info("Zoom level: " + l.player.zoomLevel + ", FOV: " + l.player.zoomFov);
- break;
- case te.EIGHT:
- l.player.decreaseZoomSpeed();
- break;
- case te.NINE:
- l.player.increaseZoomSpeed()
- }
- return c && c.reticule.hide(),
- !0
- }
- .bind(this)),
- document.addEventListener("keyup", function(e) {
- switch (e.which) {
- case te.PLUSEQUALS:
- l.player.deactivatePersistentZooming();
- break;
- case te.DASHUNDERSCORE:
- l.player.deactivatePersistentZooming()
- }
- }
- .bind(this)),
- function(e) {
- me = {
- gui: null,
- visible: !1,
- model: e
- }
- }(s),
- function(e, t) {
- ve = {
- gui: null,
- visible: !1,
- model: e,
- player: t
- }
- }(s, l.player),
- function(e) {
- function t(e, i) {
- $(e).find("a").each(function(e, t) {
- i ? $(t).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(t).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
- t.style.pointerEvents = i ? "auto" : "none"
- })
- }
- e.on(de.ZoomMax, function() {
- t("#gui-zoomin", !1),
- t("#gui-zoomout", !0)
- }),
- e.on(de.ZoomMin, function() {
- t("#gui-zoomin", !0),
- t("#gui-zoomout", !1)
- }),
- e.on(de.ZoomIn, function() {
- t("#gui-zoomout", !0)
- }),
- e.on(de.ZoomOut, function() {
- t("#gui-zoomin", !0)
- }),
- e.zoomLevel >= M.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
- e.zoomLevel <= M.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
- }(c),
- P.setAutoPlay(s.heroCount()),
- U.init(c, i.mode),
- U.on(H.OPENED, _e.bind(this, "help")),
- W.init(),
- W.on(j.OPENED, (o = document.getElementById("terms-modal"),
- function() {
- _e("terms"),
- V.open(o)
- }
- )),
- W.on(j.CLOSED, V.reset),
- M.quickstart.enabled || D.delayLanding(i.mode).then(D.showMessage.bind(this, c, l, Ce.coBrand.visible)),
- (M.quickstart.enabled || c.model.outsideAllowed()) && O.init(e, c, c.tagManager, l),
- M.profiling.enabled && B.show(),
- q.init(l)
- }
- ,
- Le.exports.startLoading = function(e, t, i, n, r, o) {
- function a() {
- o.setLoadingStartTime(),
- function() {
- function e(e) {
- e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)
- }
- $("body").css("touch-action", "none"),
- $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {});
- var t = document.getElementById("terms-text")
- , i = document.getElementById("more-help-wrapper")
- , n = (document.getElementById("navigation-help-wrapper"),
- document.getElementById("help-dialog"),
- document.getElementById("tag-billboards"));
- M.useWheel && (document.body.addEventListener("mousewheel", e, {
- passive: !1
- }),
- document.body.addEventListener("DOMMouseScroll", e)),
- $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
- e.stopPropagation()
- })
- }(),
- r ? (D.showMessage(t, i, Ce.coBrand.visible),
- l()) : function(e) {
- L.show(e),
- c()
- }(l)
- }
- var s = $.Deferred()
- , l = s.resolve.bind(s);
-
-
- ye = !0,
- _(e);
- e.data.player_options && function(e) {
- Ce.tourControls.visible = true//e.tour_buttons && S.valueFromHash("gt", 1),
- Ce.coBrand.visible = e.presented_by && 1 !== M.specialEdition && M.brand && !S.valueFromHash("mls", !1),
- Ce.highlight.visible = /* e.highlight_reel && */ 1 !== M.specialEdition && M.showHighlights
- }(e.data.player_options),
- 1 === M.specialEdition && $("body").addClass("specialEdition");
- se.localizeGUI();
-
-
- !function(i) {
- function e(e, t) {
- return !!i.player_options[e] && i[t || e]
- }
- $(".model-title").text(i.name);
- var t = M.pageTitle;
- 2 !== S.valueFromHash("mls", 0) && i.name && (t = i.name),
- document.title = t,
- S.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
- delay: {
- show: 50,
- hide: 0
- },
- trigger: "hover",
- html: !1,
- viewport: {
- selector: "body",
- padding: 10
- }
- }),
- S.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
- z.populate({
- name: e("model_name", "name"),
- coBrand: e("presented_by"),
- description: e("model_summary", "summary") || "暂无内容",
- contactName: e("contact_name"),
- address: e("address"),
- phone: e("contact_phone"),
- formattedPhone: i.formatted_contact_phone,
- email: e("contact_email"),
- url: e("external_url"),
- socialSharing: i.enable_social_sharing && i.is_public
- })
- }(e.data);
-
-
-
- r || $(".quick").addClass("hidden");
-
-
-
- n ? (R.impression(),
- a()) : (o.setWaitingStartTime(),
- N.show(r, a))
- return s
- }
- ,
- Le.exports.endLoading = function(e, t, i) {
- var n = t.player;
- function r() {
- i.dismissExaminedTag(),
- i.disableHovering()
- }
- $("#gui-thumb").fadeOut(2500),
- L.hide(function() {
- ye = !1
- }),
- Y.init(e, i),
- z.finishSetup(Object.keys(e.tags).length),
- i.on(ne.IMAGE_OPENED, _e.bind(this, "tag")),
- X.on(Z.OPENED, r),
- K.on(ae.OPENED, r),
- U.on(H.OPENED, r),
- W.on(j.OPENED, r);
- var o = i.enableHovering.bind(i);
- if (X.on(Z.CLOSED, o),
- K.on(ae.CLOSED, o),
- U.on(H.CLOSED, o),
- W.on(j.CLOSED, o),
- M.labels.enabled && Object.keys(e.labels).length,
- e.floors.length <= 1 || !Ce.floors.visible ? Ce.floors.visible = !1 : (h(e, t),
- I(e.currentFloor, n.mode)),
- "372" === getQueryVariable("m") && (Ce.floors.visible = 1,
- h(e, t)),
- c(),
- v(t, t.player),
- $("#gui").fadeIn(1500),
- Ce.highlight.visible && (2 !== M.startHighlights || e.has360Views) && setTimeout(function() {
- l(),
- (!e.has360Views && 1 !== M.startHighlights || e.has360Views && 0 === M.startHighlights) && setTimeout(l, 2e3)
- }, 2e3),
- !S.isMobile())
- for (var a = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], s = 0; s < a.length; s++)
- $(a[s]).addClass("hasHover");
- _(e),
- z.setupToggling(),
- window.editHotPanel && editHotPanel(),
- function() {
- var i = $("#pullTab")
- , e = {
- bottom: {
- "border-bottom-left-radius": "10px",
- "border-bottom-right-radius": "10px"
- },
- top: {
- "border-top-left-radius": "10px",
- "border-top-right-radius": "10px"
- }
- }
- , t = {
- bottom: {
- "border-top-right-radius": "10px",
- "border-bottom-right-radius": "10px"
- },
- top: {
- "border-bottom-left-radius": "10px",
- "border-top-left-radius": "10px"
- }
- };
- function n(e, t) {
- $("#gui-modes-map > div:visible:last").css(e),
- i.is(":visible") ? $(".viewContainer > div:visible:first").css(t) : $("#gui-modes-map > div:visible:first").css(t)
- }
- /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n(e.bottom, e.top) : n(t.bottom, t.top);
- (window.MP_PREFETCHED_MODELDATA.model.special || "true" === window.MP_PREFETCHED_MODELDATA.special) && window.specialScene && specialScene.special().afterImplement()
- }(),
- window.EditTools && (window.editTool = new EditTools(n.sceneRenderer))
- }
- ,
- Le.exports.onProgress = function(e) {
- L.progress(e)
- }
- }
- ).call(this, "/js/gui/gui.js")
- }
- , {
- "../analytics": 4,
- "../controls/serializer": 14,
- "../enum/AlignmentType": 17,
- "../enum/BlackoutStyle": 18,
- "../enum/ControlEvents": 21,
- "../enum/DirectorEvents": 23,
- "../enum/Keys": 30,
- "../enum/PathDiscardMode": 38,
- "../enum/PathDisplayMode": 39,
- "../enum/PlayerEvents": 40,
- "../enum/VROption": 47,
- "../enum/Vectors": 50,
- "../enum/Viewmode": 51,
- "../enum/WarpStyle": 52,
- "../enum/ZoomEvents": 53,
- "../lib/dat.gui": 93,
- "../localization/localize": 108,
- "../tag/Media/MediaEvent": 131,
- "../objects/Snapshot": 153,
- "../settings": 166,
- "../util/ajax": 181,
- "../util/browser": 182,
- "../util/camera": 183,
- "../util/logger": 189,
- "../util/showcase": 193,
- "../util/transitions": 195,
- "./closer/ModalCloserEvent": 61,
- "./closer/modalCloser": 62,
- "./help/HelpEvent": 66,
- "./help/help": 67,
- "./helpManager": 68,
- "./immersiveMode": 69,
- "./konami": 70,
- "./landingScreen": 71,
- "./loadingScreen": 72,
- "./memoryUsage": 73,
- "./playButton": 74,
- "./populateModal": 75,
- "./sharing/ShareEvents": 76,
- "./sharing/modal": 77,
- "./terms/TermsEvent": 78,
- "./terms/terms": 79,
- "./title/TitleEvents": 80,
- "./title/tagToggle": 81,
- "./title/titleBar": 82,
- "./tourInteraction": 84,
- "./vr/vrEvent": 85,
- "./vr/vrModal": 87,
- "./webvr/WebVrEvent": 88,
- "./webvr/webVRgui": 89,
- three: 217
- }],
- 66: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- OPENED: "help.opened",
- CLOSED: "help.closed"
- })
- }
- , {}],
- 67: [function(e, t, i) {
- "use strict";
- function n() {
- p.on("click", function(e) {
- T && T !== a.TRANSITIONING && (0 < window.getComputedStyle(v).getPropertyValue("opacity") && !x ? S.close() : T && T !== a.TRANSITIONING && (x = !0,
- setTimeout(function() {
- x = !1
- }, h.help.modalStayDuration),
- S.emit(l.OPENED),
- f.addClass("open " + T),
- p.addClass("open"),
- o(),
- r(),
- v.style.removeProperty ? v.style.removeProperty("display") : v.style.removeAttribute("display"),
- v.classList.add("fadeIn")))
- }),
- E.on("click", function(e) {
- S.close()
- }),
- C.on("click", function(e) {
- T && T !== a.TRANSITIONING && (o(),
- r())
- }),
- I.on("click", function(e) {
- o(),
- I.addClass("underline-tab"),
- c.fill(b, s.MORE_HELP),
- f.addClass("more-help")
- })
- }
- function r() {
- C.addClass("underline-tab"),
- c.fill(_, s.NAVIGATION, T),
- f.addClass(T)
- }
- function o() {
- f.removeClass("more-help " + a.PANORAMA + " " + a.DOLLHOUSE + " " + a.FLOORPLAN + " " + a.OUTDOOR),
- A.forEach(function(e) {
- e.classList.remove("underline-tab")
- })
- }
- var a = e("../../enum/Viewmode")
- , s = e("../../enum/HelpModalType")
- , l = e("./HelpEvent")
- , c = (e("../helpManager"),
- e("./../populateModal"))
- , h = e("../../settings")
- , u = e("../../util/common")
- , d = e("events").EventEmitter
- , p = $(".footer-help").eq(0)
- , f = $("#help-dialog").eq(0)
- , g = document.querySelector("#quick-logo")
- , m = document.querySelector("#loaderCoBrand")
- , v = document.querySelector("#help-dialog")
- , y = document.querySelector(".footer")
- , A = $(".help-tabs").children().toArray()
- , C = $(".navigation-tab").eq(0)
- , I = $(".more-help-tab").eq(0)
- , E = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
- f.find(".close").eq(0))
- , _ = f.find(".interactions").toArray()
- , b = f.find(".ui-instructions").toArray()
- , w = a.PANORAMA
- , T = a.PANORAMA
- , x = !1
- , S = {
- init: function(e, t) {
- w = T = t,
- [v, m, g, y].forEach(function(e) {
- e.classList.add(c.deviceType)
- }),
- n()
- },
- close: function() {
- if (f.hasClass("open") && (this.emit(l.CLOSED),
- p.removeClass("open"),
- f.removeClass("open"),
- v.classList.contains("fadeIn"))) {
- v.classList.remove("fadeIn");
- var e = T === a.TRANSITIONING ? w : T;
- c.clear(_, s.NAVIGATION, e)
- }
- },
- updateMode: function(e) {
- w = T,
- T = e
- }
- };
- u.extendObject(S, d.prototype),
- t.exports = S
- }
- , {
- "../../enum/HelpModalType": 28,
- "../../enum/Viewmode": 51,
- "../../settings": 166,
- "../../util/common": 185,
- "../helpManager": 68,
- "./../populateModal": 75,
- "./HelpEvent": 66,
- events: 202
- }],
- 68: [function(s, l, e) {
- (function(e) {
- "use strict";
- var t = s("../util/browser")
- , i = s("./../util/logger")
- , n = s("./../settings")
- , r = new i(e)
- , o = function() {
- var t;
- try {
- return t = window.localStorage.getItem("visitCount") || "0",
- t = (parseFloat(t) + 1).toString(),
- window.localStorage.setItem("visitCount", t),
- r.debug("visitCount = " + t),
- t
- } catch (e) {
- t = "1",
- r.debug("couldn't set local storage")
- }
- }()
- , a = !1;
- l.exports = {
- isHelpDisabled: function() {
- return "0" === t.valueFromHash("help", null) || a
- },
- isLargeHelpEnabled: function() {
- return ("1" === o || "1" === t.valueFromHash("help", null)) && !this.isHelpDisabled()
- },
- isSmallHelpEnabled: function() {
- return "2" === t.valueFromHash("help", null) && !this.isHelpDisabled()
- },
- isHelpEnabled: function() {
- return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
- },
- setAutoPlay: function(e) {
- a = 0 <= n.warp.auto && 1 < e
- }
- }
- }
- ).call(this, "/js/gui/helpManager.js")
- }
- , {
- "../util/browser": 182,
- "./../settings": 166,
- "./../util/logger": 189
- }],
- 69: [function(e, t, i) {
- "use strict";
- function r(e) {
- M || n(e) && C.hasClass("playing") || (clearTimeout(x),
- T = !0,
- h.close(),
- function(e) {
- !n(e) && S ? v.forEach(function(e) {
- e.classList.remove("drawerOpen"),
- e.classList.add("duringTour")
- }) : C.hasClass("open") ? v.forEach(function(e) {
- e.classList.remove("duringTour"),
- e.classList.add("drawerOpen")
- }) : P || R === g.FLOORPLAN || R === g.DOLLHOUSE || v.forEach(function(e) {
- e.classList.add("fadeOut")
- })
- }(e),
- R !== g.DOLLHOUSE && R !== g.FLOORPLAN && (E.hasClass("expand") && !_.hasClass("closed") || l.valueFromHash("title", 1),
- C.hasClass("playing") || (y.forEach(function(e) {
- e.classList.add("detectHover")
- }),
- x = setTimeout(a, c.immersive.timeToShowAgain))))
- }
- function o() {
- C.hasClass("playing") || (clearTimeout(x),
- x = setTimeout(a, c.immersive.timeToShowAgain))
- }
- function a() {
- clearTimeout(x),
- T = !1,
- m.forEach(function(e) {
- e.classList.remove("drawerOpen")
- }),
- S || v.forEach(function(e) {
- e.classList.remove("duringTour")
- }),
- y.forEach(function(e) {
- e.classList.remove("detectHover")
- })
- }
- function s() {
- T ? a() : r(),
- M = !0,
- setTimeout(function() {
- M = !1
- }, c.immersive.uiStayDuration)
- }
- function n(e) {
- return "mouse" === e || "touch" === e || "key" === e || "gui" === e
- }
- var l = e("../util/browser")
- , c = e("../settings")
- , h = e("./help/help")
- , u = e("../enum/tagEvents")
- , d = e("../enum/ControlEvents")
- , p = e("../enum/PlayerEvents")
- , f = e("../enum/DirectorEvents")
- , g = (p = e("../enum/PlayerEvents"),
- e("../enum/Viewmode"))
- , m = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
- , v = $(".pinBottom-container, #drawer-container, .footer").toArray()
- , y = $("#hover-bottom, #hover-top").toArray()
- , A = ($("#pullTab").eq(0),
- $("#playHead").eq(0),
- $(".pinBottom-container").eq(0))
- , C = $("#drawer").eq(0)
- , I = $("#drawer-container").eq(0)
- , E = $("#meta-info").eq(0)
- , _ = $(".pinTop.left").eq(0)
- , b = $("#player").eq(0)
- , w = document.getElementById("pullTab")
- , T = !1
- , x = null
- , S = !1
- , M = !1
- , R = null
- , P = !1;
- t.exports.init = function(e, t, i, n) {
- (function(t, i, e, n) {
- [g.PANORAMA, g.DOLLHOUSE, g.FLOORPLAN].forEach(function(e) {
- t.controls[e].on(d.Move, r),
- t.controls[e].on(d.LongTap, s)
- }),
- b.on("mousewheel DOMMouseScroll", r),
- e.on(u.TagActivated, r),
- e.on(u.TagNavigation, r),
- i.on(p.FlyingEnded, o),
- i.on(p.ModeChanging, function(e, t) {
- P = t !== g.PANORAMA && e !== g.PANORAMA
- }),
- i.on(p.ModeChanged, function(e, t) {
- R = i.mode,
- t !== g.TRANSITIONING ? a() : r("modeChange")
- }),
- n.on(f.TourStart, function() {
- S = !0,
- r()
- }),
- n.on(f.TourEnd, function() {
- S = !1,
- a()
- }),
- n.on(f.ActionInterrupted, function() {
- S = !1
- }),
- w.addEventListener("touchend", function() {
- $("#pullTab").hasClass("opened") && !S && a()
- }, !0)
- }
- )(e, t, i, n),
- l.isMobile() ? (y.forEach(function(e) {
- e.classList.add("mobile")
- }),
- A.click(a)) : (y.forEach(function(e) {
- e.addEventListener("mouseleave", function() {
- !b.is(":hover") && y[0].classList.contains("detectHover") && a()
- }, !0)
- }),
- b.mouseleave(function() {
- y[0].classList.contains("detectHover") && a()
- })),
- R = t.mode
- }
- ,
- t.exports.hideUi = r,
- t.exports.resetDrawer = function() {
- I.hasClass("duringTour") || (S = !1,
- r("gui"),
- a())
- }
- }
- , {
- "../enum/ControlEvents": 21,
- "../enum/DirectorEvents": 23,
- "../enum/tagEvents": 32,
- "../enum/PlayerEvents": 40,
- "../enum/Viewmode": 51,
- "../settings": 166,
- "../util/browser": 182,
- "./help/help": 67
- }],
- 70: [function(i, n, e) {
- (function(e) {
- "use strict";
- var t = i("./../util/logger")
- , o = i("./../settings")
- , a = i("./debug")
- , s = i("./../util/common")
- , l = (i("./gui"),
- new t(e));
- o.console && $("body").append('<div id="debug-console"></div>'),
- n.exports.init = function(i, n, r) {
- l.debug("konami has the modelInstance");
- var t = [];
- $(window).on("keydown", function(e) {
- t.push(e.which),
- t.length > o.secretPanelWord.length && t.shift(),
- s.equalLists(t, o.secretPanelWord) && (l.debug("Developer mode active."),
- o.debug = !0)
- }),
- $(window).on("keydown", function e(t) {
- o.debug && 72 === t.which && (i && r ? (a.toggle(i, n, r),
- $(window).off("keydown", e)) : console.warn("sorry we're not ready yet"))
- })
- }
- }
- ).call(this, "/js/gui/konami.js")
- }
- , {
- "./../settings": 166,
- "./../util/common": 185,
- "./../util/logger": 189,
- "./debug": 63,
- "./gui": 65
- }],
- 71: [function(e, t, i) {
- "use strict";
- function r() {
- s.clear(m, l.LANDING[v]),
- g.removeClass("fadeIn")
- }
- var o = e("../settings")
- , a = (e("./help/help"),
- e("./helpManager"))
- , s = e("./populateModal")
- , l = e("../enum/HelpModalType")
- , n = e("../enum/Viewmode")
- , c = e("../enum/DirectorEvents")
- , h = e("../enum/PlayerEvents")
- , u = $("#quick-blackout").eq(0)
- , d = $("#quick-logo").eq(0)
- , p = $(".quick-brand").toArray()
- , f = $("#loaderCoBrand").eq(0)
- , g = $("#interaction-modal").eq(0)
- , m = g.find(".interaction").toArray()
- , v = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
- "");
- t.exports.delayLanding = function(e) {
- var t = $.Deferred();
- e || t.resolve();
- var i = o.startupFlyinDelay;
- return e === n.PANORAMA && (i += o.dollhouse.transitionTime),
- setTimeout(t.resolve.bind(t), i),
- t
- }
- ,
- t.exports.showMessage = function(e, t, i) {
- var n = 0;
- o.quickstart.enabled && (function(e) {
- /* e && (f.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
- d.before(f),
- p = $(".quick-brand").toArray()), */
- u.addClass("fadeOut")
- /* setTimeout(function() {
- p.forEach(function(e) {
- e.classList.add("fadeIn")
- })
- }, o.quickstart.showTextDelay),
- setTimeout(function() {
- p.forEach(function(e) {
- e.classList.add("fadeOut")
- })
- }, o.quickstart.fadeOutDelay) */
- }(i),
- n = o.quickstart.showTextDelay + o.quickstart.fadeOutDelay),
- function(e, t) {
- setTimeout(function() {
- if (a.isHelpEnabled()) {
- if (t(),
- s.init(),
- g.addClass("fadeIn landing " + s.deviceType),
- a.isSmallHelpEnabled())
- return void g.addClass("small");
- s.fill(m, l.LANDING[v]),
- g.addClass(v)
- }
- }, e);
- var i = {
- pc: ["images/pc_step1.png", "images/pc_step2.png", "images/pc_step3.png"],
- mobile: ["images/phone_step1.png", "images/phone_step2.png", "images/phone_step3.png"]
- }
- , n = $(".nav-icon .icon");
- /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) && n.attr("src", i.mobile[0]);
- function r(e) {
- e.on("click", function() {
- var e = null;
- if (e = "plus" == $(this).attr("data-id") ? +n.attr("data-page") + 1 : +n.attr("data-page") - 1,
- i.length < e || e < 1)
- return !1;
- /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? n.attr({
- "data-page": e,
- src: i.mobile[e - 1]
- }) : n.attr({
- "data-page": e,
- src: i.pc[e - 1]
- })
- })
- }
- r($(".next-button")),
- r($(".prev-button"))
- }(n, function() {
- e.once(h.Move, r),
- t.once(c.TourStart, r)
- })
- }
- ,
- t.exports.init = function(e, t) {
- v = t.mode === n.PANORAMA && t.pano && !t.pano.isAligned() ? n.OUTDOOR : t.mode
- }
- ,
- t.exports.dismissModal = r
- }
- , {
- "../enum/DirectorEvents": 23,
- "../enum/HelpModalType": 28,
- "../enum/PlayerEvents": 40,
- "../enum/Viewmode": 51,
- "../settings": 166,
- "./help/help": 67,
- "./helpManager": 68,
- "./populateModal": 75
- }],
- 72: [function(e, t, i) {
- "use strict";
- var n = e("./circleLoader").circleLoader;
- t.exports = {
- element: $("#gui-loading"),
- hide: function(e) {
- n.done(),
- this.element.fadeOut(1500, e)
- },
- show: function(e) {
- this.element.fadeIn(500, function() {
- this.element.css("display", "table"),
- e && e()
- }
- .bind(this))
- },
- progress: function(e) {
- n.set(e)
- }
- }
- }
- , {
- "./circleLoader": 60
- }],
- 73: [function(e, t, i) {
- "use strict";
- var n = e("../settings")
- , r = $("#memory-info")
- , o = r.find("#memory-gpu")
- , a = !1;
- t.exports = {
- show: function() {
- n.profiling.enabled && (r.show(),
- a = !0)
- },
- hide: function() {
- r.hide(),
- a = !1
- },
- toggle: function() {
- a ? this.hide() : this.show()
- },
- update: function(e) {
- n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
- }
- }
- }
- , {
- "../settings": 166
- }],
- 74: [function(e, t, i) {
- "use strict";
- e("../util/browser"),
- e("../analytics");
- e("../settings"),
- t.exports = {
- show: function(e, t) {
- $("#gui-message").fadeOut(500, function() {
- t()
- })
- }
- }
- }
- , {
- "../analytics": 4,
- "../settings": 166,
- "../util/browser": 182
- }],
- 75: [function(e, t, i) {
- "use strict";
- function n(e, t, i, n) {
- i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
- }
- var r = e("../util/browser")
- , o = e("../localization/localize")
- , a = e("../enum/HelpModalType")
- , s = (e("../enum/HelpModalSize"),
- e("../enum/Viewmode"));
- t.exports = {
- init: function() {
- if (!this.hasInitialized) {
- this.hasInitialized = !0,
- this.deviceType = r.isMobile() ? "mobile" : "desktop",
- this.assets = {},
- this.assets[a.LANDING[s.PANORAMA]] = {
- desktop: {
- left: {
- "top-info": o.ROTATE,
- "big-image": "images/nav_help_mouse_drag_left.png",
- keyboard: "images/nav_help_keyboard_left_right.png"
- },
- middle: {
- "top-info": o.MOVE,
- "big-image": "images/nav_help_mouse_click.png",
- keyboard: "images/nav_help_keyboard_up_down.png"
- },
- right: {
- "top-info": o.ZOOM,
- "big-image": "images/nav_help_mouse_zoom.png",
- keyboard: "images/nav_help_zoom_keys.png"
- }
- },
- mobile: {
- left: {
- "top-info": o.ROTATE,
- "big-image": "images/nav_help_gesture_drag.png"
- },
- middle: {
- "top-info": o.MOVE,
- "big-image": "images/nav_help_gesture_tap.png"
- },
- right: {
- "top-info": o.ZOOM,
- "big-image": "images/nav_help_gesture_pinch.png"
- }
- }
- },
- this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
- this.assets[a.LANDING[s.DOLLHOUSE]] = {
- desktop: {
- left: {
- "top-info": o.ROTATE,
- "big-image": "images/nav_help_mouse_drag_left.png",
- keyboard: "images/nav_help_keyboard_left_right.png"
- },
- middle: {
- "top-info": o.MOVE,
- "big-image": "images/nav_help_mouse_position_right.png"
- }
- },
- mobile: {
- left: {
- "top-info": o.ROTATE,
- "big-image": "images/nav_help_gesture_drag.png"
- },
- middle: {
- "top-info": o.MOVE,
- "big-image": "images/nav_help_gesture_position_two_finger.png"
- }
- }
- },
- this.assets[a.LANDING[s.FLOORPLAN]] = {
- desktop: {
- left: {
- "top-info": o.MOVE,
- "big-image": "images/nav_help_mouse_position_left.png"
- },
- middle: {
- "top-info": o.ROTATE,
- "big-image": "images/nav_help_mouse_drag_right.png",
- keyboard: "images/nav_help_keyboard_left_right.png"
- }
- },
- mobile: {
- left: {
- "top-info": o.MOVE,
- "big-image": "images/nav_help_gesture_position.png"
- },
- middle: {
- "top-info": o.ROTATE,
- "big-image": "images/nav_help_gesture_drag_two_finger.png"
- }
- }
- };
- var e = {
- "top-info": o.INSIDE,
- "big-image": "images/nav_help_click_inside.png",
- keyboard: "images/nav_help_inside_key.png"
- };
- this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
- this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
- this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
- var t = {
- "top-info": o.INSIDE,
- "big-image": "images/nav_help_tap_inside.png"
- };
- this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
- this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
- this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
- this.assets[a.NAVIGATION] = {},
- this.assets[a.NAVIGATION][s.PANORAMA] = {
- desktop: {
- left: {
- "top-info": o.HELP_DESKTOP_PANORAMA_1A,
- "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
- "big-image": "images/nav_help_mouse_drag_left.png",
- keyboard: "images/nav_help_keyboard_left_right.png"
- },
- middle: {
- "top-info": o.HELP_DESKTOP_PANORAMA_2A,
- "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
- "big-image": "images/nav_help_mouse_click.png",
- keyboard: "images/nav_help_keyboard_up_down.png"
- },
- right: {
- "top-info": o.HELP_DESKTOP_PANORAMA_3A,
- "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
- "big-image": "images/nav_help_mouse_zoom.png",
- keyboard: "images/nav_help_zoom_keys.png"
- }
- },
- mobile: {
- left: {
- "top-info": o.HELP_MOBILE_PANORAMA_1,
- "big-image": "images/nav_help_gesture_drag.png"
- },
- middle: {
- "top-info": o.HELP_MOBILE_PANORAMA_2,
- "big-image": "images/nav_help_gesture_tap.png"
- },
- right: {
- "top-info": o.HELP_MOBILE_3,
- "big-image": "images/nav_help_gesture_pinch.png"
- }
- }
- },
- this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
- desktop: {
- left: {
- "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
- "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
- "big-image": "images/nav_help_mouse_drag_left.png",
- keyboard: "images/nav_help_keyboard_all.png"
- },
- middle: {
- "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
- "big-image": "images/nav_help_mouse_position_right.png"
- },
- right: {
- "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
- "big-image": "images/nav_help_mouse_zoom.png"
- }
- },
- mobile: {
- left: {
- "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
- "big-image": "images/nav_help_gesture_drag.png"
- },
- middle: {
- "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
- "big-image": "images/nav_help_gesture_position_two_finger.png"
- },
- right: {
- "top-info": o.HELP_MOBILE_3,
- "big-image": "images/nav_help_gesture_pinch.png"
- }
- }
- },
- this.assets[a.NAVIGATION][s.FLOORPLAN] = {
- desktop: {
- left: {
- "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
- "big-image": "images/nav_help_mouse_position_left.png"
- },
- middle: {
- "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
- "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
- "big-image": "images/nav_help_mouse_drag_right.png",
- keyboard: "images/nav_help_keyboard_left_right.png"
- },
- right: {
- "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
- "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
- "big-image": "images/nav_help_mouse_zoom.png",
- keyboard: "images/nav_help_keyboard_up_down.png"
- }
- },
- mobile: {
- left: {
- "top-info": o.HELP_MOBILE_FLOORPLAN_1,
- "big-image": "images/nav_help_gesture_position.png"
- },
- middle: {
- "top-info": o.HELP_MOBILE_FLOORPLAN_2,
- "big-image": "images/nav_help_gesture_drag_two_finger.png"
- },
- right: {
- "top-info": o.HELP_MOBILE_3,
- "big-image": "images/nav_help_gesture_pinch.png"
- }
- }
- },
- this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
- this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
- "top-info": o.HELP_DESKTOP_360_2A,
- "bottom-info": o.HELP_DESKTOP_360_2B,
- "big-image": "images/nav_help_click_inside.png",
- keyboard: "images/nav_help_inside_key.png"
- },
- this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
- "top-info": o.HELP_MOBILE_360_2,
- "big-image": "images/nav_help_tap_inside.png"
- },
- this.assets[a.MORE_HELP] = {
- desktop: {
- "more-help-hlr": {
- "top-info": o.HELP_MORE_HLR_A,
- "big-image": "images/nav_help_expand.svg",
- "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
- },
- "more-help-dollhouse": {
- "top-info": o.HELP_MORE_DOLLHOUSE_A,
- "big-image": "images/nav_help_dollhouse.svg",
- "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
- },
- "more-help-floors": {
- "top-info": o.HELP_MORE_FLOORS_A,
- "big-image": "images/nav_help_floor picker.svg",
- "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
- },
- "more-help-tag": {
- "top-info": o.HELP_MORE_TAG_A,
- "big-image": "images/nav_help_tag.svg",
- "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
- },
- "more-help-zoom": {
- "top-info": o.HELP_MORE_ZOOM_A,
- "big-image": "images/nav_help_zoom.svg",
- "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
- },
- "more-help-tour": {
- "top-info": o.HELP_MORE_TOUR_A,
- "big-image": "images/nav_help_play.png",
- "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
- },
- "more-help-inside": {
- "top-info": o.HELP_MORE_INSIDE_A,
- "big-image": "images/nav_help_inside.svg",
- "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
- },
- "more-help-vr": {
- "top-info": o.HELP_MORE_VR_A,
- "big-image": "images/nav_help_vr.svg",
- "bottom-info": o.HELP_DESKTOP_MORE_VR_B
- },
- "more-help-360": {
- "top-info": o.HELP_MORE_360_A,
- "big-image": "images/nav_help_360.svg",
- "bottom-info": o.HELP_DESKTOP_MORE_360_B
- },
- "more-help-fullscreen": {
- "top-info": o.HELP_MORE_FULLSCREEN_A,
- "big-image": "images/nav_help_fullscreen.svg",
- "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
- }
- },
- mobile: {
- "more-help-hlr": {
- "top-info": o.HELP_MORE_HLR_A,
- "big-image": "images/nav_help_expand.svg",
- "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
- },
- "more-help-dollhouse": {
- "top-info": o.HELP_MORE_DOLLHOUSE_A,
- "big-image": "images/nav_help_dollhouse.svg",
- "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
- },
- "more-help-floors": {
- "top-info": o.HELP_MORE_FLOORS_A,
- "big-image": "images/nav_help_floor picker.svg",
- "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
- },
- "more-help-tag": {
- "top-info": o.HELP_MORE_TAG_A,
- "big-image": "images/nav_help_tag.svg",
- "bottom-info": o.HELP_MOBILE_MORE_TAG_B
- },
- "more-help-tour": {
- "top-info": o.HELP_MORE_TOUR_A,
- "big-image": "images/nav_help_play.png",
- "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
- },
- "more-help-inside": {
- "top-info": o.HELP_MORE_INSIDE_A,
- "big-image": "images/nav_help_inside.svg",
- "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
- },
- "more-help-vr": {
- "top-info": o.HELP_MORE_VR_A,
- "big-image": "images/webvr.svg",
- "bottom-info": o.HELP_MOBILE_MORE_VR_B
- },
- "more-help-360": {
- "top-info": o.HELP_MORE_360_A,
- "big-image": "images/nav_help_360.svg",
- "bottom-info": o.HELP_MOBILE_MORE_360_B
- }
- }
- },
- this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
- desktop: {
- left: {
- "top-info": o.ROTATE,
- "big-image": "images/nav_help_mouse_drag_left.png",
- keyboard: "images/nav_help_keyboard_left_right.png"
- },
- middle: {
- "top-info": o.MOVE,
- "big-image": "images/nav_help_mouse_click.png",
- keyboard: "images/nav_help_keyboard_up_down.png"
- },
- right: {
- "top-info": o.PLAY,
- "big-image": "images/Desktop-help-play-button.svg",
- keyboard: "images/Desktop-help-spacebar-2.svg"
- }
- },
- mobile: {
- left: {
- "top-info": o.ROTATE,
- "big-image": "images/nav_help_gesture_drag.png"
- },
- middle: {
- "top-info": o.MOVE,
- "big-image": "images/nav_help_gesture_tap.png"
- },
- right: {
- "top-info": o.PLAY,
- "big-image": "images/mobile-help-play-button.svg"
- }
- }
- },
- this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
- this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
- this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
- this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
- this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
- this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
- }
- },
- fill: function(e, t, i) {
- n.call(this, e, t, i, !0)
- },
- clear: function(e, t, i) {
- n.call(this, e, t, i, !1)
- }
- }
- }
- , {
- "../enum/HelpModalSize": 27,
- "../enum/HelpModalType": 28,
- "../enum/Viewmode": 51,
- "../localization/localize": 108,
- "../util/browser": 182
- }],
- 76: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- OPENED: "share.open",
- CLOSED: "share.closed",
- LINK_CLICKED: "share.linked"
- })
- }
- , {}],
- 77: [function(e, t, i) {
- "use strict";
- function n(n) {
- function e(e, t) {
- var i = "top=" + (window.screenY + ($("#player").height() - t) / 2) + ",left=" + (window.screenX + ($("#player").width() - e) / 2) + ",width=" + e + ",height=" + t;
- I.emit(l.LINK_CLICKED, {
- channel: n
- }),
- window.open(C[n], "shareWindow", i)
- }
- switch (n) {
- case A.FACEBOOK:
- e(580, 420);
- break;
- case A.TWITTER:
- e(550, 440);
- break;
- case A.MAIL:
- I.emit(l.LINK_CLICKED, {
- channel: "email"
- }),
- window.open(C[n], "_blank");
- break;
- case A.LINKEDIN:
- }
- }
- function r(e) {
- I.emit(l.LINK_CLICKED, {
- channel: "copylink"
- });
- var t = document.createRange();
- t.selectNodeContents(v);
- var i = window.getSelection();
- i.removeAllRanges(),
- i.addRange(t),
- document.execCommand("copy"),
- y.classList.remove("hidden"),
- v.classList.add("highlighted")
- }
- function o(e) {
- e && (e.stopPropagation(),
- e.target === v) || (window.getSelection().removeAllRanges(),
- v.classList.remove("highlighted"),
- y.classList.add("hidden"))
- }
- var a = e("../../util/browser")
- , s = e("../../localization/localize")
- , l = e("./ShareEvents")
- , c = e("../../util/common")
- , h = e("events").EventEmitter
- , u = document.getElementById("sharing")
- , d = document.getElementById("share-modal")
- , p = document.getElementById("share-close")
- , f = document.getElementById("facebook-share")
- , g = document.getElementById("twitter-share")
- , m = document.getElementById("mail-share")
- , v = document.getElementById("share-url-text")
- , y = document.getElementById("copy-success")
- , A = Object.freeze({
- FACEBOOK: "facebook",
- TWITTER: "twitter",
- MAIL: "mail",
- LINKEDIN: "linkedin"
- })
- , C = {};
- C[A.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
- C[A.TWITTER] = "http://twitter.com/intent/tweet?text=",
- C[A.MAIL] = "mailto:?subject=";
- var I = {
- init: function(e) {
- var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
- C[A.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
- C[A.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
- C[A.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
- u.addEventListener("click", this.toggle.bind(this)),
- p.addEventListener("click", this.hide.bind(this)),
- v.addEventListener("click", r),
- d.addEventListener("click", o),
- f.addEventListener("click", n.bind(this, A.FACEBOOK)),
- g.addEventListener("click", n.bind(this, A.TWITTER)),
- m.addEventListener("click", n.bind(this, A.MAIL)),
- v.textContent = window.location.href + "&utm_source=4",
- d.classList.add(a.isMobile() ? "mobile" : "desktop"),
- u.classList.remove("hidden")
- },
- show: function() {
- this.emit(l.OPENED),
- d.classList.add("fadeIn")
- },
- hide: function() {
- d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
- document.selection && document.selection.empty(),
- window.getSelection().removeAllRanges(),
- o(),
- d.classList.remove("fadeIn"))
- },
- toggle: function() {
- d.classList.contains("fadeIn") ? this.hide() : this.show()
- }
- };
- c.extendObject(I, h.prototype),
- t.exports = I
- }
- , {
- "../../localization/localize": 108,
- "../../util/browser": 182,
- "../../util/common": 185,
- "./ShareEvents": 76,
- events: 202
- }],
- 78: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- OPENED: "terms.opened",
- CLOSED: "terms.closed"
- })
- }
- , {}],
- 79: [function(e, t, i) {
- "use strict";
- var n = e("./TermsEvent")
- , r = e("../../localization/localize")
- , o = e("../../analytics")
- , a = e("../../util/ajax")
- , s = e("../../util/common")
- , l = e("events").EventEmitter
- , c = document.getElementById("terms-modal")
- , h = {
- init: function() {
- $(".footer-terms").on("click", function(e) {
- e.preventDefault(),
- this.show()
- }
- .bind(this)),
- $("#terms-modal .close").on("click", this.hide.bind(this))
- },
- show: function() {
- this.emit(n.OPENED),
- a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
- var t = $("#terms-text").html(e);
- o.track("showcase_gui", {
- gui_action: "click_terms_button",
- interaction_source: "gui"
- }),
- t.find("a").attr("target", "_blank")
- }).fail(function() {
- $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
- }),
- c.classList.add("fadeIn")
- },
- hide: function(e) {
- e && e.preventDefault(),
- c.classList.contains("fadeIn") && this.emit(n.CLOSED),
- c.classList.remove("fadeIn")
- }
- };
- s.extendObject(h, l.prototype),
- t.exports = h
- }
- , {
- "../../analytics": 4,
- "../../localization/localize": 108,
- "../../util/ajax": 181,
- "../../util/common": 185,
- "./TermsEvent": 78,
- events: 202
- }],
- 80: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- OPEN_INFO: "title.open.info",
- CLOSE_INFO: "title.close.info",
- SHOW_INFO: "title.show.info",
- HIDE_INFO: "title.hide.info",
- LINK_CLICKED: "title.link.click",
- CONTACT_LINK_CLICKED: "title.contact.click",
- ORIGIN_LINK_CLICKED: "title.origin.click"
- })
- }
- , {}],
- 81: [function(e, t, i) {
- "use strict";
- var o = e("../../settings");
- t.exports.init = function(e, t) {
- o.tags.enabled && 0 !== Object.keys(e.tags).length && function(t, i) {
- function e(e) {
- t.shouldShowtags = "show" === this.value,
- t.shouldShowtags ? i.showAlltags(o.tags.startup.fadeInDuration) : i.hideAlltags(o.tags.startup.fadeInDuration)
- }
- document.getElementById("tag-toggles").classList.remove("hidden"),
- document.getElementById("radio-tag-show").checked = !0;
- for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
- n[r].addEventListener("change", e)
- }(e, t)
- }
- }
- , {
- "../../settings": 166
- }],
- 82: [function(S, M, e) {
- (function(e) {
- "use strict";
- function i(e) {
- return !(!e || l.inIframe() && document.referrer === e || (E.classList.remove("hidden"),
- _.innerHTML = r.WEBVR_LEARN_MORE + ": ",
- _.appendChild(function(e) {
- var t = document.createElement("a");
- return t.id = "url",
- t.target = "_blank",
- t.href = e,
- t.innerText = e,
- t.addEventListener("click", x.emit.bind(x, a.ORIGIN_LINK_CLICKED)),
- t
- }(e)),
- b.forEach(function(e) {
- e.classList.add("share-link")
- }),
- 0))
- }
- function s(e, t) {
- var i = e
- , n = t;
- return function(e, t) {
- i.push(t || n, e)
- }
- }
- var l = S("../../util/browser")
- , t = S("../../util/common")
- , n = S("../../util/logger")
- , r = S("../../localization/localize")
- , o = S("./titleBarSettings")
- , c = S("../../settings")
- , a = S("./TitleEvents")
- , h = S("events").EventEmitter
- , u = new n(e)
- , d = document.querySelector(".pinTop.left")
- , p = document.getElementsByClassName("title-container")[0]
- , f = document.getElementById("title-toggle").querySelector("i")
- , g = document.getElementById("meta-info-wrapper")
- , m = document.getElementById("meta-info")
- , v = document.getElementById("meta-description")
- , y = document.getElementsByClassName("contact-info")[0]
- , A = document.getElementById("contact-data")
- , C = document.getElementById("addressTxt")
- , I = document.getElementById("tag-toggles")
- , E = document.getElementById("share-origin")
- , _ = document.getElementById("share-link-wrapper")
- , b = [m, g, p]
- , w = !1
- , T = !1
- , x = {
- populate: function(e) {
- if (function(e, t) {
- return e && l.valueFromHash("title", 1) && 2 !== l.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
- (g_weixinObj.title = e).length > o.minTooltipCharacters && p.parentElement.setAttribute("data-original-title", e),
- t && 1 !== c.specialEdition && c.brand && !c.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
- document.getElementById("gui-name").classList.add("noCoBrand"),
- document.getElementById("cobrandTitle").classList.add("hidden")),
- !0) : (document.getElementById("model-title").classList.add("hidden"),
- !1)
- }(MP_PREFETCHED_MODELDATA.name, e.coBrand)) {
- if (function(e) {
- e ? (w = !0,
- v.innerHTML = e) : v.classList.add("hidden")
- }(e.description),
- function(e, t, i, n) {
- if ((e || t || i) && c.brand && !l.valueFromHash("mls", !1)) {
- w = !0;
- var r = []
- , o = s(r, "<br>");
- if (e && o('<span id="contactName">' + e + "</span>"),
- t) {
- var a = n || t;
- o(l.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>")
- }
- i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
- r[0] = "",
- A.innerHTML = r.join("")
- } else
- y.classList.add("hidden")
- }(e.contactName, e.phone, e.email, e.formatted_contact_phone),
- function(e) {
- if ("string" == typeof e)
- try {
- e = JSON.parse(e)
- } catch (e) {
- return u.warn("Unable to parse address data"),
- C.parentElement.classList.add("hidden")
- }
- if (e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)) {
- w = !0;
- var t = []
- , i = s(t, " ");
- e.address_1 && i(e.address_1),
- e.address_2 && i(e.address_2),
- e.city && i(e.city, ", "),
- e.state && i(e.state, ", "),
- e.zip && i(e.zip, e.state ? " " : ", "),
- t[0] = "",
- C.innerText = t.join("")
- } else
- C.parentElement.classList.add("hidden")
- }(e.address),
- w) {
- var t = document.createElement("br");
- I.insertBefore(t, I.firstElementChild)
- }
- e.socialSharing && c.share.enabled && (T = i(e.url))
- }
- },
- finishSetup: function(e) {
- w = w || !!e,
- document.getElementById("title-toggle").addEventListener("click", x.toggleTitle.bind(x)),
- w && p.addEventListener("click", x.toggleMeta.bind(x, !1)),
- [].slice.call(v.querySelectorAll("a")).forEach(function(e) {
- e.addEventListener("click", x.emit.bind(x, a.LINK_CLICKED))
- }),
- [].slice.call(y.querySelectorAll("a")).forEach(function(e) {
- e.addEventListener("click", x.emit.bind(x, a.CONTACT_LINK_CLICKED, {
- contact_type: e.getAttribute("id")
- }))
- }),
- w || (T ? p.classList.add("share-only") : p.classList.add("no-meta"))
- },
- toggleMeta: function(e, t) {
- var i = document.getElementById("model-title");
- t && t.preventDefault();
- var n = m.classList.contains("expand");
- e && !n || (n ? (b.forEach(function(e) {
- e.classList.remove("expand")
- }),
- this.emit(a.CLOSE_INFO),
- i.classList.remove("expand")) : (b.forEach(function(e) {
- e.classList.add("expand")
- }),
- i.classList.add("expand"),
- this.emit(a.OPEN_INFO)))
- },
- setupToggling: function() {
- g.style.height = m.offsetHeight + "px",
- m.addEventListener("transitionend", function() {
- g.style.height = m.offsetHeight + "px"
- })
- },
- toggleTitle: function(e) {
- e && e.preventDefault(),
- d.classList.contains("closed") ? (d.classList.add("open"),
- f.classList.remove("icon-dpad-right"),
- f.classList.add("icon-dpad-left"),
- this.emit(a.SHOW_INFO),
- setTimeout(function() {
- d.classList.remove("closed"),
- d.classList.remove("open")
- }, o.removeAnimationClasses)) : (d.classList.add("closed"),
- f.classList.remove("icon-dpad-left"),
- f.classList.add("icon-dpad-right"),
- this.emit(a.HIDE_INFO))
- }
- };
- t.extendObject(x, h.prototype),
- M.exports = x
- }
- ).call(this, "/js/gui/title/titleBar.js")
- }
- , {
- "../../localization/localize": 108,
- "../../settings": 166,
- "../../util/browser": 182,
- "../../util/common": 185,
- "../../util/logger": 189,
- "./TitleEvents": 80,
- "./titleBarSettings": 83,
- events: 202
- }],
- 83: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- minTooltipCharacters: 19,
- removeAnimationClasses: 500
- })
- }
- , {}],
- 84: [function(e, t, i) {
- "use strict";
- function n() {
- v.playTour(),
- y && clearTimeout(y),
- c(),
- E.removeClass("fadeIn")
- }
- function r() {
- A.classList.contains("playing") && (v.stopTour(),
- E.addClass("fadeIn"),
- setTimeout(function() {
- E.removeClass("fadeIn")
- }, h.tourInteraction.showPauseButton),
- M || (clearTimeout(y),
- y = setTimeout(s, h.tourInteraction.showModal)),
- setTimeout(function() {
- A.classList.remove("playing")
- }, h.tourInteraction.allowNextClick))
- }
- function o() {
- v.tourInProgress && (v.stopTour(),
- v.endTourProgress(),
- A.classList.remove("playing"))
- }
- function a() {
- _.is(":visible") ? n() : r()
- }
- function s() {//去掉导览结束时的提示
- /* if (!h.tourInteraction.disabled) {
- T.removeClass("small landing " + d.FLOORPLAN + " " + d.OUTDOOR + " " + d.PANORAMA),
- T.addClass("fadeIn tour " + p.deviceType);
- var e, t = h.tourInteraction.smallModal ? m.SMALL : m.LARGE;
- if (!h.tourInteraction.smallModal)
- 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,
- p.fill(x, g.TOUR_INTERACTION[e]),
- T.addClass(e);
- T.addClass(t)
- } */
- }
- function l(e, t) {
- if (t) {
- var i = "keydown" === t.type
- , n = t.which === u.SPACE || v.tourIsPlaying;
- i && n || e || (M = !0),
- v.atEndOfTour() && c(),
- !v.tourIsPlaying && v.tourInProgress && (E.removeClass("fadeIn"),
- c(),
- t.which !== u.SPACE && o()),
- i && n && a()
- }
- }
- function c() {
- T.removeClass("fadeIn")
- }
- var h = (e("../util/browser"),
- e("../settings"))
- , u = e("../enum/Keys")
- , d = e("../enum/Viewmode")
- , p = (e("./helpManager"),
- e("./populateModal"))
- , f = e("../enum/DirectorEvents")
- , g = e("../enum/HelpModalType")
- , m = e("../enum/HelpModalSize")
- , v = null
- , y = null
- , A = document.getElementById("pause-overlay")
- , C = document.getElementById("player")
- , I = document.getElementById("gui")
- , E = $("#pause-icon").eq(0)
- , _ = $("#play").eq(0)
- , b = $("#playHead").eq(0)
- , w = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
- , T = $("#interaction-modal").eq(0)
- , x = $("#interaction-modal .interaction").toArray()
- , S = ["touchstart", "mousedown", "pointerdown"]
- , M = !1;
- t.exports.init = function(e) {
- v = e,
- S.forEach(function(t) {
- C.addEventListener(t, l.bind(this, !1), !0),
- I.addEventListener(t, l.bind(this, !0), !0),
- A.addEventListener(t, r, !0),
- w.forEach(function(e) {
- e.addEventListener(t, o, !0)
- }),
- $("#drawer img").on(t, o)
- }),
- document.addEventListener("keydown", l.bind(this, !1), !0),
- v.on(f.TourStart, function() {
- A.classList.add("playing")
- })
- }
- ,
- t.exports.play = n,
- t.exports.pause = r,
- t.exports.pauseWithoutCTA = o,
- t.exports.togglePlay = a,
- t.exports.stopTour = function() {
- b.hasClass("playing") && (clearTimeout(y),
- v.atEndOfTour() ? (A.classList.remove("playing"),
- s()) : E.removeClass("fadeIn"))
- }
- ,
- t.exports.dismissModal = c
- }
- , {
- "../enum/DirectorEvents": 23,
- "../enum/HelpModalSize": 27,
- "../enum/HelpModalType": 28,
- "../enum/Keys": 30,
- "../enum/Viewmode": 51,
- "../settings": 166,
- "../util/browser": 182,
- "./helpManager": 68,
- "./populateModal": 75
- }],
- 85: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- OPENED: "vr.modal.opened",
- LAUNCH: "vr.modal.launch",
- CLOSED: "vr.modal.closed",
- NEXT: "vr.modal.next",
- PREV: "vr.modal.prev",
- STORE: "vr.modal.store",
- falseICECHOSEN: "vr.modal.device"
- })
- }
- , {}],
- 86: [function(e, t, i) {
- "use strict";
- var h = e("../../util/browser")
- , u = e("../../enum/VRApps")
- , n = e("../../enum/VRPlatforms")
- , d = e("../../util/ajax")
- , p = e("../../settings")
- , r = {};
- for (var o in r[u.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
- r[u.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
- r[u.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=",
- u) {
- var a = u[o];
- r[a] += encodeURIComponent(document.referrer + "&display=" + a)
- }
- var s, f = {}, g = (-1 === (s = window.location.host).indexOf(".port.com") && -1 === s.indexOf("localhost") && (s = "my.port.com"),
- "https://" + s);
- t.exports.init = function(e, t, o) {
- function a(e, t, i, n) {
- function r() {
- return "&utm_medium=" + (h.inIframe() ? "embed" : "direct") + ("&utm_source=" + s) + ("&utm_showcase_session_id=" + o)
- }
- 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()
- }
- var s = h.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
- , l = g + "/vr/dlist/?ret=" + s
- , c = g + "/vr/show/?ret=" + s;
- switch (e) {
- case n.IOS:
- !function(t, e, i, n) {
- var r = a(t, e, i, n)
- , o = {
- responseType: "json",
- data: {
- branch_key: p.appConfig.branch_key,
- data: {
- m: e,
- full_url: r,
- $desktop_url: "",
- $og_app_id: "331853976762864119",
- $og_title: i,
- $og_description: n,
- $og_image_url: location.origin + "/api/v1/player/models/" + e + "/thumb",
- $canonical_url: window.location.href
- }
- }
- };
- d.post("https://api.branch.io/v1/url", o).done(function(e) {
- f[t] = e.url
- }).fail(function(e) {
- f[t] = e
- }
- .bind(this, r))
- }(u.CardboardIOS, t.sid, t.name, t.summary);
- break;
- default:
- !function(e, t, i) {
- for (var n in u) {
- var r = u[n]
- , o = a(r, e, t, i);
- f[r] = o
- }
- }(t.sid, t.name, t.summary)
- }
- }
- ,
- t.exports.launch = function(e) {
- var t = f[e];
- window.open(t, "_blank")
- }
- ,
- t.exports.launchStore = function(e) {
- var t = r[e];
- window.open(t, "_blank")
- }
- }
- , {
- "../../enum/VRApps": 46,
- "../../enum/VRPlatforms": 49,
- "../../settings": 166,
- "../../util/ajax": 181,
- "../../util/browser": 182
- }],
- 87: [function(e, t, i) {
- "use strict";
- function c(e) {
- var t;
- switch (e) {
- case y.IOS:
- return 9 < (t = g.iosVersion()).major || 9 === t.major && 1 <= t.minor;
- case y.Android:
- return 4 < (t = g.androidVersion()).major || 4 === t.major && 4 < t.minor || 4 === t.major && 4 === t.minor && 4 <= t.patch
- }
- return !1
- }
- function h(e) {
- switch (e) {
- case y.Android:
- x.filter(".cardboard").off().on("click", q.cardboardAndroid),
- x.filter(".gearvr").off().on("click", q.gear),
- n(k, U, "logo-button", "same-line");
- break;
- case y.UnsupportedAndroid:
- n("", H, "", "");
- break;
- case y.IOS:
- x.filter(".cardboard").off().on("click", q.cardboardIOS),
- n(k, "", "logo-button", "");
- break;
- case y.Desktop:
- x.filter(".cardboard").off().on("click", r.bind(this, null, N, B)),
- x.filter(".gearvr").off().on("click", r.bind(this, U, F, null)),
- n(k, U, "logo-button", "same-line"),
- Q.cardboard()
- }
- }
- function u(e) {
- $(".p1, .p2, .p3").hide(),
- l.insertAfter(T),
- w.removeClass("front-page"),
- w.removeClass("details-page"),
- w.removeClass("lastPage"),
- x.removeClass("logo-button"),
- x.removeClass("same-line"),
- T.removeClass("headsetOptions"),
- S.attr("src", ""),
- S.filter(".second").removeClass("gear"),
- S.css("display", "inline-block"),
- S.off(),
- M.filter(".second").css("display", ""),
- O.css("display", "none"),
- $(".p" + (e + 1) + _).show(),
- S.filter(".third").insertBefore(M.filter(".third"))
- }
- function n(e, t, i, n) {
- w.addClass("front-page"),
- S.filter(".first").attr("src", e),
- S.filter(".second").attr("src", t),
- x.filter(".first").addClass(i),
- x.filter(".second").addClass(i),
- x.addClass(n),
- ".show-desktop" === _ && T.insertAfter(l)
- }
- function r(e, t, i) {
- T.addClass("headsetOptions"),
- x.off(),
- S.filter(".second").attr("src", t),
- O.css("display", "block"),
- M.filter(".second").css("display", "none"),
- O.on("click", function() {
- u(b.Title),
- h(y.Desktop)
- }),
- e && (X.emit(C.falseICECHOSEN, {
- name: v.GearVR
- }),
- S.filter(".first").attr("src", e),
- S.filter(".second").addClass("gear"),
- S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
- Q.gearvr()),
- i && (X.emit(C.falseICECHOSEN, {
- name: v.Cardboard
- }),
- S.filter(".third").attr("src", i),
- S.filter(".third").show(),
- S.filter(".third").insertAfter(S.filter(".second")),
- S.filter(".third").addClass("link"),
- S.filter(".second").addClass("link"),
- S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
- S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid)),
- Q.cardboard())
- }
- function d(e, t) {
- switch (t) {
- case y.IOS:
- j = W,
- Y = G;
- break;
- case y.Desktop:
- e === b.Cardboard ? (j = N,
- Y = B,
- S.filter(".second").on("click", m.launchStore.bind(this, v.CardboardIOS)),
- S.filter(".third").on("click", m.launchStore.bind(this, v.CardboardAndroid))) : (j = F,
- S.filter(".second").on("click", m.launchStore.bind(this, v.GearVR)),
- Y = "");
- break;
- default:
- Y = e === b.Cardboard ? (j = H,
- G) : (j = V,
- z)
- }
- }
- function p(e, t, i) {
- w.find(".inner").addClass("details-page"),
- w.addClass("details-page"),
- S.filter(".first").attr("src", e),
- S.filter(".second").attr("src", t),
- S.filter(".third").attr("src", i)
- }
- function f() {
- var e = 1 < g.aspectRatio() && g.isMobile();
- w.toggleClass("landscape", e).toggleClass("portrait", !e),
- w.toggleClass("tiny", $("#player").height() <= o.narrowLandscapeHeight),
- w.toggleClass("tinier", $("#player").height() <= o.reallyNarrowLandscapeHeight)
- }
- var g = e("../../util/browser")
- , m = e("./vrLink")
- , v = e("../../enum/VRApps")
- , y = e("../../enum/VRPlatforms")
- , A = e("../../enum/VRPages")
- , C = e("./vrEvent")
- , o = (e("../../settings"),
- e("../../constants"))
- , I = e("../../localization/localize")
- , a = e("../../util/common")
- , s = e("events").EventEmitter
- , E = 0
- , _ = null
- , b = A.standard
- , w = $(".vr-popup")
- , l = w.find(".vr-popup-body")
- , T = w.find(".vr-images")
- , x = w.find(".img-container")
- , S = w.find(".vr-sm-image")
- , M = x.find(".vr-img-caption")
- , R = $(".vr-buttons").find(".prev-button")
- , P = $(".vr-buttons").find(".next-button")
- , O = T.find(".front-close")
- , L = $(".vr-page")
- , D = w.find("img")
- , N = "images/apple-store.png"
- , F = "images/badge-oculus.png"
- , B = "images/badge-cardboard.png"
- , V = "images/logo-samsung.png"
- , k = "images/headset-cardboard.png"
- , U = "images/headset-gearvr.png"
- , H = "images/ico-android-robot.png"
- , z = "images/ico-gearvr.png"
- , G = "images/ico-vr.png"
- , W = "images/apple-logo-white.svg"
- , j = null
- , Y = null
- , q = {}
- , X = {
- init: function(e, t) {
- function i(e) {
- X.emit(C.STORE, {
- type: e
- }),
- m.launchStore(e)
- }
- function n(e) {
- switch (e !== b.pageCount && (u(e),
- L.text(e + 1 + " / " + b.pageCount)),
- e) {
- case b.Title:
- R.css("display", "none"),
- P.text(a[e]),
- h(r);
- break;
- case b.Cardboard:
- R.css("display", "block"),
- P.text(a[e]),
- x.filter(".cardboard").off(),
- x.filter(".gearvr").off(),
- d(e, r),
- p(k, j, Y);
- break;
- case b.Gear:
- P.text(a[e]),
- d(e, r),
- w.addClass("lastPage"),
- p(U, j, Y);
- break;
- case b.pageCount:
- w.removeClass("fadeIn"),
- X.emit(C.CLOSED)
- }
- D.filter("[src='']").hide()
- }
- var r = g.detectAndroid() ? g.detectAndroidMobile() && c(y.Android) ? (w.addClass("supported"),
- _ = ".show-supported",
- y.Android) : (w.addClass("unsupported"),
- _ = ".show-unsupported",
- y.UnsupportedAndroid) : g.detectIPhone() || g.detectIPod() ? (w.addClass("ios"),
- _ = ".show-ios",
- b = A.ios,
- y.IOS) : (w.addClass("desktop"),
- _ = ".show-desktop",
- y.Desktop);
- function o(e) {
- X.emit(C.LAUNCH, {
- vr_platform: r,
- vr_app: e
- }),
- m.launch(e)
- }
- m.init(r, e, t),
- r !== y.Desktop && w.addClass("mobile"),
- q.cardboardAndroid = o.bind(this, v.CardboardAndroid),
- q.gear = o.bind(this, v.GearVR),
- q.cardboardIOS = o.bind(this, v.CardboardIOS),
- f(),
- $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
- $(_).show();
- var a = [I.VR_LEARN_MORE_CAPS, I.VR_NEXT_CAPS, I.VR_GOT_IT_CAPS]
- , s = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
- r === y.IOS && (a.splice(1, 1),
- s.splice(1, 1)),
- $("#vr").on("click", function(e) {
- e.preventDefault(),
- window.vrEnabled || (window.vrEnabled = !0,
- this.classList.add("active"),
- $("#gui div").not("#vrOff").addClass("vrHide"),
- $("#vrOffImg").css({
- display: "inline-block"
- }))
- }),
- $("#vrOff").on("click", function() {
- window.vrEnabled = !1,
- $("#gui div").not("#vrOff").removeClass("vrHide"),
- $("#vrOffImg").css({
- display: "none"
- }),
- $("#player canvas").css({
- width: "",
- height: ""
- }),
- $("#vr").removeClass("active")
- });
- var l = "https://my.port.com/vr/show/?m=" + e.sid;
- r === y.IOS ? $(".cardboardLink").on("click", i.bind(this, v.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, v.CardboardAndroid)),
- $(".gearLink").on("click", i.bind(this, v.GearVR)),
- $("span.modelLink").text(l),
- R.on("click", function(e) {
- X.emit(C.PREV),
- n(--E)
- }),
- P.on("click", function(e) {
- P.text(),
- X.emit(C.NEXT, {
- nextAction: s[E]
- }),
- n(++E)
- }),
- w.find(".close").on("click", X.dismiss)
- },
- dismiss: function() {
- w.hasClass("fadeIn") && (w.removeClass("fadeIn"),
- X.emit(C.CLOSED))
- },
- isDeviceSupported: c
- };
- a.extendObject(X, s.prototype),
- $(window).resize(f);
- var Z, K, Q = (Z = M.filter(".first").find(".cardboard"),
- K = M.filter(".first").find(".gearvr"),
- {
- cardboard: function() {
- K.addClass("hidden"),
- Z.removeClass("hidden")
- },
- gearvr: function() {
- Z.addClass("hidden"),
- K.removeClass("hidden")
- }
- });
- t.exports = X
- }
- , {
- "../../constants": 8,
- "../../enum/VRApps": 46,
- "../../enum/VRPages": 48,
- "../../enum/VRPlatforms": 49,
- "../../localization/localize": 108,
- "../../settings": 166,
- "../../util/browser": 182,
- "../../util/common": 185,
- "./vrEvent": 85,
- "./vrLink": 86,
- events: 202
- }],
- 88: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- OPENED: "webvr.modal.opened",
- SHOW_TERMS: "webvr.footer.show.terms"
- })
- }
- , {}],
- 89: [function(B, V, e) {
- (function(e) {
- "use strict";
- function a() {
- function t() {
- p.isPresenting || (r.info("exiting webVR"),
- c("webvr_exit_app"),
- -1 === window.location.search.indexOf("&qs=1") ? window.location = window.location + "&qs=1" : window.location = window.location,
- window.removeEventListener("vrdisplaypresentchange", t))
- }
- r.info("Headset mounted"),
- u.suspend();
- var e = document.createElement("canvas");
- for (e.getContext("webgl"),
- e.className = "webvr-canvas",
- document.bgColor = "#000",
- document.body.style.backgroundColor = "#000"; document.body.firstChild; )
- document.body.removeChild(document.body.firstChild);
- document.body.appendChild(e),
- c("webvr_enter_app"),
- p.requestPresent([{
- source: e,
- predistorted: !0
- }]).catch(function(e) {
- r.error("Failed to present: " + e),
- c("webvr_exit_calibrate"),
- t()
- }),
- d.then(function() {
- window.dispatchEvent(new Event("vrapp-start"))
- }),
- window.addEventListener("vrdisplaypresentchange", t)
- }
- function s() {
- c("webvr_modal_close"),
- _.find(".enter-button").off("click", a),
- E.fadeOut(g.guiAnimationSpeed, function() {
- _.toggleClass("hidden", !1),
- b.toggleClass("hidden", !0),
- f.exitFullscreen()
- }),
- I.fadeIn(g.guiAnimationSpeed)
- }
- function t() {
- M.toggleClass("hidden", !0),
- S.toggleClass("hidden", !1)
- }
- function l() {
- _.toggleClass("hidden"),
- b.toggleClass("hidden")
- }
- function c(e) {
- var t = f.isLandscape() ? "landscape" : "portrait";
- i.trackAlways("showcase_gui", {
- gui_action: e,
- orientation: t
- })
- }
- function h() {
- var e = f.isLandscape();
- E.toggleClass("landscape", e).toggleClass("portrait", !e)
- }
- var u, d, p, f = B("../../util/browser"), g = B("../../settings"), m = (B("./../gui"),
- B("../../enum/VRPlatforms")), v = B("../../enum/VRApps"), y = B("./../vr/vrLink"), A = B("./WebVrEvent"), i = B("../../analytics"), C = (B("../../constants"),
- 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 = {
- init: function(e, t, i, n) {
- function r(e) {
- e.preventDefault(),
- o(e.currentTarget.id)
- }
- function o(i) {
- F[i](),
- Object.keys(F).map(function(e, t) {
- $("#" + e).toggleClass("tabs-underlined", e === i)
- })
- }
- p = i,
- u = t,
- y.init(m.Android, e, n),
- h(),
- new RegExp("daydream","i").test(p.displayName) ? (o("tabdaydream"),
- w.filter(".device-headset-side").attr("src", "images/device-daydream-side.png"),
- _.find(".title").text(C.localizeText("WEBVR_FOR_DAYDREAM"))) : (o("tabcardboard"),
- w.filter(".device-headset-side").attr("src", R),
- _.find(".title").text(C.localizeText("WEBVR_FOR_CARDBOARD"))),
- $("#vr").on("click", function(e) {
- e.preventDefault(),
- c("click_webvr_button"),
- E.is(":hidden") && (N.emit(A.OPENED),
- I.fadeOut(g.guiAnimationSpeed),
- E.fadeIn(g.guiAnimationSpeed),
- function() {
- if (!d) {
- var n = "https://static.port.com/webvr/" + (f.valueFromHash("webvr") || g.appConfig.webvr_version) + "/js/main.js";
- d = new Promise(function(e, t) {
- var i = document.createElement("script");
- i.type = "text/javascript",
- i.src = n,
- i.onload = e,
- document.head.appendChild(i)
- }
- )
- }
- _.find(".enter-button").on("click", a)
- }())
- }),
- $(".webvr-popup .close").on("click", function(e) {
- e.preventDefault(),
- _.hasClass("hidden") ? (c("webvr_help_close"),
- l()) : s()
- }),
- $("#tabcardboard").on("click", r),
- $("#tabdaydream").on("click", r),
- $("#tabnative").on("click", r),
- $(".webvr-popup .open-with-app").on("click", function(e) {
- e.preventDefault(),
- c("webvr_learn_more"),
- o("tabnative"),
- l()
- }),
- $(".webvr-popup .help").on("click", function(e) {
- e.preventDefault(),
- c(_.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
- l()
- }),
- $(".webvr-popup .terms").on("click", function(e) {
- e.preventDefault(),
- c("webvr_click_terms"),
- s(),
- N.emit(A.SHOW_TERMS)
- }),
- T.on("click", function(e) {
- e.preventDefault(),
- c(D),
- window.open(L, "_blank")
- }),
- x.on("click", function(e) {
- e.preventDefault(),
- c("webvr_phone_link"),
- window.open("https://vr.google.com/daydream/phones/", "_blank")
- }),
- $(".webvr-popup .badge-cardboard").on("click", function(e) {
- e.preventDefault(),
- c("webvr_cardboard_link"),
- y.launch(v.CardboardAndroid)
- }),
- $(".webvr-popup .badge-oculus").on("click", function(e) {
- e.preventDefault(),
- c("webvr_oculus_link"),
- y.launch(v.GearVR)
- })
- }
- }, F = {
- tabcardboard: function() {
- w.filter(".device-headset").attr("src", R),
- w.filter(".device-phone").attr("src", "images/ico-android-robot.png"),
- L = "https://vr.google.com/cardboard/get-cardboard/",
- D = "webvr_cardboard_link",
- T.text(C.localizeText("VR_GOOGLE_CARDBOARD")),
- x.text(C.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
- $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
- t()
- },
- tabdaydream: function() {
- w.filter(".device-headset").attr("src", "images/device-daydream.png"),
- w.filter(".device-phone").attr("src", "images/device-pixel.png"),
- L = P,
- D = O,
- T.text(C.localizeText("WEBVR_DAYDREAM_VIEW")),
- x.text(C.localizeText("VR_NEED_DAYDREAM_PHONE")),
- $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
- t()
- },
- tabnative: function() {
- w.filter(".badge-cardboard").attr("src", "images/badge-cardboard.png"),
- w.filter(".badge-oculus").attr("src", "images/badge-oculus.png"),
- M.toggleClass("hidden", !1),
- S.toggleClass("hidden", !0)
- }
- };
- n.extendObject(N, o.prototype),
- $(window).resize(h),
- V.exports = N
- }
- ).call(this, "/js/gui/webvr/webVRgui.js")
- }
- , {
- "../../analytics": 4,
- "../../constants": 8,
- "../../enum/VRApps": 46,
- "../../enum/VRPlatforms": 49,
- "../../localization/localize": 108,
- "../../settings": 166,
- "../../util/browser": 182,
- "../../util/common": 185,
- "../../util/logger": 189,
- "./../gui": 65,
- "./../vr/vrLink": 86,
- "./WebVrEvent": 88,
- events: 202
- }],
- 90: [function(e, t, i) {
- "use strict";
- function n(e, t, i, n, r) {
- this.floorId = n || 0 === n ? n : -1,
- this.roomId = r || "",
- this.labelId = e,
- this.position = (new o.Vector3).copy(t),
- this.text = i
- }
- var o = e("three")
- , r = e("../util/browser");
- n.prototype.build = function() {
- var e = window.document.createElement("div");
- r.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
- var t = window.document.createElement("div");
- t.setAttribute("class", "gui-floorplan-label-text");
- var i = window.document.createTextNode(this.text);
- t.appendChild(i),
- e.appendChild(t),
- window.document.body.appendChild(e),
- this.labelGui = e,
- this.textBlock = t,
- $(this.labelGui).hide();
- var n = window.getComputedStyle(this.labelGui);
- this.initialTransform = n.transform || n.webkitTransform
- }
- ,
- t.exports = n
- }
- , {
- "../util/browser": 182,
- three: 217
- }],
- 91: [function(e, t, i) {
- "use strict";
- function n() {
- this.player = null,
- this.modelManager = null,
- this.container = null
- }
- var c, o, r = e("three"), a = (e("../util/common"),
- e("../enum/PlayerEvents")), s = (e("../enum/DirectorEvents"),
- e("../enum/ModelManagerEvents")), l = e("../settings"), h = e("../enum/Viewmode"), u = (e("../enum/WarpStyle"),
- e("../util/transitions"),
- e("../util/lerp"),
- e("../util/browser"));
- n.prototype.init = function(e, t, i) {
- this.player = e,
- this.modelManager = t,
- this.container = i,
- this.updateModel(),
- this.bindEvents()
- }
- ,
- n.prototype.bindEvents = function() {
- this.modelManager.on(s.ActiveModelChanged, this.updateModel.bind(this)),
- this.player.on(a.ViewChanged, this.handlePlayerViewChanged.bind(this)),
- this.player.on(a.ModeChanged, this.handlePlayerViewChanged.bind(this)),
- this.player.on(a.StartInside, this.handleStartInside.bind(this)),
- this.player.on(a.StartOutside, this.handleStartOutside.bind(this))
- }
- ,
- n.prototype.updateModel = function() {
- this.model = this.modelManager.getActiveModel()
- }
- ,
- n.prototype.handlePlayerViewChanged = function() {
- this.updateLabelVisibility(),
- this.updateLabelDisplay()
- }
- ,
- n.prototype.getLabelsForFloor = function(t, i) {
- return (i = i || []).length = 0,
- this.model.labels.forEach(function(e) {
- this.labelVisibleForFloor(e, t) && i.push(e)
- }
- .bind(this)),
- i
- }
- ,
- n.prototype.getLabelsForCurrentFloor = function(e) {
- return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
- }
- ,
- n.prototype.labelVisibleForFloor = function(e, t) {
- var i = u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.mobile || !u.isMobile() && this.player.getLabelScaleFactor() < l.labels.zoomHideThreshhold.desktop;
- if (!this.model.showingLabels || !e.labelGui || !i)
- return !1;
- var n = e.floorId === this.model.floors.size() - 1;
- return this.model.allFloorsVisible ? n : e.floorId === t
- }
- ,
- n.prototype.updateLabelVisibility = function(e) {
- this.model.labels.forEach(function(e) {
- 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)
- }
- .bind(this))
- }
- ,
- n.prototype.showAllLabels = function(t, i) {
- this.model.labels.forEach(function(e) {
- this.showLabel(e, t, i)
- }
- .bind(this))
- }
- ,
- n.prototype.hideAllLabels = function(t, i) {
- this.model.labels.forEach(function(e) {
- this.hideLabel(e, t, i)
- }
- .bind(this))
- }
- ,
- n.prototype.showLabel = function(e, t, i) {
- this.model.showingLabels && (e.visible || (e.visible = !0,
- e.labelGui.style.display = "block",
- e.labelGui.style.opacity = 0,
- $(e.labelGui).delay(t).fadeTo(i, 1)))
- }
- ,
- n.prototype.hideLabel = function(e, t, i) {
- e.visible && (e.visible = !1,
- u.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
- }
- ,
- n.prototype.supportedMode = function() {
- return this.player.mode === h.FLOORPLAN
- }
- ,
- n.prototype.updateLabelDisplay = (new r.Vector3,
- new r.Vector3,
- o = [],
- function() {
- var e = this.player.getLabelScaleFactor()
- , t = 1.2 * (1 - e) + .6
- , i = u.isMobile() ? l.labels.zoomTruncateThreshhold.mobile : l.labels.zoomTruncateThreshhold.desktop;
- this.getLabelsForCurrentFloor(o);
- for (var n = 0; n < o.length; n++) {
- var r = o[n];
- this.supportedMode() && r.labelGui && (this.updateProjectedGuiElement(r.labelGui, r.textBlock, r.position, t, t),
- 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)
- }
- }
- ),
- n.prototype.updateProjectedGuiElement = (c = new r.Vector3,
- new r.Vector3,
- function(e, t, i, n, r) {
- t.style.fontSize = 100 * r + "%";
- var o = .5 * $("#player").width()
- , a = .5 * $("#player").height();
- c.copy(i),
- c.project(this.player.camera);
- var s = c.x * o + o
- , l = -c.y * a + a;
- s -= e.offsetWidth / 2,
- l -= e.offsetHeight / 2,
- e.style.left = s + "px",
- e.style.top = l + "px"
- }
- ),
- n.prototype.handleStartInside = function(e) {
- this.updateLabelVisibility()
- }
- ,
- n.prototype.handleStartOutside = function() {
- this.updateLabelVisibility()
- }
- ,
- t.exports = n
- }
- , {
- "../enum/DirectorEvents": 23,
- "../enum/ModelManagerEvents": 33,
- "../enum/PlayerEvents": 40,
- "../enum/Viewmode": 51,
- "../enum/WarpStyle": 52,
- "../settings": 166,
- "../util/browser": 182,
- "../util/common": 185,
- "../util/lerp": 188,
- "../util/transitions": 195,
- three: 217
- }],
- 92: [function(e, t, i) {
- "use strict";
- Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
- if (null == this)
- throw new TypeError("Array.prototype.findIndex called on null or undefined");
- if ("function" != typeof e)
- throw new TypeError("predicate must be a function");
- for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
- if (t = i[o],
- e.call(r, t, o, i))
- return o;
- return -1
- }
- ),
- Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
- value: function(e) {
- if (null == this)
- throw new TypeError('"this" is null or not defined');
- var t = Object(this)
- , i = t.length >>> 0;
- if ("function" != typeof e)
- throw new TypeError("predicate must be a function");
- for (var n = arguments[1], r = 0; r < i; ) {
- var o = t[r];
- if (e.call(n, o, r, t))
- return o;
- r++
- }
- }
- })
- }
- , {}],
- 93: [function(e, t, i) {
- "use strict";
- 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 || {};
- function te() {
- this.backgroundElement = document.createElement("div"),
- r.extend(this.backgroundElement.style, {
- backgroundColor: "rgba(0,0,0,0.8)",
- top: 0,
- left: 0,
- display: "none",
- zIndex: "1000",
- opacity: 0,
- WebkitTransition: "opacity 0.2s linear"
- }),
- n.makeFullscreen(this.backgroundElement),
- this.backgroundElement.style.position = "fixed",
- this.domElement = document.createElement("div"),
- r.extend(this.domElement.style, {
- position: "fixed",
- display: "none",
- zIndex: "1001",
- opacity: 0,
- WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
- }),
- document.body.appendChild(this.backgroundElement),
- document.body.appendChild(this.domElement);
- var e = this;
- n.bind(this.backgroundElement, "click", function() {
- e.hide()
- })
- }
- function ie(e, t, i) {
- Object.defineProperty(e, t, {
- get: function() {
- return "RGB" === this.__state.space || re(this, t, i),
- this.__state[t]
- },
- set: function(e) {
- "RGB" !== this.__state.space && (re(this, t, i),
- this.__state.space = "RGB"),
- this.__state[t] = e
- }
- })
- }
- function ne(e, t) {
- Object.defineProperty(e, t, {
- get: function() {
- return "HSV" === this.__state.space || oe(this),
- this.__state[t]
- },
- set: function(e) {
- "HSV" !== this.__state.space && (oe(this),
- this.__state.space = "HSV"),
- this.__state[t] = e
- }
- })
- }
- function re(e, t, i) {
- if ("HEX" === e.__state.space)
- e.__state[t] = a.component_from_hex(e.__state.hex, i);
- else {
- if ("HSV" !== e.__state.space)
- throw "Corrupted color state";
- l.extend(e.__state, a.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
- }
- }
- function oe(e) {
- var t = a.rgb_to_hsv(e.r, e.g, e.b);
- l.extend(e.__state, {
- s: t.s,
- v: t.v
- }),
- l.isNaN(t.h) ? l.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = t.h
- }
- function ae() {
- if (this.__state = o.apply(this, arguments),
- !1 === this.__state)
- throw "Failed to interpret color arguments";
- this.__state.a = this.__state.a || 1
- }
- function se(e) {
- return -1 < (e = e.toString()).indexOf(".") ? e.length - e.indexOf(".") - 1 : 0
- }
- function le(e, t) {
- this.initialValue = e[t],
- this.domElement = document.createElement("div"),
- this.object = e,
- this.property = t,
- this.__onChange = void 0,
- this.__onFinishChange = void 0
- }
- (t.exports = ee).gui = ee.gui || {},
- ee.utils = ee.utils || {},
- ee.controllers = ee.controllers || {},
- ee.dom = ee.dom || {},
- ee.color = ee.color || {},
- ee.utils.css = {
- load: function(e, t) {
- var i = (t = t || document).createElement("link");
- i.type = "text/css",
- i.rel = "stylesheet",
- i.href = e,
- t.getElementsByTagName("head")[0].appendChild(i)
- },
- inject: function(e, t) {
- t = t || document;
- var i = document.createElement("style");
- i.type = "text/css",
- i.innerHTML = e,
- t.getElementsByTagName("head")[0].appendChild(i)
- }
- },
- ee.utils.common = (Q = Array.prototype.forEach,
- J = Array.prototype.slice,
- {
- BREAK: {},
- extend: function(i) {
- return this.each(J.call(arguments, 1), function(e) {
- for (var t in e)
- this.isUndefined(e[t]) || (i[t] = e[t])
- }, this),
- i
- },
- defaults: function(i) {
- return this.each(J.call(arguments, 1), function(e) {
- for (var t in e)
- this.isUndefined(i[t]) && (i[t] = e[t])
- }, this),
- i
- },
- compose: function() {
- var i = J.call(arguments);
- return function() {
- for (var e = J.call(arguments), t = i.length - 1; 0 <= t; t--)
- e = [i[t].apply(this, e)];
- return e[0]
- }
- },
- each: function(e, t, i) {
- if (e)
- if (Q && e.forEach && e.forEach === Q)
- e.forEach(t, i);
- else if (e.length === e.length + 0) {
- for (var n = 0, r = e.length; n < r; n++)
- if (n in e && t.call(i, e[n], n) === this.BREAK)
- return
- } else
- for (var n in e)
- if (t.call(i, e[n], n) === this.BREAK)
- return
- },
- defer: function(e) {
- setTimeout(e, 0)
- },
- toArray: function(e) {
- return e.toArray ? e.toArray() : J.call(e)
- },
- isUndefined: function(e) {
- return void 0 === e
- },
- isNull: function(e) {
- return null === e
- },
- isNaN: function(e) {
- return e != e
- },
- isArray: Array.isArray || function(e) {
- return e.constructor === Array
- }
- ,
- isObject: function(e) {
- return e === Object(e)
- },
- isNumber: function(e) {
- return e === e + 0
- },
- isString: function(e) {
- return e === e + ""
- },
- isBoolean: function(e) {
- return !1 === e || !0 === e
- },
- isFunction: function(e) {
- return "[object Function]" === Object.prototype.toString.call(e)
- }
- }),
- ee.controllers.Controller = (ee.utils.common.extend(le.prototype, {
- onChange: function(e) {
- return this.__onChange = e,
- this
- },
- onFinishChange: function(e) {
- return this.__onFinishChange = e,
- this
- },
- setValue: function(e) {
- return this.object[this.property] = e,
- this.__onChange && this.__onChange.call(this, e),
- this.updateDisplay(),
- this
- },
- getValue: function() {
- return this.object[this.property]
- },
- updateDisplay: function() {
- return this
- },
- isModified: function() {
- return this.initialValue !== this.getValue()
- }
- }),
- le),
- ee.dom.dom = function(c) {
- function i(e) {
- if ("0" === e || c.isUndefined(e))
- return 0;
- var t = e.match(n);
- return c.isNull(t) ? 0 : parseFloat(t[1])
- }
- var h = {};
- c.each({
- HTMLEvents: ["change"],
- MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
- KeyboardEvents: ["keydown"]
- }, function(e, t) {
- c.each(e, function(e) {
- h[e] = t
- })
- });
- var n = /(\d+(\.\d+)?)px/
- , r = {
- makeSelectable: function(e, t) {
- void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
- return !1
- }
- : function() {}
- ,
- e.style.MozUserSelect = t ? "auto" : "none",
- e.style.KhtmlUserSelect = t ? "auto" : "none",
- e.unselectable = t ? "on" : "off")
- },
- makeFullscreen: function(e, t, i) {
- c.isUndefined(t) && (t = !0),
- c.isUndefined(i) && (i = !0),
- e.style.position = "absolute",
- t && (e.style.left = 0,
- e.style.right = 0),
- i && (e.style.top = 0,
- e.style.bottom = 0)
- },
- fakeEvent: function(e, t, i, n) {
- i = i || {};
- var r = h[t];
- if (!r)
- throw new Error("Event type " + t + " not supported.");
- var o = document.createEvent(r);
- switch (r) {
- case "MouseEvents":
- var a = i.x || i.clientX || 0
- , s = i.y || i.clientY || 0;
- o.initMouseEvent(t, i.bubbles || !1, i.cancelable || !0, window, i.clickCount || 1, 0, 0, a, s, !1, !1, !1, !1, 0, null);
- break;
- case "KeyboardEvents":
- var l = o.initKeyboardEvent || o.initKeyEvent;
- c.defaults(i, {
- cancelable: !0,
- ctrlKey: !1,
- altKey: !1,
- shiftKey: !1,
- metaKey: !1,
- keyCode: void 0,
- charCode: void 0
- }),
- l(t, i.bubbles || !1, i.cancelable, window, i.ctrlKey, i.altKey, i.shiftKey, i.metaKey, i.keyCode, i.charCode);
- break;
- default:
- o.initEvent(t, i.bubbles || !1, i.cancelable || !0)
- }
- c.defaults(o, n),
- e.dispatchEvent(o)
- },
- bind: function(e, t, i, n) {
- return n = n || !1,
- e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
- r
- },
- unbind: function(e, t, i, n) {
- return n = n || !1,
- e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
- r
- },
- addClass: function(e, t) {
- if (void 0 === e.className)
- e.className = t;
- else if (e.className !== t) {
- var i = e.className.split(/ +/);
- -1 == i.indexOf(t) && (i.push(t),
- e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
- }
- return r
- },
- removeClass: function(e, t) {
- if (t)
- if (void 0 === e.className)
- ;
- else if (e.className === t)
- e.removeAttribute("class");
- else {
- var i = e.className.split(/ +/)
- , n = i.indexOf(t);
- -1 != n && (i.splice(n, 1),
- e.className = i.join(" "))
- }
- else
- e.className = void 0;
- return r
- },
- hasClass: function(e, t) {
- return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
- },
- getWidth: function(e) {
- var t = getComputedStyle(e);
- return i(t["border-left-width"]) + i(t["border-right-width"]) + i(t["padding-left"]) + i(t["padding-right"]) + i(t.width)
- },
- getHeight: function(e) {
- var t = getComputedStyle(e);
- return i(t["border-top-width"]) + i(t["border-bottom-width"]) + i(t["padding-top"]) + i(t["padding-bottom"]) + i(t.height)
- },
- getOffset: function(e) {
- var t = {
- left: 0,
- top: 0
- };
- if (e.offsetParent)
- for (; t.left += e.offsetLeft,
- t.top += e.offsetTop,
- e = e.offsetParent; )
- ;
- return t
- },
- isActive: function(e) {
- return e === document.activeElement && (e.type || e.href)
- }
- };
- return r
- }(ee.utils.common),
- ee.controllers.OptionController = (q = ee.controllers.Controller,
- X = ee.dom.dom,
- Z = ee.utils.common,
- (K = function(e, t, i) {
- K.superclass.call(this, e, t);
- var n = this;
- if (this.__select = document.createElement("select"),
- Z.isArray(i)) {
- var r = {};
- Z.each(i, function(e) {
- r[e] = e
- }),
- i = r
- }
- Z.each(i, function(e, t) {
- var i = document.createElement("option");
- i.innerHTML = t,
- i.setAttribute("value", e),
- n.__select.appendChild(i)
- }),
- this.updateDisplay(),
- X.bind(this.__select, "change", function() {
- var e = this.options[this.selectedIndex].value;
- n.setValue(e)
- }),
- this.domElement.appendChild(this.__select)
- }
- ).superclass = q,
- Z.extend(K.prototype, q.prototype, {
- setValue: function(e) {
- var t = K.superclass.prototype.setValue.call(this, e);
- return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
- t
- },
- updateDisplay: function() {
- return this.__select.value = this.getValue(),
- K.superclass.prototype.updateDisplay.call(this)
- }
- }),
- K),
- ee.controllers.NumberController = (W = ee.controllers.Controller,
- j = ee.utils.common,
- (Y = function(e, t, i) {
- Y.superclass.call(this, e, t),
- i = i || {},
- this.__min = i.min,
- this.__max = i.max,
- this.__step = i.step,
- 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,
- this.__precision = se(this.__impliedStep)
- }
- ).superclass = W,
- j.extend(Y.prototype, W.prototype, {
- setValue: function(e) {
- return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
- void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
- Y.superclass.prototype.setValue.call(this, e)
- },
- min: function(e) {
- return this.__min = e,
- this
- },
- max: function(e) {
- return this.__max = e,
- this
- },
- step: function(e) {
- return this.__step = e,
- this.__impliedStep = e,
- this.__precision = se(e),
- this
- }
- }),
- Y),
- ee.controllers.NumberControllerBox = (U = ee.controllers.NumberController,
- H = ee.dom.dom,
- z = ee.utils.common,
- (G = function(e, t, i) {
- function n() {
- var e = parseFloat(s.__input.value);
- z.isNaN(e) || s.setValue(e)
- }
- function r(e) {
- var t = a - e.clientY;
- s.setValue(s.getValue() + t * s.__impliedStep),
- a = e.clientY
- }
- function o() {
- H.unbind(window, "mousemove", r),
- H.unbind(window, "mouseup", o)
- }
- this.__truncationSuspended = !1,
- G.superclass.call(this, e, t, i);
- var a, s = this;
- this.__input = document.createElement("input"),
- this.__input.setAttribute("type", "text"),
- H.bind(this.__input, "change", n),
- H.bind(this.__input, "blur", function() {
- n(),
- s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
- }),
- H.bind(this.__input, "mousedown", function(e) {
- H.bind(window, "mousemove", r),
- H.bind(window, "mouseup", o),
- a = e.clientY
- }),
- H.bind(this.__input, "keydown", function(e) {
- 13 === e.keyCode && (s.__truncationSuspended = !0,
- this.blur(),
- s.__truncationSuspended = !1)
- }),
- this.updateDisplay(),
- this.domElement.appendChild(this.__input)
- }
- ).superclass = U,
- z.extend(G.prototype, U.prototype, {
- updateDisplay: function() {
- return this.__input.value = this.__truncationSuspended ? this.getValue() : function(e, t) {
- var i = Math.pow(10, t);
- return Math.round(e * i) / i
- }(this.getValue(), this.__precision),
- G.superclass.prototype.updateDisplay.call(this)
- }
- }),
- G),
- ee.controllers.NumberControllerSlider = (N = ee.controllers.NumberController,
- F = ee.dom.dom,
- B = ee.utils.css,
- V = ee.utils.common,
- (k = function(e, t, i, n, r) {
- function o(e) {
- e.preventDefault();
- var t = F.getOffset(s.__background)
- , i = F.getWidth(s.__background);
- return s.setValue(function(e, t, i, n, r) {
- return n + (e - t) / (i - t) * (r - n)
- }(e.clientX, t.left, t.left + i, s.__min, s.__max)),
- !1
- }
- function a() {
- F.unbind(window, "mousemove", o),
- F.unbind(window, "mouseup", a),
- s.__onFinishChange && s.__onFinishChange.call(s, s.getValue())
- }
- k.superclass.call(this, e, t, {
- min: i,
- max: n,
- step: r
- });
- var s = this;
- this.__background = document.createElement("div"),
- this.__foreground = document.createElement("div"),
- F.bind(this.__background, "mousedown", function(e) {
- F.bind(window, "mousemove", o),
- F.bind(window, "mouseup", a),
- o(e)
- }),
- F.addClass(this.__background, "slider"),
- F.addClass(this.__foreground, "slider-fg"),
- this.updateDisplay(),
- this.__background.appendChild(this.__foreground),
- this.domElement.appendChild(this.__background)
- }
- ).superclass = N,
- k.useDefaultStyles = function() {
- 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}")
- }
- ,
- V.extend(k.prototype, N.prototype, {
- updateDisplay: function() {
- var e = (this.getValue() - this.__min) / (this.__max - this.__min);
- return this.__foreground.style.width = 100 * e + "%",
- k.superclass.prototype.updateDisplay.call(this)
- }
- }),
- k),
- ee.controllers.FunctionController = (P = ee.controllers.Controller,
- O = ee.dom.dom,
- L = ee.utils.common,
- (D = function(e, t, i) {
- D.superclass.call(this, e, t);
- var n = this;
- this.__button = document.createElement("div"),
- this.__button.innerHTML = void 0 === i ? "Fire" : i,
- O.bind(this.__button, "click", function(e) {
- return e.preventDefault(),
- n.fire(),
- !1
- }),
- O.addClass(this.__button, "button"),
- this.domElement.appendChild(this.__button)
- }
- ).superclass = P,
- L.extend(D.prototype, P.prototype, {
- fire: function() {
- this.__onChange && this.__onChange.call(this),
- this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
- this.getValue().call(this.object)
- }
- }),
- D),
- ee.controllers.BooleanController = (x = ee.controllers.Controller,
- S = ee.dom.dom,
- M = ee.utils.common,
- (R = function(e, t) {
- R.superclass.call(this, e, t);
- var i = this;
- this.__prev = this.getValue(),
- this.__checkbox = document.createElement("input"),
- this.__checkbox.setAttribute("type", "checkbox"),
- S.bind(this.__checkbox, "change", function() {
- i.setValue(!i.__prev)
- }, !1),
- this.domElement.appendChild(this.__checkbox),
- this.updateDisplay()
- }
- ).superclass = x,
- M.extend(R.prototype, x.prototype, {
- setValue: function(e) {
- var t = R.superclass.prototype.setValue.call(this, e);
- return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
- this.__prev = this.getValue(),
- t
- },
- updateDisplay: function() {
- return !0 === this.getValue() ? (this.__checkbox.setAttribute("checked", "checked"),
- this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
- R.superclass.prototype.updateDisplay.call(this)
- }
- }),
- R),
- ee.color.toString = (T = ee.utils.common,
- function(e) {
- if (1 == e.a || T.isUndefined(e.a)) {
- for (var t = e.hex.toString(16); t.length < 6; )
- t = "0" + t;
- return "#" + t
- }
- return "rgba(" + Math.round(e.r) + "," + Math.round(e.g) + "," + Math.round(e.b) + "," + e.a + ")"
- }
- ),
- ee.color.interpret = (I = ee.color.toString,
- E = ee.utils.common,
- w = [{
- litmus: E.isString,
- conversions: {
- THREE_CHAR_HEX: {
- read: function(e) {
- var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
- return null !== t && {
- space: "HEX",
- hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
- }
- },
- write: I
- },
- SIX_CHAR_HEX: {
- read: function(e) {
- var t = e.match(/^#([A-F0-9]{6})$/i);
- return null !== t && {
- space: "HEX",
- hex: parseInt("0x" + t[1].toString())
- }
- },
- write: I
- },
- CSS_RGB: {
- read: function(e) {
- var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
- return null !== t && {
- space: "RGB",
- r: parseFloat(t[1]),
- g: parseFloat(t[2]),
- b: parseFloat(t[3])
- }
- },
- write: I
- },
- CSS_RGBA: {
- read: function(e) {
- var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
- return null !== t && {
- space: "RGB",
- r: parseFloat(t[1]),
- g: parseFloat(t[2]),
- b: parseFloat(t[3]),
- a: parseFloat(t[4])
- }
- },
- write: I
- }
- }
- }, {
- litmus: E.isNumber,
- conversions: {
- HEX: {
- read: function(e) {
- return {
- space: "HEX",
- hex: e,
- conversionName: "HEX"
- }
- },
- write: function(e) {
- return e.hex
- }
- }
- }
- }, {
- litmus: E.isArray,
- conversions: {
- RGB_ARRAY: {
- read: function(e) {
- return 3 == e.length && {
- space: "RGB",
- r: e[0],
- g: e[1],
- b: e[2]
- }
- },
- write: function(e) {
- return [e.r, e.g, e.b]
- }
- },
- RGBA_ARRAY: {
- read: function(e) {
- return 4 == e.length && {
- space: "RGB",
- r: e[0],
- g: e[1],
- b: e[2],
- a: e[3]
- }
- },
- write: function(e) {
- return [e.r, e.g, e.b, e.a]
- }
- }
- }
- }, {
- litmus: E.isObject,
- conversions: {
- RGBA_OBJ: {
- read: function(e) {
- return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b) && E.isNumber(e.a)) && {
- space: "RGB",
- r: e.r,
- g: e.g,
- b: e.b,
- a: e.a
- }
- },
- write: function(e) {
- return {
- r: e.r,
- g: e.g,
- b: e.b,
- a: e.a
- }
- }
- },
- RGB_OBJ: {
- read: function(e) {
- return !!(E.isNumber(e.r) && E.isNumber(e.g) && E.isNumber(e.b)) && {
- space: "RGB",
- r: e.r,
- g: e.g,
- b: e.b
- }
- },
- write: function(e) {
- return {
- r: e.r,
- g: e.g,
- b: e.b
- }
- }
- },
- HSVA_OBJ: {
- read: function(e) {
- return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v) && E.isNumber(e.a)) && {
- space: "HSV",
- h: e.h,
- s: e.s,
- v: e.v,
- a: e.a
- }
- },
- write: function(e) {
- return {
- h: e.h,
- s: e.s,
- v: e.v,
- a: e.a
- }
- }
- },
- HSV_OBJ: {
- read: function(e) {
- return !!(E.isNumber(e.h) && E.isNumber(e.s) && E.isNumber(e.v)) && {
- space: "HSV",
- h: e.h,
- s: e.s,
- v: e.v
- }
- },
- write: function(e) {
- return {
- h: e.h,
- s: e.s,
- v: e.v
- }
- }
- }
- }
- }],
- function() {
- b = !1;
- var i = 1 < arguments.length ? E.toArray(arguments) : arguments[0];
- return E.each(w, function(e) {
- if (e.litmus(i))
- return E.each(e.conversions, function(e, t) {
- if (_ = e.read(i),
- !1 === b && !1 !== _)
- return (b = _).conversionName = t,
- _.conversion = e,
- E.BREAK
- }),
- E.BREAK
- }),
- b
- }
- ),
- ee.GUI = ee.gui.GUI = function(e, t, i, c, h, u, d, p, f, n, g, r, o, m, v) {
- function y(e, t, i, n) {
- if (void 0 === t[i])
- throw new Error("Object " + t + ' has no property "' + i + '"');
- var r;
- if (n.color)
- r = new g(t,i);
- else {
- var o = [t, i].concat(n.factoryArgs);
- r = c.apply(e, o)
- }
- n.before instanceof h && (n.before = n.before.__li),
- C(e, r),
- m.addClass(r.domElement, "c");
- var a = document.createElement("span");
- m.addClass(a, "property-name"),
- a.innerHTML = r.property;
- var s = document.createElement("div");
- s.appendChild(a),
- s.appendChild(r.domElement);
- var l = A(e, s, n.before);
- return m.addClass(l, R.CLASS_CONTROLLER_ROW),
- m.addClass(l, typeof r.getValue()),
- function(t, i, n) {
- if (n.__li = i,
- n.__gui = t,
- v.extend(n, {
- options: function(e) {
- return 1 < arguments.length ? (n.remove(),
- y(t, n.object, n.property, {
- before: n.__li.nextElementSibling,
- factoryArgs: [v.toArray(arguments)]
- })) : v.isArray(e) || v.isObject(e) ? (n.remove(),
- y(t, n.object, n.property, {
- before: n.__li.nextElementSibling,
- factoryArgs: [e]
- })) : void 0
- },
- name: function(e) {
- return n.__li.firstElementChild.firstElementChild.innerHTML = e,
- n
- },
- listen: function() {
- return n.__gui.listen(n),
- n
- },
- remove: function() {
- return n.__gui.remove(n),
- n
- }
- }),
- n instanceof f) {
- var r = new p(n.object,n.property,{
- min: n.__min,
- max: n.__max,
- step: n.__step
- });
- v.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
- var t = n[e]
- , i = r[e];
- n[e] = r[e] = function() {
- var e = Array.prototype.slice.call(arguments);
- return t.apply(n, e),
- i.apply(r, e)
- }
- }),
- m.addClass(i, "has-slider"),
- n.domElement.insertBefore(r.domElement, n.domElement.firstElementChild)
- } else if (n instanceof p) {
- var e = function(e) {
- return v.isNumber(n.__min) && v.isNumber(n.__max) ? (n.remove(),
- y(t, n.object, n.property, {
- before: n.__li.nextElementSibling,
- factoryArgs: [n.__min, n.__max, n.__step]
- })) : e
- };
- n.min = v.compose(e, n.min),
- n.max = v.compose(e, n.max)
- } else
- n instanceof u ? (m.bind(i, "click", function() {
- m.fakeEvent(n.__checkbox, "click")
- }),
- m.bind(n.__checkbox, "click", function(e) {
- e.stopPropagation()
- })) : n instanceof d ? (m.bind(i, "click", function() {
- m.fakeEvent(n.__button, "click")
- }),
- m.bind(i, "mouseover", function() {
- m.addClass(n.__button, "hover")
- }),
- m.bind(i, "mouseout", function() {
- m.removeClass(n.__button, "hover")
- })) : n instanceof g && (m.addClass(i, "color"),
- n.updateDisplay = v.compose(function(e) {
- return i.style.borderLeftColor = n.__color.toString(),
- e
- }, n.updateDisplay),
- n.updateDisplay());
- n.setValue = v.compose(function(e) {
- return t.getRoot().__preset_select && n.isModified() && _(t.getRoot(), !0),
- e
- }, n.setValue)
- }(e, l, r),
- e.__controllers.push(r),
- r
- }
- function A(e, t, i) {
- var n = document.createElement("li");
- return t && n.appendChild(t),
- i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
- e.onResize(),
- n
- }
- function C(e, t) {
- var i = e.getRoot()
- , n = i.__rememberedObjects.indexOf(t.object);
- if (-1 != n) {
- var r = i.__rememberedObjectIndecesToControllers[n];
- if (void 0 === r && (r = {},
- i.__rememberedObjectIndecesToControllers[n] = r),
- r[t.property] = t,
- i.load && i.load.remembered) {
- var o, a = i.load.remembered;
- if (a[e.preset])
- o = a[e.preset];
- else {
- if (!a[T])
- return;
- o = a[T]
- }
- if (o[n] && void 0 !== o[n][t.property]) {
- var s = o[n][t.property];
- t.initialValue = s,
- t.setValue(s)
- }
- }
- }
- }
- function I(e, t) {
- return document.location.href + "." + t
- }
- function l(e, t) {
- e.domElement.style.width = t + "px",
- e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
- e.__closeButton && (e.__closeButton.style.width = t + "px")
- }
- function a(r, o) {
- var a = {};
- return v.each(r.__rememberedObjects, function(e, t) {
- var i = {}
- , n = r.__rememberedObjectIndecesToControllers[t];
- v.each(n, function(e, t) {
- i[t] = o ? e.initialValue : e.getValue()
- }),
- a[t] = i
- }),
- a
- }
- function E(e, t, i) {
- var n = document.createElement("option");
- n.innerHTML = t,
- n.value = t,
- e.__preset_select.appendChild(n),
- i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
- }
- function _(e, t) {
- var i = e.__preset_select[e.__preset_select.selectedIndex];
- i.innerHTML = t ? i.value + "*" : i.value
- }
- 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");
- var b, w, T = "Default", x = function() {
- try {
- return "localStorage"in window && null !== window.localStorage
- } catch (e) {
- return !1
- }
- }(), S = !0, s = !1, M = [], R = function(t) {
- var i = this;
- this.domElement = document.createElement("div"),
- this.__ul = document.createElement("ul"),
- this.domElement.appendChild(this.__ul),
- m.addClass(this.domElement, "dg"),
- this.__folders = {},
- this.__controllers = [],
- this.__rememberedObjects = [],
- this.__rememberedObjectIndecesToControllers = [],
- this.__listening = [],
- t = t || {},
- t = v.defaults(t, {
- autoPlace: !0,
- width: R.DEFAULT_WIDTH
- }),
- t = v.defaults(t, {
- resizable: t.autoPlace,
- hideable: t.autoPlace
- }),
- v.isUndefined(t.load) ? t.load = {
- preset: T
- } : t.preset && (t.load.preset = t.preset),
- v.isUndefined(t.parent) && t.hideable && M.push(this),
- t.resizable = v.isUndefined(t.parent) && t.resizable,
- t.autoPlace && v.isUndefined(t.scrollable) && (t.scrollable = !0);
- var n, e, r = x && "true" === localStorage.getItem(I(0, "isLocal"));
- if (Object.defineProperties(this, {
- parent: {
- get: function() {
- return t.parent
- }
- },
- scrollable: {
- get: function() {
- return t.scrollable
- }
- },
- autoPlace: {
- get: function() {
- return t.autoPlace
- }
- },
- preset: {
- get: function() {
- return i.parent ? i.getRoot().preset : t.load.preset
- },
- set: function(e) {
- i.parent ? i.getRoot().preset = e : t.load.preset = e,
- function(e) {
- for (var t = 0; t < e.__preset_select.length; t++)
- e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
- }(this),
- i.revert()
- }
- },
- width: {
- get: function() {
- return t.width
- },
- set: function(e) {
- t.width = e,
- l(i, e)
- }
- },
- name: {
- get: function() {
- return t.name
- },
- set: function(e) {
- t.name = e,
- a && (a.innerHTML = t.name)
- }
- },
- closed: {
- get: function() {
- return t.closed
- },
- set: function(e) {
- t.closed = e,
- t.closed ? m.addClass(i.__ul, R.CLASS_CLOSED) : m.removeClass(i.__ul, R.CLASS_CLOSED),
- this.onResize(),
- i.__closeButton && (i.__closeButton.innerHTML = e ? R.TEXT_OPEN : R.TEXT_CLOSED)
- }
- },
- load: {
- get: function() {
- return t.load
- }
- },
- useLocalStorage: {
- get: function() {
- return r
- },
- set: function(e) {
- x && ((r = e) ? m.bind(window, "unload", n) : m.unbind(window, "unload", n),
- localStorage.setItem(I(0, "isLocal"), e))
- }
- }
- }),
- v.isUndefined(t.parent)) {
- if (t.closed = !1,
- m.addClass(this.domElement, R.CLASS_MAIN),
- m.makeSelectable(this.domElement, !1),
- x && r) {
- i.useLocalStorage = !0;
- var o = localStorage.getItem(I(0, "gui"));
- o && (t.load = JSON.parse(o))
- }
- this.__closeButton = document.createElement("div"),
- this.__closeButton.innerHTML = R.TEXT_CLOSED,
- m.addClass(this.__closeButton, R.CLASS_CLOSE_BUTTON),
- this.domElement.appendChild(this.__closeButton),
- m.bind(this.__closeButton, "click", function() {
- i.closed = !i.closed
- })
- } else {
- void 0 === t.closed && (t.closed = !0);
- var a = document.createTextNode(t.name);
- m.addClass(a, "controller-name");
- var s = A(i, a);
- m.addClass(this.__ul, R.CLASS_CLOSED),
- m.addClass(s, "title"),
- m.bind(s, "click", function(e) {
- return e.preventDefault(),
- i.closed = !i.closed,
- !1
- }),
- t.closed || (this.closed = !1)
- }
- t.autoPlace && (v.isUndefined(t.parent) && (S && (w = document.createElement("div"),
- m.addClass(w, "dg"),
- m.addClass(w, R.CLASS_AUTO_PLACE_CONTAINER),
- document.body.appendChild(w),
- S = !1),
- w.appendChild(this.domElement),
- m.addClass(this.domElement, R.CLASS_AUTO_PLACE)),
- this.parent || l(i, t.width)),
- m.bind(window, "resize", function() {
- i.onResize()
- }),
- m.bind(this.__ul, "webkitTransitionEnd", function() {
- i.onResize()
- }),
- m.bind(this.__ul, "transitionend", function() {
- i.onResize()
- }),
- m.bind(this.__ul, "oTransitionEnd", function() {
- i.onResize()
- }),
- this.onResize(),
- t.resizable && function(t) {
- function e(e) {
- return e.preventDefault(),
- r = e.clientX,
- m.addClass(t.__closeButton, R.CLASS_DRAG),
- m.bind(window, "mousemove", i),
- m.bind(window, "mouseup", n),
- !1
- }
- function i(e) {
- return e.preventDefault(),
- t.width += r - e.clientX,
- t.onResize(),
- r = e.clientX,
- !1
- }
- function n() {
- m.removeClass(t.__closeButton, R.CLASS_DRAG),
- m.unbind(window, "mousemove", i),
- m.unbind(window, "mouseup", n)
- }
- var r;
- t.__resize_handle = document.createElement("div"),
- v.extend(t.__resize_handle.style, {
- width: "6px",
- marginLeft: "-3px",
- height: "200px",
- cursor: "ew-resize",
- position: "absolute"
- }),
- m.bind(t.__resize_handle, "mousedown", e),
- m.bind(t.__closeButton, "mousedown", e),
- t.domElement.insertBefore(t.__resize_handle, t.domElement.firstElementChild)
- }(this),
- n = function() {
- x && "true" === localStorage.getItem(I(0, "isLocal")) && localStorage.setItem(I(0, "gui"), JSON.stringify(i.getSaveObject()))
- }
- ,
- this.saveToLocalStorageIfPossible = n,
- i.getRoot(),
- t.parent || ((e = i.getRoot()).width += 1,
- v.defer(function() {
- e.width -= 1
- }))
- };
- return R.toggleHide = function() {
- s = !s,
- v.each(M, function(e) {
- e.domElement.style.zIndex = s ? -999 : 999,
- e.domElement.style.opacity = s ? 0 : 1
- })
- }
- ,
- R.CLASS_AUTO_PLACE = "a",
- R.CLASS_AUTO_PLACE_CONTAINER = "ac",
- R.CLASS_MAIN = "main",
- R.CLASS_CONTROLLER_ROW = "cr",
- R.CLASS_TOO_TALL = "taller-than-window",
- R.CLASS_CLOSED = "closed",
- R.CLASS_CLOSE_BUTTON = "close-button",
- R.CLASS_DRAG = "drag",
- R.DEFAULT_WIDTH = 245,
- R.TEXT_CLOSED = "Close Controls",
- R.TEXT_OPEN = "Open Controls",
- m.bind(window, "keydown", function(e) {
- "text" === document.activeElement.type || 72 !== e.which && 72 != e.keyCode || R.toggleHide()
- }, !1),
- v.extend(R.prototype, {
- add: function(e, t) {
- return y(this, e, t, {
- factoryArgs: Array.prototype.slice.call(arguments, 2)
- })
- },
- addColor: function(e, t) {
- return y(this, e, t, {
- color: !0
- })
- },
- remove: function(e) {
- this.__ul.removeChild(e.__li),
- this.__controllers.slice(this.__controllers.indexOf(e), 1);
- var t = this;
- v.defer(function() {
- t.onResize()
- })
- },
- destroy: function() {
- this.autoPlace && w.removeChild(this.domElement)
- },
- addFolder: function(e) {
- if (void 0 !== this.__folders[e])
- throw new Error('You already have a folder in this GUI by the name "' + e + '"');
- var t = {
- name: e,
- parent: this
- };
- t.autoPlace = this.autoPlace,
- this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
- t.load = this.load.folders[e]);
- var i = new R(t);
- this.__folders[e] = i;
- var n = A(this, i.domElement);
- return m.addClass(n, "folder"),
- i
- },
- open: function() {
- this.closed = !1
- },
- close: function() {
- this.closed = !0
- },
- onResize: function() {
- var t = this.getRoot();
- if (t.scrollable) {
- var e = m.getOffset(t.__ul).top
- , i = 0;
- v.each(t.__ul.childNodes, function(e) {
- t.autoPlace && e === t.__save_row || (i += m.getHeight(e))
- }),
- $("#player").height() - e - 20 < i ? (m.addClass(t.domElement, R.CLASS_TOO_TALL),
- t.__ul.style.height = $("#player").height() - e - 20 + "px") : (m.removeClass(t.domElement, R.CLASS_TOO_TALL),
- t.__ul.style.height = "auto")
- }
- t.__resize_handle && v.defer(function() {
- t.__resize_handle.style.height = t.__ul.offsetHeight + "px"
- }),
- t.__closeButton && (t.__closeButton.style.width = t.width + "px")
- },
- remember: function() {
- 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>'),
- this.parent)
- throw new Error("You can only call remember on a top level GUI.");
- var t = this;
- v.each(Array.prototype.slice.call(arguments), function(e) {
- 0 == t.__rememberedObjects.length && function(i) {
- var e = i.__save_row = document.createElement("li");
- m.addClass(i.domElement, "has-save"),
- i.__ul.insertBefore(e, i.__ul.firstChild),
- m.addClass(e, "save-row");
- var t = document.createElement("span");
- t.innerHTML = " ",
- m.addClass(t, "button gears");
- var n = document.createElement("span");
- n.innerHTML = "Save",
- m.addClass(n, "button"),
- m.addClass(n, "save");
- var r = document.createElement("span");
- r.innerHTML = "New",
- m.addClass(r, "button"),
- m.addClass(r, "save-as");
- var o = document.createElement("span");
- o.innerHTML = "Revert",
- m.addClass(o, "button"),
- m.addClass(o, "revert");
- var a = i.__preset_select = document.createElement("select");
- if (i.load && i.load.remembered ? v.each(i.load.remembered, function(e, t) {
- E(i, t, t == i.preset)
- }) : E(i, T, !1),
- m.bind(a, "change", function() {
- for (var e = 0; e < i.__preset_select.length; e++)
- i.__preset_select[e].innerHTML = i.__preset_select[e].value;
- i.preset = this.value
- }),
- e.appendChild(a),
- e.appendChild(t),
- e.appendChild(n),
- e.appendChild(r),
- e.appendChild(o),
- x) {
- var s = document.getElementById("dg-save-locally")
- , l = document.getElementById("dg-local-explain");
- s.style.display = "block";
- var c = document.getElementById("dg-local-storage");
- "true" === localStorage.getItem(I(0, "isLocal")) && c.setAttribute("checked", "checked");
- var h = function() {
- l.style.display = i.useLocalStorage ? "block" : "none"
- };
- h(),
- m.bind(c, "change", function() {
- i.useLocalStorage = !i.useLocalStorage,
- h()
- })
- }
- var u = document.getElementById("dg-new-constructor");
- m.bind(u, "keydown", function(e) {
- !e.metaKey || 67 !== e.which && 67 != e.keyCode || b.hide()
- }),
- m.bind(t, "click", function() {
- u.innerHTML = JSON.stringify(i.getSaveObject(), void 0, 2),
- b.show(),
- u.focus(),
- u.select()
- }),
- m.bind(n, "click", function() {
- i.save()
- }),
- m.bind(r, "click", function() {
- var e = prompt("Enter a new preset name.");
- e && i.saveAs(e)
- }),
- m.bind(o, "click", function() {
- i.revert()
- })
- }(t),
- -1 == t.__rememberedObjects.indexOf(e) && t.__rememberedObjects.push(e)
- }),
- this.autoPlace && l(this, this.width)
- },
- getRoot: function() {
- for (var e = this; e.parent; )
- e = e.parent;
- return e
- },
- getSaveObject: function() {
- var i = this.load;
- return i.closed = this.closed,
- 0 < this.__rememberedObjects.length && (i.preset = this.preset,
- i.remembered || (i.remembered = {}),
- i.remembered[this.preset] = a(this)),
- i.folders = {},
- v.each(this.__folders, function(e, t) {
- i.folders[t] = e.getSaveObject()
- }),
- i
- },
- save: function() {
- this.load.remembered || (this.load.remembered = {}),
- this.load.remembered[this.preset] = a(this),
- _(this, !1),
- this.saveToLocalStorageIfPossible()
- },
- saveAs: function(e) {
- this.load.remembered || (this.load.remembered = {},
- this.load.remembered[T] = a(this, !0)),
- this.load.remembered[e] = a(this),
- this.preset = e,
- E(this, e, !0),
- this.saveToLocalStorageIfPossible()
- },
- revert: function(t) {
- v.each(this.__controllers, function(e) {
- this.getRoot().load.remembered ? C(t || this.getRoot(), e) : e.setValue(e.initialValue)
- }, this),
- v.each(this.__folders, function(e) {
- e.revert(e)
- }),
- t || _(this.getRoot(), !1)
- },
- listen: function(e) {
- var t = 0 == this.__listening.length;
- this.__listening.push(e),
- t && function e(t) {
- 0 != t.length && r(function() {
- e(t)
- }),
- v.each(t, function(e) {
- e.updateDisplay()
- })
- }(this.__listening)
- }
- }),
- R
- }(ee.utils.css, 0, 0, ee.controllers.factory = (h = ee.controllers.OptionController,
- u = ee.controllers.NumberControllerBox,
- d = ee.controllers.NumberControllerSlider,
- p = ee.controllers.StringController = (v = ee.controllers.Controller,
- y = ee.dom.dom,
- A = ee.utils.common,
- (C = function(e, t) {
- function i() {
- n.setValue(n.__input.value)
- }
- C.superclass.call(this, e, t);
- var n = this;
- this.__input = document.createElement("input"),
- this.__input.setAttribute("type", "text"),
- y.bind(this.__input, "keyup", i),
- y.bind(this.__input, "change", i),
- y.bind(this.__input, "blur", function() {
- n.__onFinishChange && n.__onFinishChange.call(n, n.getValue())
- }),
- y.bind(this.__input, "keydown", function(e) {
- 13 === e.keyCode && this.blur()
- }),
- this.updateDisplay(),
- this.domElement.appendChild(this.__input)
- }
- ).superclass = v,
- A.extend(C.prototype, v.prototype, {
- updateDisplay: function() {
- return y.isActive(this.__input) || (this.__input.value = this.getValue()),
- C.superclass.prototype.updateDisplay.call(this)
- }
- }),
- C),
- f = ee.controllers.FunctionController,
- g = ee.controllers.BooleanController,
- m = ee.utils.common,
- function(e, t) {
- var i = e[t];
- 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,{
- min: arguments[2],
- max: arguments[3]
- }) : m.isString(i) ? new p(e,t) : m.isFunction(i) ? new f(e,t,"") : m.isBoolean(i) ? new g(e,t) : void 0
- }
- ), 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) {
- function f(t, i, n, r) {
- t.style.background = "",
- p.each(o, function(e) {
- t.style.cssText += "background: " + e + "linear-gradient(" + i + ", " + n + " 0%, " + r + " 100%); "
- })
- }
- var g = function(e, t) {
- function i(e) {
- a(e),
- h.bind(window, "mousemove", a),
- h.bind(window, "mouseup", n)
- }
- function n() {
- h.unbind(window, "mousemove", a),
- h.unbind(window, "mouseup", n)
- }
- function r() {
- var e = d(this.value);
- !1 !== e ? (l.__color.__state = e,
- l.setValue(l.__color.toOriginal())) : this.value = l.__color.toString()
- }
- function o() {
- h.unbind(window, "mousemove", s),
- h.unbind(window, "mouseup", o)
- }
- function a(e) {
- e.preventDefault();
- var t = h.getWidth(l.__saturation_field)
- , i = h.getOffset(l.__saturation_field)
- , n = (e.clientX - i.left + document.body.scrollLeft) / t
- , r = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
- return 1 < r ? r = 1 : r < 0 && (r = 0),
- 1 < n ? n = 1 : n < 0 && (n = 0),
- l.__color.v = r,
- l.__color.s = n,
- l.setValue(l.__color.toOriginal()),
- !1
- }
- function s(e) {
- e.preventDefault();
- var t = h.getHeight(l.__hue_field)
- , i = h.getOffset(l.__hue_field)
- , n = 1 - (e.clientY - i.top + document.body.scrollTop) / t;
- return 1 < n ? n = 1 : n < 0 && (n = 0),
- l.__color.h = 360 * n,
- l.setValue(l.__color.toOriginal()),
- !1
- }
- g.superclass.call(this, e, t),
- this.__color = new u(this.getValue()),
- this.__temp = new u(0);
- var l = this;
- this.domElement = document.createElement("div"),
- h.makeSelectable(this.domElement, !1),
- this.__selector = document.createElement("div"),
- this.__selector.className = "selector",
- this.__saturation_field = document.createElement("div"),
- this.__saturation_field.className = "saturation-field",
- this.__field_knob = document.createElement("div"),
- this.__field_knob.className = "field-knob",
- this.__field_knob_border = "2px solid ",
- this.__hue_knob = document.createElement("div"),
- this.__hue_knob.className = "hue-knob",
- this.__hue_field = document.createElement("div"),
- this.__hue_field.className = "hue-field",
- this.__input = document.createElement("input"),
- this.__input.type = "text",
- this.__input_textShadow = "0 1px 1px ",
- h.bind(this.__input, "keydown", function(e) {
- 13 === e.keyCode && r.call(this)
- }),
- h.bind(this.__input, "blur", r),
- h.bind(this.__selector, "mousedown", function(e) {
- h.addClass(this, "drag").bind(window, "mouseup", function(e) {
- h.removeClass(l.__selector, "drag")
- })
- });
- var c = document.createElement("div");
- p.extend(this.__selector.style, {
- width: "122px",
- height: "102px",
- padding: "3px",
- backgroundColor: "#222",
- boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
- }),
- p.extend(this.__field_knob.style, {
- position: "absolute",
- width: "12px",
- height: "12px",
- border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
- boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
- borderRadius: "12px",
- zIndex: 1
- }),
- p.extend(this.__hue_knob.style, {
- position: "absolute",
- width: "15px",
- height: "2px",
- borderRight: "4px solid #fff",
- zIndex: 1
- }),
- p.extend(this.__saturation_field.style, {
- width: "100px",
- height: "100px",
- border: "1px solid #555",
- marginRight: "3px",
- display: "inline-block",
- cursor: "pointer"
- }),
- p.extend(c.style, {
- width: "100%",
- height: "100%",
- background: "none"
- }),
- f(c, "top", "rgba(0,0,0,0)", "#000"),
- p.extend(this.__hue_field.style, {
- width: "15px",
- height: "100px",
- display: "inline-block",
- border: "1px solid #555",
- cursor: "ns-resize"
- }),
- function(e) {
- e.style.background = "",
- e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
- e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
- e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
- e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
- e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
- }(this.__hue_field),
- p.extend(this.__input.style, {
- outline: "none",
- textAlign: "center",
- color: "#fff",
- border: 0,
- fontWeight: "bold",
- textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
- }),
- h.bind(this.__saturation_field, "mousedown", i),
- h.bind(this.__field_knob, "mousedown", i),
- h.bind(this.__hue_field, "mousedown", function(e) {
- s(e),
- h.bind(window, "mousemove", s),
- h.bind(window, "mouseup", o)
- }),
- this.__saturation_field.appendChild(c),
- this.__selector.appendChild(this.__field_knob),
- this.__selector.appendChild(this.__saturation_field),
- this.__selector.appendChild(this.__hue_field),
- this.__hue_field.appendChild(this.__hue_knob),
- this.domElement.appendChild(this.__input),
- this.domElement.appendChild(this.__selector),
- this.updateDisplay()
- };
- g.superclass = e,
- p.extend(g.prototype, e.prototype, {
- updateDisplay: function() {
- var t = d(this.getValue());
- if (!1 !== t) {
- var i = !1;
- p.each(u.COMPONENTS, function(e) {
- if (!p.isUndefined(t[e]) && !p.isUndefined(this.__color.__state[e]) && t[e] !== this.__color.__state[e])
- return i = !0,
- {}
- }, this),
- i && p.extend(this.__color.__state, t)
- }
- p.extend(this.__temp.__state, this.__color.__state),
- this.__temp.a = 1;
- var e = this.__color.v < .5 || .5 < this.__color.s ? 255 : 0
- , n = 255 - e;
- p.extend(this.__field_knob.style, {
- marginLeft: 100 * this.__color.s - 7 + "px",
- marginTop: 100 * (1 - this.__color.v) - 7 + "px",
- backgroundColor: this.__temp.toString(),
- border: this.__field_knob_border + "rgb(" + e + "," + e + "," + e + ")"
- }),
- this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
- this.__temp.s = 1,
- this.__temp.v = 1,
- f(this.__saturation_field, "left", "#fff", this.__temp.toString()),
- p.extend(this.__input.style, {
- backgroundColor: this.__input.value = this.__color.toString(),
- color: "rgb(" + e + "," + e + "," + e + ")",
- textShadow: this.__input_textShadow + "rgba(" + n + "," + n + "," + n + ",.7)"
- })
- }
- });
- var o = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
- return g
- }(ee.controllers.Controller, ee.dom.dom, ee.color.Color = (o = ee.color.interpret,
- a = ee.color.math = {
- hsv_to_rgb: function(e, t, i) {
- var n = Math.floor(e / 60) % 6
- , r = e / 60 - Math.floor(e / 60)
- , o = i * (1 - t)
- , a = i * (1 - r * t)
- , s = i * (1 - (1 - r) * t)
- , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
- return {
- r: 255 * l[0],
- g: 255 * l[1],
- b: 255 * l[2]
- }
- },
- rgb_to_hsv: function(e, t, i) {
- var n, r = Math.min(e, t, i), o = Math.max(e, t, i), a = o - r;
- return 0 == o ? {
- h: NaN,
- s: 0,
- v: 0
- } : (n = e == o ? (t - i) / a : t == o ? 2 + (i - e) / a : 4 + (e - t) / a,
- (n /= 6) < 0 && (n += 1),
- {
- h: 360 * n,
- s: a / o,
- v: o / 255
- })
- },
- rgb_to_hex: function(e, t, i) {
- var n = this.hex_with_component(0, 2, e);
- return n = this.hex_with_component(n, 1, t),
- this.hex_with_component(n, 0, i)
- },
- component_from_hex: function(e, t) {
- return e >> 8 * t & 255
- },
- hex_with_component: function(e, t, i) {
- return i << (c = 8 * t) | e & ~(255 << c)
- }
- },
- s = ee.color.toString,
- l = ee.utils.common,
- ae.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
- l.extend(ae.prototype, {
- toString: function() {
- return s(this)
- },
- toOriginal: function() {
- return this.__state.conversion.write(this)
- }
- }),
- ie(ae.prototype, "r", 2),
- ie(ae.prototype, "g", 1),
- ie(ae.prototype, "b", 0),
- ne(ae.prototype, "h"),
- ne(ae.prototype, "s"),
- ne(ae.prototype, "v"),
- Object.defineProperty(ae.prototype, "a", {
- get: function() {
- return this.__state.a
- },
- set: function(e) {
- this.__state.a = e
- }
- }),
- Object.defineProperty(ae.prototype, "hex", {
- get: function() {
- return "HEX" !== !this.__state.space && (this.__state.hex = a.rgb_to_hex(this.r, this.g, this.b)),
- this.__state.hex
- },
- set: function(e) {
- this.__state.space = "HEX",
- this.__state.hex = e
- }
- }),
- ae), ee.color.interpret, ee.utils.common), ee.utils.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
- window.setTimeout(e, 1e3 / 60)
- }
- , ee.dom.CenteredDiv = (n = ee.dom.dom,
- r = ee.utils.common,
- te.prototype.show = function() {
- var e = this;
- this.backgroundElement.style.display = "block",
- this.domElement.style.display = "block",
- this.domElement.style.opacity = 0,
- this.domElement.style.webkitTransform = "scale(1.1)",
- this.layout(),
- r.defer(function() {
- e.backgroundElement.style.opacity = 1,
- e.domElement.style.opacity = 1,
- e.domElement.style.webkitTransform = "scale(1)"
- })
- }
- ,
- te.prototype.hide = function() {
- var e = this
- , t = function() {
- e.domElement.style.display = "none",
- e.backgroundElement.style.display = "none",
- n.unbind(e.domElement, "webkitTransitionEnd", t),
- n.unbind(e.domElement, "transitionend", t),
- n.unbind(e.domElement, "oTransitionEnd", t)
- };
- n.bind(this.domElement, "webkitTransitionEnd", t),
- n.bind(this.domElement, "transitionend", t),
- n.bind(this.domElement, "oTransitionEnd", t),
- this.backgroundElement.style.opacity = 0,
- this.domElement.style.opacity = 0,
- this.domElement.style.webkitTransform = "scale(1.1)"
- }
- ,
- te.prototype.layout = function() {
- this.domElement.style.left = $("#player").width() / 2 - n.getWidth(this.domElement) / 2 + "px",
- this.domElement.style.top = $("#player").height() / 2 - n.getHeight(this.domElement) / 2 + "px"
- }
- ,
- te), ee.dom.dom, ee.utils.common)
- }
- , {}],
- 94: [function(e, t, i) {
- (function(J) {
- "use strict";
- function i(e) {
- function t(e, t) {
- for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
- for (var a = 1; a <= e[o]; a++)
- r[t[n]] = [],
- r[t[n]][0] = i,
- r[t[n]][1] = o,
- n++,
- i++;
- i *= 2
- }
- return r
- }
- function _(e) {
- for (var t = e[0], i = e[1] - 1; 0 <= i; )
- t & 1 << i && (B |= 1 << V),
- i--,
- --V < 0 && (255 == B ? (b(255),
- b(0)) : b(B),
- V = 7,
- B = 0)
- }
- function b(e) {
- F.push(e)
- }
- function w(e) {
- b(e >> 8 & 255),
- b(255 & e)
- }
- function T(e, t, i, n, r) {
- for (var o, a = r[0], s = r[240], l = function(e, t) {
- var i, n, r, o, a, s, l, c, h, u, d = 0;
- for (h = 0; h < 8; ++h) {
- i = e[d],
- n = e[d + 1],
- r = e[d + 2],
- o = e[d + 3],
- a = e[d + 4],
- s = e[d + 5],
- l = e[d + 6];
- var p = i + (c = e[d + 7])
- , f = i - c
- , g = n + l
- , m = n - l
- , v = r + s
- , y = r - s
- , A = o + a
- , C = o - a
- , I = p + A
- , E = p - A
- , _ = g + v
- , b = g - v;
- e[d] = I + _,
- e[d + 4] = I - _;
- var w = .707106781 * (b + E);
- e[d + 2] = E + w,
- e[d + 6] = E - w;
- var T = .382683433 * ((I = C + y) - (b = m + f))
- , x = .5411961 * I + T
- , S = 1.306562965 * b + T
- , M = .707106781 * (_ = y + m)
- , R = f + M
- , P = f - M;
- e[d + 5] = P + x,
- e[d + 3] = P - x,
- e[d + 1] = R + S,
- e[d + 7] = R - S,
- d += 8
- }
- for (h = d = 0; h < 8; ++h) {
- i = e[d],
- n = e[d + 8],
- r = e[d + 16],
- o = e[d + 24],
- a = e[d + 32],
- s = e[d + 40],
- l = e[d + 48];
- var O = i + (c = e[d + 56])
- , L = i - c
- , D = n + l
- , N = n - l
- , F = r + s
- , B = r - s
- , V = o + a
- , k = o - a
- , U = O + V
- , H = O - V
- , z = D + F
- , G = D - F;
- e[d] = U + z,
- e[d + 32] = U - z;
- var W = .707106781 * (G + H);
- e[d + 16] = H + W,
- e[d + 48] = H - W;
- var j = .382683433 * ((U = k + B) - (G = N + L))
- , Y = .5411961 * U + j
- , q = 1.306562965 * G + j
- , X = .707106781 * (z = B + N)
- , Z = L + X
- , K = L - X;
- e[d + 40] = K + Y,
- e[d + 24] = K - Y,
- e[d + 8] = Z + q,
- e[d + 56] = Z - q,
- d++
- }
- for (h = 0; h < 64; ++h)
- u = e[h] * t[h],
- Q[h] = 0 < u ? .5 + u | 0 : u - .5 | 0;
- return Q
- }(e, t), c = 0; c < 64; ++c)
- A[C[c]] = l[c];
- var h = A[0] - i;
- i = A[0],
- 0 == h ? _(n[0]) : (_(n[y[o = 32767 + h]]),
- _(v[o]));
- for (var u = 63; 0 < u && 0 == A[u]; u--)
- ;
- if (0 == u)
- return _(a),
- i;
- for (var d, p = 1; p <= u; ) {
- for (var f = p; 0 == A[p] && p <= u; ++p)
- ;
- var g = p - f;
- if (16 <= g) {
- d = g >> 4;
- for (var m = 1; m <= d; ++m)
- _(s);
- g &= 15
- }
- o = 32767 + A[p],
- _(r[(g << 4) + y[o]]),
- _(v[o]),
- p++
- }
- return 63 != u && _(a),
- i
- }
- function x(e) {
- if (e <= 0 && (e = 1),
- 100 < e && (e = 100),
- i != e) {
- (function(e) {
- 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++) {
- var n = u((t[i] * e + 50) / 100);
- n < 1 ? n = 1 : 255 < n && (n = 255),
- O[C[i]] = n
- }
- 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++) {
- var a = u((r[o] * e + 50) / 100);
- a < 1 ? a = 1 : 255 < a && (a = 255),
- L[C[o]] = a
- }
- for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
- for (var h = 0; h < 8; h++)
- D[l] = 1 / (O[C[l]] * s[c] * s[h] * 8),
- N[l] = 1 / (L[C[l]] * s[c] * s[h] * 8),
- l++
- }
- )(e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)),
- i = e
- }
- }
- var S, M, R, P, i, u = (Math.round,
- 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];
- this.encode = function(e, t) {
- var i = ((new Date).getTime(),
- t.quality);
- i && x(i),
- F = new Array,
- B = 0,
- V = 7,
- w(65496),
- w(65504),
- w(16),
- b(74),
- b(70),
- b(73),
- b(70),
- b(0),
- b(1),
- b(1),
- b(0),
- w(1),
- w(1),
- b(0),
- b(0),
- function() {
- w(65499),
- w(132),
- b(0);
- for (var e = 0; e < 64; e++)
- b(O[e]);
- b(1);
- for (var t = 0; t < 64; t++)
- b(L[t])
- }(),
- function(e, t) {
- w(65472),
- w(17),
- b(8),
- w(t),
- w(e),
- b(3),
- b(1),
- b(17),
- b(0),
- b(2),
- b(17),
- b(1),
- b(3),
- b(17),
- b(1)
- }(e.width, e.height),
- function() {
- w(65476),
- w(418),
- b(0);
- for (var e = 0; e < 16; e++)
- b(G[e + 1]);
- for (var t = 0; t <= 11; t++)
- b(W[t]);
- b(16);
- for (var i = 0; i < 16; i++)
- b(j[i + 1]);
- for (var n = 0; n <= 161; n++)
- b(Y[n]);
- b(1);
- for (var r = 0; r < 16; r++)
- b(q[r + 1]);
- for (var o = 0; o <= 11; o++)
- b(X[o]);
- b(17);
- for (var a = 0; a < 16; a++)
- b(Z[a + 1]);
- for (var s = 0; s <= 161; s++)
- b(K[s])
- }(),
- w(65498),
- w(12),
- b(3),
- b(1),
- b(0),
- b(2),
- b(17),
- b(3),
- b(17),
- b(0),
- b(63),
- b(0);
- var n = 0
- , r = 0
- , o = 0;
- B = 0,
- V = 7,
- this.encode.displayName = "_encode_";
- 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; ) {
- for (a = 0; a < A; ) {
- for (u = h = A * C + a,
- d = -1,
- f = p = 0; f < 64; f++)
- u = h + (p = (y ? 63 - f : f) >> 3) * A + (d = 4 * (7 & f)),
- v <= C + p && (u -= A * (C + 1 + p - v)),
- A <= a + d && (u -= a + d - A + 4),
- s = g[u++],
- l = g[u++],
- c = g[u++],
- k[f] = (z[s] + z[l + 256 >> 0] + z[c + 512 >> 0] >> 16) - 128,
- U[f] = (z[s + 768 >> 0] + z[l + 1024 >> 0] + z[c + 1280 >> 0] >> 16) - 128,
- H[f] = (z[s + 1280 >> 0] + z[l + 1536 >> 0] + z[c + 1792 >> 0] >> 16) - 128;
- n = T(k, D, n, S, R),
- r = T(U, N, r, M, P),
- o = T(H, N, o, M, P),
- a += 32
- }
- C += I
- }
- if (0 <= V) {
- var E = [];
- E[1] = V + 1,
- E[0] = (1 << V + 1) - 1,
- _(E)
- }
- return w(65497),
- new J(F)
- }
- ,
- (new Date).getTime(),
- e = e || 50,
- function() {
- for (var e = String.fromCharCode, t = 0; t < 256; t++)
- n[t] = e(t)
- }(),
- S = t(G, W),
- M = t(q, X),
- R = t(j, Y),
- P = t(Z, K),
- function() {
- for (var e = 1, t = 2, i = 1; i <= 15; i++) {
- for (var n = e; n < t; n++)
- y[32767 + n] = i,
- v[32767 + n] = [],
- v[32767 + n][1] = i,
- v[32767 + n][0] = n;
- for (var r = -(t - 1); r <= -e; r++)
- y[32767 + r] = i,
- v[32767 + r] = [],
- v[32767 + r][1] = i,
- v[32767 + r][0] = t - 1 + r;
- e <<= 1,
- t <<= 1
- }
- }(),
- function() {
- for (var e = 0; e < 256; e++)
- z[e] = 19595 * e,
- z[e + 256 >> 0] = 38470 * e,
- z[e + 512 >> 0] = 7471 * e + 32768,
- z[e + 768 >> 0] = -11059 * e,
- z[e + 1024 >> 0] = -21709 * e,
- z[e + 1280 >> 0] = 32768 * e + 8421375,
- z[e + 1536 >> 0] = -27439 * e,
- z[e + 1792 >> 0] = -5329 * e
- }(),
- x(e),
- (new Date).getTime()
- }
- t.exports.encode = function(e, t) {
- return (t = t || {}).quality = t.quality || 50,
- {
- data: new i(t.quality).encode(e, t),
- width: e.width,
- height: e.height
- }
- }
- }
- ).call(this, e("buffer").Buffer)
- }
- , {
- buffer: 198
- }],
- 95: [function(e, t, i) {
- "use strict";
- !function() {
- if ("performance"in window == 0 && (window.performance = {}),
- Date.now = Date.now || function() {
- return (new Date).getTime()
- }
- ,
- "now"in window.performance == 0) {
- var e = Date.now();
- performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
- window.performance.now = function() {
- return Date.now() - e
- }
- }
- }()
- }
- , {}],
- 96: [function(e, t, i) {
- "use strict";
- var a = e("three");
- a.EffectComposer = function(e, t) {
- if (this.renderer = e,
- void 0 === t) {
- var i = {
- minFilter: a.LinearFilter,
- magFilter: a.LinearFilter,
- format: a.RGBAFormat,
- stencilBuffer: !1
- }
- , n = e.getSize();
- t = new a.WebGLRenderTarget(n.width,n.height,i)
- }
- this.renderTarget1 = t,
- this.renderTarget2 = t.clone(),
- this.writeBuffer = this.renderTarget1,
- this.readBuffer = this.renderTarget2,
- this.passes = [],
- void 0 === a.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
- this.copyPass = new a.ShaderPass(a.CopyShader)
- }
- ,
- a.EffectComposer.prototype = {
- swapBuffers: function() {
- var e = this.readBuffer;
- this.readBuffer = this.writeBuffer,
- this.writeBuffer = e
- },
- addPass: function(e) {
- this.passes.push(e)
- },
- insertPass: function(e, t) {
- this.passes.splice(t, 0, e)
- },
- render: function(e) {
- this.writeBuffer = this.renderTarget1,
- this.readBuffer = this.renderTarget2;
- var t, i, n = !1, r = this.passes.length;
- for (i = 0; i < r; i++)
- if ((t = this.passes[i]).enabled) {
- if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, n),
- t.needsSwap) {
- if (n) {
- var o = this.renderer.context;
- o.stencilFunc(o.NOTEQUAL, 1, 4294967295),
- this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
- o.stencilFunc(o.EQUAL, 1, 4294967295)
- }
- this.swapBuffers()
- }
- t instanceof a.MaskPass ? n = !0 : t instanceof a.ClearMaskPass && (n = !1)
- }
- },
- reset: function(e) {
- if (void 0 === e) {
- var t = this.renderer.getSize();
- (e = this.renderTarget1.clone()).setSize(t.width, t.height)
- }
- this.renderTarget1.dispose(),
- this.renderTarget2.dispose(),
- this.renderTarget1 = e,
- this.renderTarget2 = e.clone(),
- this.writeBuffer = this.renderTarget1,
- this.readBuffer = this.renderTarget2
- },
- setSize: function(e, t) {
- this.renderTarget1.setSize(e, t),
- this.renderTarget2.setSize(e, t)
- }
- }
- }
- , {
- three: 217
- }],
- 97: [function(e, t, i) {
- "use strict";
- var n = e("three");
- n.MaskPass = function(e, t) {
- this.scene = e,
- this.camera = t,
- this.enabled = !0,
- this.clear = !0,
- this.needsSwap = !1,
- this.inverse = !1
- }
- ,
- n.MaskPass.prototype = {
- render: function(e, t, i, n) {
- var r, o, a = e.context;
- a.colorMask(!1, !1, !1, !1),
- a.depthMask(!1),
- o = this.inverse ? (r = 0,
- 1) : (r = 1,
- 0),
- a.enable(a.STENCIL_TEST),
- a.stencilOp(a.REPLACE, a.REPLACE, a.REPLACE),
- a.stencilFunc(a.ALWAYS, r, 4294967295),
- a.clearStencil(o),
- e.render(this.scene, this.camera, i, this.clear),
- e.render(this.scene, this.camera, t, this.clear),
- a.colorMask(!0, !0, !0, !0),
- a.depthMask(!0),
- a.stencilFunc(a.EQUAL, 1, 4294967295),
- a.stencilOp(a.KEEP, a.KEEP, a.KEEP)
- }
- },
- n.ClearMaskPass = function() {
- this.enabled = !0
- }
- ,
- n.ClearMaskPass.prototype = {
- render: function(e, t, i, n) {
- var r = e.context;
- r.disable(r.STENCIL_TEST)
- }
- }
- }
- , {
- three: 217
- }],
- 98: [function(e, t, i) {
- "use strict";
- var o = e("three");
- o.RenderPass = function(e, t, i, n, r) {
- this.scene = e,
- this.camera = t,
- this.overrideMaterial = i,
- this.clearColor = n,
- this.clearAlpha = void 0 !== r ? r : 1,
- this.oldClearColor = new o.Color,
- this.oldClearAlpha = 1,
- this.enabled = !0,
- this.clear = !0,
- this.needsSwap = !1
- }
- ,
- o.RenderPass.prototype = {
- render: function(e, t, i, n) {
- this.scene.overrideMaterial = this.overrideMaterial,
- this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
- this.oldClearAlpha = e.getClearAlpha(),
- e.setClearColor(this.clearColor, this.clearAlpha)),
- e.render(this.scene, this.camera, i, this.clear),
- this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
- this.scene.overrideMaterial = null
- }
- }
- }
- , {
- three: 217
- }],
- 99: [function(e, t, i) {
- "use strict";
- var n = e("three");
- n.ShaderPass = function(e, t) {
- this.textureID = void 0 !== t ? t : "tDiffuse",
- e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
- this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
- this.material = new n.ShaderMaterial({
- defines: e.defines || {},
- uniforms: this.uniforms,
- vertexShader: e.vertexShader,
- fragmentShader: e.fragmentShader
- })),
- this.renderToScreen = !1,
- this.enabled = !0,
- this.needsSwap = !0,
- this.clear = !1,
- this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
- this.scene = new n.Scene,
- this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
- this.scene.add(this.quad)
- }
- ,
- n.ShaderPass.prototype = {
- render: function(e, t, i, n) {
- this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
- this.quad.material = this.material,
- this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
- }
- }
- }
- , {
- three: 217
- }],
- 100: [function(e, t, i) {
- "use strict";
- e("three").CopyShader = {
- uniforms: {
- tDiffuse: {
- type: "t",
- value: null
- },
- opacity: {
- type: "f",
- value: 1
- }
- },
- vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
- fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
- }
- }
- , {
- three: 217
- }],
- 101: [function(e, t, i) {
- "use strict";
- e("three").HorizontalBlurShader = {
- uniforms: {
- tDiffuse: {
- type: "t",
- value: null
- },
- h: {
- type: "f",
- value: 1 / 512
- }
- },
- vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
- 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")
- }
- }
- , {
- three: 217
- }],
- 102: [function(e, t, i) {
- "use strict";
- e("three").VerticalBlurShader = {
- uniforms: {
- tDiffuse: {
- type: "t",
- value: null
- },
- v: {
- type: "f",
- value: 1 / 512
- }
- },
- vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
- 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")
- }
- }
- , {
- three: 217
- }],
- 103: [function(e, t, i) {
- "use strict";
- var z = e("three");
- !function() {
- if ("performance"in window == 0 && (window.performance = {}),
- "now"in window.performance == 0) {
- var e = Date.now();
- performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
- window.performance.now = function() {
- return Date.now() - e
- }
- }
- }(),
- z.WebGLRenderer.prototype.paramThreeToGL = function(e) {
- var t, i = this.extensions, n = this.context;
- if (e === z.RepeatWrapping)
- return n.REPEAT;
- if (e === z.ClampToEdgeWrapping)
- return n.CLAMP_TO_EDGE;
- if (e === z.MirroredRepeatWrapping)
- return n.MIRRORED_REPEAT;
- if (e === z.NearestFilter)
- return n.NEAREST;
- if (e === z.NearestMipMapNearestFilter)
- return n.NEAREST_MIPMAP_NEAREST;
- if (e === z.NearestMipMapLinearFilter)
- return n.NEAREST_MIPMAP_LINEAR;
- if (e === z.LinearFilter)
- return n.LINEAR;
- if (e === z.LinearMipMapNearestFilter)
- return n.LINEAR_MIPMAP_NEAREST;
- if (e === z.LinearMipMapLinearFilter)
- return n.LINEAR_MIPMAP_LINEAR;
- if (e === z.UnsignedByteType)
- return n.UNSIGNED_BYTE;
- if (e === z.UnsignedShort4444Type)
- return n.UNSIGNED_SHORT_4_4_4_4;
- if (e === z.UnsignedShort5551Type)
- return n.UNSIGNED_SHORT_5_5_5_1;
- if (e === z.UnsignedShort565Type)
- return n.UNSIGNED_SHORT_5_6_5;
- if (e === z.ByteType)
- return n.BYTE;
- if (e === z.ShortType)
- return n.SHORT;
- if (e === z.UnsignedShortType)
- return n.UNSIGNED_SHORT;
- if (e === z.IntType)
- return n.INT;
- if (e === z.UnsignedIntType)
- return n.UNSIGNED_INT;
- if (e === z.FloatType)
- return n.FLOAT;
- if (null !== (t = i.get("OES_texture_half_float")) && e === z.HalfFloatType)
- return t.HALF_FLOAT_OES;
- if (e === z.AlphaFormat)
- return n.ALPHA;
- if (e === z.RGBFormat)
- return n.RGB;
- if (e === z.RGBAFormat)
- return n.RGBA;
- if (e === z.LuminanceFormat)
- return n.LUMINANCE;
- if (e === z.LuminanceAlphaFormat)
- return n.LUMINANCE_ALPHA;
- if (e === z.AddEquation)
- return n.FUNC_ADD;
- if (e === z.SubtractEquation)
- return n.FUNC_SUBTRACT;
- if (e === z.ReverseSubtractEquation)
- return n.FUNC_REVERSE_SUBTRACT;
- if (e === z.ZeroFactor)
- return n.ZERO;
- if (e === z.OneFactor)
- return n.ONE;
- if (e === z.SrcColorFactor)
- return n.SRC_COLOR;
- if (e === z.OneMinusSrcColorFactor)
- return n.ONE_MINUS_SRC_COLOR;
- if (e === z.SrcAlphaFactor)
- return n.SRC_ALPHA;
- if (e === z.OneMinusSrcAlphaFactor)
- return n.ONE_MINUS_SRC_ALPHA;
- if (e === z.DstAlphaFactor)
- return n.DST_ALPHA;
- if (e === z.OneMinusDstAlphaFactor)
- return n.ONE_MINUS_DST_ALPHA;
- if (e === z.DstColorFactor)
- return n.DST_COLOR;
- if (e === z.OneMinusDstColorFactor)
- return n.ONE_MINUS_DST_COLOR;
- if (e === z.SrcAlphaSaturateFactor)
- return n.SRC_ALPHA_SATURATE;
- if (null !== (t = i.get("WEBGL_compressed_texture_s3tc"))) {
- if (e === z.RGB_S3TC_DXT1_Format)
- return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
- if (e === z.RGBA_S3TC_DXT1_Format)
- return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
- if (e === z.RGBA_S3TC_DXT3_Format)
- return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
- if (e === z.RGBA_S3TC_DXT5_Format)
- return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
- }
- if (null !== (t = i.get("WEBGL_compressed_texture_pvrtc"))) {
- if (e === z.RGB_PVRTC_4BPPV1_Format)
- return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
- if (e === z.RGB_PVRTC_2BPPV1_Format)
- return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
- if (e === z.RGBA_PVRTC_4BPPV1_Format)
- return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
- if (e === z.RGBA_PVRTC_2BPPV1_Format)
- return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
- }
- if (null !== (t = i.get("WEBGL_compressed_texture_etc1")) && e === z.RGB_ETC1_Format)
- return t.COMPRESSED_RGB_ETC1_WEBGL;
- if (null !== (t = i.get("EXT_blend_minmax"))) {
- if (e === z.MinEquation)
- return t.MIN_EXT;
- if (e === z.MaxEquation)
- return t.MAX_EXT
- }
- return 0
- }
- ,
- z.WebGLState = function(l, i, c) {
- var n = this
- , r = new z.Vector4
- , e = l.getParameter(l.MAX_VERTEX_ATTRIBS)
- , o = new Uint8Array(e)
- , a = new Uint8Array(e)
- , s = new Uint8Array(e)
- , t = {}
- , h = null
- , u = null
- , d = null
- , p = null
- , f = null
- , g = null
- , m = null
- , v = null
- , y = !1
- , A = null
- , C = null
- , I = null
- , E = null
- , _ = null
- , b = null
- , w = null
- , T = null
- , x = null
- , S = null
- , M = null
- , R = null
- , P = null
- , O = null
- , L = null
- , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
- , N = void 0
- , F = {}
- , B = new z.Vector4
- , V = null
- , k = null
- , U = new z.Vector4
- , H = new z.Vector4;
- this.init = function() {
- this.clearColor(0, 0, 0, 1),
- this.clearDepth(1),
- this.clearStencil(0),
- this.enable(l.DEPTH_TEST),
- l.depthFunc(l.LEQUAL),
- l.frontFace(l.CCW),
- l.cullFace(l.BACK),
- this.enable(l.CULL_FACE),
- this.enable(l.BLEND),
- l.blendEquation(l.FUNC_ADD),
- l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
- }
- ,
- this.initAttributes = function() {
- for (var e = 0, t = o.length; e < t; e++)
- o[e] = 0
- }
- ,
- this.enableAttribute = function(e) {
- o[e] = 1,
- 0 === a[e] && (l.enableVertexAttribArray(e),
- a[e] = 1),
- 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
- s[e] = 0)
- }
- ,
- this.enableAttributeAndDivisor = function(e, t, i) {
- o[e] = 1,
- 0 === a[e] && (l.enableVertexAttribArray(e),
- a[e] = 1),
- s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
- s[e] = t)
- }
- ,
- this.disableUnusedAttributes = function() {
- for (var e = 0, t = a.length; e < t; e++)
- a[e] !== o[e] && (l.disableVertexAttribArray(e),
- a[e] = 0)
- }
- ,
- this.enable = function(e) {
- !0 !== t[e] && (l.enable(e),
- t[e] = !0)
- }
- ,
- this.disable = function(e) {
- !1 !== t[e] && (l.disable(e),
- t[e] = !1)
- }
- ,
- this.getCompressedTextureFormats = function() {
- if (null === h && (h = [],
- i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
- for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
- h.push(e[t]);
- return h
- }
- ,
- this.setBlending = function(e, t, i, n, r, o, a, s) {
- e === z.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
- e === u && s === y || (e === z.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
- l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
- l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === z.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
- l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
- l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === z.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
- l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
- l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
- l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
- l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
- u = e,
- y = s),
- e === z.CustomBlending ? (r = r || t,
- o = o || i,
- a = a || n,
- t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
- d = t,
- g = r),
- i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
- p = i,
- f = n,
- m = o,
- v = a)) : v = m = g = f = p = d = null
- }
- ,
- this.setDepthFunc = function(e) {
- if (A !== e) {
- if (e)
- switch (e) {
- case z.NeverDepth:
- l.depthFunc(l.NEVER);
- break;
- case z.AlwaysDepth:
- l.depthFunc(l.ALWAYS);
- break;
- case z.LessDepth:
- l.depthFunc(l.LESS);
- break;
- case z.LessEqualDepth:
- l.depthFunc(l.LEQUAL);
- break;
- case z.EqualDepth:
- l.depthFunc(l.EQUAL);
- break;
- case z.GreaterEqualDepth:
- l.depthFunc(l.GEQUAL);
- break;
- case z.GreaterDepth:
- l.depthFunc(l.GREATER);
- break;
- case z.NotEqualDepth:
- l.depthFunc(l.NOTEQUAL);
- break;
- default:
- l.depthFunc(l.LEQUAL)
- }
- else
- l.depthFunc(l.LEQUAL);
- A = e
- }
- }
- ,
- this.setDepthTest = function(e) {
- e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
- }
- ,
- this.setDepthWrite = function(e) {
- C !== e && (l.depthMask(e),
- C = e)
- }
- ,
- this.setColorWrite = function(e) {
- I !== e && (l.colorMask(e, e, e, e),
- I = e)
- }
- ,
- this.setStencilFunc = function(e, t, i) {
- _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
- _ = e,
- b = t,
- w = i)
- }
- ,
- this.setStencilOp = function(e, t, i) {
- T === e && x === t && S === i || (l.stencilOp(e, t, i),
- T = e,
- x = t,
- S = i)
- }
- ,
- this.setStencilTest = function(e) {
- e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
- }
- ,
- this.setStencilWrite = function(e) {
- E !== e && (l.stencilMask(e),
- E = e)
- }
- ,
- this.setFlipSided = function(e) {
- M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
- M = e)
- }
- ,
- this.setLineWidth = function(e) {
- e !== R && (l.lineWidth(e),
- R = e)
- }
- ,
- this.setPolygonOffset = function(e, t, i) {
- e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
- !e || P === t && O === i || (l.polygonOffset(t, i),
- P = t,
- O = i)
- }
- ,
- this.getScissorTest = function() {
- return L
- }
- ,
- this.setScissorTest = function(e) {
- (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
- }
- ,
- this.activeTexture = function(e) {
- void 0 === e && (e = l.TEXTURE0 + D - 1),
- N !== e && (l.activeTexture(e),
- N = e)
- }
- ,
- this.bindTexture = function(e, t) {
- void 0 === N && n.activeTexture();
- var i = F[N];
- void 0 === i && (i = {
- type: void 0,
- texture: void 0
- },
- F[N] = i),
- i.type === e && i.texture === t || (l.bindTexture(e, t),
- i.type = e,
- i.texture = t)
- }
- ,
- this.compressedTexImage2D = function() {
- try {
- l.compressedTexImage2D.apply(l, arguments)
- } catch (e) {
- console.error(e)
- }
- }
- ,
- this.texImage2D = function() {
- try {
- l.texImage2D.apply(l, arguments)
- } catch (e) {
- console.error(e)
- }
- }
- ,
- this.clearColor = function(e, t, i, n) {
- r.set(e, t, i, n),
- !1 === B.equals(r) && (l.clearColor(e, t, i, n),
- B.copy(r))
- }
- ,
- this.clearDepth = function(e) {
- V !== e && (l.clearDepth(e),
- V = e)
- }
- ,
- this.clearStencil = function(e) {
- k !== e && (l.clearStencil(e),
- k = e)
- }
- ,
- this.scissor = function(e) {
- !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
- U.copy(e))
- }
- ,
- this.viewport = function(e) {
- !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
- H.copy(e))
- }
- ,
- this.reset = function() {
- for (var e = 0; e < a.length; e++)
- 1 === a[e] && (l.disableVertexAttribArray(e),
- a[e] = 0);
- t = {},
- N = void 0,
- F = {},
- M = E = C = I = u = h = null
- }
- }
- }
- , {
- three: 217
- }],
- 104: [function(a, h, e) {
- (function(i, e) {
- "use strict";
- function t(e) {
- this.urls = e;
- var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
- this.builder = n.loadProto(t),
- this.decoder = this.builder.build("binary_mesh")
- }
- var s = a("three")
- , n = a("protobufjs")
- , r = a("../util/logger")
- , o = (a("../util/common"),
- a("../util/ajax"))
- , l = a("../objects/Chunk")
- , c = new r(e);
- t.prototype = {
- constructor: t,
- load: function(t, i, n, r) {
- return c.time("download"),
- o.get(t, {
- responseType: "arraybuffer"
- }).done(function(e) {
- c.timeEnd("download"),
- this.parse(e, t, i, n, r)
- }
- .bind(this)).fail(r)
- },
- parse: function(e, t, i, n, r) {
- var o = this.readProtobuf(e);
- if (!o)
- return r();
- try {
- c.time("convert to webgl"),
- this.convertProtobufToSceneObject(o, t, i, n, r),
- c.timeEnd("convert to webgl")
- } catch (e) {
- return c.error("failed parsing .dam"),
- c.error(e.message),
- r()
- }
- },
- readProtobuf: function(e) {
- var t;
- try {
- c.time("parse proto"),
- t = this.decoder.decode(e),
- c.timeEnd("parse proto")
- } catch (e) {
- return c.error("failed parsing proto for .dam"),
- c.error(e.message),
- null
- }
- return t
- },
- convertProtobufToSceneObject: function(e, i, t, n, r) {
- if (0 === e.chunk.length)
- return c.warn("No chunks in damfile..."),
- t([]);
- var o = new s.Matrix4;
- o.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
- var a = e.chunk.map(function(e) {
- var t = new s.BufferGeometry;
- return t.addAttribute("position", new s.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
- 0 < e.vertices.uv.length && t.addAttribute("uv", new s.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
- t.setIndex(new s.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
- t.applyMatrix(o),
- t.computeBoundingBox(),
- new l({
- geometry: t,
- textureName: e.material_name,
- name: e.chunk_name,
- meshUrl: i
- })
- });
- return a ? t(a) : (c.error(".dam protobuf came out with no chunks..."),
- r())
- }
- },
- h.exports = t
- }
- ).call(this, a("buffer").Buffer, "/js/loaders/DamLoader.js")
- }
- , {
- "../objects/Chunk": 144,
- "../util/ajax": 181,
- "../util/common": 185,
- "../util/logger": 189,
- buffer: 198,
- protobufjs: 214,
- three: 217
- }],
- 105: [function(n, r, e) {
- (function(e) {
- "use strict";
- var t = (n("three"),
- n("../settings"),
- n("../util/browser"),
- n("./DamLoader"))
- , i = n("../util/logger")
- , u = (n("../ab"),
- new i(e));
- r.exports = {
- getLoaders: function() {
- return [["_50k", ".dam", t], ["", ".dam", t]]
- },
- load: function(e, t, i, n, r, o) {
- var a = this.getLoaders()[o = o || 0];
- if (a) {
- var s = a[0]
- , l = a[1]
- , c = new a[2](t)
- , h = t.get(e + s + l);
- h ? (u.debug("Trying " + s + l),
- c.load(h, i, n, function() {
- this.load(e, t, i, n, r, ++o)
- }
- .bind(this))) : (u.debug("Skipping " + l + ", not available"),
- this.load(e, t, i, n, r, ++o))
- } else
- r && r("No suitable model file found...")
- }
- }
- }
- ).call(this, "/js/loaders/ModelLoader.js")
- }
- , {
- "../ab": 3,
- "../settings": 166,
- "../util/browser": 182,
- "../util/logger": 189,
- "./DamLoader": 104,
- three: 217
- }],
- 106: [function(i, n, e) {
- (function(e) {
- "use strict";
- var l = i("../util/common")
- , c = i("../util/texture")
- , h = i("../util/browser")
- , t = i("../util/logger")
- , u = i("../settings")
- , d = new t(e);
- n.exports = {
- load: function(i, n) {
- if (!i.chunks[0] || !i.chunks[0].meshUrl)
- return $.when();
- var r = l.countUnique(i.chunks.map(function(e) {
- return e.textureName
- }))
- , e = -1 !== i.chunks[0].meshUrl.indexOf("_50k") ? "_50k" : ""
- , t = "_50k" == e ? "high" : "low";
- u.minimalMemoryMode && "high" === t && (h.detectSamsungS6() ? (d.warn("Galaxy S6 cannot handle large textures, turning down quality."),
- t = "low") : r > u.maxMobileTextures && (d.warn("Model probably too large for mobile, turning down quality."),
- t = "low"));
- var o = i.data.job.uuid + e + "_texture_jpg_" + t + "/"
- , a = $.Deferred()
- , s = 0;
- return i.chunks.forEach(function(e) {
- if (!e.material.map && e.textureName) {
- var t = i.urls.get(o + e.textureName);
- e.setTextureMap(c.load(t, function(e, t) {
- e || (n.push(t),
- s++,
- a.notify(s, r),
- s === r && a.resolve())
- }
- .bind(this, c.isLoaded(t))))
- }
- }),
- a.promise()
- }
- }
- }
- ).call(this, "/js/loaders/ModelTextureLoader.js")
- }
- , {
- "../settings": 166,
- "../util/browser": 182,
- "../util/common": 185,
- "../util/logger": 189,
- "../util/texture": 194
- }],
- 107: [function(s, l, e) {
- (function(n, e) {
- "use strict";
- function t(e) {
- this.model = e,
- this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
- this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
- var t = n("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
- , i = r.loadProto(t);
- this.decoder = i.build("VisionModeldata")
- }
- var r = s("protobufjs")
- , i = s("../util/ajax")
- , o = (s("../util/common"),
- s("../util/math"))
- , a = new (s("../util/logger"))(e);
- t.prototype.load = function() {
- return this.modelDataPath ? (a.info("Using vision.modeldata"),
- this.loadVisionModelData()) : this.sweepLocationsPath ? (a.warn("Using sweep_locations.csv"),
- this.loadSweepLocationsCSV()) : (a.warn("No sweep file found"),
- $.when([]))
- }
- ,
- t.prototype.loadVisionModelData = function() {
- return i.get(this.modelDataPath, {
- responseType: "arraybuffer"
- }).then(function(e) {
- var t;
- try {
- t = this.decoder.decode(e)
- } catch (e) {
- return a.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
- this.loadSweepLocationsCSV()
- }
- var i = t.sweepLocations.map(function(e) {
- return {
- uuid: e.uuid.toUTF8().replace(/-/g, ""),
- position: {
- x: e.pose.translation.x,
- y: e.pose.translation.y,
- z: e.pose.translation.z
- },
- quaternion: {
- x: e.pose.rotation.x,
- y: e.pose.rotation.y,
- z: e.pose.rotation.z,
- w: e.pose.rotation.w
- },
- puck: {
- x: e.puck.x,
- y: e.puck.y,
- z: e.puck.z
- },
- floor: e.group,
- neighbours: e.visibles,
- alignmentType: e.alignment_type
- }
- }).map(function(e) {
- return e.position = o.convertVisionVector(e.position),
- e.quaternion = o.convertVisionQuaternion(e.quaternion),
- e.puck = o.convertVisionVector(e.puck),
- e
- });
- return i.forEach(function(e) {
- e.neighbours = e.neighbours.map(function(e) {
- return i[e].uuid
- })
- }),
- i
- }
- .bind(this), function() {
- return a.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
- this.loadSweepLocationsCSV()
- }
- .bind(this))
- }
- ,
- t.prototype.loadSweepLocationsCSV = function() {
- return i.get(this.sweepLocationsPath).then(function(e) {
- return e.split("\n").map(function(e) {
- return e.split(", ")
- }).filter(function(e) {
- return 1 < e.length
- }).map(function(e) {
- return {
- uuid: e[0],
- position: {
- x: parseFloat(e[1]),
- y: parseFloat(e[2]),
- z: parseFloat(e[3])
- },
- quaternion: {
- x: parseFloat(e[4]),
- y: parseFloat(e[5]),
- z: parseFloat(e[6]),
- w: parseFloat(e[7])
- }
- }
- }).map(function(e) {
- return e.position = o.convertVisionVector(e.position),
- e.quaternion = o.convertVisionQuaternion(e.quaternion),
- e
- })
- }).fail(function() {
- a.warn("Could not load sweep_locations.csv, no sweeps loaded.")
- })
- }
- ,
- l.exports = t
- }
- ).call(this, s("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
- }
- , {
- "../util/ajax": 181,
- "../util/common": 185,
- "../util/logger": 189,
- "../util/math": 190,
- buffer: 198,
- protobufjs: 214
- }],
- 108: [function(s, l, e) {
- (function(e) {
- "use strict";
- function t() {
- this.locale = null
- }
- var i = s("../settings")
- , n = s("../util/common")
- , r = s("../util/logger")
- , o = s("../enum/Locale")
- , a = new r(e);
- t.prototype.init = function() {
- var e;
- switch (i.languageTag) {
- case null:
- case "en":
- case o.EN_US:
- this.locale = o.EN_US,
- e = s("./strings-en-US");
- break;
- case "es":
- case o.ES_MX:
- this.locale = o.ES_MX,
- e = s("./strings-es-MX");
- break;
- case "fr":
- case o.FR_FR:
- this.locale = o.FR_FR,
- e = s("./strings-fr-FR");
- break;
- case "de":
- case o.DE_DE:
- this.locale = o.DE_DE,
- e = s("./strings-de-DE");
- break;
- case "ru":
- case o.RU_RU:
- this.locale = o.RU_RU,
- e = s("./strings-ru-RU");
- break;
- case "cn":
- case o.CN_CN:
- this.locale = o.CN_CN,
- e = s("./strings-cn-CN");
- break;
- case "jp":
- case o.JP_JP:
- this.locale = o.JP_JP,
- e = s("./strings-jp-JP");
- break;
- default:
- a.info("Unsupported language tag, defaulting to 'en-US'"),
- this.locale = o.EN_US,
- e = s("./strings-en-US")
- }
- a.info("Using locale '" + this.locale + "'"),
- n.extendObject(this, e)
- }
- ,
- t.prototype.localizeGUI = function() {
- var e = document.querySelector("#gui-parent");
- this.localizeTree(e),
- this.localizeLoadingText()
- }
- ,
- t.prototype.localizeLoadingText = function() {
- document.querySelector("#help-dialog").classList.add(this.locale),
- document.querySelector("#interaction-modal").classList.add(this.locale),
- document.querySelector("#gui").classList.add(this.locale)
- }
- ,
- t.prototype.localizeTree = function(e) {
- var t, i, n = /{\[{ ?(\w+) ?}\]}/;
- if (e.nodeType === Node.TEXT_NODE)
- (t = e.data.match(n)) && (i = t[1],
- e.data = this.localizeText(i) || i);
- else if (e.nodeType === Node.ELEMENT_NODE) {
- var r = e.getAttribute("title");
- r && ((t = r.match(n)) && (i = t[1],
- e.setAttribute("title", this.localizeText(i) || i)))
- }
- for (e = e.firstChild; e; )
- this.localizeTree(e),
- e = e.nextSibling
- }
- ,
- t.prototype.localizeText = function(e) {
- var t = this[e];
- return t || this.locale === o.EN_US || (a.warn("Localization key '" + e + "' not available for locale '" + this.locale + "', defaulting to English."),
- t = s("./strings-en-US")[e]),
- t || a.warn("Localization key '" + e + "' not available for locale 'en-US'"),
- t
- }
- ,
- l.exports = new t
- }
- ).call(this, "/js/localization/localize.js")
- }
- , {
- "../enum/Locale": 31,
- "../settings": 166,
- "../util/common": 185,
- "../util/logger": 189,
- "./strings-cn-CN": 109,
- "./strings-de-DE": 110,
- "./strings-en-US": 111,
- "./strings-es-MX": 112,
- "./strings-fr-FR": 113,
- "./strings-jp-JP": 114,
- "./strings-ru-RU": 115
- }],
- 109: [function(e, t, i) {
- "use strict";
- t.exports = {
- PAGE_TITLE: "",
- LOADING: "正在加载",
- PRESENTED_BY_CAPS: "呈现者:",
- POWERED_BY: "技术支持:",
- POWERED_BY_CAPS: "技术支持:",
- DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
- MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
- PRESENTED_BY: "呈现者:",
- MORE: "更多 ",
- LESS: "更少 ",
- TAG_CONTENT: "tag™ 内容",
- SHOW: "显示",
- HIDE: "隐藏",
- DOLLHOUSE: "场景屋",
- FLOOR_PLAN: "楼层平面图",
- OPEN_HIGHLIGHTS: "打开精彩片段",
- CLOSE_HIGHLIGHTS: "关闭",
- PREVIOUS: "上一个",
- PLAY: "播放",
- PAUSE: "暂停",
- NEXT: "下一个",
- EXPLORE_3D_SPACE: "探索 3D 空间",
- VIEW_DOLLHOUSE: "观看场景屋",
- SOCIAL_SHARING: "分享这个空间",
- VIEW_IN_VR: "以 VR 观看",
- VIEW_FULLSCREEN: "全屏观看",
- EXIT_FULLSCREEN: " 退出全屏",
- ZOOM_IN: "放大",
- ZOOM_OUT: "缩小",
- FLOOR_NAME: "楼层",
- FLOOR_ALL: "ALL",
- FLOOR_Lang: ["Floor", ""],
- TERMS: "条款",
- PORT_TERMS: "port 条款",
- TERMS_OF_USE: "使用条款",
- CLOSE_TERMS: "关闭",
- TERMS_TEXT_FILE: "terms-cn-CN.html",
- TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
- WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
- WEBVR_ENTER_WEBVR: "进入 VR",
- WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
- WEBVR_LEARN_MORE: "了解更多",
- WEBVR_VIEW_SPACE: "在 VR 中观看空间",
- WEBVR_DAYDREAM_VIEW: "Daydream 视图",
- WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
- WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
- WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
- VR_VIEW_SPACE: "在虚拟现实中观看空间",
- VR_LEARN_MORE_CAPS: "了解更多",
- VR_PREVIOUS_CAPS: "上一个’,",
- VR_NEXT_CAPS: "下一个",
- VR_GOT_IT_CAPS: "明白了",
- VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
- VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
- VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
- VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
- VR_WHAT_YOU_NEED: "关于...您需要什么",
- VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
- VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
- VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
- VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
- VR_GOOGLE_CARDBOARD: "Google Cardboard",
- VR_GOOGLE_DAYDREAM: "Google Daydream",
- VR_APP: "port VR 应用程序",
- VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
- VR_COMPATIBLE_IPHONES_1: "iPhones",
- VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
- VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
- VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
- VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
- VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
- VR_ANDROID_DVICES: "Android 设备",
- VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
- VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
- VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
- VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
- VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
- VR_APP_OPEN: "请使用 port VR 应用程序打开",
- VR_DOWNLOAD_HERE: "在此下载",
- VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
- VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
- VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
- VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
- VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
- SHARE_TO: "分享到",
- SHARE_LINK: "直接链接",
- SHARE_EXPLORE: "探索",
- SHARE_AT: "在",
- SHARE_WITH: "使用",
- SHARE_3D: "以 3D",
- SHARE_COPIED: "已复制!",
- ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
- ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
- ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
- ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
- ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
- ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
- ERROR_GENERIC_ACTIONS_3: " 或",
- ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
- ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
- ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
- ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
- ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
- ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
- ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
- ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
- ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
- ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
- ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
- ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
- ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
- ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
- ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
- ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
- ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
- ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
- LINK_TO_LOCATION: "地点链接",
- MENU_COPY: "复制",
- LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
- ROTATE: "旋转",
- MOVE: "移动",
- INSIDE: "内部",
- ZOOM: "缩放",
- HELP: "小帮手",
- HELP_NAVIGATION_TAB: "导航",
- HELP_MORE_HELP_TAB: "更多帮助",
- HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
- HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
- HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
- HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
- HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
- HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
- HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
- HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
- HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
- HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
- HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
- HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
- HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
- HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
- HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
- HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
- HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
- HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
- HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
- HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
- HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
- HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
- HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
- HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
- HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
- HELP_MORE_HLR_A: "精彩片段集锦",
- HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
- HELP_MORE_DOLLHOUSE_A: "场景屋",
- HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
- HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
- HELP_MORE_FLOORS_A: "楼层选择器",
- HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
- HELP_MORE_TAG_A: "tag™ 贴文",
- HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
- HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
- HELP_MORE_ZOOM_A: "缩放控件",
- HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
- HELP_MORE_TOUR_A: "导览控件",
- HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
- HELP_MORE_INSIDE_A: "内部视图",
- HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
- HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
- HELP_MORE_VR_A: "VR 模式",
- HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
- HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
- HELP_MORE_360_A: "360° 视图",
- HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
- HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
- HELP_MORE_FULLSCREEN_A: "全屏",
- HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
- CLOSE: "关闭"
- }
- }
- , {}],
- 110: [function(e, t, i) {
- "use strict";
- t.exports = {
- PAGE_TITLE: "",
- LOADING: "Lädt",
- PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
- POWERED_BY: "Angetrieben von",
- POWERED_BY_CAPS: "ANGETRIEBEN VON",
- DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
- MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
- PRESENTED_BY: "Präsentiert von ",
- MORE: "Mehr ",
- LESS: "Weniger ",
- TAG_CONTENT: "tag™ Inhalt",
- SHOW: "Anzeigen",
- HIDE: "Verbergen",
- DOLLHOUSE: "Puppenhaus",
- FLOOR_PLAN: "Grundriss",
- OPEN_HIGHLIGHTS: "Highlights anzeigen",
- CLOSE_HIGHLIGHTS: "Schließen",
- PREVIOUS: "Vorheriges",
- PLAY: "Abspielen",
- PAUSE: "Pausieren",
- NEXT: "Nächstes",
- EXPLORE_3D_SPACE: "Innenraum betreten",
- VIEW_DOLLHOUSE: "Puppenhaus ansehen",
- SOCIAL_SHARING: "Teilen Sie diesen Raum",
- VIEW_IN_VR: "In VR ansehen",
- VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
- EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
- ZOOM_IN: "Vergrößern",
- ZOOM_OUT: "Verkleinern",
- FLOOR_NAME: "Etage ",
- FLOOR_ALL: "Alle",
- TERMS: "Bedingungen",
- PORT_TERMS: "port Bedingungen",
- TERMS_OF_USE: "Nutzungsbedingungen",
- TERMS_TEXT_FILE: "terms-de-DE.html",
- CLOSE_TERMS: "Schließen",
- TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
- HELP: "Hilfe",
- HELP_NAVIGATION_TAB: "Navigation",
- HELP_MORE_HELP_TAB: "Hilfe-Details",
- CLOSE: "Schließen",
- HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
- HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
- HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
- HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
- HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
- HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
- HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
- HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
- HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
- 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.",
- HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
- HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
- 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.",
- HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
- HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
- HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
- HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
- HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
- HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
- HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
- HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
- HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
- HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
- HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
- HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
- HELP_MORE_HLR_A: "Liste das Highlight",
- HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
- HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
- HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
- HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
- HELP_MORE_FLOORS_A: "Etage auswählen",
- HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
- HELP_MORE_TAG_A: "tag™ Posts",
- HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
- HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
- HELP_MORE_ZOOM_A: "Zoom Steuerung",
- HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
- HELP_MORE_TOUR_A: "Tour Steuerung",
- HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
- HELP_MORE_INSIDE_A: "Innenansicht",
- HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
- HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
- HELP_MORE_VR_A: "VR Modus",
- HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
- HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
- HELP_MORE_360_A: "360° Views Ansicht ",
- HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
- HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
- HELP_MORE_FULLSCREEN_A: "Vollbild",
- HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
- WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
- WEBVR_FOR_DAYDREAM: "Für Daydream View",
- WEBVR_ENTER_WEBVR: "Starten Sie VR",
- WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
- WEBVR_LEARN_MORE: "Mehr Infos",
- WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
- WEBVR_DAYDREAM_VIEW: "Daydream View",
- WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
- WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
- VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
- VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
- VR_GOOGLE_DAYDREAM: "Google Daydream",
- VR_APP: "port VR App",
- VR_APP_OPEN: "Oder öffnen Sie die port VR App",
- 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",
- VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
- VR_APP_FOR_ANDROID: "port VR app für Android",
- VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
- VR_VIEW_SPACE: "Ansicht des Raumes in VR",
- VR_LEARN_MORE_CAPS: "MEHR INFOS",
- VR_PREVIOUS_CAPS: "ZURÜCK",
- VR_NEXT_CAPS: "WEITER",
- VR_GOT_IT_CAPS: "VERSTANDEN",
- VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
- VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
- VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
- VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
- VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
- VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
- VR_GOOGLE_CARDBOARD: "Google Cardboard",
- VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
- VR_COMPATIBLE_IPHONES_1: "iPhones",
- VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
- VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
- VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
- VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
- VR_ANDROID_DVICES: "Android Geräte",
- VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
- VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
- VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
- VR_DOWNLOAD_HERE: "Hier runterladen",
- VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
- VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
- VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
- VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
- VR_ANDROID_OPTIONS: "VR Headset Optionen",
- SHARE_TO: "Teilen auf",
- SHARE_LINK: "Direkter Link",
- SHARE_EXPLORE: "Umsehen",
- SHARE_AT: "auf",
- SHARE_WITH: "mit",
- SHARE_3D: "in 3D",
- SHARE_COPIED: "Kopiert!",
- ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
- ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
- ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
- ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
- ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
- ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
- ERROR_GENERIC_ACTIONS_3: " oder ",
- ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
- ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
- ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
- ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
- ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
- ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
- ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
- ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
- ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
- ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
- ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
- ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
- ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
- ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
- ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
- ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
- ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
- ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
- LINK_TO_LOCATION: "Link zu",
- MENU_COPY: "Kopieren",
- LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
- ROTATE: "Drehen",
- INSIDE: "Drinnen",
- MOVE: "Bewegen",
- ZOOM: "Vergrößern"
- }
- }
- , {}],
- 111: [function(e, t, i) {
- "use strict";
- t.exports = {
- PAGE_TITLE: "",
- LOADING: "Loading",
- PRESENTED_BY_CAPS: "PRESENTED BY",
- POWERED_BY: "powered by ",
- POWERED_BY_CAPS: "POWERED BY",
- DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
- MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
- PRESENTED_BY: "Presented by ",
- MORE: "More ",
- LESS: "Less ",
- TAG_CONTENT: "tag™ Content",
- SHOW: "Show",
- HIDE: "Hide",
- DOLLHOUSE: "Dollhouse",
- FLOOR_PLAN: "Floor plan",
- OPEN_HIGHLIGHTS: "Open Highlights",
- CLOSE_HIGHLIGHTS: "Close",
- PREVIOUS: "Previous",
- PLAY: "Play",
- PAUSE: "Pause",
- NEXT: "Next",
- EXPLORE_3D_SPACE: "Explore 3D Space",
- VIEW_DOLLHOUSE: "View dollhouse",
- SOCIAL_SHARING: "Share this Space",
- VIEW_IN_VR: "View in VR",
- VIEW_FULLSCREEN: "全屏",
- EXIT_FULLSCREEN: "退出全屏",
- ZOOM_IN: "Zoom in",
- ZOOM_OUT: "Zoom out",
- FLOOR_NAME: "Floor ",
- FLOOR_ALL: "全部",
- TERMS: "Terms",
- PORT_TERMS: "port terms",
- TERMS_OF_USE: "Terms of Use",
- TERMS_TEXT_FILE: "terms-en-US.html",
- CLOSE_TERMS: "Close",
- TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
- HELP: "Help",
- HELP_NAVIGATION_TAB: "Navigation",
- HELP_MORE_HELP_TAB: "More Help",
- CLOSE: "Close",
- HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
- HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
- HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
- HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
- HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
- HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
- HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
- HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
- HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
- HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
- HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
- HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
- HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
- HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
- HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
- HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
- HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
- HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
- HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
- HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
- HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
- HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
- HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
- HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
- HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
- HELP_MORE_HLR_A: "Highlight Reel",
- HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
- HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
- HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
- HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
- HELP_MORE_FLOORS_A: "Floor Selector",
- HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
- HELP_MORE_TAG_A: "tag™ Posts",
- HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
- HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
- HELP_MORE_ZOOM_A: "Zoom Controls",
- HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
- HELP_MORE_TOUR_A: "Tour Controls",
- HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
- HELP_MORE_INSIDE_A: "Inside View",
- HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
- HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
- HELP_MORE_VR_A: "VR Mode",
- HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
- HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
- HELP_MORE_360_A: "360° Views",
- HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
- HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
- HELP_MORE_FULLSCREEN_A: "Full screen",
- HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
- WEBVR_FOR_CARDBOARD: "For Google Cardboard",
- WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
- WEBVR_FOR_DAYDREAM: "For Daydream View",
- WEBVR_ENTER_WEBVR: "ENTER VR",
- WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
- WEBVR_LEARN_MORE: "Learn more",
- WEBVR_VIEW_SPACE: "View Space in VR",
- WEBVR_DAYDREAM_VIEW: "Daydream View",
- WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
- VR_VIEW_SPACE: "View Space in Virtual Reality",
- VR_LEARN_MORE_CAPS: "LEARN MORE",
- VR_PREVIOUS_CAPS: "PREVIOUS",
- VR_NEXT_CAPS: "NEXT",
- VR_GOT_IT_CAPS: "GOT IT",
- VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
- VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
- VR_SHOW_IOS_1: "Tap to view the space in VR",
- VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
- VR_WHAT_YOU_NEED: "What You'll Need For...",
- VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
- VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
- VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
- VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
- VR_GOOGLE_CARDBOARD: "Google Cardboard",
- VR_GOOGLE_DAYDREAM: "Google Daydream",
- VR_APP: "port VR App",
- VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
- VR_COMPATIBLE_IPHONES_1: "iPhones",
- VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
- VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
- VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
- VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
- VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
- VR_ANDROID_DVICES: "Android Devices",
- VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
- VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
- VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
- VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
- VR_APP_FOR_ANDROID: "port VR app for Android Phones",
- VR_APP_OPEN: "Open with the port VR app instead",
- VR_DOWNLOAD_HERE: "Download here",
- VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
- VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
- VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
- VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
- VR_ANDROID_OPTIONS: "Available VR Headset Options",
- SHARE_TO: "Share to",
- SHARE_LINK: "Direct Link",
- SHARE_EXPLORE: "Explore ",
- SHARE_AT: "at",
- SHARE_WITH: "with",
- SHARE_3D: " in 3D",
- SHARE_COPIED: "Copied!",
- ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
- ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
- ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
- ERROR_GENERIC_SOLUTION: "Restart your browser.",
- ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
- ERROR_GENERIC_ACTIONS_2: "install a supported browser",
- ERROR_GENERIC_ACTIONS_3: " or ",
- ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
- ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
- ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
- ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
- ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
- ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
- ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
- ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
- ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
- ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
- ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
- ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
- ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
- ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
- ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
- ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
- ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
- ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
- LINK_TO_LOCATION: "Link to location",
- MENU_COPY: "Copy",
- LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
- ROTATE: "Rotate",
- INSIDE: "Inside",
- MOVE: "Move",
- ZOOM: "Zoom"
- }
- }
- , {}],
- 112: [function(e, t, i) {
- "use strict";
- t.exports = {
- PAGE_TITLE: "",
- LOADING: "Cargando",
- PRESENTED_BY_CAPS: "PRESENTADO POR",
- POWERED_BY: "potenciando por ",
- POWERED_BY_CAPS: "POTENCIADO POR ",
- DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
- MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
- PRESENTED_BY: "Presentado por ",
- MORE: "Más ",
- LESS: "Menos ",
- TAG_CONTENT: "Contenido de tag™",
- SHOW: "Mostrar",
- HIDE: "Ocultar",
- DOLLHOUSE: "Dollhouse",
- FLOOR_PLAN: "Planos",
- OPEN_HIGHLIGHTS: "Aspectos Destacados",
- CLOSE_HIGHLIGHTS: "Cerrar",
- PREVIOUS: "Anterior",
- PLAY: "Play",
- PAUSE: "Pausa",
- NEXT: "Siguiente",
- EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
- VIEW_DOLLHOUSE: "Ver dollhouse",
- SOCIAL_SHARING: "Compartir este espacio",
- VIEW_IN_VR: "Ver en realidad virtual",
- VIEW_FULLSCREEN: "Ver en pantalla completa",
- EXIT_FULLSCREEN: "Salir de pantalla completa",
- ZOOM_IN: "Acercar",
- ZOOM_OUT: "Alejar",
- FLOOR_NAME: "Piso ",
- FLOOR_ALL: "Todas",
- TERMS: "Condiciones",
- PORT_TERMS: "port términos de uso",
- TERMS_OF_USE: "Términos de uso",
- TERMS_TEXT_FILE: "terms-es-MX.html",
- CLOSE_TERMS: "Cerrar",
- 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.",
- HELP: "Ayuda",
- HELP_NAVIGATION_TAB: "Navegación",
- HELP_MORE_HELP_TAB: "Más Ayuda",
- CLOSE: "Cerrar",
- HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
- HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
- HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
- HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
- HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
- HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
- HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
- HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
- HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
- HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
- HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
- HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
- 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.",
- HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
- HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
- HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
- HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
- HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
- HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
- HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
- HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
- HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
- HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
- HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
- HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
- HELP_MORE_HLR_A: "Galería destacada",
- HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
- HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
- HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
- HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
- HELP_MORE_FLOORS_A: "Seleccionador de plantas",
- HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
- HELP_MORE_TAG_A: "tag™ Posts",
- HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
- HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
- HELP_MORE_ZOOM_A: "Controles de zoom",
- HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
- HELP_MORE_TOUR_A: "Controles de recorrido",
- HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
- HELP_MORE_INSIDE_A: "Vista interior",
- HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
- HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
- HELP_MORE_VR_A: "Modo de realidad virtual",
- HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
- HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
- HELP_MORE_360_A: "360° Views",
- HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
- HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
- HELP_MORE_FULLSCREEN_A: "Pantalla completa",
- HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
- WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
- WEBVR_FOR_DAYDREAM: "Para Daydream View",
- WEBVR_ENTER_WEBVR: "ENTRAR VR",
- WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
- WEBVR_LEARN_MORE: "Más información",
- WEBVR_VIEW_SPACE: "Ver Espacio en VR",
- WEBVR_DAYDREAM_VIEW: "Daydream View",
- WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
- WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
- VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
- VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
- VR_GOOGLE_DAYDREAM: "Daydream de Google",
- VR_APP: "port VR App",
- VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
- VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
- VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
- VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
- VR_LEARN_MORE_CAPS: "SABER MÁS",
- VR_PREVIOUS_CAPS: "ANTERIOR",
- VR_NEXT_CAPS: "SIGUIENTE",
- VR_GOT_IT_CAPS: "COMPRENDIDO",
- VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
- VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
- VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
- VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
- VR_WHAT_YOU_NEED: "Lo que necesitaras...",
- VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
- VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
- VR_GOOGLE_CARDBOARD: "Google Cardboard",
- VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
- VR_COMPATIBLE_IPHONES_1: "iPhones",
- VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
- VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
- VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
- VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
- VR_ANDROID_DVICES: "Dispositivos Android",
- VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
- VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
- VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
- VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
- VR_DOWNLOAD_HERE: "Descargar aquí",
- VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
- VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
- VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
- VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
- VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
- SHARE_TO: "Compartir en",
- SHARE_LINK: "Enlace directo",
- SHARE_EXPLORE: "Explorar ",
- SHARE_AT: "en",
- SHARE_WITH: "con",
- SHARE_3D: " en 3D",
- SHARE_COPIED: "¡Copiado!",
- ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
- ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
- ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
- ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
- ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
- ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
- ERROR_GENERIC_ACTIONS_3: " o ",
- ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
- ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
- ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
- ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
- ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
- ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
- ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
- ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
- ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
- ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
- ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
- ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
- ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
- ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
- ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
- ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
- ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
- ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
- LINK_TO_LOCATION: "Enlace a la ubicación",
- MENU_COPY: "Copiar",
- LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
- ROTATE: "Girar",
- INSIDE: "Interior",
- MOVE: "Moverse",
- ZOOM: "Acercar o alejar"
- }
- }
- , {}],
- 113: [function(e, t, i) {
- "use strict";
- t.exports = {
- PAGE_TITLE: "",
- LOADING: "Chargement",
- PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
- POWERED_BY: "alimenté par ",
- POWERED_BY_CAPS: "ALIMENTÉ PAR",
- DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
- MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
- PRESENTED_BY: "Présenté par ",
- MORE: "Plus ",
- LESS: "Moins ",
- TAG_CONTENT: "Contenu tag™",
- SHOW: "Montrer",
- HIDE: "Cacher",
- DOLLHOUSE: "Dollhouse",
- FLOOR_PLAN: "Plan de sol",
- OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
- CLOSE_HIGHLIGHTS: "Fermer",
- PREVIOUS: "Précédent",
- PLAY: "Lecture",
- PAUSE: "Pause",
- NEXT: "Suivant",
- EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
- VIEW_DOLLHOUSE: "Voir dollhouse",
- SOCIAL_SHARING: "Partager cet espace",
- VIEW_IN_VR: "Voir en VR",
- VIEW_FULLSCREEN: "Plein écran",
- EXIT_FULLSCREEN: "Fermer plein écran",
- ZOOM_IN: "Zoom avant",
- ZOOM_OUT: "Zoom arrière",
- FLOOR_NAME: "Étage ",
- FLOOR_ALL: "Tous",
- TERMS: "Mentions légales",
- PORT_TERMS: "port mentions légales",
- TERMS_OF_USE: "Conditions d'utilisation",
- TERMS_TEXT_FILE: "terms-fr-FR.html",
- CLOSE_TERMS: "Fermer",
- TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
- HELP: "Aide",
- HELP_NAVIGATION_TAB: "Navigation",
- HELP_MORE_HELP_TAB: "Aide",
- CLOSE: "Fermer",
- HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
- HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
- HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
- HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
- HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
- HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
- HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
- HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
- HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
- HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
- HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
- HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
- HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
- HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
- HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
- HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
- HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
- HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
- HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
- HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
- HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
- HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
- HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
- HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
- HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
- HELP_MORE_HLR_A: "Carrousel",
- HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
- HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
- HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
- HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
- HELP_MORE_FLOORS_A: "Sélecteur d’étage",
- HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
- HELP_MORE_TAG_A: "tag™ Posts",
- HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
- HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
- HELP_MORE_ZOOM_A: "Commandes de zoom",
- HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
- HELP_MORE_TOUR_A: "Commandes de la visite",
- HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
- HELP_MORE_INSIDE_A: "Vue intérieure",
- HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
- HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
- HELP_MORE_VR_A: "Mode RV",
- HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
- HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
- HELP_MORE_360_A: "Vues 360°",
- HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
- HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
- HELP_MORE_FULLSCREEN_A: "Plein écran",
- HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
- WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
- WEBVR_FOR_DAYDREAM: "Pour Daydream View",
- WEBVR_ENTER_WEBVR: "ENTRER VR",
- WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
- WEBVR_LEARN_MORE: "En savoir plus",
- WEBVR_VIEW_SPACE: "Voir Espace en VR",
- WEBVR_DAYDREAM_VIEW: "Daydream View",
- WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
- WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
- VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
- VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
- VR_PREVIOUS_CAPS: "PRÉCÉDENT",
- VR_NEXT_CAPS: "SUIVANT",
- VR_GOT_IT_CAPS: "BIEN COMPRIS",
- VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
- VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
- VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
- VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
- VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
- VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
- VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
- VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
- VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
- VR_GOOGLE_CARDBOARD: "Google Cardboard",
- VR_GOOGLE_DAYDREAM: "Google Daydream",
- VR_APP: "port VR App",
- VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
- VR_COMPATIBLE_IPHONES_1: "iPhones",
- VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
- VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
- VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
- 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",
- VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
- VR_ANDROID_DVICES: "Appareils Android",
- VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
- VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
- VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
- VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
- VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
- VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
- VR_DOWNLOAD_HERE: "Télécharger ici",
- VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
- VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
- VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
- VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
- VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
- SHARE_TO: "Partager sur",
- SHARE_LINK: "Lien direct",
- SHARE_EXPLORE: "Explorer ",
- SHARE_AT: "à",
- SHARE_WITH: "avec",
- SHARE_3D: " en 3D",
- SHARE_COPIED: "Copié!",
- ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
- ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
- ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
- ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
- ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
- ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
- ERROR_GENERIC_ACTIONS_3: " ou ",
- ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
- ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
- ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
- ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
- ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
- ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
- ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
- ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
- ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
- ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
- ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
- ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
- ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
- ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
- ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
- ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
- ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
- ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
- LINK_TO_LOCATION: "Lien vers l'emplacement",
- MENU_COPY: "Copie",
- LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
- ROTATE: "Faire pivoter",
- INSIDE: "Intérieure",
- MOVE: "Se déplacer",
- ZOOM: "Zoom"
- }
- }
- , {}],
- 114: [function(e, t, i) {
- "use strict";
- t.exports = {
- PAGE_TITLE: "",
- LOADING: "読み込み中",
- PRESENTED_BY_CAPS: "PRESENTED BY",
- POWERED_BY: "powered by",
- POWERED_BY_CAPS: "POWERED BY",
- DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
- MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
- PRESENTED_BY: "Presented by ",
- MORE: "全て表示 ",
- LESS: "閉じる ",
- TAG_CONTENT: "tag™コンテンツ ",
- SHOW: "表示",
- HIDE: "非表示",
- DOLLHOUSE: "ドールハウス",
- FLOOR_PLAN: "フロアプラン",
- OPEN_HIGHLIGHTS: "ハイライトを開く",
- CLOSE_HIGHLIGHTS: "閉じる",
- PREVIOUS: "前へ",
- PLAY: "再生",
- PAUSE: "一時停止",
- NEXT: "次へ",
- EXPLORE_3D_SPACE: "3DSpaceの探索",
- VIEW_DOLLHOUSE: "ドールハウスの表示",
- SOCIAL_SHARING: "このSpaceを共有する",
- VIEW_IN_VR: "VRで表示",
- VIEW_FULLSCREEN: "フルスクリーン表示",
- EXIT_FULLSCREEN: "フルスクリーン表示を終了",
- ZOOM_IN: "ズームイン",
- ZOOM_OUT: "ズームアウト",
- FLOOR_NAME: "フロア ",
- FLOOR_ALL: "すべて",
- TERMS: "規約",
- PORT_TERMS: "port規約",
- TERMS_OF_USE: "利用規約",
- CLOSE_TERMS: "閉じる",
- TERMS_TEXT_FILE: "terms-jp-JP.html",
- TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
- WEBVR_FOR_DAYDREAM: "Daydream View用",
- WEBVR_ENTER_WEBVR: "VRに入る",
- WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
- WEBVR_LEARN_MORE: "もっと詳しく",
- WEBVR_VIEW_SPACE: "VRでSpaceを表示",
- WEBVR_DAYDREAM_VIEW: "Daydream View",
- WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
- WEBVR_FOR_CARDBOARD: "Google Cardboard用",
- WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
- VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
- VR_LEARN_MORE_CAPS: "もっと詳しく",
- VR_PREVIOUS_CAPS: "前へ",
- VR_NEXT_CAPS: "次へ",
- VR_GOT_IT_CAPS: "了解",
- VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
- VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
- VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
- VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
- VR_WHAT_YOU_NEED: "必要なもの",
- VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
- VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
- VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
- VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
- VR_GOOGLE_CARDBOARD: "Google Cardboard",
- VR_GOOGLE_DAYDREAM: "Google Daydream",
- VR_APP: "port VRアプリ",
- VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
- VR_COMPATIBLE_IPHONES_1: "iPhone",
- VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
- VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
- VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
- VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
- VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
- VR_ANDROID_DVICES: "Androidデバイス",
- VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
- VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
- VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
- VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
- VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
- VR_APP_OPEN: "port VRアプリで開く",
- VR_DOWNLOAD_HERE: "ここからダウンロード",
- VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
- VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
- VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
- VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
- VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
- SHARE_TO: "共有先",
- SHARE_LINK: "ダイレクトリンク",
- SHARE_EXPLORE: "探索",
- SHARE_AT: "場所",
- SHARE_WITH: "使用アプリ",
- SHARE_3D: "3Dで",
- SHARE_COPIED: "コピーされました!",
- ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
- ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
- ERROR_GENERIC_PROBLEM: "問題が発生しました。",
- ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
- ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
- ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
- ERROR_GENERIC_ACTIONS_3: "または",
- ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
- ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
- ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
- ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
- ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
- ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
- ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
- ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
- ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
- ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
- ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
- ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
- ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
- ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
- ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
- ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
- ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
- ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
- LINK_TO_LOCATION: "ロケーションへのリンク",
- MENU_COPY: "コピー",
- LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
- ROTATE: "回転",
- MOVE: "移動",
- INSIDE: "内側",
- ZOOM: "ズーム",
- HELP: "ヘルプ",
- HELP_NAVIGATION_TAB: "ナビゲーション",
- HELP_MORE_HELP_TAB: "その他のヘルプ",
- HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
- HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
- HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
- HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
- HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
- HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
- HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
- HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
- HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
- HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
- HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
- HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
- HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
- HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
- HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
- HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
- HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
- HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
- HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
- HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
- HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
- HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
- HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
- HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
- HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
- HELP_MORE_HLR_A: "ハイライト",
- HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
- HELP_MORE_DOLLHOUSE_A: "ドールハウス",
- HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
- HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
- HELP_MORE_FLOORS_A: "フロアセレクター",
- HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
- HELP_MORE_TAG_A: "tag™ Posts",
- HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
- HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
- HELP_MORE_ZOOM_A: "ズームコントロール",
- HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
- HELP_MORE_TOUR_A: "ツアーコントロール",
- HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
- HELP_MORE_INSIDE_A: "内側ビュー",
- HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
- HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
- HELP_MORE_VR_A: "VRモード",
- HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
- HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
- HELP_MORE_360_A: "360° Views",
- HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
- HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
- HELP_MORE_FULLSCREEN_A: "フルスクリーン",
- HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
- CLOSE: "閉じる"
- }
- }
- , {}],
- 115: [function(e, t, i) {
- "use strict";
- t.exports = {
- PAGE_TITLE: "",
- LOADING: "Загрузка",
- PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
- POWERED_BY: "разработано на платформе ",
- POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
- DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
- MOBILE_SHORT_CTA: "Нажмите для просмотра.",
- PRESENTED_BY: "Представлено ",
- MORE: "Больше ",
- LESS: "Меньше ",
- TAG_CONTENT: "tag™ Контент",
- SHOW: "Показать",
- HIDE: "Скрыть",
- DOLLHOUSE: "Dollhouse",
- FLOOR_PLAN: "Планировка",
- OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
- CLOSE_HIGHLIGHTS: "Закрыть",
- PREVIOUS: "Предыдущий",
- PLAY: "Воспроизвести",
- PAUSE: "Пауза",
- NEXT: "Следующий",
- EXPLORE_3D_SPACE: "Просмотреть 3D модель",
- VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
- SOCIAL_SHARING: "Поделиться этой моделью",
- VIEW_IN_VR: "Посмотреть в VR",
- VIEW_FULLSCREEN: "Полный экран",
- EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
- ZOOM_IN: "Увеличить",
- ZOOM_OUT: "Уменьшить",
- FLOOR_NAME: "Этаж ",
- FLOOR_ALL: "Все",
- TERMS: "Условия",
- PORT_TERMS: "Правила пользования",
- TERMS_OF_USE: "Условия использования",
- TERMS_TEXT_FILE: "terms-ru-RU.html",
- CLOSE_TERMS: "Закрыть",
- TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
- HELP: "Помощь",
- HELP_NAVIGATION_TAB: "Навигация",
- HELP_MORE_HELP_TAB: "Доп. Помощь",
- CLOSE: "Закрыть",
- HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
- HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
- HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
- HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
- HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
- HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
- HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
- HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
- HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
- HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
- HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
- HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
- HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
- HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
- HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
- HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
- HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
- HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
- HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
- HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
- HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
- HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
- HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
- HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
- HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
- HELP_MORE_HLR_A: "Фотоколлаж",
- HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
- HELP_MORE_DOLLHOUSE_A: "Dollhouse",
- HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
- HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
- HELP_MORE_FLOORS_A: "Выбор Этажа",
- HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
- HELP_MORE_TAG_A: "tag™ Posts",
- HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
- HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
- HELP_MORE_ZOOM_A: "Масштаб",
- HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
- HELP_MORE_TOUR_A: "Управление Туром",
- HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
- HELP_MORE_INSIDE_A: "Вид Изнутри",
- HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
- HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
- HELP_MORE_VR_A: "Режим VR",
- HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
- HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
- HELP_MORE_360_A: "360° Views",
- HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
- HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
- HELP_MORE_FULLSCREEN_A: "Полный экран",
- HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
- WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
- WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
- WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
- WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
- WEBVR_LEARN_MORE: "Узнать больше",
- WEBVR_VIEW_SPACE: "Запустить модель в VR",
- WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
- WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
- WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
- VR_WHAT_YOU_NEED: "Что Вам потребуется...",
- VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
- VR_GOOGLE_DAYDREAM: "Google Daydream",
- VR_APP: "port VR App",
- VR_APP_OPEN: "Или открыть через приложение port VR",
- VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
- VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
- VR_APP_FOR_ANDROID: "Приложение port VR для Android",
- VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
- VR_VIEW_SPACE: "Запустить модель в VR",
- VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
- VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
- VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
- VR_GOT_IT_CAPS: "ЯСНО",
- VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
- VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
- VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
- VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
- VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
- VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
- VR_GOOGLE_CARDBOARD: "Google Cardboard",
- VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
- VR_COMPATIBLE_IPHONES_1: "iPhones",
- VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
- VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
- VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
- VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
- VR_ANDROID_DVICES: "Android устройства",
- VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
- VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
- VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
- VR_DOWNLOAD_HERE: "Скачать здесь",
- VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
- VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
- VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
- VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
- VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
- SHARE_TO: "Поделиться",
- SHARE_LINK: "Прямая ссылка",
- SHARE_EXPLORE: "просмотреть",
- SHARE_AT: "на",
- SHARE_WITH: "с",
- SHARE_3D: "в 3D",
- SHARE_COPIED: "Скопировано!",
- ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
- ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
- ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
- ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
- ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
- ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
- ERROR_GENERIC_ACTIONS_3: " или ",
- ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
- ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
- ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
- ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
- ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
- ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
- ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
- ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
- ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
- ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
- ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
- ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
- ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
- ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
- ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
- ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
- ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
- ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
- LINK_TO_LOCATION: "Ссылка на местоположение",
- MENU_COPY: "Копировать",
- LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
- ROTATE: "Вращать",
- MOVE: "Передвигаться",
- INSIDE: "Вид изнутри",
- ZOOM: "Масштаб"
- }
- }
- , {}],
- 116: [function(r, e, t) {
- (function(i) {
- "use strict";
- function re(e) {
- console.log("e1:" + e),
- e = Math.round(.4 * e * 100),
- console.log("e2:" + e);
- var t = $(".progressbar");
- t.find(".bar").css("width", e + "%"),
- t.find(".label").css("left", t.width() * e / 100 - 15 + "px"),
- t.find(".perc").text(e + "%")
- }
- $("#gui-loading").fadeIn(200),
- re(.1);
- var e = g_version ? "modeldata.js" : "someData.json";
- $.ajax(g_Prefix + "data/" + window.number + "/" + e + "?" + randomTime().getTime(), {
- dataType: "json"
- }).done(function(e) {
- var t = matcher(e);
- t.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}", window.number),
- t.user = {
- is_authenticated: !1,
- 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"]
- }
-
-
- try{//处理一下导览数据,旧的曾有导览数据是错误的,将它删除
- var newImages = [];
- t.model.images.forEach((tourImg)=>{tourImg.thumbnail_signed_src && newImages.push(tourImg)})
- t.model.images = newImages
-
- }catch(e){console.log(e) }
-
-
- window.MP_PREFETCHED_MODELDATA = t
-
- t.model.summary = t.summary
- t.model.name = t.name
- for(let i in t){
- t[i] == "false" && (t[i] = false)
- }
-
- re(.7),
- function() {
- function y(e) {
- t.update(e)
- }
- function A(e, t) {
- ne.error(t),
- n.error(t),
- N.report(e, "error-" + t)
- }
- function C(e, t, i) {
- try {
- e.start(t)
- } catch (e) {
- throw ne.warn(e.message),
- function(e) {
- var t = O.details();
- t && "Safari" === t.name && 500 < t.version && t.version < 600 ? (n.error("webgl-safari"),
- N.report(e, "error-webgl-safari")) : (n.error("webgl-generic"),
- N.report(e, "error-webgl-generic"))
- }(i.sid),
- e
- }
- }
- function I(e) {
- e.stopPropagation(),
- e.preventDefault()
- }
- window.MP_PREFETCHED_MODELDATA.hoticon && (g_HotImage = {
- point: window.MP_PREFETCHED_MODELDATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
- point2: window.MP_PREFETCHED_MODELDATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
- });
-
-
-
- /* window.MP_PREFETCHED_MODELDATA.backgroundMusic ? (g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic,
- $("#volume").show()) : "one" === g_version && (g_bgAudio.src = g_Prefix + "/audio/audio" + window.number + "/background.mp3");
- */
-
- if (window.MP_PREFETCHED_MODELDATA.backgroundMusic) {
- if(window.isLocal) g_bgAudio.src = manage.dealURL(window.MP_PREFETCHED_MODELDATA.backgroundMusic) ;
- else g_bgAudio.src = window.MP_PREFETCHED_MODELDATA.backgroundMusic.substr(0,4)=="http" ? window.MP_PREFETCHED_MODELDATA.backgroundMusic : "//" + window.MP_PREFETCHED_MODELDATA.backgroundMusic;
-
- $("#volume").show();
- }else if (g_version === "one"){
- g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
-
- //g_bgAudio.src = manage.dealURL(src) ;
- }
-
- //隐藏公司logo
- window.MP_PREFETCHED_MODELDATA.loadlogo && showLogo();
-
- r("./lib/three75-shim"),
- r("./lib/array-polyfill"),
- r("./lib/performance-polyfill"),
- r("./lib/shaders/CopyShader.js"),
- r("./lib/shaders/HorizontalBlurShader.js"),
- r("./lib/shaders/VerticalBlurShader.js"),
- r("./lib/postprocessing/EffectComposer.js"),
- r("./lib/postprocessing/RenderPass.js"),
- r("./lib/postprocessing/MaskPass.js"),
- r("./lib/postprocessing/ShaderPass.js"),
- window.Promise || (window.Promise = r("promise-polyfill"));
- var E = r("three")
- , _ = r("three")
- , b = (r("./util/sentry"),
- r("./player"))
- , w = r("./director")
- , T = r("./controls/CameraControls")
- , x = r("./model/ModelManager")
- , S = r("./DisplayController")
- , M = r("./label/LabelDisplayController")
- , R = r("./enum/Viewmode")
- , e = r("./util/logger")
- , P = r("./showcase")
- , O = r("./util/browser")
- , L = r("./settings")
- , D = r("./gui/gui")
- , n = r("./gui/error")
- , N = r("./analytics")
- , F = r("./util/transitions")
- , B = r("./effects")
- , V = r("./objects/Skybox")
- , k = (r("./util/common"),
- r("./util/PanoramaCollection"),
- r("./util/math"),
- r("./util/showcase"))
- , U = r("./util/camera")
- , H = (r("./objects/Panorama"),
- r("./cameras/PanoramaCamera"),
- r("./preloaders"))
- , z = r("events").EventEmitter
- , G = r("./featureflags")
- , W = (r("./util/lerp"),
- r("./util/ajax"),
- r("./ab"))
- , j = r("./sdk/automation.js")
- , Y = r("./scene/SceneRenderer")
- , q = r("./scene/QuickstartManager")
- , X = r("./tile/QualityManager.js")
- , Z = r("./localization/localize")
- , K = r("./tag/tagManager")
- , Q = r("./tile/TileDownloader")
- , J = r("./tile/PanoRenderer")
- , ee = (r("./enum/PanoSizeClass"),
- r("./enum/PanoramaEvents"),
- r("./enum/SceneRendererEvents"))
- , t = r("./gui/memoryUsage")
- , te = r("./enum/RenderLayers")
- , ie = r("./TimingData")
- , ne = new e(i);
- e.level = L.logLevel,
- e.consoleEnabled = L.console,
- function() {
- var e = k.getModelIDFromQueryString();
- if (!e)
- return A(null, "loading-failed");
- var t = k.parseSidUrl(e)
- , i = O.valueFromHash("play", !1) ? "autoplay" : O.inIframe() ? "click" : "fullpage"
- , n = {
- panoElementsToLoad: 6,
- modelElementsToLoad: 0,
- totalElementsLoaded: 0,
- totalElementsToLoad: 0,
- totalPercentageLoaded: 0,
- progressCallback: null
- }
- , r = document.getElementById("player")
- , o = L.quickstart.enabled
- , a = null
- , s = null
- , l = null
- , c = null
- , h = null
- , u = null
- , d = null
- , p = null
- , f = null
- , g = null
- , m = null
- , v = new ie;
- !function(e) {
- ne.info("Version", "2.25.6-0-gd87e5b1"),
- z.defaultMaxListeners = 1e3,
- function(e) {
- e.addEventListener("dragenter", I, !1),
- e.addEventListener("dragover", I, !1)
- }(e),
- O.valueFromHash("title", !0) || $(document).ready(function() {
- $(".model-title").hide()
- })
- }(r),
- function(e) {
- return G.loadFeatureFlags(e).done(function(e) {
- G.updateDependentSettings(e, L)
- })
- }({
- urlBase: t.urlBase
- }).then(function() {
- return Z.init(),
- function(e, t) {
- var i = P.getModel({
- url: t,
- floors: O.valueFromHash("f", !0),
- autoload: !1
- });
- return $.when(i, y).then(null, function(e) {
- return this
- })
- }(0, e)
- }).then(function(e) {
- return re(.9),
- function(e, t, i, n, r) {
- ne.info("Model data loaded"),
- ne.debug("UUID: " + e.data.job.uuid),
- W.init(G.getFlags()),
- i && N.initKeen({
- token: i,
- appId: n
- }),
- N.initSegment({
- model: e.sid,
- version: "2.25.6-0-gd87e5b1",
- startSource: r.startSource,
- token: t,
- autoplay: r.autoplay,
- quickstart: r.quickstart
- })
- }(g = e, L.appConfig.segment_key, L.appConfig.keen_write_key, L.appConfig.keen_project_id, {
- startSource: i,
- autoplay: L.autoplay,
- quickstart: o
- }),
- g.urls.init()
- }).then(function() {
- return g.loadPanos()
- }).then(function() {
- s = U.getStartCameraOptions(g, g.panos);
- //初始画面
- window.MP_PREFETCHED_MODELDATA.camera_start && window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg && function(e) {
- $("<img/>").attr("src", e).on("load", function() {
- $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
- $(this).remove()
- $(".shotImg.innerBtn").removeClass('blank').css("background-image", "url(" + e + ")")
- })
-
- }(window.MP_PREFETCHED_MODELDATA.camera_start.thumbImg);
-
-
-
-
-
-
- d = function(e) {
- var t = new E.PerspectiveCamera;
- t.layers.enable(te.PANOMARKERS),
- t.layers.enable(te.RETICULE),
- t.layers.enable(te.TAG);
- var o = new E.Scene
- , i = new E.AmbientLight(16777215);
- return o.add(i),
- o.skybox = new V,
- o.add(o.skybox),
- o.plane = new E.Mesh(new E.PlaneBufferGeometry(1e5,1e5),new E.RawShaderMaterial({
- side: E.DoubleSide
- })),
- o.plane.position.y = 0,
- o.plane.rotateX(-Math.PI / 2),
- o.plane.material.visible = !1,
- o.add(o.plane),
- o.updateMatrixWorld(),
- L.showScreenshotLocations && e.data.images.forEach(function(e) {
- if (e.metadata && e.metadata.camera_position) {
- var t = e.metadata.camera_position
- , i = new E.Mesh(new E.BoxGeometry(.3,.3,.3));
- i.position = t.clone(),
- o.add(i);
- var n = e.metadata.camera_quaternion
- , r = new E.Vector3(0,0,-1).applyQuaternion(n);
- o.add(new E.ArrowHelper(r,t.clone(),1,16711680))
- }
- }),
- L.showAxis && (o.add(new E.ArrowHelper(new E.Vector3(0,1,0),new E.Vector3(0,0,0),1,255)),
- o.add(new E.ArrowHelper(new E.Vector3(0,0,1),new E.Vector3(0,0,0),1,16711680)),
- o.add(new E.ArrowHelper(new E.Vector3(1,0,0),new E.Vector3(0,0,0),1,65280))),
- new Y(o,t,B)
- }(g),
- m = function(e, t) {
- var i = e ? 1 : 1e3
- , n = W.tilegen || W.imgopt ? 6 : 2;
- n = O.valueFromHash("tileconc", n);
- var r = new X
- , o = new Q({
- concurrentDownloads: n
- })
- , a = new J
- , s = new x
- , l = new w
- , c = new b(t)
- , h = new T
- , u = new S(i)
- , d = new M
- , p = new K;
- return {
- qualityManager: r,
- panoRenderer: a,
- tileDownloader: o,
- player: c,
- director: l,
- modelManager: s,
- tagManager: p,
- displayController: u,
- labelDisplayController: d,
- controls: h
- }
- }(o, s.mode),
- l = m.controls,
- c = m.player,
- h = m.director,
- u = m.tagManager,
- p = m.tileDownloader,
- f = m.qualityManager,
- m.panoRenderer,
- function(e, t, i, n) {
- var r = i.controls
- , o = i.qualityManager
- , a = i.panoRenderer
- , s = i.tileDownloader
- , l = i.modelManager;
- r.init(n, l),
- j.init(i.director, r, i.player, l, t),
- o.init(l),
- s.init(o),
- a.init(t, s, o),
- l.init(s, a, o),
- l.addModel(e),
- t.addComponent(F)
- }(g, d, m, r),
- c.director = h,
- g.supportsTiles && p.start(),
- !o || s.mode === R.PANORAMA && s.pano || (ne.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
- o = !1);
- var e = null;
- if (o) {
- ne.warn("Quickstart engaged. Hold on to your knickers.");
- var t = l.controls[R.PANORAMA];
- a = new q(f,d.scene,d.camera,t,r),
- C(d, r, g),
- e = a.load(s).then(function() {
- d.addComponent(a),
- d.once(ee.AfterRender, function() {
- ne.warn("First render after quickstart load finished.")
- })
- })
- }
- return window.flyToFirst = function() {
- var e = c.model.panos.get("8d778e19657f433fb9cf8947d823bb70")
- , t = new _.Quaternion(.7099827027821568,-.07708150183830938,.6958985789714591,.07555241737970636)
- , i = new _.Vector3(0,0,-1).applyQuaternion(t).add(e.position);
- c.flyToPano({
- pano: e,
- lookAtPoint: i
- })
- }
- ,
- $.when(e, D.startLoading(g, c, h, L.autoplay, o, v))
- }).then(function() {
- return function(e, t, i, n, r) {
- return r.progressCallback = t,
- N.sessionStart(),
- e.load(n).progress(function(e, t) {
- e.modelElementsToLoad = t[1],
- function(e) {
- e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
- }(e),
- function(e) {
- e.totalElementsLoaded++,
- e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
- isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0),
- e.totalPercentageLoaded = .4 + .6 * e.totalPercentageLoaded,
- console.log("pro:" + e.totalPercentageLoaded),
- e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
- }(e)
- }
- .bind(this, r))
- }(g, D.onProgress, 0, !o, n)
- }).then(function() {
- s.quickstart = o,
- function(e, t, i, n) {
- var r = i.qualityManager
- , o = i.panoRenderer
- , a = i.tileDownloader
- , s = i.modelManager
- , l = i.player
- , c = i.director
- , h = i.tagManager
- , u = i.displayController
- , d = i.labelDisplayController
- , p = i.controls;
- t.scene.add(e),
- t.qualityManager = r;
- var f = {
- camera: t.camera,
- director: c,
- modelManager: s,
- tileDownloader: a,
- panoRenderer: o,
- qualityManager: r,
- tagManager: h,
- container: n,
- controls: p
- };
- l.init(f),
- l.setScene(t.scene),
- h.init(s, l),
- c.init(l, s),
- u.init(c, l, s, h, n),
- d.init(l, s, n),
- B.bindEvents(l),
- t.addComponent(h),
- t.addComponent(l),
- t.addComponent(o),
- l.sceneRenderer = t
- }(g, d, m, r),
- d.started || C(d, r, g),
- N.modelLoaded(g, c, l, L.autoplay),
- function(e, t, i, n) {
- return ne.info("Starting player in " + i.mode),
- N.report(t.sid, "started-playing", n, i.quickstart),
- e.start(i)
- }(c, g, s, L.autoplay).done(function() {
- h.autoTour()
- }),
- g.supportsTiles || new H(g,c).start();
- o && (d.removeComponent(a),
- a.destroy(),
- s.pano.enter()),
- D.init(g, h, c, l, d, s, N.getSessionId()),
- D.endLoading(g, h, u),
- d.once(ee.AfterRender, function() {
- v.setAppReadyTime();
- var e = v.calcFullLoadingTime();
- ne.warn("Total load time: " + e / 1e3),
- N.loadComplete(e),
- ne.warn("First render after model load finished.")
- }),
- d.on(ee.MemoryUsageUpdated, y)
- }).fail(A.bind(this, e))
- }()
- }()
- })
- }
- ).call(this, "/js/main.js")
- }
- , {
- "./DisplayController": 1,
- "./TimingData": 2,
- "./ab": 3,
- "./analytics": 4,
- "./cameras/PanoramaCamera": 7,
- "./controls/CameraControls": 9,
- "./director": 15,
- "./effects": 16,
- "./enum/PanoSizeClass": 36,
- "./enum/PanoramaEvents": 37,
- "./enum/RenderLayers": 41,
- "./enum/SceneRendererEvents": 43,
- "./enum/Viewmode": 51,
- "./featureflags": 59,
- "./gui/error": 64,
- "./gui/gui": 65,
- "./gui/memoryUsage": 73,
- "./label/LabelDisplayController": 91,
- "./lib/array-polyfill": 92,
- "./lib/performance-polyfill": 95,
- "./lib/postprocessing/EffectComposer.js": 96,
- "./lib/postprocessing/MaskPass.js": 97,
- "./lib/postprocessing/RenderPass.js": 98,
- "./lib/postprocessing/ShaderPass.js": 99,
- "./lib/shaders/CopyShader.js": 100,
- "./lib/shaders/HorizontalBlurShader.js": 101,
- "./lib/shaders/VerticalBlurShader.js": 102,
- "./lib/three75-shim": 103,
- "./localization/localize": 108,
- "./tag/tagManager": 124,
- "./model/ModelManager": 140,
- "./objects/Panorama": 148,
- "./objects/Skybox": 152,
- "./player": 155,
- "./preloaders": 156,
- "./scene/QuickstartManager": 157,
- "./scene/SceneRenderer": 158,
- "./sdk/automation.js": 164,
- "./settings": 166,
- "./showcase": 168,
- "./tile/PanoRenderer": 169,
- "./tile/QualityManager.js": 170,
- "./tile/TileDownloader": 171,
- "./util/PanoramaCollection": 178,
- "./util/ajax": 181,
- "./util/browser": 182,
- "./util/camera": 183,
- "./util/common": 185,
- "./util/lerp": 188,
- "./util/logger": 189,
- "./util/math": 190,
- "./util/sentry": 192,
- "./util/showcase": 193,
- "./util/transitions": 195,
- events: 202,
- "promise-polyfill": 213,
- three: 217
- }],
- 117: [function(e, t, i) {
- "use strict";
- function n(e) {
- e = e || {},
- r.RawShaderMaterial.call(this, a.extendObject({
- fragmentShader: o.cube.fragmentShader,
- vertexShader: o.cube.vertexShader,
- uniforms: r.UniformsUtils.clone(o.cube.uniforms),
- name: "CubemapMaterial"
- }, e))
- }
- var r = e("three")
- , o = e("../shaders")
- , a = e("../util/common");
- (n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n,
- t.exports = n
- }
- , {
- "../shaders": 167,
- "../util/common": 185,
- three: 217
- }],
- 118: [function(e, t, i) {
- "use strict";
- function n(e) {
- e = e || {},
- r.RawShaderMaterial.call(this, a.extendObject({
- fragmentShader: o.model.fragmentShader,
- vertexShader: o.model.vertexShader,
- uniforms: r.UniformsUtils.clone(o.model.uniforms),
- name: "ModelTextureMaterial"
- }, e))
- }
- var r = e("three")
- , o = e("../shaders")
- , a = e("../util/common");
- ((n.prototype = Object.create(r.RawShaderMaterial.prototype)).constructor = n).prototype.setProjectedPanos = function(e, t, i) {
- i && (this.uniforms.progress.value = 0),
- e.ensureSkyboxReadyForRender(),
- this.uniforms.pano0Map.value = e.getSkyboxTexture(),
- this.uniforms.pano0Position.value.copy(e.position),
- this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
- t.ensureSkyboxReadyForRender(),
- this.uniforms.pano1Map.value = t.getSkyboxTexture(),
- this.uniforms.pano1Position.value.copy(t.position),
- this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
- }
- ,
- t.exports = n
- }
- , {
- "../shaders": 167,
- "../util/common": 185,
- three: 217
- }],
- 119: [function(m, v, e) {
- (function(e) {
- "use strict";
- function t(e, t, i, n) {
- this.div = null,
- this.body = null,
- this.label = e,
- this.description = t,
- this.parsedDescription = [],
- this.media = i || {
- type: null
- },
- this.loadingSpinner = null,
- this.parser = new r({
- supportLinks: !c.valueFromHash("mls"),
- keepLinkLabels: !0
- }),
- this.state = g.CLOSED,
- this.orientation = "",
- this.initialTransform = "",
- this.hovering = !1,
- this.openTransition = null,
- this.closeTransition = null,
- this.openPromise = null,
- this.closePromise = null,
- this.animationTransition = null,
- this.animationScale = 0
- }
- var r = m("../Parser/DescriptionParser")
- , i = m("../Media/Link")
- , n = m("../Media/Image")
- , o = m("../Media/EmbedlyPlayer")
- , a = m("../Media/EmbedlyEmbed")
- , s = m("../../util/transitions")
- , l = m("../../util/lerp")
- , c = m("../../util/browser")
- , b = m("./BillboardEvent")
- , w = m("../Media/MediaEvent")
- , h = m("../Parser/DescriptionChunkType")
- , u = m("events").EventEmitter
- , d = m("./billboardSettings")
- , T = m("./overlaySettings")
- , p = new (m("../../util/logger"))(e)
- , f = document.getElementById("tag-billboards");
- f.addEventListener("touchend", function(e) {
- f.style.pointerEvents = "none"
- }),
- f.addEventListener("touchcancel", function(e) {
- f.style.pointerEvents = "none"
- });
- var g = {
- CLOSED: "closed",
- OPENING: "opening",
- OPEN: "open",
- CLOSING: "closing",
- ACTIVE: "active"
- };
- (t.prototype = Object.create(u.prototype)).build = function(e) {
- this.parsedDescription = this.parser.parse(this.description);
- var t = document.createElement("div");
- t.className = "tag-container has-hotzone",
- this.div = t,
- this.body = document.createElement("div"),
- this.body.className = "tag-body";
- var i = document.createElement("div");
- i.classList.add("tag-content");
- var n = document.createElement("div");
- n.classList.add("tag-text-content");
- var r = document.createElement("div");
- r.className = "tag-label",
- r.textContent = this.label,
- n.appendChild(r);
- var o = document.createElement("div");
- o.className = "tag-desc",
- n.appendChild(o),
- i.appendChild(n),
- this.body.appendChild(i),
- this.appendDescriptionElements(this.parsedDescription, o),
- this.appendMedia(),
- t.appendChild(this.body),
- f.appendChild(t),
- this.bindEvents(t, this.body)
- }
- ,
- t.prototype.bindEvents = function(i, e) {
- function t(n) {
- return function(e) {
- if (!this.div.classList.contains("overlay")) {
- var t, i = document.getElementById("player");
- try {
- t = new MouseEvent(n,e)
- } catch (i) {
- (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)
- }
- i.dispatchEvent(t)
- }
- }
- }
- e.addEventListener("mousedown", function(e) {
- e.stopPropagation()
- }),
- e.addEventListener("mouseup", function(e) {
- e.stopPropagation()
- }),
- i.addEventListener("touchstart", function(e) {
- f.style.pointerEvents = "auto"
- }),
- i.addEventListener("mousedown", t("mousedown").bind(this)),
- i.addEventListener("mouseup", t("mouseup").bind(this)),
- e.addEventListener("mouseover", function(e) {
- this.state === g.OPEN && i.classList.remove("has-hotzone")
- }
- .bind(this)),
- i.addEventListener("mouseenter", function(e) {
- this.state !== g.CLOSING && (this.hovering = !0,
- this.emit(b.ENTER))
- }
- .bind(this)),
- i.addEventListener("mouseleave", function(e) {
- this.hovering = !1,
- this.emit(b.LEAVE)
- }
- .bind(this)),
- i.addEventListener("gesturestart", function(e) {
- e.preventDefault()
- });
- var n = i.querySelector(".tag-text-content")
- , r = 0;
- n.addEventListener("touchstart", function(e) {
- r = e.changedTouches[0].clientY
- }),
- n.addEventListener("touchmove", function(t) {
- function e(e) {
- e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight == 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
- }
- return i.classList.contains("overlay") ? e(this.querySelector(".tag-desc")) : void e(this)
- }),
- i.addEventListener("touchmove", function(e) {
- 0 == (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
- })
- }
- ,
- t.prototype.appendDescriptionElements = function(e, i) {
- 0 < e.length && this.div.classList.add("has-text"),
- e.forEach(function(e, t) {
- switch (e.type) {
- case h.TEXT:
- i.appendChild(this.createTextElement(e.text));
- break;
- case h.LINK:
- i.appendChild(this.createLinkElement(e.link))
- }
- }
- .bind(this))
- }
- ,
- t.prototype.appendLoadingSpinner = function() {
- this.loadingSpinner = document.createElement("div"),
- this.loadingSpinner.classList.add("loading-spinner");
- var e = document.createElement("div");
- e.classList.add("gui-spinner-icon"),
- this.loadingSpinner.appendChild(e),
- this.body.appendChild(this.loadingSpinner)
- }
- ,
- t.prototype.onMediaLoadFinished = function() {
- this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
- this.applyOrientation(this.orientation),
- this.loadingSpinner = null)
- }
- ,
- t.prototype.appendMedia = function() {
- if (this.media && this.media.type && "error" !== this.media.type && (!c.valueFromHash("mls", 0) || this.media.type === h.IMAGE)) {
- this.appendLoadingSpinner();
- var e = document.createElement("div");
- e.classList.add("tag-media-content");
- var t = document.createElement("i");
- switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
- t.classList.add(e)
- }),
- this.body.appendChild(t),
- this.body.appendChild(e),
- this.media.type) {
- case h.IMAGE:
- e.appendChild(this.createImageElement(this.media, this.body));
- break;
- case h.VIDEO:
- e.appendChild(this.createVideoElement(this.media, this.body));
- break;
- case h.RICH:
- e.appendChild(this.createEmbedElement(this.media, this.body))
- }
- }
- }
- ,
- t.prototype.createTextElement = function(e) {
- var t = document.createElement("span");
- return t.textContent = e,
- t
- }
- ,
- t.prototype.createLinkElement = function(e) {
- var t = new i(e);
- return t.on(w.LINK_CLICK, this.emit.bind(this, w.LINK_CLICK)),
- t.createDomElement()
- }
- ,
- t.prototype.createImageElement = function(t, C) {
- function e() {
- function e() {
- p || (E.classList.remove("view-image"),
- a.classList.add("overlay"),
- t(),
- window.addEventListener("resize", A),
- a.addEventListener("click", i),
- c.addEventListener("click", r),
- o.addEventListener("click", n),
- p = !0,
- _.emit(w.IMAGE_OPENED))
- }
- function t() {
- C.classList.add("show-info"),
- s.classList.remove("collapsible"),
- s.style.height = "";
- var e = parseFloat(getComputedStyle(v).lineHeight)
- , t = g + e
- , i = a.clientWidth - 2 * T.boundaryWidth - m
- , n = a.clientHeight - 2 * T.boundaryHeight - m - t
- , r = n
- , o = r * I.aspect;
- i < o && (r = (o = i) / I.aspect),
- n < r && (o = (r = n) * I.aspect),
- o += m,
- r += m + t,
- C.style.width = o + "px",
- C.style.height = r + "px",
- l.style.paddingTop = e + m + "px",
- 0 < _.description.length && (s.classList.add("collapsible"),
- s.style.height = s.clientHeight + 12 + "px",
- y.style.height = "calc(100% - " + v.clientHeight + "px)")
- }
- function i(e) {
- e.target === a && n()
- }
- function n() {
- p && (p = !1,
- E.classList.add("view-image"),
- a.classList.remove("overlay"),
- s.style.height = "",
- l.style.paddingTop = "",
- C.style.width = "",
- C.style.height = "",
- window.removeEventListener("resize", A),
- a.removeEventListener("click", i),
- c.removeEventListener("click", r),
- o.removeEventListener("click", n),
- _.emit(w.IMAGE_CLOSED),
- _.close(!0))
- }
- function r(e) {
- C.classList.toggle("show-info")
- }
- var a = _.div
- , s = a.getElementsByClassName("tag-content")[0]
- , l = a.getElementsByClassName("tag-media-content")[0]
- , o = C.getElementsByClassName("close")[0]
- , c = s.getElementsByClassName("tag-label")[0];
- a.classList.add("has-image"),
- E.classList.add("view-image"),
- a.classList.add(1 <= I.aspect ? "image-landscape" : "image-portrait"),
- _.applyOrientation(_.orientation);
- 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,
- function() {
- clearInterval(h),
- clearTimeout(u),
- h = setInterval(function() {
- var e = a.clientHeight;
- d !== e && (t(),
- d = e)
- }, 100),
- u = setTimeout(clearInterval.bind(this, h), 1e3)
- }
- );
- I.on(w.IMAGE_OPENING, e),
- _.on(b.ACTIVATE, e),
- _.on(w.IMAGE_CLOSED, I.onClosed.bind(I)),
- _.on(b.CLOSING, n)
- }
- var I = new n
- , E = I.createDomElement();
- this.once(b.OPENED, function() {
- I.load(t.src).then(e).catch(function(e) {
- p.warn("Failed to load image:", t.src),
- p.warn("with error:", e)
- }).then(this.onMediaLoadFinished.bind(this))
- });
- var _ = this;
- return E
- }
- ,
- t.prototype.createVideoElement = function(t, e) {
- var i = new o({
- autoPlay: !0,
- autoResume: !0,
- startMuted: !1,
- loop: !1
- })
- , n = i.createDomElement();
- return this.once(b.OPENED, function() {
- i.load(t.src).then(function() {
- this.div.classList.add("has-video"),
- this.state !== g.OPEN && this.state !== g.ACTIVE || (i.show(),
- i.play()),
- this.on(b.OPENING, i.show.bind(i)),
- this.on(b.OPENED, i.play.bind(i)),
- this.on(b.CLOSING, i.pause.bind(i)),
- this.on(b.CLOSED, i.hide.bind(i))
- }
- .bind(this)).catch(function(e) {
- p.warn("Failed to embed video:", t.src),
- p.warn("with error:", e)
- }).then(this.onMediaLoadFinished.bind(this))
- }
- .bind(this)),
- n
- }
- ,
- t.prototype.createEmbedElement = function(t, e) {
- var i = new a
- , n = i.createDomElement();
- return this.once(b.OPENED, function() {
- i.load(t.src).then(function() {
- this.div.classList.add("has-embed"),
- this.state !== g.OPEN && this.state !== g.ACTIVE || i.show(),
- this.applyOrientation(this.orientation),
- this.on(b.OPENING, i.show.bind(i)),
- this.on(b.CLOSED, i.hide.bind(i))
- }
- .bind(this)).catch(function(e) {
- p.warn("Failed to embed:", t.src),
- p.warn("with error:", e)
- }).then(this.onMediaLoadFinished.bind(this))
- }
- .bind(this)),
- n
- }
- ,
- t.prototype.open = function(e) {
- return this.openPromise = $.Deferred(),
- this.state === g.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
- this.openTransition ? e && this.setActiveState() : this.openTransition = s.setTimeout(function() {
- this.state !== g.OPEN && (this.emit(b.OPENING),
- e && this.emit(b.ACTIVATING),
- this.state = g.OPENING,
- this.animateOpen(function() {
- e && this.setActiveState(),
- this.openPromise.resolve()
- }
- .bind(this)))
- }
- .bind(this), d.animation.openDelay),
- s.cancel(this.closeTransition),
- this.closePromise && this.closePromise.reject(),
- this.closeTransition = void 0,
- this.openPromise.promise())
- }
- ,
- t.prototype.close = function(e) {
- return this.closePromise = $.Deferred(),
- !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = s.setTimeout(function() {
- this.state !== g.CLOSED && (this.emit(b.CLOSING),
- this.state = g.CLOSING,
- this.animateClose())
- }
- .bind(this), d.animation.closeDelay)),
- s.cancel(this.openTransition),
- this.openPromise && this.openPromise.reject(),
- this.openTransition = void 0,
- this.closePromise.resolve(),
- this.closePromise.promise())
- }
- ,
- t.prototype.setActiveState = function() {
- this.state !== g.CLOSED && (this.state = g.ACTIVE,
- this.emit(b.ACTIVATE),
- this.div.classList.remove("has-hotzone"))
- }
- ,
- t.prototype.animateOpen = function(e) {
- if (this.state === g.OPENING) {
- if (s.cancel(this.animationTransition),
- c.detectSamsungNative())
- return this.boardOrientation = null,
- this.div.style.visibility = "visible",
- this.emit(b.OPENED),
- this.state = g.OPEN,
- void (e && e());
- this.div.style.webkitTransform = "scale(0)",
- this.div.style.transform = "scale(0)",
- this.div.style.visibility = "visible",
- this.animationTransition = s.start(l.property(this, "animationScale", 1), d.animation.openDuration, function() {
- this.emit(b.OPENED),
- this.state = g.OPEN,
- e && e()
- }
- .bind(this))
- }
- }
- ,
- t.prototype.animateClose = function(e) {
- this.state === g.CLOSING && (s.cancel(this.animationTransition),
- this.animationTransition = s.start(l.property(this, "animationScale", 0), d.animation.closeDuration, function() {
- this.emit(b.CLOSED),
- this.state = g.CLOSED,
- this.div.style.visibility = "hidden",
- this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
- e && e()
- }
- .bind(this)))
- }
- ,
- t.prototype.needsUpdate = function() {
- return this.state !== g.CLOSED
- }
- ,
- t.prototype.update = function(e, t) {
- if (this.needsUpdate()) {
- var i = (this.updateOrientation(e),
- this.calcScale(t))
- , n = {
- x: (e.x + 1) * $("#player").width() / 2,
- y: (e.y + 1) * $("#player").height() / 2
- };
- this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
- this.div.style.webkitTransform = this.div.screenTransform,
- this.div.style.transform = this.div.screenTransform
- }
- }
- ,
- t.prototype.getDimensions = function() {
- return this.div.getBoundingClientRect()
- }
- ,
- t.prototype.calcScale = function(e) {
- return Math.sqrt(e / 40) * d.boardToDiscRatio
- }
- ,
- t.prototype.updateOrientation = function(e) {
- if (this.state !== g.ACTIVE) {
- var t = e.y < -1 / 3 ? 0 : e.y < 1 / 3 ? 1 : 2
- , i = e.x < -1 / 3 ? 0 : e.x < 1 / 3 ? 1 : 2
- , n = "";
- n += 0 == i ? "right" : 2 == i ? "left" : "",
- n += 0 == t ? "-down" : 2 == t ? "-up" : "",
- 1 == i && (n = 0 == t ? "bottom" : 2 == t ? "top" : "",
- 1 == t && (n = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
- 1 == i && 1 == t && n === this.orientation || this.applyOrientation(n)
- }
- }
- ,
- t.prototype.applyOrientation = function(e) {
- this.div.style.transform = this.div.style.webkitTransform = "",
- this.div.classList.remove("tag-container-" + this.orientation),
- this.div.classList.add("tag-container-" + e);
- var t = window.getComputedStyle(this.div);
- this.initialTransform = t.transform || t.webkitTransform,
- "none" === this.initialTransform && (this.initialTransform = "");
- var i = t.transform.slice(7, -1).split(",")
- , n = -i[4]
- , r = -i[5];
- this.div.style.webkitTransformOrigin = n + "px " + r + "px",
- this.div.style.transformOrigin = n + "px " + r + "px",
- this.orientation = e
- }
- ,
- v.exports = t
- }
- ).call(this, "/js/tag/Billboard/Billboard.js")
- }
- , {
- "../../util/browser": 182,
- "../../util/lerp": 188,
- "../../util/logger": 189,
- "../../util/transitions": 195,
- "../Media/EmbedlyEmbed": 125,
- "../Media/EmbedlyPlayer": 126,
- "../Media/Image": 128,
- "../Media/Link": 129,
- "../Media/MediaEvent": 131,
- "../Parser/DescriptionChunkType": 133,
- "../Parser/DescriptionParser": 134,
- "./BillboardEvent": 120,
- "./billboardSettings": 121,
- "./overlaySettings": 122,
- events: 202
- }],
- 120: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- ENTER: "billboard.enter",
- LEAVE: "billboard.leave",
- OPENING: "billboard.opening",
- OPENED: "billboard.open",
- CLOSING: "billboard.closing",
- CLOSED: "billboard.closed",
- ACTIVATING: "billboard.activating",
- ACTIVATE: "billboard.activate"
- })
- }
- , {}],
- 121: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- animation: Object.freeze({
- hoverOnClosing: !1,
- openDelay: 100,
- closeDelay: 50,
- openDuration: 200,
- closeDuration: 100
- }),
- boardToDiscRatio: 1.2
- })
- }
- , {}],
- 122: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- boundaryWidth: 30,
- boundaryHeight: 0
- })
- }
- , {}],
- hot: [function(e, t, i) {
- "use strict";
- function n(e, t, i) {
- this.sid = e,
- this.position = this.convertValue(t.position, g.Vector3)
-
- if(t.quaternion){
- this.quaternion = this.convertValue(t.quaternion, g.Quaternion)
- }else{
- this.rotation = new g.Euler().setFromVector3(this.convertValue(t.rotation, g.Vector3 ))
- }
-
- this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
- this.isSprite = t.isSprite
- this.noAction = t.noAction
- this.linkType = t.linkType || "common"
-
- this.link = t.link,
- this.model = i,
- this.size = t.size;
-
- this.styleTex = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
-
- this.build()
- t.infoAttribute && t.infoAttribute.title && this.createTitleElem(t.infoAttribute.title)
-
- this.changeTex()
-
- this.setVisiblePanos(t.visiblePanos);
- this.infoAttribute = t.infoAttribute;
-
- }
- var g = e("three")
- , r = e("../shaders")
- , m = e("../settings")
- , v = e("../enum/Viewmode")
- , d = e("../objects/Panorama")
- , o = e("../util/texture")
- , math = e("../util/math")
- , p = new g.Raycaster
- , a = new g.PlaneBufferGeometry(g_HotMeshSize.g_HotMeshWidth,g_HotMeshSize.g_HotMeshHeight,1,1)
-
-
-
- var defaultTex1 = o.load(g_HotImage.point);
- var defaultTex2 = o.load(g_HotImage.point2)
-
-
- n.prototype.changeTex = function(){
- var u = this.mesh.material.uniforms
- if(this.styleTex.length){
- u.texture1.value = o.load(this.styleTex[0].src);
- u.texture2.value = o.load(this.styleTex[1]&&this.styleTex[1].src || this.styleTex[0].src);
- }else{
- u.texture1.value = defaultTex1;
- u.texture2.value = defaultTex2;
- }
- }
-
- n.prototype.initStyleImg = function(t){
- this.styleTex = []
- t.styleImg = t.styleImg || [];
- t.styleImg.forEach((src)=>{
- this.styleTex.push({src:manage.dealURL(src)})
- })
- this.changeTex()
- }
- n.prototype.update = function(camera) {
- if(this.isSprite){
- this.mesh.quaternion.copy(camera.quaternion)
- }
- if(window.hotNeedUpdatePannel == this){
- this.updatePannel()
- }
- }
- n.prototype.setVisiblePanos = function(visibleData){
- if(visibleData == "get"){
- this.visiblePanos = player.model.panos.list.map((pano)=>{return pano.id})
- }else if(visibleData){
- this.visiblePanos = visibleData;
- }
- }
- n.prototype.build = function() {
- var t = g.UniformsUtils.clone(r.hot.uniforms);
- var e = new g.Mesh(a, new g.ShaderMaterial({
- uniforms: t,
- vertexShader: r.hot.vertexShader,
- fragmentShader: r.hot.fragmentShader,
- transparent: !0
- }))
- , t = parseFloat(window.MP_PREFETCHED_MODELDATA.hotIconScale);
- e.dynamic = !0,
- e.position.copy(this.position);
- e.quaternion.copy(this.quaternion)
-
- t && e.scale.set(t, t, t),
- e.name = this.sid,
- e.type = "hotSprite",
- (e.belongHot = this).link && (e.hotLink = this.link),
- this.mesh = e,
- this.model.add(e),
- g_HotMeshes.push(e);
-
-
-
- }
-
-
-
- n.prototype.showPannel = function(){
- var hardware = this.hardwareTemp || this.infoAttribute.hardware //hardwareTemp为编辑时绝对有的,如果是{}代表没有
- if(hardware && hardware.id!=void 0){
- $("#hotPannel>div").css("display","block");
- $("#hotPannel .title").text(hardware.name);
-
- this.updatePannel()
- window.hotNeedUpdatePannel = this
- return true
- }else{
- $("#hotPannel>div").css("display","");
- }
- }
- n.prototype.updatePannel = function(){
- var pos = math.getPos2d(this.position, player.camera, $("#player")[0]);
- if(pos.trueSide){
- $("#hotPannel>div").css( {display:'block', "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
- }else{
- $("#hotPannel>div").css({display:'none'})
- }
- }
-
-
-
-
-
-
- n.prototype.createTitleElem = function(title){
- var root = $("#hot");
- var elem = $(`<div> ${title}</div>`)
- root.append(elem);
- this.titleElem = elem;
- }
- n.prototype.showTitle = function(){
- if(!this.titleElem)return;
- var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
- this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
- this.titleElem.css("display","block");
- }
- n.prototype.hideTitle = function(){
- if(!this.titleElem)return;
- this.titleElem.css("display","none");
- }
- ,
- n.prototype.closestPanoTowardTag = function(e, t) {
- var i = []
- , n = []
- , r = this.mesh.position;
- if (e === v.PANORAMA) {
- var o = t.position.clone().sub(r).normalize();
- n.push(d.scoreFunctions.direction(r, o))
- }
- var a = new g.Vector3;
- i.push(function(e) {
- return Math.abs(e.position.x - r.x) > m.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > m.tags.visibility.cameraClearance
- }, function(e) {
- a.copy(r).sub(e.position);
- var t = -g.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
- , i = m.tags.navigate.tiltTolerance;
- return m.insideLookLimitDown - i < t && t < m.insideLookLimitUp + i
- },
- (pano)=>{ // add
- player.checkHasNeighbor(pano)
- }
-
- ),
- n.push(d.scoreFunctions.distanceSquared(this.mesh, -2));
- var s = t.model.panos.sortByScore(i, n);
- if (s && m.tags.navigate.lineOfSight) {
- for (var l = 0; l < s.length; l++) {
- var c = s[l].pano
- , h = c.position.distanceTo(r);
- p.set(c.position, r.clone().sub(c.position).normalize());
- var u = p.intersectObjects(t.model.colliders);
- if (0 === u.length || u[0].distance > h)
- return console.log(l),
- c
- }
- return null
- }
- return s && 0 < s.length && s[0].pano
- }
-
-
-
-
- var getLink = function(link){
- var src = '';
- var r = link.substring(link.indexOf("html") + 4)
- , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";
- -1 == r.indexOf("?") ? src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o
-
- return src
-
- }
-
-
- n.prototype.examine = function(e, options) {
- options = options || {}
- var hotPop = document.getElementById('popup');
- var hasHardware
- if(window.MP_PREFETCHED_MODELDATA.flyInOnlyBySwitch){
- hasHardware = this.showPannel();
- if(player.mode != 'panorama' || !player.currentPano)return;
- }else{
- if(this.linkType!="common" && this.infoAttribute.iframe && this.infoAttribute.iframe[0] && !options.dontOpen){
- var src = getLink(this.infoAttribute.iframe[0]);
- if(this.linkType=="jumpLink"){
- var newPage = window.open(src, "_blank" );
- newPage.focus();
- }else if(this.linkType=="iframeDiv"){
-
- var div = document.createElement("div");
- $("body").append(div);
- div.style.position = 'fixed';
- div.style.width = div.style.height = "100%";
- div.style.left = div.style.top = '0';
- div.style["z-index"] = "999"
-
- var exit = document.createElement("div");
- exit.style["background-image"] = "url(images/vrOffImg.png)";
- exit.style.position = 'absolute';
- exit.style.width = exit.style.height = "50px";
- exit.style.left = '17px'; exit.style.top = "20px"
- exit.style.cursor = "pointer";
- exit.style["background-repeat"] = "no-repeat";
- exit.style["background-size"] = "25%";
- exit.style["background-position"] = "center center";
- exit.style["background-color"] = "rgba(0, 0, 0, 0.2)";
- exit.style["border-radius"] = "50%";
- exit.style["z-index"] = "3"
- exit.onclick = ()=>{
- $(div).remove()
- if(g_bgAudio && g_bgAudio.pauseByHot){
- manage.switchBgmState(true)
- }
- }
-
- var myElement = document.createElement("iframe");
- myElement.style.position = 'absolute';
- myElement.style.width = myElement.style.height = "100%";
- myElement.style.left = myElement.style.top = '0';
-
- myElement.src = src
-
-
- div.appendChild(exit);
- div.appendChild(myElement)
-
-
- if(g_bgAudio && !g_bgAudio.paused){
- manage.switchBgmState(false);
- g_bgAudio.pauseByHot = true
- }
- if(g_tourAudio)g_tourAudio.pause()
-
- }
-
-
-
-
- return;
- }
-
- }
-
-
- if(!player.currentPano)return;
-
- var i = document.getElementById("popup");
-
- if (this.link && !options.dontOpen && !hasHardware) {
- g_currentHot = this,
- i.style.display = "block",
- i.classList.add("wait");
- var n = document.createElement("iframe");
- if(g_bgAudio && !g_bgAudio.paused){
- manage.switchBgmState(false);
- g_bgAudio.pauseByHot = true
- }
- if(g_tourAudio)g_tourAudio.pause()
- var src = getLink(this.link )
- n.src = src;
- n.id = "id1",
- n.allowTransparency = "true";
- var a = document.getElementById("id1");
- if (void 0 === a || null == a) {
- document.querySelector(".popup-content").appendChild(n);
- var s = !1;
- window.loaddingSuccess = function() {
- s = !0
- }
- ,
- setTimeout(function e() {
- if (s) {
- var t = document.querySelector("#id1").contentWindow.document;
- t.querySelector("video") && (t.querySelector("video").play(),
- !t.querySelector("video").paused && t.querySelector(".playPause") && t.querySelector(".playPause").classList.add("fa-pause")),
- t.querySelector("audio") && t.querySelector("audio").play()
- } else
- setTimeout(e, 300)
- }, 800)
- }
- }
- var l = e.mode
- , c = m.tags.navigate.nearestPano && this.closestPanoTowardTag(l, e.currentPano) || e.currentPano
- , h = this.mesh.position;
- e.flyingToTag = !0;
- var u = function() {
- e.flyingToTag = !1;
- options.dontOpen || this.link && i.classList.remove("wait")
- }
- .bind(this);
- if (l === v.PANORAMA) {
- var d = {
- pano: c,
- lookAtPoint: h,
- duration: null,
- maxDistanceOverride: null,
- skipWarpingCheck: !1
- };
- e.flyToPano(d, u)
- } else {
- var p = {
- pano: c
- };
- if (h) {
- var f = (new g.Matrix4).lookAt(c.position, h, new g.Vector3(0,1,0));
- p.quaternion = (new g.Quaternion).setFromRotationMatrix(f)
- }
- p.callback = u,
- p.duration = 1500,
- p.mode = v.PANORAMA,
- e.flyToNewMode(p)
- }
- }
-
- ,
- n.prototype.dispose = function(){
- this.mesh.parent.remove(this.mesh);
- var index = g_HotMeshes.indexOf(this.mesh);
- g_HotMeshes.splice(index,1)
- }
-
- /* n.prototype.conversionArray = function(e) {
- if ("[object Array]" == Object.prototype.toString.call(e))
- return e;
- var t = [];
- for (var i in e)
- t.push(parseFloat(e[i]));
- return t
- } */
- n.prototype.convertValue = function(v ,Type){
- var value;
- if(v instanceof Array){
- v.forEach((v1)=>{v1 = parseFloat(v1)})
- value = new Type().fromArray(v);
- }else{
- for(let i in v){v[i] = parseFloat(v[i])}
- value = new Type().copy(v);
- }
- return value
- }
-
- ,
- t.exports = n
- }
- , {
- three: 217,
- "../shaders": 167,
- "../enum/Viewmode": 51,
- "../objects/Panorama": 148,
- "../util/texture": 194,
- "../settings": 166,
- "../util/math": 190,
- }],
- 123: [function(M, R, e) {
- (function(e) {
- "use strict";
- function d(e, t, i) {
- var n = i.version || "0";
- "0" !== n && w.info("tag defined using version " + n),
- this.model = e,
- this.sid = t,
- this.color = (new f.Color).set(i.color || o.tagDefault),
- this.hoverColor = o._darken(this.color, .2),
- this.floor = null,
- this.floorIndex = i.floor,
- this.mode = m.PANORAMA,
- i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
- this.obj3d = null,
- this.disc = null,
- this.materials = {
- disc: null,
- pole: null
- },
- this.position = (new f.Vector3).copy(i.position),
- this.discPosition = (new f.Vector3).copy(i.stem.direction),
- this.discWorldPosition = null,
- this.discScale = .05,
- this.poleEnabled = i.stem.enabled,
- this.billboard = new r(i.label,i.description,i.media,this),
- this.visibleTransition = null,
- this.hoveringDisc = !1
- }
- 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"),
- 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);
- d.prototype = Object.create(b.prototype),
- d.raycaster = new f.Raycaster,
- d.prototype.bindEvents = function() {
- this.billboard.on(_.ENTER, this.setHoverState.bind(this)),
- this.billboard.on(_.LEAVE, this.setFreeState.bind(this))
- }
- ,
- d.prototype.build = function() {
- return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
- this.floor && (this.billboard.build(this.model.sid),
- this.obj3d = this.buildObject3D(),
- this.floor.add(this.obj3d)),
- this
- }
- ,
- d.prototype.buildObject3D = function() {
- var e = new f.Object3D;
- e.position.copy(this.position);
- var t = f.UniformsUtils.clone(A.tagDisc.uniforms);
- t.bg.value = x,
- t.mask.value = T,
- t.color.value.copy(this.color),
- this.materials.disc = new f.RawShaderMaterial({
- transparent: !0,
- vertexShader: A.tagDisc.vertexShader,
- fragmentShader: A.tagDisc.fragmentShader,
- uniforms: t
- }),
- this.disc = new f.Mesh(S,this.materials.disc),
- this.disc.layers.set(a.TAG),
- this.disc.position.copy(this.discPosition),
- this.disc.renderOrder = s.tagDisc;
- var i = (this.disc.tag = this).buildPole();
- return i.layers.set(a.TAG),
- i.renderOrder = s.tagStem,
- e.add(i),
- e.layers.set(a.TAG),
- e.add(this.disc)
- }
- ,
- d.prototype.buildPole = function() {
- var e = new f.BufferGeometry
- , t = new Float32Array(6);
- return t[0] = t[1] = t[2] = 0,
- t[3] = this.discPosition.x,
- t[4] = this.discPosition.y,
- t[5] = this.discPosition.z,
- e.addAttribute("position", new f.BufferAttribute(t,3)),
- this.materials.pole = new f.LineBasicMaterial({
- linewidth: g.tags.pole.width,
- color: g.tags.pole.color,
- opacity: 0,
- visible: this.poleEnabled,
- transparent: !0,
- depthWrite: !1
- }),
- new f.Line(e,this.materials.pole)
- }
- ,
- d.prototype.setFreeState = function(e) {
- !e && this.hoveringDisc || this.billboard.close(e).then(function() {
- this.materials.disc.uniforms.color.value = this.color
- }
- .bind(this))
- }
- ,
- d.prototype.setHoverState = function(e) {
- this.billboard.open(e),
- this.materials.disc.uniforms.color.value = this.hoverColor
- }
- ,
- d.prototype.hide = function(e, t) {
- var i = $.Deferred();
- if (0 === this.materials.disc.uniforms.opacity.value && !C.isRunning(this.visibleTransition))
- return i.resolve().promise();
- e = e || 0,
- t = t || 0,
- C.cancel(this.visibleTransition);
- var n, r, o, a = this.materials.disc.uniforms.opacity.value / g.tags.disc.opacity, s = t + e, l = t / s;
- return this.visibleTransition = C.start((n = this,
- r = I.property(n.materials.disc.uniforms.opacity, "value", 0),
- o = I.property(n.materials.pole, "opacity", 0),
- function(e) {
- r(e),
- n.materials.pole && o(e)
- }
- ), s * a, function() {
- i.resolve()
- }, l, E[g.warp.blendEasing]),
- i.promise()
- }
- ,
- d.prototype.show = function(e, t) {
- var i = $.Deferred();
- if (this.materials.disc.uniforms.opacity.value === g.tags.disc.opacity && !C.isRunning(this.visibleTransition))
- return i.resolve().promise();
- e = e || 0,
- t = t || 0,
- C.cancel(this.visibleTransition);
- 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;
- return this.visibleTransition = C.start((n = this,
- r = I.property(n.materials.disc.uniforms.opacity, "value", g.tags.disc.opacity),
- o = I.property(n.materials.pole, "opacity", g.tags.pole.opacity),
- function(e) {
- r(e),
- n.materials.pole && o(e)
- }
- ), s * a, function() {
- i.resolve()
- }, l, E[g.warp.blendEasing]),
- i.promise()
- }
- ,
- d.prototype.closestPanoTowardTag = function(e, t) {
- var i = []
- , n = []
- , r = this.disc.getWorldPosition();
- if (e === m.PANORAMA) {
- var o = t.position.clone().sub(r).normalize();
- i.push(y.filters.isPanoAligned()),
- i.push(y.filters.inPanoDirection(r, o, .5)),
- i.push(y.filters.isNeighbourPanoTo(t)),
- n.push(y.scoreFunctions.direction(r, o))
- }
- var a = new f.Vector3;
- i.push(function(e) {
- return Math.abs(e.position.x - r.x) > g.tags.visibility.cameraClearance || Math.abs(e.position.z - r.z) > g.tags.visibility.cameraClearance
- }, function(e) {
- a.copy(r).sub(e.position);
- var t = -f.Math.radToDeg(Math.atan(a.y / Math.sqrt(a.x * a.x + a.z * a.z)))
- , i = g.tags.navigate.tiltTolerance;
- return g.insideLookLimitDown - i < t && t < g.insideLookLimitUp + i
- }),
- n.push(y.scoreFunctions.distanceSquared(this, -2));
- var s = this.model.panos.sortByScore(i, n);
- if (g.tags.navigate.lineOfSight) {
- for (var l = 0; l < s.length; l++) {
- var c = s[l].pano
- , h = c.position.distanceTo(r);
- if (!g.tags.visibility.anyDistance && h > g.tags.visibility.visibleDistance)
- return null;
- d.raycaster.set(c.position, r.clone().sub(c.position).normalize());
- var u = d.raycaster.intersectObjects(this.model.colliders);
- if (0 === u.length || u[0].distance > h)
- return c
- }
- return null
- }
- return 0 < s.length && s[0].pano
- }
- ,
- d.prototype.examine = function(i) {
- if(!player.currentPano)return;
- var e = i.mode
- , n = g.tags.navigate.nearestPano && this.closestPanoTowardTag(e, i.currentPano) || i.currentPano
- , t = this.disc.getWorldPosition();
- this.billboard.setActiveState();
- var r = function() {
- var e = this.billboard.getDimensions()
- , t = new f.Vector3;
- v.convertScreenPositionToNDC(e.left + e.width / 2, e.top + e.height / 2, t),
- t.unproject(i.camera),
- i.flyToPano({
- pano: n,
- lookAtPoint: t
- })
- }
- .bind(this);
- if (e === m.PANORAMA)
- if (n !== i.currentPano) {
- var o = {
- pano: n,
- lookAtPoint: t,
- duration: null,
- maxDistanceOverride: null,
- skipWarpingCheck: !1
- };
- i.flyToPano(o, r)
- } else
- setTimeout(function() {
- this.billboard.open().then(function() {
- r()
- })
- }
- .bind(this), 0);
- else {
- var a = {
- pano: n
- };
- if (t) {
- var s = (new f.Matrix4).lookAt(n.position, t, new f.Vector3(0,1,0));
- a.quaternion = (new f.Quaternion).setFromRotationMatrix(s)
- }
- a.callback = r,
- a.duration = 1500,
- a.mode = m.PANORAMA,
- i.flyToNewMode(a)
- }
- }
- ,
- d.prototype.update = (n = new f.Vector3,
- function(e, t) {
- this.discWorldPosition = this.disc.getWorldPosition(),
- this.updateDisc(e, t),
- this.billboard.needsUpdate() && (n.copy(this.discWorldPosition).project(t),
- n.z < 1 && (n.y *= -1,
- this.billboard.update(n, this.getDiscRadius(n, t))))
- }
- ),
- d.prototype.updateDisc = (l = new f.Vector3,
- c = new f.Vector3,
- h = new f.Vector3,
- u = new f.Vector3,
- p = new f.Vector3,
- function(e, t) {
- var i = g.tags.visibility
- , n = g.tags.disc.scale
- , r = e === m.DOLLHOUSE || e === m.FLOORPLAN ? g.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
- 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)),
- this.obj3d.visible) {
- this.disc.quaternion.copy(t.quaternion);
- var o = n.maxSize - (n.maxSize - n.minSize) * f.Math.smoothstep(r, n.nearBound, n.farBound);
- l.copy(this.discWorldPosition).project(t),
- c.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(l),
- h.set(o / 2, 0, 0).add(c),
- u.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(h),
- p.copy(u).unproject(t);
- var a = p.distanceTo(this.discWorldPosition)
- , s = 1 + g.tags.disc.scale.responsiveness / 100 * (d.viewportScale() - 1);
- this.discScale = a * s,
- this.disc.scale.set(this.discScale, this.discScale, this.discScale)
- }
- }
- ),
- d.prototype.getDiscRadius = (i = new f.Vector3,
- function(e, t) {
- return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
- Math.abs(e.x - i.x) * $("#player").width()
- }
- ),
- d.prototype.tagVisibleOnCurrentFloor = function(e) {
- return !(e === m.DOLLHOUSE || e === m.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
- }
- ,
- d.prototype.offScreen = function(e, t) {
- var i = e.getWorldPosition().project(t);
- return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
- }
- ,
- d.viewportScale = function() {
- return d.viewportWidth === $("#player").width() && d.viewportHeight === $("#player").height() || (d.viewportWidth = $("#player").width(),
- d.viewportHeight = $("#player").height(),
- d.currentViewportScale = Math.sqrt(Math.min(d.viewportWidth, d.viewportHeight) / g.tags.disc.scale.baseViewportSize)),
- d.currentViewportScale
- }
- ,
- R.exports = d
- }
- ).call(this, "/js/tag/tag.js")
- }
- , {
- "../enum/Colors": 19,
- "../enum/RenderLayers": 41,
- "../enum/RenderOrder": 42,
- "../enum/Viewmode": 51,
- "../objects/Panorama": 148,
- "../settings": 166,
- "../shaders": 167,
- "../util/common": 185,
- "../util/easing": 186,
- "../util/lerp": 188,
- "../util/logger": 189,
- "../util/math": 190,
- "../util/texture": 194,
- "../util/transitions": 195,
- "./Billboard/Billboard": 119,
- "./Billboard/BillboardEvent": 120,
- events: 202,
- three: 217
- }],
- 124: [function(M, R, e) {
- (function(e) {
- "use strict";
- function t() {
- this.tagState = T.IDLE,
- this.intersectTag = null,
- this.hoveredTag = null,
- this.activeTag = null,
- this.tagDiscs = [],
- this.raycaster = new i.Raycaster,
- this.modelManager = null,
- this.player = null,
- this.totaltags = 0,
- this.navigatingViaTag = !1,
- this.enabled = !1
- }
- 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"),
- M("../enum/TagStates")), x = M("events").EventEmitter, S = new n(e);
- r.extend(t, x),
- t.prototype.init = function(e, t) {
- this.modelManager = e,
- this.player = t,
- this.updateModel(),
- this.bindEvents()
- }
- ,
- t.prototype.update = function(e) {
- this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
- }
- ,
- t.prototype.updateTags = function(e, t, i, n) {
- for (var r in this.model.tags)
- this.model.tags[r].update(e, t, i, n)
- }
- ,
- t.prototype.updateModel = function() {
- this.model = this.modelManager.getActiveModel(),
- this.gettagsFromModel(),
- this.totaltags = Object.keys(this.model.tags).length
- }
- ,
- t.prototype.gettagsFromModel = function() {
- for (var e in this.tagDiscs = [],
- this.model.tags) {
- var t = this.model.tags[e].disc;
- t && this.tagDiscs.push(t)
- }
- }
- ,
- t.prototype.bindEvents = function() {
- function e() {
- Object.keys(this.model.tags).forEach(function(e) {
- var t = this.model.tags[e];
- t.bindEvents(),
- t.billboard.on(y.LINK_CLICK, function(e) {
- e.type === A.NAVIGATION && this.navigateViaLink(e.url)
- }
- .bind(this)),
- t.billboard.on(y.IMAGE_OPENED, function() {
- this.tagState = T.EXAMINE,
- this.emit(y.IMAGE_OPENED)
- }
- .bind(this)),
- t.billboard.on(v.CLOSING, this.dismissExaminedTag.bind(this))
- }
- .bind(this))
- }
- this.modelManager.on(_.ActiveModelChanged, this.updateModel.bind(this)),
- this.modelManager.on(_.ActiveModelChanged, e.bind(this)),
- this.player.on(w.ModeChanging, this.onPlayerModeChanging.bind(this)),
- this.player.on(w.PanoChosen, this.onPanoChange.bind(this)),
- this.player.on(w.Ready, this.onPlayerReady.bind(this)),
- this.player.on(w.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
- this.player.on(w.WarpStarted, this.handleWarpStart.bind(this)),
- this.player.on(w.WarpInterrupted, this.handleWarpInterruption.bind(this)),
- e.call(this)
- }
- ,
- t.prototype.navigateViaLink = function(e) {
- var t = a.deserialize(e);
- if (t)
- if (t.mode === C.PANORAMA) {
- try {
- this.player.model.panos.get(t.panoId)
- } catch (e) {
- return void S.warn("Unable to find panorama location", t.panoId)
- }
- this.player.warpToPanoById(t.panoId, t.quaternion, null, null, I.BLACK)
- } else {
- var i = {
- cameraMode: t.mode,
- position: t.position,
- quaternion: t.quaternion,
- scanId: t.panoId,
- orthoZoom: t.zoom,
- floorVisibility: t.floorVisibility,
- thumbUrl: null,
- name: null
- };
- this.player.flyToNewMode({
- mode: t.mode,
- duration: m.warp.outsideTime,
- warpDest: new g(i),
- force: !0
- })
- }
- }
- ,
- t.prototype.handleWarpStart = function(e, t, i, n) {
- this.dismissExaminedTag(),
- t === I.BLACK && (null != n || (n = m.warp.teleportTime),
- e && (i = E.END),
- this.hideShowTagsForBlackoutStyle(i, n))
- }
- ,
- t.prototype.handleWarpInterruption = function(e, t, i) {
- null != i || (i = m.warp.teleportTime),
- this.hideShowTagsForBlackoutStyle(t, i)
- }
- ,
- t.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
- var i = 0
- , n = 0
- , r = t / 2;
- switch (null != e || (e = E.MIDDLE),
- e) {
- case E.END:
- this.hideAlltags(r);
- break;
- case E.BEGINNING:
- this.hideAlltags().done(this.showAlltags.bind(this, r));
- break;
- case E.NONE:
- break;
- case E.MIDDLE:
- n = i = r,
- this.hideAlltags(n),
- setTimeout(function() {
- this.showAlltags(i)
- }
- .bind(this), n);
- break;
- case E.FADEIN:
- setTimeout(function() {
- this.showAlltags(r)
- }
- .bind(this), r)
- }
- }
- ,
- t.prototype.onPlayerModeChanging = function(e, t) {
- t !== C.PANORAMA && this.dismissExaminedTag(),
- t === C.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = C.OUTDOOR);
- var i = t !== C.OUTDOOR;
- i !== this.model.tagsShown && (i ? this.showAlltags(m.tags.startup.fadeInDuration) : this.hideAlltags(m.tags.startup.fadeInDuration))
- }
- ,
- t.prototype.onPanoChange = function(e, t) {
- var i = this.navigatingViaTag;
- if (this.navigatingViaTag = !1,
- !i) {
- this.dismissExaminedTag();
- var n = e && !e.isAligned() ? C.OUTDOOR : C.PANORAMA
- , r = t && !t.isAligned() ? C.OUTDOOR : C.PANORAMA;
- n !== r && (r === C.PANORAMA ? this.showAlltags(m.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(m.tags.startup.fadeInDuration))
- }
- }
- ,
- t.prototype.onPlayerReady = function(e, t, i) {
- this.startAlltags(e, t ? i : null)
- }
- ,
- t.prototype.onPlayerFlyingEnded = function(e, t) {
- this.updateClosestTags(e)
- }
- ,
- t.prototype.dismissExaminedTag = function() {
- this.activeTag && this.tagState === T.EXAMINE && this.dismissActiveTag(),
- this.hoveredTag && (this.hoveredTag.setFreeState(!0),
- this.hoveredTag = null)
- }
- ,
- t.prototype.startAlltags = function(e, t) {
- this.model.shouldShowtags = m.tags.enabled,
- this.enabled = !0,
- e || (this.showAlltags(m.tags.startup.fadeInDuration, m.tags.startup.fadeInDelay),
- t && setTimeout(function() {
- this.activateTag(this.model.getTagBySid(t))
- }
- .bind(this), m.tags.startup.fadeInDuration / 2))
- }
- ,
- t.prototype.showAlltags = function(e, t, i) {
- function n() {
- ++o === this.totaltags && (this.model.tagsShown = !0,
- r.resolve())
- }
- var r = $.Deferred();
- if (!i && this.player.mode === C.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
- return r.resolve().promise();
- var o = 0;
- for (var a in this.model.tags) {
- this.model.tags[a].show(e, t).done(n.bind(this))
- }
- return r.promise()
- }
- ,
- t.prototype.hideAlltags = function(e, t) {
- function i() {
- ++r === this.totaltags && (this.model.tagsShown = !1,
- n.resolve())
- }
- var n = $.Deferred()
- , r = 0;
- for (var o in this.model.tags) {
- var a = this.model.tags[o];
- a.hide(e, t).done(i.bind(this)),
- a === this.activeTag && this.dismissActiveTag()
- }
- return n.promise()
- }
- ,
- t.prototype.enableHovering = function() {
- this.enabled = !0
- }
- ,
- t.prototype.disableHovering = function() {
- this.enabled = !1
- }
- ,
- t.prototype.activateTag = function(e, t) {
- t = t || T.EXAMINE,
- this.activeTag = e,
- this.activeTag.hoveringDisc = !0,
- this.activeTag.setHoverState(t === T.EXAMINE),
- this.tagState = t,
- this.emit(b.TagActivated, e)
- }
- ,
- t.prototype.dismissActiveTag = function() {
- this.activeTag.hoveringDisc = !1,
- this.activeTag.setFreeState(!0);
- var e = this.activeTag;
- this.activeTag = null,
- this.tagState = T.IDLE,
- this.emit(b.TagDismissed, e)
- }
- ,
- t.prototype.clickedOnTag = function(e) {
- var t = function() {
- this.navigatingViaTag = !0,
- this.activeTag.examine(this.player),
- this.emit(b.TagNavigation, this.activeTag)
- }
- .bind(this);
- return this.tagState !== T.EXAMINE ? (this.activateTag(this.intersectTag, T.EXAMINE),
- this.activeTag = this.intersectTag,
- t(),
- !0) : (this.dismissActiveTag(),
- !1)
- }
- ,
- t.prototype.intersecttag = (s = new i.Vector3,
- l = new i.Vector3,
- c = new i.Vector3,
- function(e, t, i) {
- if (!this.enabled)
- return null;
- var n = null
- , r = this.tagDiscs.filter(function(e) {
- return e.parent.visible
- });
- if (0 < r.length) {
- var o = this.model.floors.reduce(function(e, t) {
- return t.hidden ? e : e.concat(t.collider.children)
- }, r);
- s.set(e.x, e.y, -1).unproject(i),
- l.set(e.x, e.y, 1).unproject(i),
- c.copy(l).sub(s).normalize(),
- this.raycaster.set(s, c);
- var a = this.raycaster.intersectObjects(o);
- 0 < a.length && -1 !== r.indexOf(a[0].object) && (n = a[0].object.tag)
- }
- return this.intersectTag = n,
- t && (this.activeTag && n !== this.activeTag && (this.tagState === T.BROWSE || this.tagState === T.EXAMINE && n) && this.dismissActiveTag(),
- n && n !== this.activeTag && (n.listeners(v.ENTER).length < 1 && (n.billboard.on(v.ENTER, function() {
- this.hoveredTag = n
- }
- .bind(this)),
- n.billboard.on(v.LEAVE, function() {
- this.hoveredTag = null
- }
- .bind(this))),
- this.activateTag(n, T.BROWSE))),
- n
- }
- ),
- t.prototype.rankedtagInDirection = (h = [],
- u = [],
- d = new i.Vector3,
- p = new i.Vector3,
- f = new i.Vector3,
- function(e, t, i, n) {
- for (var r = 0, o = u.length = 0; o < this.closesttags.length; o++) {
- var a = this.closesttags[o];
- p.copy(a.position),
- p.add(a.discPosition),
- d.copy(t),
- d.sub(p).negate(),
- d.normalize();
- var s = d.dot(n);
- if (0 <= s && (f.copy(p),
- f.project(i),
- this.intersecttag(f, !1, i))) {
- if (r >= h.length)
- for (var l = 0; l < 64; l++)
- h.push({
- tag: a,
- dot: s
- });
- var c = h[r];
- c.tag = a,
- c.dot = s,
- c.position = math.projectPositionToCanvas(p, i),
- u.push(c),
- r++
- }
- }
- return u.sort(function(e, t) {
- return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
- }),
- e < u.length ? u[e].tag : null
- }
- ),
- t.prototype.updateClosestTags = (o = new i.Vector3,
- function(e) {
- this.closesttags || (this.closesttags = []),
- this.closesttags.length = 0;
- var t = this.model.tags;
- if (t)
- for (var i in t)
- if (t.hasOwnProperty(i)) {
- var n = t[i]
- , r = n.position;
- o.copy(e),
- o.sub(r).negate(),
- o.lengthSq() < 30 && this.closesttags.push(n)
- }
- }
- ),
- R.exports = t
- }
- ).call(this, "/js/tag/tagManager.js")
- }
- , {
- "../controls/serializer": 14,
- "../enum/BlackoutStyle": 18,
- "../enum/tagEvents": 32,
- "../enum/ModelManagerEvents": 33,
- "../enum/PlayerEvents": 40,
- "../enum/TagStates": 44,
- "../enum/Viewmode": 51,
- "../enum/WarpStyle": 52,
- "../objects/Snapshot": 153,
- "../settings": 166,
- "../util/common": 185,
- "../util/lerp": 188,
- "../util/logger": 189,
- "./Billboard/BillboardEvent": 120,
- "./Media/LinkType": 130,
- "./Media/MediaEvent": 131,
- events: 202,
- three: 217
- }],
- 125: [function(r, o, e) {
- (function(e) {
- "use strict";
- function t() {
- this.embedWrapper = null,
- this.embedElement = null
- }
- var i = r("../../util/ajax")
- , a = r("./mediaSettings")
- , n = r("../../settings")
- , s = new (r("../../util/logger"))(e);
- t.prototype.createDomElement = function() {
- return this.embedWrapper = document.createElement("div"),
- this.embedWrapper.classList.add("tag-embed"),
- this.embedWrapper.classList.add("hidden"),
- this.embedWrapper
- }
- ,
- t.prototype.load = function(e) {
- var t = "https://api.embedly.com/1/oembed?key=" + n.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + a.maxEmbedWidth;
- return new Promise(function(r, o) {
- i.get(t).then(function(e) {
- if ((e = JSON.parse(e)).html && -1 === e.html.indexOf("<script")) {
- this.embedWrapper.innerHTML = e.html;
- var t = Math.min(e.width, a.maxEmbedWidth) || a.maxEmbedWidth;
- if (this.embedWrapper.style.width = t + "px",
- e.height) {
- var i = e.height / e.width;
- this.embedWrapper.style.height = t * i + "px"
- }
- this.embedElement = this.embedWrapper.firstChild;
- var n = [];
- try {
- n = [].slice.call(this.embedElement.querySelectorAll("a"))
- } catch (e) {
- s.debug("Error getting `a` elements for embed; was it an iframe?")
- }
- n.forEach(function(e) {
- e.setAttribute("target", "_blank")
- }),
- this.embedElement.classList.add("hidden"),
- this.embedWrapper.classList.remove("hidden"),
- r()
- } else
- o("Not a valid embed")
- }
- .bind(this), function(e) {
- o(e.response)
- })
- }
- .bind(this))
- }
- ,
- t.prototype.show = function() {
- this.embedElement && this.embedElement.classList.remove("hidden")
- }
- ,
- t.prototype.hide = function() {
- this.embedElement && this.embedElement.classList.add("hidden")
- }
- ,
- o.exports = t
- }
- ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
- }
- , {
- "../../settings": 166,
- "../../util/ajax": 181,
- "../../util/logger": 189,
- "./mediaSettings": 132
- }],
- 126: [function(a, s, e) {
- (function(e) {
- "use strict";
- function t(e) {
- r.call(this),
- this.options = e,
- this.playerControls = null,
- this.state = o.NOT_READY
- }
- var i, n = a("../../util/browser"), r = a("./EmbedlyEmbed"), o = (new (a("../../util/logger"))(e),
- Object.freeze({
- NOT_READY: "player.not.ready",
- CUED: "player.cued",
- PLAYING: "player.playing",
- PAUSED: "player.paused"
- }));
- (t.prototype = Object.create(r.prototype)).createDomElement = function() {
- return this.embedWrapper = document.createElement("div"),
- this.embedWrapper.classList.add("tag-video"),
- this.embedWrapper.classList.add("hidden"),
- this.embedWrapper
- }
- ,
- t.prototype.load = function(e) {
- var t = function() {
- function e(e) {
- this.playerState = e
- }
- this.playerControls = new playerjs.Player(this.embedElement),
- this.playerControls.on("ready", function(e) {
- this.playerState = o.CUED,
- this.options.startMuted && this.playerControls.mute()
- }
- .bind(this)),
- this.playerControls.on("play", e.bind(this, o.PLAYING)),
- this.playerControls.on("pause", e.bind(this, o.PAUSED)),
- this.playerControls.on("ended", function(e) {
- this.playerControls.setCurrentTime(0),
- this.options.loop ? this.playerControls.play() : this.playerControls.pause()
- }
- .bind(this))
- }
- .bind(this);
- return r.prototype.load.call(this, e).then(t.bind(this))
- }
- ,
- t.prototype.play = (i = n.isMobile(),
- function() {
- this.playerState !== o.NOT_READY && this.playerControls && !i && (this.state === o.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
- }
- ),
- t.prototype.pause = function() {
- this.playerState !== o.NOT_READY && this.playerControls && this.playerControls.pause()
- }
- ,
- s.exports = t
- }
- ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
- }
- , {
- "../../util/browser": 182,
- "../../util/logger": 189,
- "./EmbedlyEmbed": 125
- }],
- 127: [function(t, i, e) {
- (function(e) {
- "use strict";
- var r = t("../../util/ajax")
- , o = new (t("./mediaSettings"),
- t("../../util/logger"))(e)
- , a = Promise.resolve();
- i.exports.enqueue = function(i) {
- function n() {}
- return a = new Promise(function(e, t) {
- a.catch(n).then(function() {
- (o.debug("requesting file from embedly:", i.href),
- r.get(i.href, {
- responseType: i.responseType
- }).then(function(e) {
- return o.debug("requesting file finished:", i.href),
- e
- })).then(e, t)
- })
- }
- )
- }
- }
- ).call(this, "/js/tag/Media/EmbedlyQueue.js")
- }
- , {
- "../../util/ajax": 181,
- "../../util/logger": 189,
- "./mediaSettings": 132
- }],
- 128: [function(s, l, e) {
- (function(e) {
- "use strict";
- function t() {
- this.imageWrapper = null,
- this.width = 0,
- this.height = 0,
- this.aspect = 1
- }
- var i = s("./MediaEvent")
- , n = s("./EmbedlyQueue")
- , r = s("events").EventEmitter
- , o = s("../../util/logger")
- , a = s("../../settings");
- new o(e),
- (t.prototype = Object.create(r.prototype)).createDomElement = function() {
- return this.imageWrapper = document.createElement("div"),
- this.imageWrapper.classList.add("tag-image"),
- this.imageWrapper.classList.add("hidden"),
- this.imageWrapper.addEventListener("click", function(e) {
- e.stopPropagation(),
- this.emit(i.IMAGE_OPENING),
- this.imageWrapper.style.pointerEvents = "none"
- }
- .bind(this)),
- this.imageWrapper
- }
- ,
- t.prototype.onClosed = function() {
- this.imageWrapper.style.pointerEvents = "auto"
- }
- ,
- t.prototype.load = function(e) {
- var t = Math.max(window.screen.height, window.screen.width)
- , i = "https://i.embed.ly/1/display/resize?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
- return new Promise(function(o, e) {
- n.enqueue({
- href: i,
- responseType: "arraybuffer"
- }).then(function(e) {
- var t = new Uint8Array(e)
- , i = new Blob([t])
- , n = new window.Image;
- n.addEventListener("load", function(e) {
- var t = e.target;
- this.width = t.naturalWidth,
- this.height = t.naturalHeight,
- this.aspect = this.width / this.height;
- var i = e.target.src;
- this.imageWrapper.style.backgroundImage = 'url("' + i + '")',
- this.imageWrapper.style.width = this.width + "px",
- this.imageWrapper.style.height = this.height + "px",
- this.imageWrapper.classList.remove("hidden"),
- o()
- }
- .bind(this));
- var r = URL.createObjectURL(i);
- n.src = r
- }
- .bind(this), e)
- }
- .bind(this))
- }
- ,
- l.exports = t
- }
- ).call(this, "/js/tag/Media/Image.js")
- }
- , {
- "../../settings": 166,
- "../../util/logger": 189,
- "./EmbedlyQueue": 127,
- "./MediaEvent": 131,
- events: 202
- }],
- 129: [function(e, t, i) {
- "use strict";
- function n(e) {
- this.label = e.label,
- this.href = e.url,
- this.type = this.updateLinkForType(),
- this.domElement = null,
- this.id = c++
- }
- var r = e("./LinkType")
- , o = e("./MediaEvent")
- , a = e("../../util/browser")
- , s = e("../../analytics")
- , l = e("events").EventEmitter
- , c = 0;
- (n.prototype = Object.create(l.prototype)).updateLinkForType = function() {
- var e, t = a.valueFromHash("m") || a.valueFromHash("model");
- 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,
- new RegExp("[#&?]start=([^#&?]*)").exec(e)[1]),
- r.NAVIGATION) : (this.href = this.href + "&play=1",
- r.MODEL) : r.EXT_LINK
- }
- ;
- var h = {};
- n.prototype.createDomElement = function() {
- if (this.domElement = document.createElement("a"),
- this.domElement.classList.add("tag-link"),
- this.domElement.textContent = this.label,
- this.type === r.EXT_LINK) {
- this.domElement.textContent += " ";
- var e = document.createElement("i");
- e.classList.add("icon-ext-link"),
- e.title = "Link to external web site",
- this.domElement.appendChild(e)
- }
- return this.domElement.addEventListener("click", function(e) {
- switch (e.stopPropagation(),
- h[this.id] = !0,
- s.trackAlways("click_tag_link", {
- link_type: this.type,
- link_count: c,
- links_clicked: Object.keys(h).length
- }),
- this.type) {
- case r.MODEL:
- window.location.replace(this.href);
- break;
- case r.EXT_LINK:
- window.open(this.href, "_blank")
- }
- this.emit(o.LINK_CLICK, {
- type: this.type,
- url: this.href
- })
- }
- .bind(this)),
- this.domElement
- }
- ,
- t.exports = n
- }
- , {
- "../../analytics": 4,
- "../../util/browser": 182,
- "./LinkType": 130,
- "./MediaEvent": 131,
- events: 202
- }],
- 130: [function(e, t, i) {
- "use strict";
- t.exports = {
- NAVIGATION: "navigation",
- MODEL: "model",
- EXT_LINK: "ext-link"
- }
- }
- , {}],
- 131: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- LINK_CLICK: "mtmedia.link",
- IMAGE_LOADED: "mtmedia.image.loaded",
- IMAGE_OPENING: "mtmedia.image.opening",
- IMAGE_OPENED: "mtmedia.image.opened",
- IMAGE_CLOSING: "mtmedia.image.closing",
- IMAGE_CLOSED: "mtmedia.image.closed",
- VIDEO_START: "mtmedia.video.start",
- VIDEO_PAUSE: "mtmedia.video.pause",
- VIDEO_ENDED: "mtmedia.video.end"
- })
- }
- , {}],
- 132: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- maxEmbedWidth: 350,
- defaultAspectRatio: .75
- })
- }
- , {}],
- 133: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- TEXT: "text",
- LINK: "link",
- IMAGE: "photo",
- VIDEO: "video",
- RICH: "rich"
- })
- }
- , {}],
- 134: [function(e, t, i) {
- "use strict";
- function n(e) {
- this.capabilities = {
- links: {
- enable: e.supportLinks,
- keepLabels: e.keepLinkLabels
- }
- }
- }
- var r = e("./DescriptionChunkType");
- n.prototype.parse = function(e, i) {
- var n = [];
- return e.split("[").map(function(e, t) {
- return 0 === t ? e : "[" + e
- }).forEach(function(e) {
- var t = this.findMarkdown(e);
- if (t) {
- if (-1 !== t.url.indexOf("javascript:"))
- return;
- this.addLinkChunk(n, t, i),
- this.addTextChunk(n, e.slice(t.markdown.length))
- } else
- this.addTextChunk(n, e)
- }
- .bind(this)),
- n
- }
- ,
- n.prototype.findMarkdown = function(e) {
- var t = e.match(/\[([^\]]*)\]\((.*)\)/);
- if (t) {
- for (var i = t[2], n = 1, r = 0; r < i.length && ("(" === i[r] ? n++ : ")" === i[r] && n--,
- 0 !== n); )
- r++;
- var o = i.length - r;
- return {
- markdown: t[0].substring(0, t[0].length - o),
- label: t[1],
- url: t[2].substring(0, r)
- }
- }
- }
- ,
- n.prototype.addTextChunk = function(e, t) {
- 0 !== t.length && e.push({
- type: r.TEXT,
- text: t
- })
- }
- ,
- n.prototype.addLinkChunk = function(e, t) {
- if (this.capabilities.links.enable) {
- var i = {
- label: t.label,
- url: t.url
- };
- -1 === i.url.indexOf("://") && (i.url = "http://" + i.url),
- e.push({
- type: r.LINK,
- link: i
- })
- } else
- this.capabilities.links.keepLabels && this.addTextChunk(e, t.label)
- }
- ,
- t.exports = n
- }
- , {
- "./DescriptionChunkType": 133
- }],
- 135: [function(t, r, e) {
- (function(e) {
- "use strict";
- var i = new (t("../util/logger"))(e)
- , n = {
- parseIdsFromChunkName: function(e, t) {
- t.floorId = n.parseFloor(e),
- t.roomId = n.parseRoom(e)
- },
- parseFloor: function(e) {
- var t = e.match(/_group([0-9]+)/);
- if (!t)
- return 0;
- try {
- return parseInt(t[1], 10)
- } catch (e) {
- return i.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
- 0
- }
- },
- parseRoom: function(e) {
- var t = e.match(/_sub([0-9]+)/);
- if (!t)
- return -1;
- try {
- return parseInt(t[1], 10)
- } catch (e) {
- return i.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
- 0
- }
- }
- };
- r.exports = n
- }
- ).call(this, "/js/model/Chunks.js")
- }
- , {
- "../util/logger": 189
- }],
- 136: [function(a, c, e) {
- (function(e) {
- "use strict";
- function t(e) {
- r.call(this),
- this.model = e,
- this.exploded = !1
- }
- var i = a("../objects/Floor")
- , n = (a("../settings"),
- a("../util/logger"))
- , s = a("../util/transitions")
- , r = a("../util/IndexedCollection")
- , o = a("../util/common")
- , l = a("../util/easing");
- new n(e),
- o.inherit(t, r),
- t.prototype.add = function(e) {
- r.prototype.add.call(this, e),
- this.model.add(e)
- }
- ,
- t.prototype.getIndex = function(e) {
- return e.floorIndex
- }
- ,
- t.prototype.build = function() {
- this.list.forEach(function(e) {
- e.build()
- })
- }
- ,
- t.prototype.size = function() {
- return this.length
- }
- ,
- t.prototype.sort = function() {
- r.prototype.sort.call(this, function(e, t) {
- return e.floorIndex - t.floorIndex
- })
- }
- ,
- t.prototype.nextFloor = function(e, t) {
- return this.index[e.floorIndex + t] || null
- }
- ,
- t.prototype.getFloorAtPoint = function(e) {
- for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
- var r = this.list[n]
- , o = r.distanceToPoint(e);
- (!t || o < i) && (i = o,
- t = r)
- }
- return t
- }
- ,
- t.prototype.getOrMakeFloor = function(e) {
- var t = this.index[e];
- return t || (t = new i(this.model,e),
- this.add(t)),
- t
- }
- ,
- t.prototype.hide = function() {
- this.list.forEach(function(e) {
- e.hide()
- })
- }
- ,
- t.prototype.show = function() {
- this.list.forEach(function(e) {
- e.show()
- })
- }
- ,
- t.prototype.names = function() {
- return this.list.reduce(function(e, t) {
- return e.concat(t.name)
- }, [])
- }
- ,
- t.prototype.toggleExplodeHorizontal = function() {
- function i(e, t) {
- a.copy(e.position),
- e.position.x = r[e.floorIndex] * t,
- e.position.y = 1 * e.floorIndex * t,
- a.sub(e.position).multiplyScalar(-1),
- e.panos.forEach(function(e) {
- e.translate(a)
- })
- }
- var n, r = [], o = 0;
- this.list.forEach(function(e, t, i) {
- n = 0 < t ? Math.max(i[t - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
- o += n,
- r[t] = o
- }),
- r = r.map(function(e) {
- return e - o / 2
- });
- var a = this.list[0].position.clone();
- this.exploded ? this.list.forEach(function(t) {
- s.start(function(e) {
- i(t, 1 - e)
- }, 1500, null, 0, l.easeOutExpo)
- }) : this.list.forEach(function(t) {
- s.start(function(e) {
- i(t, e)
- }, 1500, null, 0, l.easeOutExpo)
- }),
- this.exploded = !this.exploded
- }
- ,
- t.prototype.toggleExplodeVertical = function() {
- function i(e, t) {
- var i = i.copy(e.position);
- e.position.y = (5 * e.floorIndex - n.y / 2) * t,
- i.sub(e.position).multiplyScalar(-1),
- e.panos.forEach(function(e) {
- e.translate(i)
- })
- }
- var n = this.model.size;
- this.list[0].position.clone(),
- this.exploded ? this.list.forEach(function(t) {
- s.start(function(e) {
- i(t, 1 - e)
- }, 1500, null, 0, l.easeOutExpo)
- }) : this.list.forEach(function(t) {
- s.start(function(e) {
- i(t, e)
- }, 1500, null, 0, l.easeOutExpo)
- }),
- this.exploded = !this.exploded
- }
- ,
- c.exports = t
- }
- ).call(this, "/js/model/FloorCollection.js")
- }
- , {
- "../objects/Floor": 146,
- "../settings": 166,
- "../util/IndexedCollection": 175,
- "../util/common": 185,
- "../util/easing": 186,
- "../util/logger": 189,
- "../util/transitions": 195
- }],
- 137: [function(r, o, e) {
- (function(e) {
- "use strict";
- function h() {
- n.call(this)
- }
- var u = r("../settings")
- , t = r("../util/logger")
- , d = r("../enum/Viewmode")
- , p = r("../objects/Snapshot")
- , i = (r("../util/math"),
- r("../util/common"))
- , n = r("../util/IndexedCollection")
- , l = new t(e);
- i.inherit(h, n),
- h.prototype.getImage = function(e) {
- return e && this.index.hasOwnProperty(e) ? this.index[e] : null
- }
- ,
- h.prototype.filterByModesAndReel = function(e, t) {
- for (var i = [], n = 0; n < t.length; n += 1) {
- var r = t[n]
- , o = this.index[r.sid];
- o && i.push(o)
- }
- var a = e[d.DOLLHOUSE]
- , s = e[d.FLOORPLAN];
- (i = i.filter(function(e) {
- if (!e.metadata || void 0 === e.metadata.camera_mode)
- return !0;
- var t;
- try {
- t = d.convertWorkshopModeInt(e.metadata.camera_mode)
- } catch (e) {
- return l.debug(e.message),
- !1
- }
- return t === d.PANORAMA || t === d.FLOORPLAN && s || t === d.DOLLHOUSE && a
- })).length !== this.list.length && l.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
- this.list = i,
- this.reIndex()
- }
- ,
- h.prototype.getHeroLocations = function(e) {
- if (0 === this.list.length)
- return [];
- for (var t = [], i = 0; i < this.list.length; ++i) {
- var n = this.list[i]
- , r = n.thumbnail_signed_src
- , o = n.name || "";
- if (n.metadata && void 0 !== n.metadata.camera_quaternion) {
- if (!u.show360Views.enabled && n.metadata.scan_id) {
- var a = e.get(n.metadata.scan_id);
- if (a && !a.isAligned())
- continue
- }
- var s = d.convertWorkshopModeInt(n.metadata.camera_mode);
- if (s === d.MESH)
- continue;
-
- if(window.isLocal)var src = manage.dealURL(r)
- else var src = "one" === g_version ? g_Prefix + r + "?" + randomTime().getTime() : r + "?" + randomTime().getTime()
-
- var l = {
- cameraMode: s,
- position: n.metadata.camera_position,
- quaternion: n.metadata.camera_quaternion,
- zoom: n.metadata.zoom,
- panoId: n.metadata.scan_id,
- orthoZoom: n.metadata.ortho_zoom,
- floorVisibility: void 0 !== n.metadata.floor_visibility ? n.metadata.floor_visibility.slice(0) : [],
- thumbUrl: src,
- name: h.filterImageName(o),
- sid: n.sid
- }
- , c = new p(l);
- t.push(c)
- }
- }
- return t
- }
- ,
- h.prototype.getIndex = function(e) {
- return e.sid
- }
- ,
- h.filterImageName = function(e) {
- return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
- }
- ,
- o.exports = h
- }
- ).call(this, "/js/model/ImageCollection.js")
- }
- , {
- "../enum/Viewmode": 51,
- "../objects/Snapshot": 153,
- "../settings": 166,
- "../util/IndexedCollection": 175,
- "../util/common": 185,
- "../util/logger": 189,
- "../util/math": 190
- }],
- 138: [function(h, u, e) {
- (function(e) {
- "use strict";
- function n() {
- c.call(this)
- }
- var r = h("../label/Label")
- , i = h("../settings")
- , t = h("../util/logger")
- , o = h("../util/math")
- , a = h("../util/ajax")
- , s = h("./RoomCollection")
- , l = h("../util/common")
- , c = h("../util/IndexedCollection");
- new t(e),
- l.inherit(n, c),
- n.prototype.getIndex = function(e) {
- return e.labelId
- }
- ,
- n.prototype.associateWithRooms = function(e) {
- this.forEach(function(t) {
- e.forEach(function(e) {
- e.roomId === t.roomId && (t.room = e)
- })
- })
- }
- ,
- n.prototype.createFromLabelData = function(e) {
- e.forEach(function(e) {
- var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
- t = s.generateRoomId(e.floorId, t);
- var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
- i.position = o.convertWorkshopVector(i.position),
- this.add(i),
- i.build()
- }
- .bind(this))
- }
- ,
- n.prototype.load = function(e, t) {
- return a.get(e, {
- responseType: "json",
- auth: t ? i.authorizationHeader : null
- }).done(function(e) {
- var t = [];
- for (var i in e) {
- var n = e[i];
- t.push(n)
- }
- this.createFromLabelData(t)
- }
- .bind(this))
- }
- ,
- n.parseRoomIndexFromWorkshopRoomId = function(e) {
- var t = -1;
- if (e) {
- var i = e.split("_");
- t = parseInt(i[0])
- }
- return t
- }
- ,
- u.exports = n
- }
- ).call(this, "/js/model/LabelCollection.js")
- }
- , {
- "../label/Label": 90,
- "../settings": 166,
- "../util/IndexedCollection": 175,
- "../util/ajax": 181,
- "../util/common": 185,
- "../util/logger": 189,
- "../util/math": 190,
- "./RoomCollection": 141
- }],
- 139: [function(P, O, e) {
- (function(e) {
- "use strict";
- function t(e, t) {
- o.Object3D.call(this),
- this.sid = window.number;//t.sid,
- this.data = t,
- this.options = e,
- this.urls = new i(e.urlFiles),
- this.isPublic = void 0 !== t.is_public && t.is_public,
- this.images = new E(this),
- this.images.extend(t.images),
- this.heroImage = this.images.getImage(t.icon),
- this.heroLocations = [],
- this.outdoorPanoLocations = [],
- this.floors = new c(this),
- this.floorsEnabled = void 0 === e.floors || e.floors,
- this.changingFloor = !1,
- this.chunks = [],
- this.panos = new g,
- this.colliders = [],
- this.loadPanosPromise = null,
- this.loadMeshTexturesPromise = null,
- this.auxDataPromise = null,
- this.meshTexturesLoaded = !1,
- this.meshTextures = [],
- this.tags = {},
- this.tagsShown = !1,
- this.shouldShowtags = !1,
- this.has360Views = !1,
- this.showingLabels = u.labels.enabled && t.player_options.labels,
- this.supportedModes = {},
- this.supportedModes[s.PANORAMA] = !0,
- this.supportedModes[s.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && I.valueFromHash("dh", 1),
- this.supportedModes[s.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && I.valueFromHash("dh", 1),
- this.supportedModes[s.TRANSITIONING] = !0,
- this.supportsTiles = this.configureTiling(),
- this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || false//!0,
- this.mode = s.DOLLHOUSE,
- this.size = null,
- this.center = null,
- this.boundingBox = new o.Box3,
- this.currentFloor = null,
- this.allFloorsVisible = !0,
- this.projectedPano0 = null,
- this.projectedPano1 = null,
- this.floorsEnabled && t.floors && -1 !== t.floors.indexOf(",") && t.floors.split(",").forEach(function(e, t) {
- this.addFloor(new r(this,t,e.trim()))
- }
- .bind(this)),
- this.waitQueue = [],
- this.on("load", function(e) {
- 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
- return !e.isLoadedCallback()
- }),
- 0 === this.waitQueue.length && this.emit("waiting-done"))
- }
- .bind(this)),
- this.setupCustomProperties(),
- this.hots = {}
-
- }
- var o = P("three")
- , a = P("../util/ajax")
- , i = P("../util/ModelUrls")
- , n = P("../objects/BoundingTextureSkybox")
- , s = P("../enum/Viewmode")
- , l = P("../enum/RenderOrder")
- , r = (P("../enum/AlignmentType"),
- P("../objects/Floor"))
- , c = P("./FloorCollection")
- , h = P("../objects/Chunk")
- , u = (P("../objects/Room"),
- P("../objects/Snapshot"),
- P("../label/Label"),
- P("../util/math"),
- P("../settings"))
- , d = P("../shaders")
- , p = P("../util/logger")
- , f = (P("../tag/tag"),
- P("../tag/tagManager"),
- P("../objects/Panorama"))
- , g = P("../util/PanoramaCollection")
- , m = P("../loaders/ModelLoader")
- , v = P("../loaders/ModelTextureLoader")
- , y = P("../loaders/SweepDataLoader")
- , A = P("../util/transitions")
- , C = (P("../util/easing"),
- P("../util/lerp"),
- P("../util/common"))
- , I = (P("../util/texture"),
- P("./../util/browser"))
- , E = P("./ImageCollection")
- , _ = P("./RoomCollection")
- , b = P("./LabelCollection")
- , w = P("./Chunks")
- , T = P("./../util/showcase")
- , x = P("../exception/BasicException")
- , S = (P("../constants"),
- P("events").EventEmitter)
- , M = P("hot")
- , R = new p(e);
- t.prototype = Object.create(o.Object3D.prototype),
- C.extend(t, S),
- t.prototype.setupCustomProperties = function() {
- var t = u.modelAlpha;
- Object.defineProperty(this, "alpha", {
- get: function() {
- return t
- },
- set: function(e) {
- t = e,
- this.chunks.forEach(function(e) {
- e.material && e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = t)
- })
- }
- })
- }
- ,
- t.prototype.configureTiling = function() {
- var e = function() {
- try {
- var e = document.createElement("canvas")
- , t = e.getContext("webgl");
- return (t = t || e.getContext("experimental-webgl")).getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
- } catch (e) {
- return 0
- }
- }();
- if (e < 2048)
- return !1;
- R.warn("Max cube texture size: " + e);
- for (var t = 0; t < u.tiling.tilingFlagNames.length; t++) {
- var i = u.tiling.tilingFlagNames[t];
- if ("1" === I.valueFromHash(i, null))
- return !0;
- if ("0" === I.valueFromHash(i, null))
- return !1
- }
- return !!T.modelDataPromisesTiles(this.data)
- }
- ,
- t.prototype.toggleAlpha = function() {
- this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
- }
- ,
- t.prototype.load = function(e) {
- var t = this.urls.init().then(function() {
- return $.when(this.loadPanos(), this.loadMesh())
- }
- .bind(this));
- return e ? t = t.then(this.loadMeshTextures.bind(this)) : t.then(this.loadMeshTextures.bind(this)),
- this.auxDataPromise = $.when(this.loadhots(), this.loadLabels()),
- $.when(t, this.auxDataPromise).done(this.build.bind(this))
- }
-
-
-
- ,
- t.prototype.loadMesh = function() {
- var n = $.Deferred()
- , r = this;
- return m.load(r.data.job.uuid, r.urls, function(e, t) {
- if (0 === e.length) {
- R.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
- r.supportedModes[s.DOLLHOUSE] = !1,
- r.supportedModes[s.FLOORPLAN] = !1;
- var i = new h({
- geometry: new o.PlaneBufferGeometry(5,5,1,1)
- });
- i.material.visible = !1,
- i.rotateX(-Math.PI / 2),
- i.geometry.computeBoundingBox(),
- e = [i]
- }
- e.forEach(function(e) {
- var t = r.floorsEnabled ? w.parseFloor(e.name) : 0;
- r.addChunk(t, e)
- }),
- r.floors.sort(),
- n.resolve(r)
- }, function(e, t) {
- n.notify(e, t)
- }, function(e) {
- R.error(e),
- n.reject("loading-failed")
- }),
- n.promise()
- }
- ,
- t.prototype.loadMeshTextures = function() {
- return this.loadTexturesPromise || (this.loadTexturesPromise = v.load(this, this.meshTextures).then(function() {
- this.meshTexturesLoaded = !0
- }
- .bind(this))),
- this.loadTexturesPromise
- }
- ,
- t.prototype.shineHots = function() {
- A.trigger({
- func: function(e) {
- var opa = e <= .5 ? 2 * e : -2 * e + 2
- for(var i in this.hots){
- this.hots[i].mesh.material.uniforms.opac.value = opa;
- }
- }
- .bind(this),
- cycling: !0,
- duration: 3e3,
- name: "hotShine"
- })
- }
- ,
- t.prototype.createHotItem = function(e, t) {
- for (var i = document.createDocumentFragment(), n = Object.keys(e), r = 0; r < n.length; r++) {
- var o = document.createElement("li")
- , a = document.createElement("span");
- a.innerHTML = e[n[r]].title || e[n[r]].infoAttribute.title || "热点",
- o.hot = t[n[r]],
- o.appendChild(a),
- i.appendChild(o)
- }
- document.querySelector("#hotListContent ul").appendChild(i),
- console.log(i)
- }
- ,
- t.prototype.loadOverlays = function(overlays){
- var overlays = window.data2 && window.data2.overlays /* ||
- [
- { depth: 0.02,
- file: "https://super.4dage.com/data/TEST/overlay/b6fe7cb6bd2b6.mp4",
- hasBox: 0,
- height: 0.8165,
- media: ["video"],
- pos: [-4.3132, 0.6788, -13.5162],
- qua: [0, 0.9396, 0, 0.3421],
- sid: "1591079418827",
- width: 0.6124
- }] */
-
- overlays && overlays.forEach((info)=>{
- new Overlay(info)
- })
- }
-
- ,
- t.prototype.loadhots = function() {
- var r = $.Deferred()
- , e = g_Prefix + "data/" + this.sid + "/data2.js?" + randomTime().getTime();
- return a.get(e, {
- responseType: "json",
- auth: this.isPublic ? null : u.authorizationHeader
- }).done(function(e) {
- window.data2 = e;
- if(!e){
- console.error("data2 is null")
- }else{
- g_data2 = hotMatcher(e)
- this.hotsCount = 0;
- //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
- window.hotData = {}
-
- if(e.hots){
- var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
-
- sids.forEach((sid)=>{
- this.hotsCount++,
- this.hots[sid] = new M(sid,e.hots[sid] ,this);
- e.hots[sid].infoAttribute || (e.hots[sid].infoAttribute = {})
- this.hots[sid].initStyleImg(e.hots[sid].infoAttribute);
- window.hotData[sid] = e.hots[sid];
- })
- }
- this.createHotItem(window.hotData, this.hots);
-
- g_index = I.valueFromHash("m"),
- e.tourAudio && (g_tourAudio = new Audio,
- g_tourAudio.loop = !1,
- g_tourAudio.addEventListener("ended", function() {
- var e = document.createEvent("MouseEvent");
- e.initEvent("tourAudioEnded", !0, !0),
- window.dispatchEvent(e)
- }));
- e.weixinDesc && (g_weixinObj.desc = e.weixinDesc)
- //window.wx && manage.weixinShare(),
-
-
-
- }
- /* var i = $.Deferred()
- , n = g_Prefix + "data/" + this.sid + "/hot/js/data.js?" + randomTime().getTime();
- a.get(n, {
- responseType: "json",
- auth: this.isPublic ? null : u.authorizationHeader
- }).done(function(e) {
- window.hotData = e,
- this.createHotItem(e, this.hots);
-
- for(let i in this.hots){
- e[i] && this.hots[i].initStyleImg(e[i]);
- }
-
- i.resolve()
- }
- .bind(this)).fail(function() {
- console.log("Data.js is empty");
-
- i.resolve()
- }),
- */
- r.resolve()
- }
- .bind(this)).fail(function() {
- console.log("没有热点"),
- //window.wx && manage.weixinShare(),
- r.resolve()
- }),
- r
- }
- ,
- t.prototype.loadPanos = function() {
- if (this.loadPanosPromise)
- return this.loadPanosPromise;
- var e = new y(this);
- return this.loadPanosPromise = e.load().then(function(e) {
- return this.data.sweeps && 0 < Object.keys(this.data.sweeps).length && (e = e.filter(function(e) {
- if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
- else console.log(e.uuid)
- //return this.data.sototype.loadOverlaysweeps[e.uuid].enabled
- }
- .bind(this))),
- this.panos.extend(e.map(function(e) {
- return new f(this,e.uuid,e,this.supportsTiles)
- }
- .bind(this))),
- this.panos.forEach(function(i) {
- i.neighbourUUIDs && (i.neighbourUUIDs.forEach(function(e) {
- var t = this.panos.get(e);
- t && this.panos.setNeighbour(i, t, !0)
- }
- .bind(this)),
- i.neighbourPanos = this.panos.getNeighbours(i) || this.panos.setNeighbour(i, i, !0))
- }
- .bind(this)),
- 0 === this.panos.length && (R.warn("Model has no panos, turning off inside mode"),
- this.supportedModes[s.PANORAMA] = !1),
- $.when(this)
- }
- .bind(this)),
- this.loadPanosPromise
- }
- ,
- t.prototype.loadHighlightReel = function() {
- var t = $.Deferred()
- , e = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
- return a.get(e, {
- responseType: "json",
- auth: this.isPublic ? null : u.authorizationHeader
- }).done(function(e) {
- e.reel ? (R.info("Got highlight reel with " + e.reel.length + " items"),
- this.images.filterByModesAndReel(this.supportedModes, e.reel)) : R.info("No highlight reel found"),
- t.resolve()
- }
- .bind(this)).fail(function() {
- R.warn("Getting highlight reel failed, no highlights available"),
- t.resolve()
- }),
- t
- }
- ,
- t.prototype.waitForLoad = function(e, t) {
- t() || (this.waitQueue.push({
- object: e,
- isLoadedCallback: t
- }),
- 1 === this.waitQueue.length && this.emit("waiting"))
- }
- ,
- t.prototype.hide = function() {
- this.floors.hide()
- }
- ,
- t.prototype.show = function() {
- this.floors.show()
- }
- ,
- t.prototype.floorNames = function() {
- return this.floors.names()
- }
- ,
- t.prototype.warpDestFloors = function(e, t) {
- if (e && this.floors.length === e.length) {
- var i = e.findIndex(function(e) {
- return e
- }
- .bind(this));
- -1 !== i && this.setFloor(this.floors.list[i], null, t)
- } else
- this.toggleAllFloors(!0)
- }
- ,
- t.prototype.setFloor = function(e, t, i) {
- this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
- this.allFloorsVisible = !1,
- this._setFloor(e, t, i)
- }
- ,
- t.prototype.toggleAllFloors = function(e) {
- this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
- this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
- this._setFloor(this.currentFloor)
- }
- ,
- t.prototype._setFloor = function(e, t, i) {
- var n;
- if (t = t || this.mode,
- this.emit("floor.changed", e, t, this.currentFloor),
- this.currentFloor = e,
- t === s.PANORAMA) {
- if (this.show(),
- this.shouldShowtags && this.tagsShown)
- for (n in this.tags)
- this.tags[n].show(u.showFloorDuration)
- } else if ((t === s.FLOORPLAN || t === s.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
- e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
- }
- .bind(this)),
- this.shouldShowtags && this.tagsShown))
- for (n in this.tags) {
- var r = this.tags[n];
- this.allFloorsVisible ? r.show(u.showFloorDuration) : r.floor === this.currentFloor ? r.show(u.showFloorDuration, u.showFloorDelay) : r.hide(u.hideFloorDuration, u.hideFloorDelay)
- }
- var o = this
- , a = e;
- A.start(function() {}, u.showFloorDelay, function() {
- o.floors.forEach(function(t) {
- t.chunks.forEach(function(e) {
- e.renderOrder = t === a ? l.visibleFloor : l.ghostFloor
- })
- })
- }
- .bind(this))
- }
- ,
- t.prototype.toggleExplode = function() {
- this.floors.toggleExplodeHorizontal()
- }
- ,
- t.prototype.toggleExplodeUp = function() {
- this.floors.toggleExplodeVertical()
- }
- ,
- t.prototype.nextFloor = function(e) {
- return this.floors.nextFloor(this.currentFloor, e)
- }
- ,
- t.prototype.addFloor = function(e) {
- this.floors.add(e)
- }
- ,
- t.prototype.getFloorAtPoint = function(e) {
- return this.floors.getFloorAtPoint(e)
- }
- ,
- t.prototype.getTagBySid = function(e) {
- return this.tags[e]
- }
- ,
- t.prototype.addChunk = function(e, t) {
- this.floors.getOrMakeFloor(e).addChunk(t),
- this.chunks.push(t)
- }
- ,
- t.prototype.setMode = function(t) {
- if (!this.supportedModes[t])
- throw new x("Mode not supported for this model: " + t);
- this.mode = t
- this.skybox.material.transparent = t == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
- this.chunks.forEach(function(e) {
- e.setMode(t)
- })
- }
- ,
- t.prototype.build = function() {
- this.heroLocations = this.images.getHeroLocations(this.panos);
- var e = function() {
- 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()
- }
- .bind(this)();
- for (var t in this.has360Views = u.show360Views.enabled && this.heroLocations.some(function(e) {
- return e.cameraMode === s.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
- }
- .bind(this)) || e,
- null === this.heroImage && R.warn("No hero image defined."),
- this.currentFloor = this.floors.last(),
- this.floors.build(),
- this.colliders = this.floors.reduce(function(e, t) {
- return e.concat(t.collider.children)
- }, []),
- this.panos.forEach(function(e) {
- e.build1(),
- e.on("enter", function() {
- e.floor !== this.currentFloor && this.setFloor(e.floor)
- }
- .bind(this))
- }
- .bind(this)),
- this.panos.forEach(function(e) {
- e.build2()
- }),
- this.floors.forEach(function(e) {
- this.boundingBox.union(e.boundingBox)
- }
- .bind(this)),
- this.size = this.boundingBox.size(),
- this.center = this.boundingBox.center(),
- this.floors.forEach(function(e) {
- R.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
- }
- .bind(this)),
- this.panos.populate_path_graph(),
- this.skybox = new n(this.boundingBox),
- this.skybox.matrixWorldNeedsUpdate = !0,
- this.add(this.skybox),
- setTimeout(function() {
- this.hotsCount && this.shineHots()
- }
- .bind(this), 1300),
- this.tags)
- this.tags[t].build();
- return R.debug("Done building model"),
- 0 < f.raycastsDone && (R.warn("raycasts: " + f.raycastsDone),
- R.warn("raycasts skipped: " + f.raycastsSkipped)),
- this.buildRooms(),
- this.labels.associateWithRooms(this.rooms),
- $.when(this)
- }
- ,
- t.prototype.loadLabels = function() {
- this.labels = new b(this);
- var e = $.Deferred();
- /* if (window.MP_PREFETCHED_MODELDATA.model.player_options.labels && (this.showingLabels = !0),
- !this.showingLabels) */
- return e.resolve();
-
-
-
- var t = g_Prefix + "data/" + this.sid + "/labels.json";
- return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
- R.warn("Getting labels failed, not displaying labels."),
- e.resolve()
- }),
- e
- }
- ,
- t.prototype.buildRooms = function() {
- this.rooms = new _(this),
- this.rooms.createFromChunks(this.chunks),
- this.rooms.calcRoomBoundaries()
- }
- ,
- t.prototype.updateProjectedPanos = function() {
- this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
- }
- ,
- t.prototype.setProjectedPanos = function(t, i, n) {
- null != n || (n = !0),
- n = !!n,
- this.projectedPano0 = t,
- this.projectedPano1 = i,
- this.skybox.material.setProjectedPanos(t, i, n),
- this.chunks.forEach(function(e) {
- e.materialInside.setProjectedPanos(t, i, n)
- })
- }
- ,
- t.prototype.setSide = function(t) {
- this.floors.forEach(function(e) {
- e.collider.material.side = t
- })
- }
- ,
- t.prototype.heroCount = function() {
- return this.heroLocations ? this.heroLocations.length : 0
- }
- ,
- t.prototype.getHeroDescriptorByIndex = function(e) {
- if (e < 0)
- return R.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
- null;
- if (this.heroCount() < 1)
- return R.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
- null;
- var t = this.heroLocations[e];
- return void 0 === t ? (R.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
- null) : t
- }
- ,
- t.prototype.findPanoramicHero = function() {
- for (var e in this.heroLocations)
- if (this.heroLocations[e].cameraMode === s.PANORAMA)
- return this.heroLocations[e];
- return null
- }
- ,
- t.prototype.listImagePanos = function() {
- var i = []
- , n = this;
- return this.images.forEach(function(e) {
- if (e.metadata && e.metadata.scan_id) {
- var t = n.panos.get(e.metadata.scan_id);
- t && (n.supportsTiles || t.isLoaded("high") || i.push(t))
- }
- }),
- i
- }
- ,
- t.prototype.fadePanoMarkers = function(e, t) {
- this.panos.fadeMarkerOpacity(e, t)
- }
- ,
- t.prototype.setSweepVisibility = function(t) {
- this.panos.forEach(function(e) {
- e.marker && (e.marker.visible = t)
- })
- }
- ,
- t.prototype.outsideAllowed = function() {
- return this.supportedModes[s.DOLLHOUSE] && this.supportedModes[s.FLOORPLAN]
- }
- ,
- O.exports = t
- }
- ).call(this, "/js/model/Model.js")
- }
- , {
- "../constants": 8,
- "../enum/AlignmentType": 17,
- "../enum/RenderOrder": 42,
- "../enum/Viewmode": 51,
- "../exception/BasicException": 55,
- "../label/Label": 90,
- "../loaders/ModelLoader": 105,
- "../loaders/ModelTextureLoader": 106,
- "../loaders/SweepDataLoader": 107,
- "../tag/tag": 123,
- "../tag/tagManager": 124,
- "../objects/BoundingTextureSkybox": 143,
- "../objects/Chunk": 144,
- "../objects/Floor": 146,
- "../objects/Panorama": 148,
- "../objects/Room": 150,
- "../objects/Snapshot": 153,
- "../settings": 166,
- "../shaders": 167,
- "../util/ModelUrls": 177,
- "../util/PanoramaCollection": 178,
- "../util/ajax": 181,
- "../util/common": 185,
- "../util/easing": 186,
- "../util/lerp": 188,
- "../util/logger": 189,
- "../util/math": 190,
- "../util/texture": 194,
- "../util/transitions": 195,
- "./../util/browser": 182,
- "./../util/showcase": 193,
- "./Chunks": 135,
- "./FloorCollection": 136,
- "./ImageCollection": 137,
- "./LabelCollection": 138,
- "./RoomCollection": 141,
- events: 202,
- three: 217,
- hot: "hot"
- }],
- 140: [function(e, t, i) {
- "use strict";
- function n() {
- this.modelMap = {},
- this.activeModel = null,
- this.modelCount = 0,
- this.tileDownloader = null,
- this.panoRenderer = null
- }
- var r = (e("three"),
- e("../util/common"))
- , o = e("../exception/BasicException")
- , a = e("../enum/ModelManagerEvents")
- , s = e("../enum/PanoRendererEvents")
- , l = e("events").EventEmitter;
- n.prototype.init = function(e, t, i) {
- this.tileDownloader = e,
- this.panoRenderer = t,
- this.qualityManager = i,
- this.bindEvents()
- }
- ,
- n.prototype.bindEvents = function() {
- this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
- }
- ,
- n.prototype.onTileRendered = function(e, t, i, n) {}
- ,
- n.prototype.addModel = function(e) {
- this.modelMap[e.sid] = e,
- 0 === this.modelCount && this.activateModel(e.sid),
- this.modelCount++,
- this.emit(a.ModelAdded)
- }
- ,
- n.prototype.getModel = function(e) {
- return this.modelMap[e]
- }
- ,
- n.prototype.activateModel = function(e) {
- var t = this.modelMap[e];
- if (!t)
- throw new o("Tried to activate invalid model!");
- var i = this.activeModel;
- this.activeModel = t,
- this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
- this.tileDownloader.setUrls(t.urls),
- t.panos.forEach(function(e) {
- e.attachToPanoRenderer(this.panoRenderer),
- e.tileDownloader = this.tileDownloader,
- e.qualityManager = this.qualityManager
- }
- .bind(this)),
- this.emit(a.ActiveModelChanged, {
- oldModel: i,
- model: t
- })
- }
- ,
- n.prototype.getActiveModel = function() {
- return this.activeModel
- }
- ,
- r.extend(n, l),
- t.exports = n
- }
- , {
- "../enum/ModelManagerEvents": 33,
- "../enum/PanoRendererEvents": 35,
- "../exception/BasicException": 55,
- "../util/common": 185,
- events: 202,
- three: 217
- }],
- 141: [function(r, l, e) {
- (function(e) {
- "use strict";
- function o() {
- n.call(this)
- }
- var a = r("../objects/Room")
- , t = (r("../settings"),
- r("../util/logger"))
- , i = (r("../util/transitions"),
- r("../util/easing"),
- r("../util/common"))
- , n = r("../util/IndexedCollection")
- , s = r("./Chunks");
- new t(e),
- i.inherit(o, n),
- o.prototype.getIndex = function(e) {
- return e.roomId
- }
- ,
- o.prototype.calcRoomBoundaries = function() {
- this.forEach(function(e) {
- e.calcBoundaries()
- })
- }
- ,
- o.prototype.createFromChunks = function(e) {
- var n = {
- floorId: -1,
- roomId: -1
- }
- , r = {};
- e.forEach(function(e) {
- s.parseIdsFromChunkName(e.name, n);
- var t = r[n.roomId];
- if (!t) {
- var i = o.generateRoomId(n.floorId, n.roomId);
- t = new a(n.floorId,i),
- this.add(t),
- r[n.roomId] = t
- }
- t.addChunk(e)
- }
- .bind(this)),
- this.calcRoomBoundaries()
- }
- ,
- o.generateRoomId = function(e, t) {
- return e + "_" + t
- }
- ,
- l.exports = o
- }
- ).call(this, "/js/model/RoomCollection.js")
- }
- , {
- "../objects/Room": 150,
- "../settings": 166,
- "../util/IndexedCollection": 175,
- "../util/common": 185,
- "../util/easing": 186,
- "../util/logger": 189,
- "../util/transitions": 195,
- "./Chunks": 135
- }],
- 142: [function(e, t, i) {
- "use strict";
- function n(e, t, i) {
- var n = (e = e.clone().expandByScalar(0.01)).size()
- , r = new o.BoxGeometry(n.x,n.y,n.z);
- r.boundingBox = e,
- o.Mesh.call(this, r, t),
- this.position.copy(e.center()),
- this.frustumCulled = !1,
- i && this.add(new o.WireframeHelper(this))
- }
- var o = e("three");
- (n.prototype = Object.create(o.Mesh.prototype)).constructor = n,
- t.exports = n
- }
- , {
- three: 217
- }],
- 143: [function(l, c, e) {
- (function(e) {
- "use strict";
- function t(e) {
- s.time("Computing a nice bounding cubemap");
- var t = new r({
- side: i.BackSide,
- transparent: !0
- });
- t.uniforms.modelAlpha.value = 0,
- t.uniforms.opacity.value = 1 - o.modelAlpha,
- this.renderOrder = a.boundingSkybox,
- n.call(this, e, t),
- s.timeEnd("Computing a nice bounding cubemap")
- }
- var i = l("three")
- , n = (l("../enum/Viewmode"),
- l("../shaders"),
- l("./BoundingMesh"))
- , r = l("../materials/ModelTextureMaterial")
- , o = l("../settings")
- , a = l("../enum/RenderOrder")
- , s = new (l("../util/logger"))(e);
- (t.prototype = Object.create(n.prototype)).constructor = t,
- c.exports = t
- }
- ).call(this, "/js/objects/BoundingTextureSkybox.js")
- }
- , {
- "../enum/RenderOrder": 42,
- "../enum/Viewmode": 51,
- "../materials/ModelTextureMaterial": 118,
- "../settings": 166,
- "../shaders": 167,
- "../util/logger": 189,
- "./BoundingMesh": 142,
- three: 217
- }],
- 144: [function(e, t, i) {
- "use strict";
- function n(e) {
- this.materialInside = new s({
- side: r.DoubleSide
- });
- var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
- this.materialOutside = new r.RawShaderMaterial({
- fragmentShader: o.modelOutside.fragmentShader,
- vertexShader: o.modelOutside.vertexShader,
- uniforms: t,
- side: r.FrontSide,
- name: "chunkOut"
- }),
- r.Mesh.call(this, e.geometry, this.materialInside),
- this.name = e.name || "",
- this.textureName = e.textureName,
- this.meshUrl = e.meshUrl
- }
- var r = e("three")
- , o = e("../shaders")
- , a = e("../enum/Viewmode")
- , s = e("../materials/ModelTextureMaterial");
- (n.prototype = Object.create(r.Mesh.prototype)).setTextureMap = function(e) {
- this.materialInside.uniforms.map.value = e,
- this.materialOutside.uniforms.map.value = e
- }
- ,
- n.prototype.setMode = function(e) {
- var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
- t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
- t.transparent = this.material.transparent,
- t.uniforms.opacity.value = this.material.uniforms.opacity.value;
-
-
- this.material = t
-
-
- }
- ,
- t.exports = n
- }
- , {
- "../enum/Viewmode": 51,
- "../materials/ModelTextureMaterial": 118,
- "../shaders": 167,
- three: 217
- }],
- 145: [function(e, t, i) {
- "use strict";
- function n(e) {
- this.chunksize = e || 10,
- this.chunks = {},
- this.boundingBoxes = {},
- this.children = [],
- this.offset = new m.Vector3(0,.5,0),
- this.material = new m.MeshBasicMaterial({
- color: 16777215 * Math.random(),
- side: m.DoubleSide
- })
- }
- var m = e("three");
- e("../enum/Viewmode"),
- n.prototype.add = function(e) {
- var t, i, n, r, o, a, s, l, c, h, u = e.attributes;
- u ? (t = u.position.array,
- i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
- e.faces);
- var d = new m.Vector3;
- if (i)
- for (n = 0,
- r = i.length; n < r; n += 3) {
- var p = 3 * i[n]
- , f = 3 * i[n + 1]
- , g = 3 * i[n + 2];
- o = (t[p] + t[f] + t[g]) / 3,
- a = (t[1 + p] + t[1 + f] + t[1 + g]) / 3,
- s = (t[2 + p] + t[2 + f] + t[2 + g]) / 3,
- c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
- this.boundingBoxes[l]) : (h = this.chunks[l] = [],
- this.boundingBoxes[l] = new m.Box3),
- 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]),
- c.expandByPoint(d.set(t[p], t[1 + p], t[2 + p])),
- c.expandByPoint(d.set(t[f], t[1 + f], t[2 + f])),
- c.expandByPoint(d.set(t[g], t[1 + g], t[2 + g]))
- }
- else
- for (n = 0,
- r = t.length; n < r; n += 9)
- o = (t[n] + t[n + 3] + t[n + 6]) / 3,
- a = (t[n + 1] + t[n + 4] + t[n + 7]) / 3,
- s = (t[n + 2] + t[n + 5] + t[n + 8]) / 3,
- c = (l = Math.floor(o / this.chunksize) + "." + Math.floor(a / this.chunksize) + "." + Math.floor(s / this.chunksize))in this.chunks ? (h = this.chunks[l],
- this.boundingBoxes[l]) : (h = this.chunks[l] = [],
- this.boundingBoxes[l] = new m.Box3),
- 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]),
- c.expandByPoint(d.set(t[n], t[n + 1], t[n + 2])),
- c.expandByPoint(d.set(t[n + 3], t[n + 4], t[n + 5])),
- c.expandByPoint(d.set(t[n + 6], t[n + 7], t[n + 8]))
- }
- ,
- n.prototype.build = function() {
- var e = new m.Object3D;
- for (var t in e.material = this.material,
- this.chunks) {
- var i = this.chunks[t]
- , n = new m.BufferGeometry;
- n.addAttribute("position", new m.BufferAttribute(new Float32Array(i),3)),
- n.boundingBox = this.boundingBoxes[t];
- var r = new m.Mesh(n,this.material);
- r.material.visible = !1,
- e.add(r),
- this.chunks[t] = []
- }
- return e
- }
- ,
- t.exports = n
- }
- , {
- "../enum/Viewmode": 51,
- three: 217
- }],
- 146: [function(e, t, i) {
- "use strict";
- var n = e("three")
- , r = e("../settings")
- , o = e("../util/common")
- , a = e("../util/lerp")
- , s = e("./ChunkedCollider")
- , l = e("../util/transitions")
- , c = e("../util/easing")
- , h = (e("../objects/Panorama"),
- e("../enum/RenderOrder"));
- e("../localization/localize");
- function u(e, t, i) {
- n.Object3D.call(this),
- this.model = e,
- this.floorIndex = t,
- this.lang = r.languageTag,
- this.name = i || "cn" === r.languageTag ? "Floor " + (t + 1) : "第" + (t + 1) + "层",
- this.panos = [],
- this.chunks = [],
- this.colliderBuilder = new s(3),
- this.collider = null,
- this.center = null,
- this.boundingBox = new n.Box3,
- this.size = null,
- this.hidden = !1,
- this.conservativeBoundingBox = new n.Box3,
- this.debugColor = 16777215 * Math.random(),
- this.transition = null
- }
- (u.prototype = Object.create(n.Object3D.prototype)).enter = function(e) {
- this.model.setFloor(this, e)
- }
- ,
- u.prototype.hide = function(e) {
- if (!this.hidden || this.transition) {
- this.chunks.forEach(function(e) {
- e.material.transparent = !0
- }),
- l.cancel(this.transition);
- var t = e ? 0 : r.hideFloorDuration + r.hideFloorDelay
- , i = e ? 0 : r.hideFloorDelay / t;
- this.transition = l.start(a.allUniforms(this.chunks, "opacity", .08), t, function() {
- this.hidden = !0
- }
- .bind(this), i, c.easeInOutQuad)
- }
- }
- ,
- u.prototype.show = function(e) {
- if (this.hidden || this.transition) {
- this.hidden = !1,
- l.cancel(this.transition);
- var t = e ? r.showFloorDuration : r.showFloorDuration + r.showFloorDelay
- , i = e ? 0 : r.showFloorDelay / t;
- this.transition = l.start(a.allUniforms(this.chunks, "opacity", 1), t, function() {
- this.hidden || this.chunks.forEach(function(e) {
- e.material.transparent = !1
- })
- }
- .bind(this), i, c.easeInOutQuad)
- }
- }
- ,
- u.prototype.toggle = function(e, t) {
- (e = void 0 === e ? this.hidden : e) ? this.show(t) : this.hide(t)
- }
- ,
- u.prototype.containsPoint = function(t) {
- return this.collider.children.some(function(e) {
- return e.geometry.boundingBox || e.geometry.computeBoundingBox(),
- e.geometry.boundingBox.containsPoint(t)
- })
- }
- ,
- u.prototype.distanceToPoint = function(i) {
- var n = null
- , r = 1 / 0;
- return this.collider.children.forEach(function(e) {
- e.geometry.boundingBox || e.geometry.computeBoundingBox();
- var t = e.geometry.boundingBox.distanceToPoint(i);
- (!n || t < r) && (r = t,
- n = e)
- }),
- r
- }
- ,
- u.prototype.addChunk = function(e) {
- e.renderOrder = h.ghostFloor,
- this.add(e),
- this.chunks.push(e),
- this.boundingBox.union(e.geometry.boundingBox),
- this.size = this.boundingBox.size(),
- this.colliderBuilder.add(e.geometry)
- }
- ,
- u.prototype.addPano = function(e) {
- this.panos.push(e),
- this.add(e.skyboxMesh),
- e.marker && this.add(e.marker);
- var t = new n.Vector3(1,1,1)
- , i = (new n.Box3).setFromCenterAndSize(e.position, t);
- this.boundingBox.union(i)
- }
- ,
- u.prototype.build = function() {
- this.collider = this.colliderBuilder.build(!0),
- this.add(this.collider),
- this.center = this.boundingBox.center(),
- this.conservativeBoundingBox.copy(this.boundingBox),
- this.conservativeBoundingBox.min.y = o.lowerMedian(this.collider.children.map(function(e) {
- return e.geometry.boundingBox.min.y
- }), 5),
- this.conservativeBoundingBox.max.y = o.lowerMedian(this.collider.children.map(function(e) {
- return e.geometry.boundingBox.max.y
- }), 5),
- this.colliderBuilder = null
- }
- ,
- u.prototype.toShortString = function() {
- return o.nth(this.floorIndex + 1)
- }
- ,
- u.prototype.toString = function() {
- return this.name
- }
- ,
- t.exports = u
- }
- , {
- "../enum/RenderOrder": 42,
- "../localization/localize": 108,
- "./strings-cn-CN": 109,
- "../objects/Panorama": 148,
- "../settings": 166,
- "../util/common": 185,
- "../util/easing": 186,
- "../util/lerp": 188,
- "../util/transitions": 195,
- "./ChunkedCollider": 145,
- three: 217
- }],
- 147: [function(e, t, i) {
- "use strict";
- function n(e) {
- this.player = e,
- this.obj3d = null,
- this.UP = new u.Vector3(0,1,0)
- }
- var u = e("three")
- , d = e("../settings");
- n.prototype.prefs = {
- linewidth: 3,
- height: .07,
- opacity: .45,
- endScale: .05
- },
- n.prototype.discard = function() {
- if (this.obj3d) {
- var e = this.obj3d.parent;
- e && e.remove(this.obj3d)
- }
- this.obj3d = null
- }
- ,
- n.prototype.draw = function() {
- if (this.discard(),
- d.showNeighbors) {
- var e = this.player.currentPano.floor;
- this.obj3d = new u.Object3D;
- var t = this.player.model.panos.getNeighbours(this.player.currentPano)
- , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
- i.y += this.prefs.height;
- var n = .1525
- , r = new u.Matrix4;
- for (var o in t)
- if (t[o]) {
- var a = this.player.model.panos.get(o)
- , s = (a.position.clone().sub(this.player.model.position),
- a.position.clone().sub(a.floorPosition))
- , l = a.floorPosition.clone().sub(this.player.model.position);
- l.y += this.prefs.height;
- var c = new u.Geometry;
- 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)),
- 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)),
- r.identity().setPosition(s),
- c.applyMatrix(r),
- c.vertices.push(new u.Vector3(0,-this.prefs.endScale,0)),
- 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)),
- r.lookAt(l, i, this.UP).setPosition(l),
- c.applyMatrix(r),
- c.vertices.push(l, i);
- var h = new u.Line(c,new u.LineBasicMaterial({
- color: a.debugColor.getHex(),
- transparent: !0,
- opacity: this.prefs.opacity,
- depthWrite: !1,
- name: "sLine" + o,
- linewidth: this.prefs.linewidth
- }));
- this.obj3d.add(h)
- }
- e.add(this.obj3d)
- }
- }
- ,
- n.prototype.update = function() {
- d.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
- }
- ,
- t.exports = n
- }
- , {
- "../settings": 166,
- three: 217
- }],
- 148: [function(S, M, e) {
- (function(e) {
- "use strict";
- function r(e, t, i, n) {
- this.model = e,
- this.id = t,
- this.alignmentType = i.alignmentType || c.ALIGNED,
- this.neighbourUUIDs = i.neighbours || null,
- this.neighbourPanos = null,
- this.floor = null,
- this.floorIndex = i.floor,
- this.failedLoadingAt = 0,
- this.maxLoadRetries = 4,
- this.origin = i.position.clone(),
- this.position = this.alignmentType === c.UNALIGNED ? new s.Vector3(0,-5,0) : i.position.clone(),
- this.quaternion = i.quaternion.clone(),
- this.skyboxMesh = new s.Mesh(E),
- this.skyboxMesh.position.copy(this.position),
- this.skyboxMesh.quaternion.copy(this.quaternion),
- this.skyboxMesh.name = "skybox",
- this.skyboxMesh.visible = !1,
- this.skyboxMesh.updateMatrix(),
- this.skyboxMesh.updateMatrixWorld(),
- this.marker = null,
- this.showFloorMarker = this.showFloorMarker = !window.MP_PREFETCHED_MODELDATA.hideFloorMarker,
- this.isAligned() && (this.marker = new s.Mesh(_,new s.MeshBasicMaterial({
- map: b,
- side: s.DoubleSide,
- opacity: 0,
- transparent: !0,
- depthWrite: !1
- })),
- this.marker.visible = this.showFloorMarker,
- this.marker.renderOrder = l.panoMarker,
- this.marker.name = "marker",
- (this.marker.pano = this).marker.layers.set(v.PANOMARKERS),
- this.marker.updateMatrixWorld(),
- a.colorMarkerOnLoad && this.on("load", function() {
- this.marker.material.color.set(65280)
- })),
- this.debugColor = (new s.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
- this.floorPosition = i.puck ? i.puck.clone() : null,
- this.tiled = n,
- this.tiled ? this.solidSkybox = null : (this.solidSkybox = new s.Texture([null, null, null, null, null, null]),
- this.solidSkybox.flipY = !1,
- a.minimalMemoryMode && (this.solidSkybox.minFilter = s.LinearFilter,
- this.solidSkybox.magFilter = s.LinearFilter,
- this.solidSkybox.generateMipmaps = !1)),
- this.zoomed = !1,
- this.panoRenderer = null,
- this.qualityManager = null,
- this.tileDownloader = null,
- this.tiledPanoRenderTarget = null,
- this.minimumTiledPanoLoaded = !1,
- this.highestPartialTileRenderOpCompleted = 0,
- this.highestFullTileRenderOpCompleted = 0,
- this.shouldRedrawOnBaseLoaded = !1,
- this.lockUntilRenderingComplete = !1,
- a.colorMarkerOnLoad && this.on("load", function() {
- this.marker.material.color.set(65280)
- }),
- (e = new s.TextureLoader).setCrossOrigin(!0);
- var r = e.load("images/texture.jpg");
- if (this.vrMarker = new s.Mesh(new s.OctahedronGeometry(.1,0),new s.MeshLambertMaterial({
- color: 16777215,
- transparent: !0,
- opacity: .75,
- map: r
- })),
- this.vrMarker.boluoType = "vr",
- this.vrMarker.position.z = 1,
- this.vrMarker.enabled = !0,
- this.vrMarker.visible = !1,
- window.vrMarkers = window.vrMarkers || [],
- window.vrMarkers.push(this.vrMarker),
- this.marker && this.marker.add(this.vrMarker),
- a.showAxis && (this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,1,0),new s.Vector3(0,0,0),1,255)),
- this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(0,0,1),new s.Vector3(0,0,0),1,16711680)),
- this.skyboxMesh.add(new s.ArrowHelper(new s.Vector3(1,0,0),new s.Vector3(0,0,0),1,65280))),
- this.adjustAngleEnable) {
- (i = new s.Quaternion).setFromAxisAngle(new s.Vector3(1,0,0), this.adjustAngleX),
- this.skyboxMesh.quaternion.multiply(i);
- var o = new s.Quaternion;
- o.setFromAxisAngle(new s.Vector3(0,1,0), this.adjustAngleY),
- this.skyboxMesh.quaternion.multiply(o),
- (n = new s.Quaternion).setFromAxisAngle(new s.Vector3(0,0,1), this.adjustAngleZ),
- this.skyboxMesh.quaternion.multiply(n),
- this.skyboxMesh.updateMatrix(),
- this.skyboxMesh.updateMatrixWorld(),
- this.model.updateProjectedPanos()
- }
-
-
-
-
- }
- var i, t, s = S("three"), n = S("../util/logger"), a = S("../settings"), l = (S("../enum/Viewmode"),
- S("../enum/RenderOrder")), c = S("../enum/AlignmentType"), o = (S("../util/common"),
- S("../util/transitions")), h = S("../util/lerp"), u = S("../util/ajax"), d = S("../util/texture"), p = S("../util/panorama"), f = (S("../enum/TileDownloaderEvents"),
- S("../enum/PanoramaEvents")), g = S("../enum/PanoRendererEvents"), m = S("../enum/PanoSizeClass"), v = S("../enum/RenderLayers"), y = (S("../scene/SceneRenderer"),
- S("../enum/GLCubeFaces"),
- 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");
- (r.prototype = Object.create(C.prototype)).enter = (t = null,
- function() {
- this.setZoomed(!1),
- this.emit("enter", {
- oldPano: t,
- newPano: this
- }),
- t = this
- }
- ),
- r.prototype.exit = function() {
- this.tiled ? (this.clearWaitDeferreds(),
- this.minimumTiledPanoLoaded = !1,
- this.tiledPanoRenderTarget = null,
- this.setZoomed(!1),
- this.panoRenderer.deactivateTiledPano(this),
- this.highestPartialTileRenderOpCompleted = 0,
- this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
- this.solidSkybox.loaded = !1,
- this.solidSkybox.version = 0),
- this.emit("exit")
- }
- ,
- r.prototype.hoverOn = function(e) {
- this.marker && (o.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
- a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
- }
- ,
- r.prototype.hoverOff = function(e) {
- this.marker && o.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
- }
- ,
- r.prototype.build1 = function() {
- this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
- this.floor.addPano(this),
- this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
- this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
- a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
- }
- ,
- r.prototype.build2 = function() {
- this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
- this.height = this.position.distanceTo(this.floorPosition),
- this.placeMarker()
- }
- ,
- r.prototype.interpolateFloorPosition = function() {
- var e = this.model.panos.filter(r.filters.isNeighbourPanoTo(this)).filter(function(e) {
- return !!e.floorPosition
- }).sort(function(e, t) {
- return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
- }
- .bind(this))
- , t = this.position.clone();
- return 2 <= e.length ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
- t
- }
- ,
- r.prototype.raycastFloorPosition = function() {
- I.warn("Performance warning: Raycasting to find floor position");
- var e = new s.Raycaster(this.position,new s.Vector3(0,-1,0)).intersectObjects(this.model.colliders);
- return e.length ? e[0].point : null
- }
- ,
- 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)],
- function() {
- I.warn("Performance warning: Raycasting to find floor index");
- for (var e = 0; e < i.length; e++) {
- var t = new s.Raycaster(this.position.clone(),i[e].clone()).intersectObjects(this.model.colliders);
- if (t.length)
- return t[0].object.parent.parent
- }
- return null
- }
- ),
- r.prototype.placeMarker = function() {
- this.marker && (this.marker.position.copy(this.floorPosition),
- this.marker.position.y += .05,
- this.marker.lookAt(new s.Vector3(0,1,0).add(this.marker.position)))
- }
- ,
- r.prototype.translate = function(e) {
- this.position.add(e),
- this.floorPosition.add(e)
- }
- ,
- r.prototype.findClosestMidtpointPanoTo = function(e) {
- return (new s.Vector3).addVectors(this.position, e.position).divideScalar(2),
- this.model.panos.find([r.filters.notIn([this, e])], [r.sortFunctions.distanceToPoint(point)])
- }
- ,
- r.prototype.attachToPanoRenderer = function(e) {
- this.panoRenderer = e,
- this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
- this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
- this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
- this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
- }
- ;
- var w, T, x = {};
- r.prototype.getWaitDeferred = function(e) {
- var t = x[this.id];
- t || (t = {},
- x[this.id] = t);
- var i = t[e];
- return i || (i = {
- deferred: $.Deferred(),
- active: !1
- },
- t[e] = i),
- i
- }
- ,
- r.prototype.resetWaitDeferred = function(e) {
- var t = this.getWaitDeferred(e);
- t.active = !1,
- t.deferred = $.Deferred()
- }
- ,
- r.prototype.clearWaitDeferreds = function() {
- var e = x[this.id];
- for (var t in e || (e = {},
- x[this.id] = e),
- e)
- if (e.hasOwnProperty(t)) {
- var i = e[t];
- i.active = !1,
- i.deferred = $.Deferred()
- }
- }
- ,
- r.prototype.loadTiledPano = (new s.Vector3,
- w = [],
- T = [],
- function(e, t, i, n, r, o) {
- null != n || (n = !0),
- null != r || (r = !0);
- var a = this.getWaitDeferred(e)
- , s = a.deferred
- , l = null
- , c = null;
- if (i && ("number" == typeof i ? l = i : (l = i.hFov,
- c = i.vFov)),
- !this.isLoaded(e)) {
- if (!a.active) {
- if (a.active = !0,
- i) {
- var h = A.matchingTilesInDirection(this, e, t, l, c);
- w[this.id + ":" + e] = {
- tileCount: 0,
- targetTileCount: h
- },
- I.info("Loading partial pano: " + this.id + " with " + h + " tiles")
- }
- T[this.id] || (T[this.id] = !0,
- this.on(f.LoadComplete, function(e, t) {
- var i = this.getWaitDeferred(e).deferred;
- i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
- this.resetWaitDeferred(e))
- }
- .bind(this)),
- this.on(f.LoadFailed, function(e) {
- var t = this.getWaitDeferred(e).deferred;
- t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
- this.resetWaitDeferred(e))
- }
- .bind(this)),
- this.on(f.TileLoaded, function(e, t, i) {
- var n = this.getWaitDeferred(e).deferred;
- if (n && "pending" === n.state()) {
- n.notify(e, t, i);
- var r = w[this.id + ":" + e];
- r && (r.tileCount++,
- r.tileCount === r.targetTileCount && (this.onPanoRendered(this.id, e, i, !0),
- n.resolve(e, i),
- this.resetWaitDeferred(e)))
- }
- }
- .bind(this)))
- }
- this.tileDownloader.clearForceQueue(),
- this.tileDownloader.forceQueueTilesForPano(this, e, t, l, c, o),
- this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), n),
- this.panoRenderer.renderPanoTiles(this.id, t, r)
- }
- return s.promise()
- }
- ),
- r.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
- e === this.id && t === this.qualityManager.getPanoSize(m.BASE) && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
- this.panoRenderer.resetRenderStatus(this.id, !0, !1),
- this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
- }
- ,
- r.prototype.onTileRendered = function(e, t, i, n) {
- e === this.id && this.emit(f.TileLoaded, t, i, n)
- }
- ,
- r.prototype.onPanoRendered = function(e, t, i, n) {
- e === this.id && (this.minimumTiledPanoLoaded = !0,
- this.updateSkyboxForZoomLevel(),
- t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
- !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
- this.emit("load", t),
- this.model.emit("load", this),
- this.emit(f.LoadComplete, t, i))
- }
- ,
- r.prototype.setZoomed = function(e) {
- this.zoomed = e,
- this.updateSkyboxForZoomLevel()
- }
- ,
- r.prototype.ensureSkyboxReadyForRender = function() {
- this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
- this.solidSkybox.loaded = !0)
- }
- ,
- r.prototype.updateSkyboxForZoomLevel = function() {
- this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
- }
- ,
- r.prototype.getSkyboxTexture = function() {
- return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
- }
- ,
- r.prototype.onTileRenderFail = function(e, t, i) {
- e === this.id && this.emit(f.LoadFailed, t)
- }
- ,
- r.prototype.isLoaded = function(e) {
- if (this.tiled) {
- if (e && "string" == typeof e)
- throw new y("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
- return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
- }
- if (e && "number" == typeof e)
- throw new y("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
- return !!this.solidSkybox.high || e in this.solidSkybox
- }
- ,
- r.prototype.loadCube = function(a) {
- if (this.isLoaded(a))
- return I.info("Skipping load of pano, already loaded"),
- $.when();
- this.emit("loading", a),
- this.model.emit("loading", this);
- var n = p.getCubemapUrls(this.model.urls, this.id, a)
- , e = n.filter(function(e) {
- return !e
- });
- "low" === a && 0 < e.length && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
- a = "high",
- n = p.getCubemapUrls(this.model.urls, this.id, a));
- var t = 0
- , i = [0, 1, 2, 3, 4, 5].map(function(e, t, i) {
- return u.getImage(n[t])
- }
- .bind(this));
- return $.when(i[0], i[1], i[2], i[3], i[4], i[5]).then(function(e, t, i, n, r, o) {
- return this.solidSkybox[a] = [e, t, i, n, r, o],
- "high" !== a && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[a],
- this.solidSkybox.low = null),
- this.solidSkybox.needsUpdate = !0,
- this.emit("load", a),
- this.model.emit("load", this),
- this
- }
- .bind(this), function() {
- I.error("Downloading cubemap for pano", this.id, "failed"),
- this.failedLoadingAt = Date.now()
- }
- .bind(this), function() {
- return $.when(++t, 6)
- })
- }
- ,
- r.raycastsSkipped = 0,
- r.raycastsDone = 0,
- r.prototype.findNeighourPanos = function() {
- return this.model.panos.setNeighbour(this.id, this.id, !1),
- this.model.panos.forEach(function(e) {
- if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
- var t = this.position.distanceTo(e.position);
- if (t > a.panoramaNeighbourMaxDistance)
- return this.model.panos.setNeighbour(this, e, !1),
- void r.raycastsSkipped++;
- var i = e.position.clone().sub(this.position).normalize()
- , n = new s.Raycaster(this.position,i.clone(),0,t).intersectObjects(this.model.colliders);
- r.raycastsDone++,
- this.model.panos.setNeighbour(this, e, 0 === n.length),
- 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)))
- }
- }
- .bind(this)),
- this.model.panos.neighbourMap[this.id]
- }
- ,
- r.prototype.worldPosition = function() {
- return this.position
- }
- ,
- r.prototype.addTextSprite = function(e, t) {
- this.removeTextSprite();
- var i = document.createElement("canvas")
- , n = i.getContext("2d");
- i.width = 256,
- i.height = 256;
- n.font = "bold 60px Arial",
- n.fillStyle = "white";
- var r = n.measureText(e).width;
- n.fillText(e, (i.width - r) / 2, (i.height + 60) / 2);
- var o = new s.Texture(i);
- o.needsUpdate = !0;
- var a = new s.SpriteMaterial({
- map: o,
- color: t || 16428055
- });
- this.text3d = new s.Sprite(a),
- this.text3d.position.copy(this.skyboxMesh.position),
- this.floor.add(this.text3d)
- }
- ,
- r.prototype.removeTextSprite = function() {
- this.text3d && (this.floor.remove(this.text3d),
- this.text3d = null)
- }
- ,
- r.prototype.isAligned = function() {
- return this.alignmentType === c.ALIGNED
- }
- ,
- r.filters = {
- inDirection: function(t, i, n) {
- return function(e) {
- return e.position.clone().sub(t).normalize().dot(i) > n
- }
- },
- inFloorDirection: function(t, i, n) {
- return function(e) {
- return e.floorPosition.clone().sub(t).normalize().dot(i) > n
- }
- },
- inPanoDirection: function(n, r, o) {
- return o = a.navigation.panoScores ? a.navigation.filterStrictness : o,
- function(e) {
- var t = e.floorPosition.clone().sub(n).normalize()
- , i = e.position.clone().sub(n).normalize();
- return t.dot(r) > o || i.dot(r) > o
- }
- },
- atFloor: function(t) {
- return function(e) {
- return !t || e.floor === t
- }
- },
- not: function(t) {
- return function(e) {
- return e !== t
- }
- },
- notIn: function(t) {
- return function(e) {
- return -1 === t.indexOf(e)
- }
- },
- isLoaded: function() {
- return function(e) {
- return e.isLoaded()
- }
- },
- isNotLoaded: function() {
- return function(e) {
- return !e.isLoaded()
- }
- },
- isCloseEnoughTo: function(t, i) {
- return function(e) {
- return t.distanceTo(e.floorPosition) < i
- }
- },
- hasMinimumHeightDifferenceTo: function(t, i) {
- return function(e) {
- return Math.abs(e.position.y - t.y) > i
- }
- },
- isNotBehindNormal: function(t, i) {
- var n = new s.Vector3;
- return i = i.clone(),
- function(e) {
- return 0 < n.copy(e.position).sub(t).normalize().dot(i)
- }
- },
- isNeighbourPanoTo: function(t) {
- return function(e) {
- return !t || !t.neighbourPanos || !!t.neighbourPanos[e.id]
- }
- },
- isNeighbourOfNeighbourTo: function(n) {
- return function(i) {
- return !!n.neighbourPanos[i.id] || n.neighbourUUIDs.some(function(e) {
- var t = n.model.panos.get(e);
- return !!t && t.neighbourPanos[i.id]
- })
- }
- },
- isNotRecentlyFailed: function(t) {
- return function(e) {
- return Date.now() - e.failedLoadingAt > t
- }
- },
- isOnVisibleFloor: function() {
- return function(e) {
- return !e.floor.hidden
- }
- },
- isPanoAligned: function() {
- return function(e) {
- return e.isAligned()
- }
- }
- },
- r.sortFunctions = {
- distanceToPoint: function(i) {
- return function(e, t) {
- return e.position.distanceTo(i) - t.position.distanceTo(i)
- }
- },
- floorDistanceToPoint: function(i) {
- return function(e, t) {
- return e.floorPosition.distanceTo(i) - t.floorPosition.distanceTo(i)
- }
- },
- choose: function(i) {
- return function(e, t) {
- return i.id === e.id ? -1 : i.id === t.id ? 1 : 0
- }
- }
- },
- r.scoreFunctions = {
- distance: function(t, i) {
- return i = i || a.navigation.distanceFactor,
- function(e) {
- return t ? t.position.distanceTo(e.position) * i : 0
- }
- },
- distanceSquared: function(t, i) {
- return i = i || a.navigation.distanceFactor,
- function(e) {
- return t ? t.position.distanceToSquared(e.position) * i : 0
- }
- },
- direction: function(t, i) {
- return function(e) {
- return e.position.clone().sub(t).normalize().dot(i) * a.navigation.directionFactor
- }
- },
- angle: function(t, i) {
- return function(e) {
- return e.position.clone().sub(t).normalize().angleTo(i) * a.navigation.angleFactor
- }
- },
- inFieldOfView: function(t, i) {
- return function(e) {
- return .75 < e.position.clone().sub(t).normalize().dot(i) ? 10 : -1
- }
- },
- optionality: function(t) {
- return function(e) {
- return e.neighbourUUIDs.filter(function(e) {
- return !(e in t.neighbourUUIDs) && e !== t.id
- }).length * a.navigation.optionalityFactor
- }
- },
- penalizeHeightDifferenceUnder: function(t, i) {
- return function(e) {
- return t.y - e.position.y < i ? -20 : 0
- }
- }
- },
- M.exports = r
- }
- ).call(this, "/js/objects/Panorama.js")
- }
- , {
- "../enum/AlignmentType": 17,
- "../enum/GLCubeFaces": 25,
- "../enum/PanoRendererEvents": 35,
- "../enum/PanoSizeClass": 36,
- "../enum/PanoramaEvents": 37,
- "../enum/RenderLayers": 41,
- "../enum/RenderOrder": 42,
- "../enum/TileDownloaderEvents": 45,
- "../enum/Viewmode": 51,
- "../exception/BasicException": 55,
- "../scene/SceneRenderer": 158,
- "../settings": 166,
- "../tile/TileUtils": 174,
- "../util/ajax": 181,
- "../util/common": 185,
- "../util/lerp": 188,
- "../util/logger": 189,
- "../util/panorama": 191,
- "../util/texture": 194,
- "../util/transitions": 195,
- events: 202,
- three: 217
- }],
- 149: [function(e, t, i) {
- "use strict";
- function n(e) {
- var t = r.UniformsUtils.clone(c.waypoint.uniforms);
- t.map.value = d,
- t.opacity.value = 0,
- t.color.value.set(o.reticuleColor),
- t.showMouseMarker = !window.MP_PREFETCHED_MODELDATA.hideMouseMarker;
- r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
- side: r.DoubleSide,
- depthWrite: !1,
- depthTest: !1,
- transparent: !0,
- vertexShader: c.waypoint.vertexShader,
- fragmentShader: c.waypoint.fragmentShader,
- uniforms: t,
- name: "waypoint",
- opacity: 0,
- visible: t.showMouseMarker
- })),
- this.layers.set(h.RETICULE),
- this.renderOrder = u.reticule,
- this.player = e,
- this.direction = new r.Vector3,
- this.hidden = !0,
- this.mouseLastMoveTime = Date.now()
- }
- var r = e("three")
- , o = e("../settings")
- , a = e("../util/transitions")
- , s = e("../util/texture")
- , l = e("../util/lerp")
- , c = e("../shaders")
- , h = e("../enum/RenderLayers")
- , u = e("../enum/RenderOrder")
- , d = s.load("images/reticule-256x256.png");
- (n.prototype = Object.create(r.Mesh.prototype)).move = function(e, t, i) {
- this.hidden = i,
- this.mouseLastMoveTime = Date.now()
- }
- ,
- n.prototype.hide = function() {
- this.hidden || (this.hidden = !0,
- a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
- }
- ,
- n.prototype.show = function() {
- this.hidden = !1,
- this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
- }
- ,
- n.prototype.update = function() {
- Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
- }
- ,
- n.prototype.updatePosition = function(e, t) {
- if (!this.hidden) {
- if (!t)
- return this.hide();
- var i = t.point
- , n = e.distanceTo(i)
- , r = 1 + .01 * n;
- n < 1 && (r -= 1 - n),
- this.show(),
- this.scale.set(r, r, r),
- this.direction = this.direction.multiplyScalar(.8),
- this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
- this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
- this.lookAt(this.position.clone().add(this.direction))
- }
- }
- ,
- n.prototype.writeAstag = function() {
- var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
- , t = new Date;
- this.tagCount = void 0 === this.tagCount ? 1 : this.tagCount + 1;
- var i = {
- enabled: !0,
- version: "0",
- created: t.toISOString(),
- created_by: "APITest",
- position: this.position.clone(),
- stem: {
- enabled: o.tags.pole.enabled,
- direction: this.direction.multiplyScalar(o.tags.pole.height)
- },
- label: "tag " + this.tagCount,
- description: "Description " + e,
- floor: function(e) {
- if (e.currentFloor) {
- var t = e.floors.indexOf(e.currentFloor);
- return -1 < t ? t : void 0
- }
- }(this.player.model),
- type: "info",
- metadata: {
- preferred_camera: {
- mode: this.player.mode
- }
- }
- };
- console.log("--------------------------"),
- console.log(JSON.stringify(i));
- var n = this.player.model.addtag(e, i).build();
- n && (n.disc && this.player.tagDiscs.push(n.disc),
- n.visible || n.show(o.tags.startup.fadeInDuration))
- }
- ,
- t.exports = n
- }
- , {
- "../enum/RenderLayers": 41,
- "../enum/RenderOrder": 42,
- "../settings": 166,
- "../shaders": 167,
- "../util/lerp": 188,
- "../util/texture": 194,
- "../util/transitions": 195,
- three: 217
- }],
- 150: [function(e, t, i) {
- "use strict";
- function n(e, t) {
- this.chunks = [],
- this.floorId = e,
- this.roomId = t,
- this.position = new l.Vector3
- }
- var l = e("three");
- n.prototype.addChunk = function(e) {
- this.chunks.push(e)
- }
- ,
- n.prototype.calcBoundaries = function() {
- 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++) {
- var a = this.chunks[o].geometry.attributes.position;
- if (a)
- for (var s = 0; s < a.array.length; s += 3)
- e.set(a.array[s], a.array[s + 1], a.array[s + 2]),
- t.add(e),
- 0 === s ? (i.copy(e),
- n.copy(e)) : (i.max(e),
- n.min(e)),
- r++
- }
- 0 < r ? (t.multiplyScalar(1 / r),
- this.average = t) : this.average = null,
- this.boundsMax = i,
- this.boundsMin = n,
- this.center = new l.Vector3,
- this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
- }
- ,
- t.exports = n
- }
- , {
- three: 217
- }],
- 151: [function(o, v, e) {
- (function(e) {
- "use strict";
- function t(e, t, i) {
- this.obj3d = null,
- this.nodes = [],
- this.colorHull = [],
- this.shortPaths = {},
- this.floorHull = null,
- this.cameraHull = null,
- this.floorPathDistance = 0,
- this.floorCurvePoints = null,
- this.floorCurveColors = null,
- this.camCurvePoints = null,
- this.warpDestHeroLoc = null,
- this.warpDestPano = null,
- this.warpPathPoints = null,
- this.warpPathLengths = [0],
- this.warpLength = 0,
- this.closeWarpDistance = 4,
- this.UP = U.UP.clone(),
- this.longestStep = 0,
- this.upcomingTransType = null,
- this.burnsDir = 1,
- this.prevNextDist = 0,
- this.nextI = 0,
- this.activeTransType = null,
- this.lastTransType = null,
- this.bunnyObj = null,
- this.director = e,
- this.player = t,
- this.playerControls = i,
- this.modelManager = t.modelManager,
- this.updateModel(),
- this.updateDefaultsFromModelData(),
- this.bindEvents(),
- this.warping = !1,
- this.waitingToWarp = !1,
- this.warpInterrupted = !1,
- this.warpInterruptionBlackoutStyle = null,
- this.warpInterruptionTravelTime = null
- }
- 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"),
- o("../util/texture")), U = o("../enum/Vectors"), H = (o("../model/ModelManager"),
- new i(e)), g = o("../enum/PlayerEvents"), z = o("../enum/BlackoutStyle"), r = o("../enum/ModelManagerEvents"), m = o("../constants"), I = {
- 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"),
- pathEnd: n.load("images/End.png"),
- 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==")
- };
- t.prototype.setScene = function(e) {
- this.createCpm(e),
- this.createBunnyObj(e)
- }
- ,
- t.prototype.updateModel = function() {
- this.model = this.modelManager.getActiveModel()
- }
- ,
- t.prototype.bindEvents = function() {
- this.modelManager.on(r.ActiveModelChanged, this.updateModel.bind(this))
- }
- ,
- t.prototype.updateDefaultsFromModelData = function() {
- this.model.data
- }
- ,
- t.prototype.pointPathDistance = function(e) {
- for (var t = 0, i = 1; i < e.length; i += 1)
- t += e[i - 1].distanceTo(e[i]);
- return t
- }
- ,
- t.prototype.pointPathLengths = function(e) {
- for (var t = [0], i = 1; i < e.length; i += 1)
- t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
- return t
- }
- ,
- t.prototype.interpAlongPath = function(e, t, i) {
- var n, r = new P.Vector3, o = t[t.length - 1];
- if (i < 1) {
- n = i * o;
- for (var a = 1; a < t.length; a += 1)
- if (t[a] > n) {
- var s = (n - t[a - 1]) / (t[a] - t[a - 1]);
- return r.copy(e[a]),
- r.sub(e[a - 1]),
- r.multiplyScalar(s),
- r.add(e[a - 1]),
- r
- }
- } else
- r.copy(e[e.length - 1]);
- return r
- }
- ,
- t.prototype.pathHeight = function() {
- return this.player.mode !== O.FLOORPLAN ? D.path.height : D.path.outsideHeight
- }
- ,
- t.prototype.createBunnyObj = function(e) {
- this.bunnyObj || (this.bunnyObj = new P.AxisHelper(.1),
- this.bunnyObj.visible = D.warp.showBunny),
- this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
- e.add(this.bunnyObj)
- }
- ,
- t.prototype.createCpm = function(e) {
- if (!this.currentPanoMarker) {
- var t = this.makeWaypointObj(I.pathEnd, "Current");
- t.material.uniforms.opacity.value = 0,
- this.currentPanoMarker = {
- mesh: t,
- placed: !1
- }
- }
- this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
- this.placeCpm(),
- this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
- }
- ,
- t.prototype.placeCpm = function() {
- if (D.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
- var e = this.player.currentPano.floor;
- this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
- e.add(this.currentPanoMarker.mesh)),
- this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
- this.currentPanoMarker.mesh.position.y += this.pathHeight(),
- this.currentPanoMarker.placed = !0
- } else
- this.popOutCpm()
- }
- ,
- t.prototype.fadeInCpm = function(e) {
- 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)
- }
- ,
- t.prototype.fadeOutCpm = function(e) {
- V.start(F.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
- }
- ,
- t.prototype.popInCpm = function() {
- D.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
- }
- ,
- t.prototype.popOutCpm = function() {
- this.fadeOutCpm(2)
- }
- ,
- t.prototype.brushPrefs = {
- linewidth: 7,
- strokeWidth: 15,
- cvSegments: 48,
- paveStep: .1,
- paveWidth: .2,
- lookBlendDist: 3,
- maxTurn: P.Math.degToRad(2)
- },
- t.prototype.panoPathDistance = function(e) {
- var t = this.model.panos;
- if (!e || e.length < 2)
- return 0;
- for (var i = [], n = 0; n < e.length; n += 1)
- i.push(t.get(e[n]).floorPosition);
- return this.pointPathDistance(i)
- }
- ,
- t.prototype.loadTileTexture = function(t) {
- var e = n.load(t, function(e) {
- e.wrapS = P.RepeatWrapping,
- e.wrapT = P.RepeatWrapping,
- e.needsUpdate = !0,
- H.debug('path texture "' + t + '" is ready')
- }, function() {
- H.error('path texture "' + t + '" failed')
- });
- return e.mapping = P.UVMapping,
- e
- }
- ,
- t.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
- return new l({
- cameraMode: n,
- position: e,
- quaternion: t,
- panoId: i,
- orthoZoom: o,
- floorVisibility: r,
- thumbUrl: null,
- name: null
- })
- }
- ,
- t.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
- return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
- }
- ,
- t.prototype.setWarpDestination = function(e) {
- this.warpDestHeroLoc = e
- }
- ,
- t.prototype.setWarpDestinationByHeroIndex = function(e) {
- var t = this.getHeroDescriptorByHeroIndex(e);
- return null !== t && (this.setWarpDestination(t),
- !0)
- }
- ,
- t.prototype.setWarpDestinationByPano = function(e, t) {
- return !!this.model.panos.get(e.id) && this.setWarpDestinationByPanoId(e.id, t)
- }
- ,
- t.prototype.setWarpDestinationByPanoId = function(e, t) {
- var i = this.model.panos.get(e);
- if (i) {
- t = t || new P.Quaternion;
- var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
- return this.setWarpDestination(n),
- !0
- }
- return !1
- }
- ,
- t.prototype.getHeroDescriptorByHeroIndex = function(e) {
- var t = this.model.heroCount();
- if (null !== this.warpDestHeroLoc && t < 2)
- return H.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
- this.model.getHeroDescriptorByIndex(0);
- var i = this.model.getHeroDescriptorByIndex(e);
- if (i) {
- var n = i.isPano() ? i.panoId : i.cameraMode;
- H.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
- }
- return i
- }
- ,
- t.prototype.getHeroDescriptorByPano = function(e) {
- return this.model.panos.get(e.id) ? this.getHeroDescriptorByPanoId(e.id) : null
- }
- ,
- t.prototype.getHeroDescriptorByPanoId = function(e) {
- var t = this.getHeroIndexFromPanoId(e);
- return this.getHeroDescriptorByHeroIndex(t)
- }
- ,
- t.prototype.getHeroIndexFromPanoId = function(e) {
- for (var t = 0; t < this.model.heroLocations.length; t++) {
- var i = this.model.heroLocations[t]
- , n = this.getHeroId(i);
- if (n && n === e)
- return t
- }
- return -1
- }
- ,
- t.prototype.getHeroPano = function(e) {
- if (null === e)
- return H.warn("getHeroPano(): no destination"),
- null;
- var t = this.getHeroId(e)
- , i = this.model.panos.get(t);
- return void 0 === i && (i = null,
- "" !== t && H.debug('unable to find pano "' + t + '"')),
- i
- }
- ,
- t.prototype.getHeroId = function(e) {
- return e.panoId
- }
- ,
- t.prototype.setWarpDestPano = function() {
- return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
- this.warpDestPano
- }
- ,
- t.prototype.brushToWarpPano = function(e, t) {
- if (this.discardPathObject(),
- !this.setWarpDestPano())
- return !1;
- if (this.warpDestHeroLoc.cameraMode !== O.PANORAMA && H.warn("Can only brush from pano to pano"),
- !this.warpDestPano)
- return H.info("No brush"),
- !1;
- if (!this.player.currentPano)
- return H.debug("No current pano, visibility undefined"),
- !1;
- if (!this.warpDestPano)
- return H.info("No wPano, visibility undefined"),
- !1;
- if (!this.warpDestPano.isAligned())
- return H.debug("Cannot brush to unaligned pano"),
- !1;
- var i = (e === L.STD || e === L.WALK) && D.path.mapGuides
- , n = !0;
- if (this.player.currentPano.id === this.warpDestPano.id)
- H.debug("Already at destination pano");
- else {
- this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
- n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
- this.obj3d = new P.Object3D,
- H.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
- n ? (H.info('No "walkable" route, using fall-back warp style transition'),
- e = t) : (this.setPathHulls(this.nodes),
- this.setFloorCurves(),
- 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)))),
- this.player.currentPano.floor.add(this.obj3d);
- var r = this.player.mode === O.DOLLHOUSE || this.player.mode === O.FLOORPLAN
- , o = e === L.STD;
- if (!n && (i || o)) {
- if (r) {
- var a = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
- this.obj3d.add(a)
- }
- var s = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
- this.obj3d.add(s)
- }
- this.appearSlow()
- }
- return this.upcomingTransType = e,
- !n
- }
- ,
- t.prototype.findShortestPath = function(e, t) {
- if (!e || !t)
- return null;
- var i = D.warp.walkExtraPanosDistance
- , n = e.id + ":" + t.id + ":" + i;
- if (this.shortPaths.hasOwnProperty(n))
- return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
- var r = t.id + ":" + e.id + ":" + i;
- if (this.shortPaths.hasOwnProperty(r))
- return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
- var o = this.model.panos.aStarSearch(e, t);
- return this.model.panos.includeNodesNearPath(o, i),
- this.shortPaths[n] = o ? o.slice() : null,
- o
- }
- ,
- t.prototype.makePathHulls = function(e) {
- var t, i, n, r, o, a = 0, s = [], l = [], c = [], h = this.model.panos;
- r = (t = h.get(e[0])).floor.floorIndex;
- for (var u = 0; u < e.length; u += 1)
- (i = (t = h.get(e[u])).floorPosition.clone().sub(this.model.position)).y += this.pathHeight(),
- s.push(i),
- l.push(t.position.clone()),
- n = t.floor.floorIndex,
- c.push(r < n ? D.path.colorUp : n < r ? D.path.colorDown : D.path.color),
- 0 < u && (a < (o = l[u].distanceTo(l[u - 1])) && (a = o));
- return a > this.longestStep && (this.longestStep = a,
- H.debug("path contains " + a + " meter segment")),
- {
- floor: s,
- camera: l,
- color: c
- }
- }
- ,
- t.prototype.makeFloorCurves = function(e, t, i) {
- var n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
- , r = this.pointPathDistance(e) - 2 * n
- , o = e.slice(0)
- , a = o[1].clone().sub(o[0]);
- a.y = 0,
- a.normalize().multiplyScalar(n),
- o[0] = (new P.Vector3).copy(o[0]).add(a),
- (a = o[o.length - 2].clone().sub(o[o.length - 1])).y = 0,
- a.normalize().multiplyScalar(n),
- o[o.length - 1] = (new P.Vector3).copy(o[o.length - 1]).add(a);
- var s = new P.CatmullRomCurve3(o)
- , l = Math.floor(r / i);
- l = 4 * Math.floor(l / 4),
- l = Math.max(4, l);
- for (var c, h, u = s.getSpacedPoints(l), d = [], p = new P.Vector3, f = 0; f < u.length; f += 1) {
- h = 0,
- c = u[f].distanceTo(e[0]);
- for (var g = 1; g < e.length; g += 1)
- p.copy(u[f]).sub(e[g]),
- p.y *= 4,
- p.length() < c && (h = g);
- d.push(t[h])
- }
- return {
- distance: r,
- points: u,
- colors: d
- }
- }
- ,
- t.prototype.makeCameraCurvePoints = function(e, t) {
- var i = this.pointPathDistance(e);
- return new P.CatmullRomCurve3(e).getSpacedPoints(Math.max(2, Math.floor(i / t)))
- }
- ,
- t.prototype.makeCameraCurveTangents = function(e, t) {
- var i = this.pointPathDistance(e)
- , n = new P.CatmullRomCurve3(e)
- , r = Math.max(2, Math.floor(i / t));
- r = r || 5;
- for (var o = [], a = 0; a <= r; a++)
- o.push(n.getTangentAt(a / r));
- return o
- }
- ,
- t.prototype.setPathHulls = function(e) {
- var t = this.makePathHulls(e);
- this.floorHull = t.floor,
- this.cameraHull = t.camera,
- this.colorHull = t.color
- }
- ,
- t.prototype.setFloorCurves = function() {
- var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
- this.floorPathDistance = e.distance,
- this.floorCurvePoints = e.points,
- this.floorCurveColors = e.colors
- }
- ,
- t.prototype.setCameraCurvePoints = function() {
- this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, D.warp.stepFactor * this.brushPrefs.paveStep)
- }
- ,
- t.prototype.chooseWarpPath = function(e) {
- var t, i, n, r = this.playerControls.cameras[O.PANORAMA];
- if (this.player.currentPano === this.warpDestPano || !e)
- return this.warpPathPoints = null,
- this.warpLength = 0,
- !1;
- this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
- void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (H.debug("warp path to unreachable node"),
- i = (t = this.warpDestPano.position.clone().sub(r.position)).clone().negate(),
- t.multiplyScalar(.15).add(r.position),
- i.multiplyScalar(.15).add(this.warpDestPano.position),
- t.y = r.position.y,
- i.y = this.warpDestPano.position.y,
- n = new P.CubicBezierCurve3(r.position.clone(),t,i,this.warpDestPano.position.clone()),
- this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (H.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
- this.setCameraCurvePoints(),
- this.warpPathPoints = this.camCurvePoints.slice(0)),
- this.warpLength = 0,
- this.warpPathLengths = [0];
- 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) {
- o.copy(this.warpPathPoints[c - 1]).sub(this.warpPathPoints[c]);
- var h = o.length();
- o.y *= D.warp.climbEffort;
- var u = o.length() / h;
- if (1 < c) {
- o.setY(0).normalize(),
- a.copy(this.warpPathPoints[c - 2]).sub(this.warpPathPoints[c - 1]).setY(0).normalize();
- var d = Math.min(1, o.dot(a))
- , p = 1 + (D.warp.brakeStrength - 1) * (1 - P.Math.smoothstep(d, l, s));
- u = Math.max(p, u)
- }
- this.warpLength += h * u,
- this.warpPathLengths[c] = this.warpLength
- }
- return !0
- }
- ,
- t.prototype.drawPathRibbon = function(e, t) {
- this.bunnyObj.visible = D.warp.showBunny;
- 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) {
- a.copy(e[s]),
- 0 === s ? a.sub(e[s + 1]) : a.sub(e[s - 1]).negate(),
- a.normalize(),
- n.crossVectors(a, U.UP),
- n.multiplyScalar(i);
- var l = (new P.Vector3).copy(e[s]).add(r);
- l.sub(n),
- o.vertices.push(l),
- (l = (new P.Vector3).copy(e[s]).add(r)).add(n),
- o.vertices.push(l)
- }
- var c, h, u, d = 0;
- for (s = 0; s < e.length - 1; s += 1) {
- var p = 2 * s
- , f = d
- , g = d += e[s + 1].distanceTo(e[s])
- , m = t[s]
- , v = t[s + 1];
- (c = new P.Face3(p,1 + p,2 + p)).vertexColors = [new P.Color(m), new P.Color(m), new P.Color(v)],
- o.faces.push(c),
- o.faceVertexUvs[0].push([new P.Vector2(0,f), new P.Vector2(1,f), new P.Vector2(0,g)]),
- (c = new P.Face3(2 + p,1 + p,3 + p)).vertexColors = [new P.Color(v), new P.Color(m), new P.Color(v)],
- o.faces.push(c),
- o.faceVertexUvs[0].push([new P.Vector2(0,g), new P.Vector2(1,f), new P.Vector2(1,g)])
- }
- o.computeFaceNormals(),
- o.computeVertexNormals(),
- h = this.player.mode === O.PANORAMA ? ((u = P.UniformsUtils.clone(C.ribbon.uniforms)).map.value = I.path,
- u.opacity.value = 0,
- u.color.value.set(D.path.color),
- new P.RawShaderMaterial({
- side: P.DoubleSide,
- depthWrite: !1,
- transparent: !0,
- vertexShader: C.ribbon.vertexShader,
- fragmentShader: C.ribbon.fragmentShader,
- uniforms: u,
- name: "ribbonT",
- opacity: 0
- })) : new P.MeshBasicMaterial({
- color: 16777215,
- side: P.DoubleSide,
- name: "ribbonOut",
- vertexColors: P.VertexColors
- });
- var y = new P.Mesh(o,h);
- return y.name = "ribbon",
- this.player.mode === O.PANORAMA && (y.renderOrder = A.ribbon),
- y
- }
- ,
- t.prototype.drawPathPavement = function(e) {
- for (var t, i = new P.Vector3, n = new P.Geometry, r = new P.Vector3, o = 0; o < e.length; o += 1)
- r.copy(e[o]),
- 0 === o ? r.sub(e[o + 1]).negate() : r.sub(e[o - 1]),
- r.normalize(),
- i.crossVectors(r, U.UP),
- i.multiplyScalar(this.brushPrefs.paveWidth),
- (t = (new P.Vector3).copy(e[o])).sub(i),
- n.vertices.push(t),
- n.vertices.push((new P.Vector3).copy(e[o])),
- (t = (new P.Vector3).copy(e[o])).add(i),
- n.vertices.push(t);
- var a, s, l;
- for (o = 0; o < e.length - 1; o += 1)
- a = 3 * o + 1,
- l = .25 + (s = .25 * o),
- n.faces.push(new P.Face3(a - 1,a,3 + a)),
- n.faceVertexUvs[0].push([new P.Vector2(0,s), new P.Vector2(.5,s), new P.Vector2(.5,l)]),
- n.faces.push(new P.Face3(3 + a,2 + a,a - 1)),
- n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(0,l), new P.Vector2(0,s)]),
- n.faces.push(new P.Face3(3 + a,a,1 + a)),
- n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(.5,s), new P.Vector2(1,s)]),
- n.faces.push(new P.Face3(3 + a,1 + a,4 + a)),
- n.faceVertexUvs[0].push([new P.Vector2(.5,l), new P.Vector2(1,s), new P.Vector2(1,l)]);
- var c = this.player.mode === O.PANORAMA ? new P.MeshBasicMaterial({
- color: D.path.color,
- side: P.DoubleSide,
- transparent: !0,
- depthWrite: !1,
- opacity: 0,
- name: "paveT",
- map: I.path
- }) : new P.MeshBasicMaterial({
- color: D.path.color,
- side: P.DoubleSide,
- transparent: !0,
- depthWrite: !1,
- opacity: 1,
- name: "paveO",
- map: I.path
- });
- return new P.Mesh(n,c)
- }
- ,
- t.prototype.hintPrefs = {
- rad: .18,
- width: .0125,
- depth: .0625,
- setBack: -.04,
- markRad: .25,
- markInnerRad: .16
- },
- t.prototype.makeWaypointObj = function(e, t) {
- var i = new P.Geometry
- , n = this.player.mode === O.PANORAMA ? D.path.waypointIndoorRadius : D.path.waypointRadius
- , r = this.pathHeight();
- 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)),
- i.faces.push(new P.Face3(0,1,2), new P.Face3(2,3,0)),
- i.faceVertexUvs[0].push([new P.Vector2(0,0), new P.Vector2(1,0), new P.Vector2(1,1)]),
- i.faceVertexUvs[0].push([new P.Vector2(1,1), new P.Vector2(0,1), new P.Vector2(0,0)]);
- var o = P.UniformsUtils.clone(C.waypoint.uniforms);
- o.map.value = e,
- o.opacity.value = 0,
- o.color.value.set(D.path.color);
- var a = {
- side: P.DoubleSide,
- depthWrite: !1,
- transparent: !0,
- vertexShader: C.waypoint.vertexShader,
- fragmentShader: C.waypoint.fragmentShader,
- uniforms: o,
- name: "waypoint",
- opacity: 0
- };
- this.player.mode !== O.PANORAMA && (a.depthTest = !1,
- a.name = "wayPtOut");
- var s = new P.RawShaderMaterial(a)
- , l = new P.Mesh(i,s);
- return l.name = t,
- l
- }
- ,
- t.prototype.makeStartMarker = function(e, t) {
- var i = (new P.Vector3).copy(t[1]).sub(t[0]);
- i.y = 0,
- i.normalize();
- var n = Math.acos(i.x)
- , r = this.makeWaypointObj(I.pathStart, "Start");
- return r.rotateOnAxis(new P.Vector3(0,1,0), n),
- r.position.copy(e),
- r
- }
- ,
- t.prototype.makeEndMarker = function(e) {
- var t = this.makeWaypointObj(I.pathEnd, "End")
- , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
- , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
- return i < n ? t.material.uniforms.color.value.set(D.path.colorUp) : n < i && t.material.uniforms.color.value.set(D.path.colorDown),
- t.position.copy(e),
- t
- }
- ,
- t.prototype.pathClean = function(e) {
- if (e) {
- for (var t in e.children)
- this.pathClean(e.children[t]);
- e.geometry && e.geometry.dispose(),
- e.material && e.material.dispose()
- }
- }
- ,
- t.prototype.discardPathObject = function() {
- if (this.obj3d) {
- var e = this.obj3d.parent;
- e && e.remove(this.obj3d),
- this.pathClean(this.obj3d)
- }
- this.obj3d = null,
- this.popInCpm()
- }
- ,
- t.prototype.discardSlow = function() {
- if (this.obj3d) {
- if (this.player.mode !== O.PANORAMA)
- return void this.discardPathObject();
- for (var e, t = 0, i = function() {
- this.discardPathObject()
- }
- .bind(this), n = 0; n < this.obj3d.children.length; n += 1)
- 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]),
- t += 1,
- i = null);
- 0 === t && this.discardPathObject(),
- this.player.mode !== O.PANORAMA && this.fadeInCpm(D.path.fadeInTime - 3)
- }
- }
- ,
- t.prototype.appearSlow = function() {
- var e;
- this.fadeOutCpm(D.path.fadeInTime);
- for (var t = this.player.mode === O.PANORAMA ? D.path.opacity : 1, i = 0; i < this.obj3d.children.length; i += 1)
- 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]))
- }
- ,
- t.prototype.update = function() {
- this.obj3d && this.obj3d.updateMatrixWorld()
- }
- ,
- t.prototype.calcBurnsAmount = function(e) {
- var n = P.Math.degToRad(D.warp.burnsAngle);
- if (this.player.mode !== O.PANORAMA)
- return this.player.mode === O.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir;
- var t = this.burnsDir * n;
- if (this.upcomingTransType === L.BLACK)
- return t;
- var i = e;
- if (null === i)
- return H.warn("Transition request for non-highlight"),
- t;
- var r = this.getHeroDescriptorByHeroIndex(i);
- if (null === r)
- return t;
- if (!r.isPano())
- return t;
- function o(e) {
- var t = Math.acos(Math.min(1, e.dot(l)))
- , i = (new P.Vector3).crossVectors(l, e);
- return Math.max(c, Math.min(Math.abs(t), n)) * Math.sign(i.y)
- }
- var a = this.getHeroPano(r)
- , s = this.playerControls.cameras[O.PANORAMA]
- , l = U.FORWARD.clone().applyQuaternion(s.quaternion).setY(0).normalize()
- , c = Math.min(P.Math.degToRad(D.warp.minBurnsAngle), n);
- if (a === this.player.currentPano)
- return o(U.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());
- var h = this.findShortestPath(this.player.currentPano, a);
- if (null == h || h.length < 1)
- return H.debug("Empty path ahead..."),
- t;
- var u = this.makePathHulls(h)
- , d = new P.CatmullRomCurve3(u.camera)
- , p = Math.min(.1, D.warp.lookAheadDist / d.getLength());
- return o(d.getPointAt(p).clone().sub(s.position).setY(0).normalize())
- }
- ,
- t.prototype.waitNextStep = function(e, t, i) {
- var o = null == i ? D.warp.tourStepDelay : i;
- o = o || (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
- var a = new P.Euler
- , s = new P.Vector3;
- H.debug("Starting wait: " + (void 0 !== t));
- var l = this.calcBurnsAmount(e)
- , c = function() {
- this.endWarpState(),
- this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
- t && t()
- }
- .bind(this)
- , n = function(e, t) {
- if (this.warpInterrupted)
- return c(),
- !0;
- var i = t || 1e3 / 60;
- if (D.warp.doBurns)
- if (this.player.mode === O.PANORAMA) {
- var n = this.playerControls.cameras[O.PANORAMA];
- a.setFromQuaternion(n.quaternion, D.warp.eOrder);
- var r = i * l / o;
- a.y += r,
- s.set(0, 0, -1),
- s.applyEuler(a),
- s.add(n.position),
- n.controls.lookAt(s),
- n.controls.lookVector.copy(s),
- n.lookAt(s)
- } else
- this.player.mode === O.DOLLHOUSE ? this.playerControls.controls[O.DOLLHOUSE].rotationAcceleration.x = l : this.playerControls.controls[O.FLOORPLAN].absoluteScale *= .9996
- }
- .bind(this);
- this.startWarpState(),
- V.start(n, o, c, 0, B.easeInOutQuad, "wait");
- /* var r = player.model.heroLocations[app.director.currentItem];
- this.player.zoomEnabled = !0;
- var h = function(e, t) {
- //console.log(e),
- this.player.zoomTo(e * r.zoom.toFixed(2), !0)
- }
- .bind(this);
- V.start(h, 2e3, null, 0, B.easeOutQuad, "zoom") */
- }
- ,
- t.prototype.warpToNonPano = function(e) {
- if (this.discardPathObject(),
- this.warpDestHeroLoc.cameraMode === O.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === O.FLOORPLAN) {
- var t = function() {
- e && e()
- }
- .bind(this);
- this.player.flyToNewMode({
- mode: this.warpDestHeroLoc.cameraMode,
- duration: D.warp.outsideTime,
- warpDest: this.warpDestHeroLoc,
- callback: t,
- force: !0
- })
- } else
- H.warn("no warp destination!!!"),
- e && e()
- }
- ,
- t.prototype._resetWarpShaderParams = function(e) {
- this.player.mode === O.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
- void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
- }
- ,
- t.prototype._clearWarpShading = function() {
- for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
- this._resetWarpShaderParams(e[t]),
- e[t].visible = !0;
- this._resetWarpShaderParams(this.model.skybox)
- }
- ,
- t.prototype._warpStopFlying = function() {
- this.activeTransType = null,
- this.placeCpm()
- }
- ,
- t.prototype._wrapupTravelOnlyBits = function() {
- this._warpStopFlying(),
- this.warpPathPoints && (this.player.currentPano.exit(),
- this.warpDestPano.enter(),
- this.player.currentPano = this.warpDestPano),
- this.player.spider.draw(),
- this.placeCpm()
- }
- ,
- t.prototype._wrapupTravel = function(e) {
- this._wrapupTravelOnlyBits(),
- this.warpCameraAim(e)
- }
- ,
- t.prototype._wrapupWarpShading = function(e) {
- this._clearWarpShading(),
- this._wrapupTravel(e)
- }
- ,
- t.prototype.wrapupWarpShadingOnly = function(e, t) {
- t !== z.END && this._clearWarpShading(),
- this._wrapupTravelOnlyBits(),
- this.upcomingTransType = null,
- e && e()
- }
- ,
- t.prototype._warpCameraAim = function(e, t) {
- var i = this.warpDestHeroLoc.quaternion
- , n = this.playerControls.cameras[O.PANORAMA]
- , r = new P.Vector3(0,0,1).applyQuaternion(i).normalize()
- , o = new P.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize().dot(r)
- , a = P.Math.radToDeg(Math.acos(o))
- , s = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(i, D.warp.eOrder)
- , l = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
- , c = new P.Euler(s.x - l.x,s.y - l.y,s.z - l.z,D.warp.eOrder);
- c.y = N.constrainedTurn(c.y),
- this.burnsDir = Math.sign(c.y);
- var h = new P.Euler(0,0,0,D.warp.eOrder)
- , u = new P.Vector3
- , d = function(e, t) {
- return !!this.warpInterrupted || (h.x = l.x + e * c.x,
- h.y = l.y + e * c.y,
- h.z = l.z + e * c.z,
- u.set(0, 0, -1),
- u.applyEuler(h),
- u.add(n.position),
- n.controls.lookAt(u),
- n.controls.lookVector.copy(u),
- void n.lookAt(u))
- }
- .bind(this);
- return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing]) : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
- void (t && t()))
- }
- ,
- t.prototype._warpBendAim = function(e, t, i, n) {
- var r = n || 0
- , o = this.playerControls.cameras[O.PANORAMA]
- , a = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
- , s = (new P.Euler).setFromQuaternion(o.quaternion, D.warp.eOrder)
- , l = new P.Euler(a.x - s.x,a.y - s.y,a.z - s.z,D.warp.eOrder);
- l.y = N.constrainedTurn(l.y);
- var c = Math.min(P.Math.degToRad(D.warp.softBendTilt), Math.abs(l.x));
- l.x = c * Math.sign(l.x),
- c = Math.min(P.Math.degToRad(Math.max(0, D.warp.softBendAngle)), c),
- this.burnsDir = Math.sign(l.y),
- c *= Math.sign(l.y),
- l.y = c;
- var h = new P.Euler(0,0,0,D.warp.eOrder)
- , u = new P.Vector3
- , d = function(e, t) {
- if (e < .5)
- h.x = s.x + e * l.x,
- h.y = s.y + e * l.y,
- h.z = s.z + e * l.z;
- else {
- var i = (1 - e) * D.warp.softBendEnd;
- h.x = a.x - i * l.x,
- h.y = a.y - i * l.y,
- h.z = a.z - i * l.z
- }
- u.set(0, 0, -1),
- u.applyEuler(h),
- u.add(o.position),
- o.controls.lookAt(u),
- o.controls.lookVector.copy(u),
- o.lookAt(u)
- }
- .bind(this);
- return V.start(d, t, i, r, B[D.warp.movementEasing])
- }
- ,
- t.prototype._warpStepCameraAim = function(e, t, i) {
- var n = this.playerControls.cameras[O.PANORAMA]
- , r = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
- , o = (new P.Euler).setFromQuaternion(n.quaternion, D.warp.eOrder)
- , a = new P.Euler(r.x - o.x,r.y - o.y,r.z - o.z,D.warp.eOrder);
- a.y = N.constrainedTurn(a.y),
- this.burnsDir = Math.sign(a.y);
- var s = new P.Euler(0,0,0,D.warp.eOrder)
- , l = new P.Vector3
- , c = function(e, t) {
- e < .5 ? s.copy(o) : s.copy(r),
- l.set(0, 0, -1),
- l.applyEuler(s),
- l.add(n.position),
- n.controls.lookAt(l),
- n.controls.lookVector.copy(l),
- n.lookAt(l)
- }
- .bind(this);
- return V.start(c, t, i, 0, B[D.warp.movementEasing])
- }
- ,
- t.prototype.setBurnsDir = function() {
- var e = this.playerControls.cameras[O.PANORAMA]
- , t = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
- , i = (new P.Euler).setFromQuaternion(e.quaternion, D.warp.eOrder)
- , n = new P.Euler(t.x - i.x,t.y - i.y,t.z - i.z,D.warp.eOrder);
- n.y = N.constrainedTurn(n.y),
- this.burnsDir = Math.sign(n.y)
- }
- ,
- t.prototype.stepWarpPath = function(e, t) {
- var i = this.playerControls.cameras[O.PANORAMA];
- if (!this.warpPathPoints)
- return i.position.copy(this.warpDestPano.position),
- !0;
- var n = this.warpPathPoints[0]
- , r = this.warpDestPano.position;
- if (null !== this.nodes && 1 < this.cameraHull.length) {
- var o = new P.Vector3;
- 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),
- i.position.copy(o)
- } else
- e < .5 ? i.position.copy(n) : i.position.copy(r)
- }
- ,
- t.prototype.interruptAndFastForward = function(e, t) {
- this.warping && (this.warpInterrupted = !0,
- this.warpInterruptionBlackoutStyle = e,
- this.warpInterruptionTravelTime = t,
- null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = z.MIDDLE),
- null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = D.minWarpTime))
- }
- ,
- t.prototype.warpCameraAim = function(e) {
- var t = D.warp.minWarpTime;
- if (this.upcomingTransType === L.BLACK)
- t = D.warp.teleportTime;
- else {
- var i = this.playerControls.cameras[O.PANORAMA]
- , n = new P.Euler(0,0,0,D.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, D.warp.eOrder)
- , r = (new P.Euler).setFromQuaternion(i.quaternion, D.warp.eOrder)
- , o = new P.Euler(n.x - r.x,n.y - r.y,n.z - r.z,D.warp.eOrder);
- o.y = N.constrainedTurn(o.y);
- var a = 1e3 * Math.abs(o.y) / P.Math.degToRad(D.warp.maxAimPerSec);
- t = Math.max(t, a)
- }
- var s = function() {
- this._warpStopFlying(),
- this.discardSlow(),
- e && e()
- }
- .bind(this);
- this._warpCameraAim(t, s)
- }
- ,
- t.prototype.warpCommonParameters = function(e, t, i, n) {
- this.model.skybox.material.uniforms.blackout.value = n;
- var r = F.uniform(this.model.skybox, "progress", 1)
- , o = F.allUniforms(this.model.chunks, "progress", 1)
- , a = !1
- , s = function() {
- if (this.warpInterrupted)
- return a = !0
- }
- .bind(this)
- , l = function(e, t) {
- return i && a ? !(this.model.skybox.material.uniforms.progress.value = 0) : void r(e, t)
- }
- .bind(this)
- , c = function(e, t) {
- return i && a ? (o(0),
- !0) : void o(e, t)
- }
- .bind(this);
- V.start(s, e, null, t, null, "safeHaltWatch"),
- V.start(l, e, null, t, B[D.warp.blendEasing], "skyboxProgress"),
- V.start(c, e, null, t, B[D.warp.blendEasing], "chunkProgress")
- }
- ,
- t.prototype.warpTravel_STD = function(e) {
- 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),
- 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;
- t += this.warpLength * D.warp.timePerMeter,
- .01 < D.warp.flySpeed && (t = 1e3 * this.warpLength / D.warp.flySpeed);
- function n(e) {
- var t = i;
- return P.Math.smoothstep(e, 0, t) * (1 - P.Math.smoothstep(e, 1 - t, 1))
- }
- var y = !1
- , r = this.warpDestHeroLoc.quaternion
- , o = new P.Vector3(0,0,-1).applyQuaternion(r).normalize()
- , A = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
- , a = A.dot(o)
- , C = P.Math.radToDeg(Math.acos(a))
- , s = function() {
- return m.lookAt(g, l, U.UP),
- u.setFromRotationMatrix(m, D.warp.eOrder),
- p.setFromQuaternion(h.quaternion, D.warp.eOrder),
- v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
- N.constrainedTurn(v.y)
- }
- .bind(this)
- , I = function(e, t) {
- if (this.warpInterrupted)
- return y = !0
- }
- .bind(this)
- , E = function(e, t) {
- return y || !this.warpPathPoints ? (k.blur(0),
- !0) : void k.blur(e)
- }
- .bind(this)
- , _ = F.allUniforms(this.model.chunks, "modelAlpha", 1)
- , b = function(e, t) {
- return y || !this.warpPathPoints ? (_(0),
- !0) : void _(e, t)
- }
- .bind(this)
- , w = function(e, t) {
- if (!this.warpPathPoints)
- return h.position.copy(this.warpDestPano.position),
- !0;
- if (y)
- return !0;
- var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
- h.position.copy(i),
- g = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
- }
- .bind(this)
- , T = function(e, t) {
- return this.warpPathPoints ? !!y || void (l = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + c, 1))) : (H.debug("Lost bunny."),
- !0)
- }
- .bind(this)
- , x = function(e, t) {
- if (y)
- return H.debug(">>>> Walkthrough interupted at t=" + e),
- !0;
- if (!this.warpPathPoints)
- return !0;
- var i = this.warpLength * e
- , n = P.Math.smoothstep(i, 0, this.brushPrefs.lookBlendDist)
- , r = P.Math.smoothstep(i, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
- D.warp.matchCam && (n *= 1 - r),
- m.lookAt(g, l, U.UP),
- u.setFromRotationMatrix(m, D.warp.eOrder),
- p.setFromQuaternion(h.quaternion, D.warp.eOrder),
- v.set(u.x - p.x, u.y - p.y, u.z - p.z, D.warp.eOrder),
- v.y = N.constrainedTurn(v.y),
- u.x = p.x + n * v.x,
- u.y = p.y + n * v.y,
- u.z = p.z + n * v.z,
- v.set(u.x - f.x, u.y - f.y, u.z - f.z, D.warp.eOrder),
- v.y = N.constrainedTurn(v.y);
- var o = P.Math.degToRad(D.warp.maxTurnPerSec) * t / 1e3;
- v.y = Math.sign(v.y) * Math.min(o, Math.abs(v.y)),
- f.x = f.x + v.x * D.warp.turnFriction,
- f.y = f.y + v.y * D.warp.turnFriction,
- f.z = f.z + v.z * D.warp.turnFriction,
- f.x = Math.max(P.Math.degToRad(D.warp.minDownAngle), f.x);
- var a = l.clone().sub(g).normalize();
- if (C < D.warp.maxAimRotation && 0 < r) {
- var s = 1 - r;
- a.x = a.x * s + r * A.x,
- a.y = a.y * s + r * A.y,
- a.z = a.z * s + r * A.z,
- a.normalize()
- }
- this.bunnyObj.position.copy(h.position).add(a),
- d.set(0, 0, -1).applyEuler(f).normalize(),
- d.multiplyScalar(8),
- d.add(h.position),
- 1 - c < e && D.warp.matchCam || (h.controls.lookAt(d),
- h.controls.lookVector.copy(d),
- h.lookAt(d))
- }
- .bind(this)
- , S = function() {
- y ? (this.discardSlow(),
- this.upcomingTransType = L.BLACK,
- this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, z.BEGINNING, e)) : this._wrapupWarpShading(e)
- }
- .bind(this);
- T(0);
- var M = D.warp.motionLeadTime + 1e3 * Math.abs(s()) / P.Math.degToRad(D.warp.maxTurnPerSec)
- , R = M / (t += M);
- this.warpCommonParameters(t, R, !0, z.NONE),
- V.start(I, t, null, 0, null, "_haltWatcher"),
- 0 < D.warp.blur && (k.blurStrength = D.warp.blur,
- V.start(E, t, null, R, n, "blurring")),
- V.start(b, t, null, R, n, "modelAlpha"),
- V.start(w, t, null, R, B[D.warp.blendEasing], "followPath"),
- V.start(T, t, null, R, B[D.warp.blendEasing], "goBunny"),
- V.start(x, t, S, 0, B[D.warp.blendEasing], "lookAtBunny")
- }
- ,
- t.prototype.warpTravel_BLACK = function(e, t, i, n) {
- var r = e || 0;
- null != t || (t = D.warp.teleportTime),
- this.warpCommonParameters(t, r, !1, i),
- this.model.chunks.forEach(function(e) {
- e.material.uniforms.blackout.value = i
- }),
- this._warpBendAim(null, t, null, r);
- var o = function() {
- this.wrapupWarpShadingOnly(n, i)
- }
- .bind(this);
- V.start(this.stepWarpPath.bind(this), t, o, r, B[D.warp.blendEasing], "stepMotion")
- }
- ,
- t.prototype.flightStepWalk = (a = new P.Vector3,
- s = new P.Vector3,
- function(e, t, i) {
- if (this.warpInterrupted)
- i && i();
- else if (this.activeTransType !== L.WALK)
- this._clearWarpShading(),
- this._warpStopFlying(),
- this.player.spider.draw(),
- this.placeCpm(),
- i && i();
- else if (this.player.currentPano !== e) {
- var n = {
- pano: e,
- lookAtPoint: t,
- duration: null,
- maxDistanceOverride: D.warp.walkMaxDist,
- skipWarpingCheck: !1,
- constantMoveSpeed: !0
- };
- n.duration = function(e, t) {
- var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
- s.copy(U.FORWARD),
- this.player.getDirection(s),
- a.copy(t).sub(e.position).normalize();
- var n = a.dot(s)
- , r = Math.acos(n)
- , o = r / i;
- return .001 < o && (i *= o / .001,
- r < 1 && (i *= 1.2)),
- i
- }
- .call(this, e, t),
- this.player.nonInterruptingFlyToPano(n, i)
- } else
- i && i()
- }
- ),
- t.prototype.makeWalkFlightFunc = function(e, t, i) {
- return this.flightStepWalk.bind(this, e, t, i)
- }
- ,
- t.prototype.warpTravel_WALK = (f = [],
- function(e) {
- for (var t = this.player.model.panos, i = null, n = !1, r = f.length = 0; r < this.nodes.length; r++) {
- var o = this.nodes[r]
- , a = t.get(o);
- this.nodes.length,
- n = i && a.position.distanceTo(i.position) < D.warp.walkMinDist,
- i && n || (f.push(o),
- i = a)
- }
- n && 1 < this.nodes.length && (f[f.length - 1] = this.nodes[this.nodes.length - 1]);
- var s = f.length
- , l = t.get(f[s - 1])
- , c = new Array(s + 1);
- c[c.length - 1] = function() {
- e && e()
- }
- .bind(this);
- for (var h = s - 1, u = c.length - 1; 0 < u; u -= 1) {
- var d = f[h];
- l = t.get(d);
- var p = new P.Vector3;
- this.getLookAtForWalkingTourNode(f, h, p),
- c[u - 1] = this.makeWalkFlightFunc(l, p, c[u]),
- h--
- }
- c[0]()
- }
- ),
- t.prototype.getLookAtForWalkingTourNode = (c = new P.Vector3,
- h = new P.Vector3,
- u = new P.Vector3,
- d = new P.Vector3,
- p = new P.Vector3,
- function(e, t, i) {
- var n = e.length;
- if (n <= t)
- return !1;
- var r = 1
- , o = 1;
- h.set(0, 0, 0),
- p.set(0, 0, 0);
- for (var a = null, s = t; s < t + 3 && !(n <= s); s++) {
- if (a = this.player.model.panos.get(e[s]),
- this.getOrientationForWalkingTourNode(e, s, u),
- s === t && c.copy(u),
- d.copy(u),
- t < s) {
- var l = d.dot(c) < .65;
- r *= l ? .2 : .75,
- o *= l ? .2 : .4
- }
- u.multiplyScalar(r),
- h.add(u),
- p.lerp(a.position, o)
- }
- return h.normalize(),
- i.copy(p),
- i.add(h),
- !0
- }
- ),
- t.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
- var n = e.length;
- if (n <= t)
- return !1;
- if (t === n - 1)
- i.copy(U.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
- else {
- var r = this.player.model.panos.get(e[t])
- , o = this.player.model.panos.get(e[t + 1]);
- i.copy(o.position).sub(r.position)
- }
- return i.normalize(),
- !0
- }
- ,
- t.prototype.warpCameraTravel = function(e, t, i, n) {
- if (this.activeTransType = this.upcomingTransType,
- this.lastTransType = this.activeTransType,
- this.upcomingTransType = null,
- e)
- this.activeTransType === L.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === L.WALK ? this.warpTravel_WALK(function() {
- this._clearWarpShading(),
- this._warpStopFlying(),
- this.player.spider.draw(),
- this.placeCpm(),
- n && n()
- }
- .bind(this)) : this.warpTravel_STD(n);
- else {
- var r = function() {
- this._wrapupTravel(n)
- }
- .bind(this)
- , o = {
- pano: this.warpDestPano,
- lookAtPoint: null,
- duration: null,
- maxDistanceOverride: null,
- skipWarpingCheck: !1
- };
- this.player.flyToPano(o, r)
- }
- }
- ,
- t.prototype.startWarpState = function() {
- this.warping = !0,
- this.warpInterrupted = !1,
- this.warpInterruptionBlackoutStyle = null,
- this.warpInterruptionTravelTime = null
- }
- ,
- t.prototype.endWarpState = function() {
- this.warping = !1
- }
- ,
- t.prototype.warpToPano = function(e, t, i, n) {
- if (this.warping)
- H.warn("Cannot warp when already warping");
- else {
- if (this.upcomingTransType = e,
- this.activeTransType = null,
- !this.setWarpDestPano())
- return this.upcomingTransType = null,
- void this.warpToNonPano(n);
- if (this.player.mode !== O.PANORAMA)
- return this.upcomingTransType = null,
- this.discardSlow(),
- void this.player.flyToNewMode({
- mode: O.PANORAMA,
- pano: this.warpDestPano,
- duration: D.warp.outsideTime,
- warpDest: this.warpDestHeroLoc,
- callback: n,
- force: !0
- });
- if (!this.warpDestPano)
- return H.warn("no warp destination, callback dropped"),
- void (this.upcomingTransType = null);
- 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)
- , o = this.chooseWarpPath(r);
- if (o && this.upcomingTransType !== L.WALK) {
- var a = function() {
- this.waitingToWarp = !1,
- this.warpToPano(e, t, i, n)
- }
- .bind(this);
- if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, a))
- return void (this.waitingToWarp = !0)
- }
- this.player.currentPano || (H.warn("Arrived at a very strange spot!"),
- this.player.currentPano = this.warpDestPano,
- this.placeCpm(),
- this.fadeOutCpm(D.path.fadeOutTime),
- this.player.spider.draw()),
- H.debug("Warping to pano ", this.warpDestPano.position),
- this.upcomingTransType !== L.WALK && this.player.emit(g.PanoChosen, this.player.currentPano, this.warpDestPano),
- this.startWarpState();
- var s = function() {
- this.endWarpState(),
- n && n()
- }
- .bind(this);
- o ? this.warpCameraTravel(r, t, i, s) : this.warpCameraAim(s)
- }
- }
- ,
- v.exports = t
- }
- ).call(this, "/js/objects/ShowPath.js")
- }
- , {
- "../constants": 8,
- "../effects": 16,
- "../enum/BlackoutStyle": 18,
- "../enum/ModelManagerEvents": 33,
- "../enum/PlayerEvents": 40,
- "../enum/RenderOrder": 42,
- "../enum/Vectors": 50,
- "../enum/Viewmode": 51,
- "../enum/WarpStyle": 52,
- "../gui/gui": 65,
- "../model/ModelManager": 140,
- "../objects/Snapshot": 153,
- "../settings": 166,
- "../shaders": 167,
- "../util/easing": 186,
- "../util/lerp": 188,
- "../util/logger": 189,
- "../util/math": 190,
- "../util/texture": 194,
- "../util/transitions": 195,
- three: 217
- }],
- 152: [function(e, t, i) {
- "use strict";
- function n() {
- var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
- , t = new r.RawShaderMaterial({
- fragmentShader: o.skysphere.fragmentShader,
- vertexShader: o.skysphere.vertexShader,
- uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
- side: r.BackSide,
- name: "skysphere"
- });
- t.uniforms.radius.value = e.parameters.radius,
- r.Mesh.call(this, e, t)
- }
- var r = e("three")
- , o = e("../shaders")
- , a = e("../settings");
- (n.prototype = Object.create(r.Mesh.prototype)).constructor = n,
- t.exports = n
- }
- , {
- "../settings": 166,
- "../shaders": 167,
- three: 217
- }],
- 153: [function(r, o, e) {
- (function(e) {
- "use strict";
- function t(e) {
- n.call(this, e),
- this.sid = e.sid,
- this.panoId = e.panoId,
- this.orthoZoom = e.orthoZoom,
- this.floorVisibility = e.floorVisibility,
- this.thumbUrl = e.thumbUrl,
- this.name = e.name,
- this.zoom = e.zoom
- }
- var i = (r("three"),
- r("../util/logger"))
- , n = (r("../settings"),
- r("../enum/Viewmode"),
- r("../util/common"),
- r("../util/transitions"),
- r("../util/lerp"),
- r("../util/ajax"),
- r("../util/texture"),
- r("./View"));
- r("events").EventEmitter,
- new i(e),
- (t.prototype = Object.create(n.prototype)).isPano = function() {
- return this.panoId && "" !== this.panoId && this.panoId != "outside"
- }
- ,
- o.exports = t
- }
- ).call(this, "/js/objects/Snapshot.js")
- }
- , {
- "../enum/Viewmode": 51,
- "../settings": 166,
- "../util/ajax": 181,
- "../util/common": 185,
- "../util/lerp": 188,
- "../util/logger": 189,
- "../util/texture": 194,
- "../util/transitions": 195,
- "./View": 154,
- events: 202,
- three: 217
- }],
- 154: [function(o, a, e) {
- (function(e) {
- "use strict";
- function t(e) {
- e = e || {},
- this.position = new i.Vector3,
- this.quaternion = new i.Quaternion,
- this.update(e)
- }
- var i = o("three")
- , n = o("../util/logger")
- , r = (o("../settings"),
- o("../enum/Viewmode"),
- o("../util/common"),
- o("../util/transitions"),
- o("../util/lerp"),
- o("../util/ajax"),
- o("../util/texture"),
- o("events").EventEmitter);
- new n(e),
- (t.prototype = Object.create(r.prototype)).isValid = function() {
- return !!this.cameraMode
- }
- ,
- t.prototype.update = function(e) {
- return this.cameraMode = e.cameraMode || this.cameraMode,
- this.pano = e.pano || this.pano,
- e.position && this.position.copy(e.position),
- e.quaternion && this.quaternion.copy(e.quaternion),
- this
- }
- ,
- a.exports = t
- }
- ).call(this, "/js/objects/View.js")
- }
- , {
- "../enum/Viewmode": 51,
- "../settings": 166,
- "../util/ajax": 181,
- "../util/common": 185,
- "../util/lerp": 188,
- "../util/logger": 189,
- "../util/texture": 194,
- "../util/transitions": 195,
- events: 202,
- three: 217
- }],
- 155: [function(J, ee, e) {
- (function(e) {
- "use strict";
- function t(e) {
- this.currentPano = null,
- this.nextPano = null,
- this.camera = null,
- this.paused = !1,
- this.flying = !1,
- this.sceneIntersectionPlane = null,
- this.target = new B.Vector3,
- this.mouse = new B.Vector3(1.1,1.1,.5),
- this.mouseAtMouseDown = new B.Vector2,
- this.mouseCouldBeClickToMove = !1,
- this.mouseLastMoveTime = Date.now(),
- this.mouseDown = !1,
- this.mouseDownTimer = null,
- this.couldBeLongTap = !1,
- this.containsMouse = !0,
- this.isTouchEvent = !1,
- this.isPanoHover = !1,
- this.reticule = new n(this),
- this.panoMarkers = [],
- this.spider = new s(this),
- this.quaternion = new B.Quaternion,
- this.position = new B.Vector3(15,10,15),
- this.previousState = null,
- this.lastInsideView = new o,
- this.last360View = new o,
- this.raycaster = new B.Raycaster,
- this.intersect = null,
- this.lastChangeTime = Date.now(),
- this.history = new h,
- this.cameraControls = null,
- this.path = null,
- this.model = null,
- this.domElement = null,
- this.cachedPanoCandidates = null,
- this.basePanoSize = 0,
- this.standardPanoSize = 0,
- this.highPanoSize = 0,
- this.ultraHighPanoSize = 0,
- this.zoomLevel = 1,
- this.zooming = 0,
- this.zoomSpeed = .5,
- this.scrollZoomSpeed = .06,
- this.zoomSpeedAdjust = .05,
- this.defaultZoomIncrement = .2,
- this.baseFov = k.insideFOV,
- this.zoomFov = this.baseFov,
- this.zoomEnabled = !0,
- this.preRenderingEnabled = !1,
- this.setupCustomProperties(e),
- this.zoomStats = new v,
- this.modeTran = ''
- this.currentCursor = '';
-
-
-
- }
- var B = J("three")
- , i = J("./util/logger")
- , n = J("./objects/Reticule")
- , a = J("./objects/Panorama")
- , r = J("./objects/ShowPath")
- , o = J("./objects/View")
- , s = (J("./objects/Snapshot"),
- J("./objects/NSpider"))
- , V = J("./enum/Viewmode")
- , T = (J("./enum/TagStates"),
- J("./enum/Vectors"))
- , l = J("./enum/Keys")
- , k = (J("./enum/AlignmentType"),
- J("./settings"))
- , x = J("./util/common")
- , U = (J("./util/browser"),
- J("./util/math"))
- , H = J("./util/lerp")
- , z = J("./util/easing")
- , G = J("./util/transitions")
- , c = J("events").EventEmitter
- , h = (J("./shaders"),
- J("./util/history"))
- , S = (J("./util/camera"),
- J("./model/ModelManager"),
- J("./enum/PathDiscardMode"))
- , M = J("./enum/PathDisplayMode")
- , W = J("./enum/PlayerEvents")
- , u = J("./enum/ControlEvents")
- , d = J("./enum/ModelManagerEvents")
- , R = J("./enum/WarpStyle")
- , P = J("./enum/BlackoutStyle")
- , p = J("./exception/BasicException")
- , f = J("./enum/PanoSizeClass")
- , g = (J("./tile/TileDownloader"),
- J("./tile/TilePrioritizer"))
- , m = (J("./enum/PanoramaEvents"),
- J("./enum/ZoomEvents"))
- , v = J("./util/ZoomStats")
- , y = J("./constants")
- , j = J("./util/common")
- , A = J("./util/cameraLight")
- , C = J("hot")
- , Y = new i(e)
- , q = Object.freeze({
- FlyToPano: G.getUniqueId(),
- FlyToNewMode: G.getUniqueId(),
- FlyToSameMode: G.getUniqueId(),
- FlyToViewFloor: G.getUniqueId(),
- LookTransition: G.getUniqueId(),
- ZoomTransition: G.getUniqueId()
- });
- function I(e) {
- for (var t = e.split(","), i = t[0].match(/:(.*?);/)[1], n = atob(t[1]), r = n.length, o = new Uint8Array(r); r--; )
- o[r] = n.charCodeAt(r);
- return new Blob([o],{
- type: i
- })
- }
- (t.prototype = Object.create(c.prototype)).init = function(e) {
- (window.player = this).modelManager = e.modelManager,
- this.tileDownloader = e.tileDownloader,
- this.panoRenderer = e.panoRenderer,
- this.qualityManager = e.qualityManager,
- this.domElement = e.container,
- this.camera = e.camera,
- this.tagManager = e.tagManager,
- this.cameraControls = e.controls,
- this.path = new r(e.director,this,e.controls),
- this.basePanoSize = this.qualityManager.getPanoSize(f.BASE),
- this.standardPanoSize = this.qualityManager.getPanoSize(f.STANDARD),
- this.highPanoSize = this.qualityManager.getPanoSize(f.HIGH),
- this.ultraHighPanoSize = this.qualityManager.getPanoSize(f.ULTRAHIGH),
- this.tileDownloader.processPriorityQueue = !1,
- this.tileDownloader.tilePrioritizer = new g(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
- this.bindEvents(e.container),
- this.updateModel()
- }
- ,
- t.prototype.screenShot = function(i) {
- if (!this.flying && !this.flyingToTag) {
- var n = this.sceneRenderer;
- for (var e in n.updateScreenSize(i),
- this.model.panos.index)
- this.model.panos.index[e].marker && (this.model.panos.index[e].marker.forceHide = this.model.panos.index[e].marker.visible,
- this.model.panos.index[e].marker.visible = !1);
- for (var e in this.model.hots)
- this.model.hots[e].mesh.visible = !1;
- this.reticule.visible = !1,
- this.reticule.forceUnvisible = !0,
- this.path.currentPanoMarker.mesh.visible = !1,
- setTimeout(function() {
- n.renderer.clear(!0, !0, !0),
- n.renderer.render(n.scene, n.camera);
- var e = n.renderer.domElement.toDataURL(i.type, .9);
- for (var t in i.f && i.f(e),
- n.updateScreenSize({
- resize: !0
- }),
- this.reticule.visible = !0,
- this.model.hots)
- this.model.hots[t].mesh.visible = !0;
- for (var t in this.model.panos.index)
- this.model.panos.index[t].marker.visible = this.model.panos.index[t].marker.forceHide;
- this.path.currentPanoMarker.mesh.visible = !0,
- n.renderer.render(n.scene, n.camera)
- }
- .bind(this), 30)
- }
- }
- ;
- var E, _, b, w, O, L, D, N, F, X, Z, K, Q = J("scaleImg");
- t.prototype.getWrapShot = function() {
- var i = this.getSnapAngleInfo()
- , n = ",{\r\t" + i
- , r = arguments[0];
- this.screenShot({
- width: g_snapShotWidth,
- height: g_snapShotHeight,
- type: "image/jpeg",
- f: function(e) {
- if (r && r.__callback)
- return r.__callback(e, i);
- var t = new Image;
- t.src = e,
- t.onload = function() {
- var e = function(r, i) {
- function n(e, t) {
- var i = o || r
- , n = document.createElement("canvas");
- n.width = i.width,
- n.height = i.height,
- n.getContext("2d").drawImage(i, 0, 0, i.width, i.height),
- o = Q(e, n, t)
- }
- function e() {
- var e = o || r
- , t = I(e.src);
- i.maxWeight && t.size > i.maxWeight && (n(i.maxWeight / t.size, "jpeg"),
- t = I(e.src)),
- (o = o || new Image).base64Src = e.src,
- o.src = window.URL.createObjectURL(t)
- }
- var o, t = Math.max(r.width, r.height);
- return "png" != i.toType && ("jpeg" == i.oldType ? (t > i.maxSize && n(i.maxSize / t, "jpeg"),
- e()) : "png" == i.oldType && i.maxWeight && i.weight > i.maxWeight && (n(t > i.maxSize ? i.maxSize / t : 1, "jpeg"),
- e())),
- o || r
- }(this, {
- maxSize: g_snapShotWidth,
- oldType: "jpeg"
- });
- e.src.replace(function(e) {
- return "image/" + (e = e.toLowerCase().replace(/jpg/i, "jpeg")).match(/png|jpeg|bmp|gif/)[0]
- }("image/jpeg"), "image/octet-stream");
- var t = "snap" + (new Date).getTime();
- !function(e, t) {
- var i = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
- i.href = e,
- i.download = t;
- var n = document.createEvent("MouseEvents");
- n.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null),
- i.dispatchEvent(n)
- }(e.src, t + ".jpg"),
- n += ',\r\t"thumbnail_signed_src":"' + t + '.jpg",',
- n += '\r\t"sid":"' + t + '",',
- n += '\r\t"name":"' + t + '"\r}',
- logData(n)
- }
- }
- })
- }
- /* ,
- t.prototype.getSnapAngleInfo = function() {
- var e = {}
- , t = '"metadata":{'
- , i = this.camera.quaternion.clone();
- switch (this.mode) {
- case "panorama":
- e.scan_id = this.currentPano.id,
- t += '"scan_id":"' + this.currentPano.id + '",';
- break;
- case "floorplan":
- e.camera_mode = 1,
- (i = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))).multiply(this.camera.quaternion),
- t += '"camera_mode":1,',
- t += '"ortho_zoom":' + U.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ",";
- break;
- case "dollhouse":
- e.camera_mode = 2,
- t += '"camera_mode":2,'
- }
- var n = new B.Quaternion(i.x,i.y,i.z,i.w);
- return n.multiply(new B.Quaternion(Math.sqrt(2) / 2,Math.sqrt(2) / 2,0,0).conjugate()),
- n.x *= -1,
- n.w *= -1,
- e.camera_position = U.toPrecision(this.camera.position.toArray(), 4),
- e.camera_quaternion = U.toPrecision(n.toArray(), 4),
- e.zoom = this.zoomLevel,
- t += '"camera_position":[' + e.camera_position + '],"camera_quaternion":[' + e.camera_quaternion + '], "zoom":' + e.zoom + "}"
- }
- , */
-
- t.prototype.getSnapAngleInfo = function(){
- var info = {};
- var str = '"metadata":{';
- var q = this.camera.quaternion.clone();
- switch (this.mode) {
- case "panorama":
- info.scan_id = this.currentPano.id;
- str += ('"scan_id":"'+this.currentPano.id+'",');
- break;
- case "floorplan":
- info.camera_mode = 1;
- q = (new B.Quaternion).setFromAxisAngle(new B.Vector3(0,1,0), B.Math.degToRad(90))
- q.multiply(this.camera.quaternion);
- str += ('"camera_mode":1,');
- //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
- str += ('"ortho_zoom":'+ U.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
- break;
- case "dollhouse":
- info.camera_mode = 2;
- str += ('"camera_mode":2,');
- break;
-
- }
-
- info.camera_position = U.toPrecision(this.camera.position.toArray(),4);
-
- //console.log(info.camera_position)
-
- info.camera_quaternion = U.toPrecision(q.toArray(),4);
-
- /* if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的 fyz 对相机截屏的角度进行校对
- var out = new B.Quaternion(q.x, q.y, q.z, q.w)
- out.multiply(new B.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
- out.x *= -1;
- out.w *= -1;
- info.camera_quaternion = U.toPrecision(out.toArray(),4);
- }else{
- info.camera_quaternion = U.toPrecision(q.toArray(),4);;
- } */
- info.zoom = this.zoomLevel;
- //console.log(info.camera_quaternion)
- // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
- // fyz 扩展编辑页面, 加上导览点缩放值
- str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
- console.log(str)
-
- return str;
- }
-
-
-
- //------end
-
-
-
-
- t.prototype.closePopup = function() {
- if (g_currentHot) {
- g_currentHot = null,
- document.getElementById("popup").style.display = "none",
- document.querySelector(".popup-content").removeChild(document.getElementById("id1")),
- $("#popup iframe:last").remove();
- document.getElementById("bgaudio");
-
- if(g_bgAudio && g_bgAudio.pauseByHot){
- manage.switchBgmState(true)
- }
-
-
- return false
-
- }
- }
- ,
- t.prototype.setupCustomProperties = function(e) {
- var i = e || V.PANORAMA;
- Object.defineProperty(this, "mode", {
- get: function() {
- return i
- },
- set: function(e) {
- var t = i;
- i = e,
- this.onModeUpdated(t, i)
- }
- })
- }
- ,
- t.prototype.isInMode = function() {
- for (var e = 0; e < arguments.length; e++)
- if (this.mode === arguments[e])
- return !0;
- return !1
- }
- ,
- t.prototype.isOutsideMode = function(e) {
- return (e = e || this.mode) === V.DOLLHOUSE || e === V.FLOORPLAN
- }
- ,
- t.prototype.is360View = function(e, t) {
- return e === V.PANORAMA && t && !t.isAligned()
- }
- ,
- t.prototype.setScene = function(e) {
- this.sceneIntersectionPlane = e.plane,
- this.path.setScene(e),
- this.moveReticuleToScene(e)
- }
- ,
- t.prototype.moveReticuleToScene = function(e) {
- this.reticule.parent && this.reticule.parent.remove(this.reticule),
- e.add(this.reticule)
- }
- ,
- t.prototype.updateModel = function() {
- function n(e) {
- var t = this.cameraControls.cameras[V.DOLLHOUSE]
- , i = this.cameraControls.controls[V.DOLLHOUSE]
- , n = t.position.y + (e - i.target.y)
- , r = k.showFloorDuration + k.showFloorDelay;
- G.start(H.property(i.target, "y", e), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor),
- G.start(H.property(t.position, "y", n), r, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToViewFloor)
- }
- this.model = this.modelManager.getActiveModel(),
- this.model.on("floor.changed", function(e, t, i) {
- this.mode === V.DOLLHOUSE && e !== i && n.call(this, e.center.y)
- }
- .bind(this)),
- this.model.on("allfloors.toggled", function(e, t) {
- if (this.mode === V.DOLLHOUSE) {
- var i = e ? this.model.center.y : i = t.center.y;
- n.call(this, i)
- }
- }
- .bind(this)),
- this.on(W.PanoChosen, this.model.setProjectedPanos.bind(this.model));
- var t = this;
- this.model.panos.list.forEach(function(e) {
- e.vrMarker.addEventListener("click", function() {
- t.flyToPano({
- pano: e
- })
- })
- })
- }
- ,
- t.prototype.updateModelDependentData = function() {
- this.cameraControls.setModelForControls(this.model),
- this.getPanoMarkersFromModel(this.model)
- }
- ,
- t.prototype.onModelChanged = function() {
- this.updateModel(),
- this.updateModelDependentData()
- }
- ,
- t.prototype.getPanoMarkersFromModel = function(e) {
- this.panoMarkers = e.panos.list.reduce(function(e, t) {
- return t.marker ? e.concat(t.marker) : e
- }, [])
- }
- ,
- t.prototype.handleControlMove = function(e) {
- this.emit(W.Move, e)
- }
- ,
- t.prototype.handleControlInputStart = function(e) {
- this.emit(W.InputStart, e)
- }
- ,
- t.prototype.onModeUpdated = function(e, t) {
- this.cameraControls.activateControls(t),
- this.emit(W.ModeChanged, e, t)
- }
- ,
- t.prototype.isWarping = function() {
- return this.path.warping
- }
- ,
- t.prototype.isWaitingToWarp = function() {
- return this.path.waitingToWarp
- }
- ,
- t.prototype.getLabelScaleFactor = function() {
- if (this.isOutsideMode()) {
- return Math.sqrt(this.cameraControls.controls[V.FLOORPLAN].currentScale / 10)
- }
- return .5
- }
- ,
- t.prototype.changeMusic = function() {
- if(!this.director.tourIsPlaying) this.director.bgmReplay()
- }
- ,
- t.prototype.bindEvents = function(e) {
- e !== document && e.setAttribute("tabindex", -1),
- e.addEventListener("mousedown", this.onMouseDown.bind(this)),
- e.addEventListener("mousemove", this.onMouseMove.bind(this)),
- e.addEventListener("mouseover", this.onMouseOver.bind(this)),
- e.addEventListener("mouseout", this.onMouseOut.bind(this)),
- e.addEventListener("mouseup", this.onMouseUp.bind(this)),
- this.modelManager.on(d.ActiveModelChanged, this.onModelChanged.bind(this)),
- e.addEventListener("touchstart", this.onTouchStart.bind(this)),
- e.addEventListener("touchmove", this.onTouchMove.bind(this)),
- e.addEventListener("touchend", this.onTouchEnd.bind(this)),
- e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
- e.addEventListener("pointermove", this.onPointerMove.bind(this)),
- e.addEventListener("pointerup", this.onPointerUp.bind(this)),
-
- document.addEventListener("pointerup", ()=>{//add
- window.transformControls && transformControls.onPointerUp()
- }),
-
-
- e.addEventListener("pointerout", this.onPointerOut.bind(this)),
- e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
- document.addEventListener("keydown", this.onKeyDown.bind(this)),
- this.cameraControls.on(u.Move, this.handleControlMove.bind(this)),
- this.cameraControls.on(u.InputStart, this.handleControlInputStart.bind(this)),
- this.cameraControls.on(u.Pinch, this.handleControlPinch.bind(this)),
- this.cameraControls.on(u.Scroll, this.handleControlScroll.bind(this)),
- window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),
- window.addEventListener("tourAudioEnded", this.changeMusic.bind(this)),
- window.getSeft && getSeft(this),
- /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? $("#closepop").on("touchstart", this.closePopup.bind(this)) : $("#closepop").on("click", this.closePopup.bind(this))
- }
- ,
- t.prototype.onMouseDown = function(e) {
- e.currentTarget !== document && e.currentTarget.focus(),
- 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
- this.updateIntersect())
- }
- ,
- t.prototype.onMouseMove = function(e) {
- this.isTouchEvent = !1,
- this.handleInputMove.call(this, e.clientX, e.clientY, !1)
- }
- ,
- t.prototype.onMouseOver = function(e) {
- this.containsMouse = !0,
- !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
- }
- ,
- t.prototype.onMouseOut = function(e) {
- this.containsMouse = !1
- }
- ,
- t.prototype.onMouseUp = function(e) {
- this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
- }
- ,
- t.prototype.onTouchStart = function(e) {
- if (e.currentTarget !== document && e.currentTarget.focus(),
- !this.mouseDown) {
- this.couldBeLongTap = !0;
- var t = x.average(e.changedTouches, "clientX")
- , i = x.average(e.changedTouches, "clientY");
- this.handleInputStart.call(this, t, i, !0),
- this.mouseDownTimer = setTimeout(function() {
- this.updateIntersect(),
- this.handleInputEnd.call(this, t, i, !0)
- }
- .bind(this), k.input.longTapThreshold)
- }
- }
- ,
- t.prototype.onTouchMove = function(e) {
- var t = x.average(e.changedTouches, "clientX")
- , i = x.average(e.changedTouches, "clientY");
- this.handleInputMove.call(this, t, i, !0)
- }
- ,
- t.prototype.onTouchEnd = function(e) {
- if (clearTimeout(this.mouseDownTimer),
- this.mouseDown) {
- this.couldBeLongTap = !1,
- this.updateIntersect();
- var t = x.average(e.changedTouches, "clientX")
- , i = x.average(e.changedTouches, "clientY");
- this.handleInputEnd.call(this, t, i, !0)
- }
- }
- ,
- t.prototype.onPointerDown = function(e) {
- return e.currentTarget !== document && e.currentTarget.focus(),
- this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
- this.handleInputStart.call(this, e.clientX, e.clientY, !0),
- void (this.mouseDownTimer = setTimeout(function() {
- this.updateIntersect(),
- this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
- }
- .bind(this), k.input.longTapThreshold)))
- }
- ,
- t.prototype.onPointerMove = function(e) {
- "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
- }
- ,
- t.prototype.onPointerUp = function(e) {
- return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
- this.couldBeLongTap = !1,
- this.updateIntersect(),
- void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
- }
- ,
- t.prototype.onPointerOut = function(e) {
- this.mouseDown = !1
- }
- ,
- t.prototype.onPointerCancel = function(e) {
- this.mouseDown = !1
- }
- ,
- t.prototype.onKeyDown = function(e) {
- var t = function() {
- this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, "key")
- }
- .bind(this)
- , i = e.which;
- switch (i) {
- case l.F:
- t(),
- this.changeFloor(-1);
- break;
- case l.R:
- t(),
- this.changeFloor(1)
- }
- if (this.mode === V.PANORAMA)
- switch (i) {
- case l.UPARROW:
- case l.W:
- this.flyLocalDirection(T.FORWARD.clone());
- break;
- case l.DOWNARROW:
- case l.S:
- this.flyLocalDirection(T.BACK.clone());
- break;
- case l.A:
- this.flyLocalDirection(T.LEFT.clone());
- break;
- case l.D:
- this.flyLocalDirection(T.RIGHT.clone())
- }
- }
- ,
- t.prototype.handleScrollPinchZoom = function(e) {
- var t = e
- , i = this.zoomLevel;
- this.zoomBy(t),
- this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
- }
- ,
- t.prototype.handleControlPinch = function(e) {
- k.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new B.Vector3(0,0,e).normalize())
- }
- ,
- t.prototype.handleControlScroll = function(e) {
- k.zoom.enabled ? (0 < e ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
- 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new B.Vector3(0,0,-e).normalize())
- }
- ,
- t.prototype.handleInputStart = function(e, t, i) {
- var n = this.handelPadding(e, t);
- e = n.x,
- t = n.y,
- this.isTouchEvent = i,
- U.convertScreenPositionToNDC(e, t, this.mouse),
- U.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
- this.mouseCouldBeClickToMove = !0,
- this.mouseDown = !0,
- this.mouseCouldBeClickToMove && window.Hotpoint && (new Hotpoint).state(this, C)
- window.transformControls && transformControls.onPointerDown()
-
-
-
- if(!this.overlayInitedPlay && this.overlayGroup.children.length){
- try{
- this.overlayGroup.children.forEach((overlay)=>{
- overlay.overlayType == "video" && overlay.plane.material.map.image.play()
- })
- }catch(e){}
-
- this.overlayInitedPlay = true
- }
-
-
- }
- ,
- t.prototype.handelPadding = function(e, t) {
- return this.pad || (this.pad = {
- x: dom.getOffset("left", $("#player")[0]),
- y: dom.getOffset("top", $("#player")[0])
- }),
- {
- x: e - this.pad.x,
- y: t - this.pad.y
- }
- }
- ,
- t.prototype.handleInputMove = function(e, t, i) {
- var n = this.handelPadding(e, t);
- e = n.x,
- t = n.y,
- this.isTouchEvent = i,
- U.convertScreenPositionToNDC(e, t, this.mouse);
-
- var moveToleranceNDC = (window.transformControls && transformControls.visible) ? 0.0000001 : k.input.moveToleranceNDC
-
- this.mouseAtMouseDown.distanceTo(this.mouse) > moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
- this.couldBeLongTap = !1,
- clearTimeout(this.mouseDownTimer)),
- this.mouseLastMoveTime = Date.now(),
- this.reticule.move(e, t, i)
-
- window.transformControls && transformControls.onPointerMove()
-
-
- }
- ,
- t.prototype.handleInputEnd = function(e, t, i) {
- if (this.isTouchEvent = i,
- this.mouseDown = !1,
- this.cameraControls.controls[V.PANORAMA].emit("interaction.direct"),
- !i && this.couldBeLongTap)
- return !0;
- if (this.handleLongTap())
- return !0;
-
- window.transformControls && transformControls.onPointerUp()
-
- if (this.mouseCouldBeClickToMove) {
- if (this.flying)
- return this.path.activeTransType === R.WALK && this.emit(W.WarpInterruptedWithFlyTo, this.path.activeTransType),
- !0;
-
- //add----
- if (this.checkHotClick())
- return !0;
-
- if (window.VisiSet && VisiSet.setPanoVisible) {//正在设置漫游可行
- this.intersect && this.intersect.object.visible && VisiSet.dealPanoVisible(this.intersect.object.name);
- return;
- }
- if (window.VisiSet && VisiSet.setTagVisible ) {
- VisiSet.tagVsetting && this.intersect && this.intersect.object.visible && VisiSet.dealTagVisible(VisiSet.tagVsetting, this.intersect.object.name);
- return;
- }
-
- if(this.hoveringPlane){
- this.clickOverlay(this.hoveringPlane)
- return;
- }
-
- if(window.EditOverlay && EditOverlay.objCursorType == "overlay"){
- return EditOverlay.addPlane({intersect:this.intersect});
- }
- /* if(objects.mainDesign && objects.mainDesign.editing && objects.mainDesign.handleClickEnd(this)){//许钟文加
- if(objects.mainDesign.editType == "wallDesign" && this.mode == "panorama") return !0;
- else if(objects.mainDesign.editType == "addOverlay")return !0;
- } */
- //----------
-
- if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.Move, this.isTouchEvent ? "touch" : "mouse"),
- this.history.invalidate(),
- this.intersect)
- return this.flyToPanoClosestToMouse();
- if (this.mode === V.PANORAMA) {
- var n = this.closestPanoInDirection(this.getMouseDirection());
- return n ? this.flyToPano({
- pano: n
- }) : this.bump(this.getMouseDirection())
- }
- }
- this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
- }
- ,
- t.prototype.handleLongTap = function() {
- if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== V.PANORAMA))
- return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(u.LongTap, "touch"),
- !0
- }
- ,
- t.prototype.checktagClick = function() {
- if (this.tagManager.intersectTag) {
- var e = this.isTouchEvent
- , t = this.tagManager.clickedOnTag(e, this);
- return e || t || G.cancelById(q.LookTransition),
- !0
- }
- if (this.tagManager.activeTag)
- return this.tagManager.dismissActiveTag(),
- !1
- }
- ,
- t.prototype.rankedtagInDirection = function(e, t) {
- return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
- }
- ,
-
-
-
- t.prototype.start = function(e) {
- $(".toolLeft").removeClass("unable");
- $(".toolTop").removeClass("unable");
- //-------------------
-
-
-
- window.initTransformCtl(B)
- window.initOverlay(B)
- this.model.loadOverlays()
- window.EditOverlay && window.EditOverlay.init(B);
- window.VisiSet && VisiSet.init()
-
- //-------------------
- var t = e.mode
- , i = e.pano
- , n = e.position
- , r = e.quaternion
- , o = e.tag
- , a = e.quickstart
- , s = $.Deferred();
- this.updateModelDependentData(),
- this.updateFromControls(),
- this.findDefaultViews();
- var l = this.is360View(t, i);
- return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
- s.done(function(e) {
- this.emit(W.Ready, l, e, o)
-
- }
- .bind(this)),
- s.promise()
- }
- ,
- t.prototype.startOutside = function(e, t) {
- var i = e.mode
- , n = e.pano
- , r = e.position
- , o = e.quaternion
- , a = e.zoom
- , s = e.floorVisibility
- , l = e.tag;
- this.emit(W.StartOutside, k[i].transitionTime),
- this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
- G.cancelById(q.FlyToViewFloor),
- i === V.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
- t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
- }
- ,
- t.prototype.startInside = function(e, t, i, n, r) {
- r = r || $.Deferred();
- var o = (this.currentPano = e) && !e.isAligned();
- if (t = o ? e.position : t || e.position,
- i = i || e.quaternion,
- e) {
- var a = this.startInside.bind(this, e, t, i, n, r);
- if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
- return
- }
-
- //add
- this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
-
-
- return this.mode = V.PANORAMA,
- e.floor.enter(this.mode),
- this.emit(W.PanoChosen, this.currentPano, this.currentPano),
- this.switchCameraMode(this.mode, i),
- this.emit(W.StartInside, o),
- r.resolve(!0),
- r
- }
- ,
- t.prototype.startInsideWithFlyin = function(i, e, n, t, r) {
- if (r = r || $.Deferred(),
- this.dollhouseMode(),
- !i)
- return Y.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
- r.resolve(!1),
- r;
- e = e || i.position;
- var o = n || this.cameraControls.activeControl.camera.quaternion
- , a = i.position;
- return this.fitDollhouse(a, e, o),
- setTimeout(function(e) {
- this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = e);
- var t = {
- mode: V.PANORAMA,
- pano: i,
- quaternion: n,
- callback: function() {
- this.emit(W.FlyinFinished),
- r.resolve(!0)
- }
- .bind(this)
- };
- this.flyToNewMode(t)
- }
- .bind(this, this.cameraControls.activeControl.maxDistance), k.startupFlyinDelay),
- r
- }
- ,
- t.prototype.checkAndWaitForPanoLoad = (Z = {},
- K = {},
- function(t, e, i, n, r, o, a, s, l, c) {
- if (function() {
- for (var e in Z)
- if (Z.hasOwnProperty(e) && Z[e] && performance.now() - K[e] < 5e3)
- return !0;
- return !1
- }())
- return !0;
- var h = function(e, t, i) {
- j.delayOneFrame(function() {
- Z[e] = !1,
- r && r(t, i)
- }
- .bind(this))
- }
- .bind(this, t.id)
- , u = function(e, t) {
- j.delayOneFrame(function() {
- Z[e] = !1,
- o && o(t)
- }
- .bind(this))
- }
- .bind(this, t.id);
- try {
- return null != s || (s = !0),
- 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),
- Z[t.id] && (K[t.id] = performance.now()),
- Z[t.id]
- } catch (e) {
- throw Z[t.id] = !1,
- K[t.id] = performance.now() - 5e3,
- e
- }
- }
- ),
- t.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
- if (!e)
- throw new p("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
- return r && this.model.waitForLoad(e, function() {
- return e.isLoaded(i)
- }),
- !e.isLoaded(t) && (e.loadCube(t).done(n),
- !0)
- }
- ,
- t.prototype.checkAndWaitForTiledPanoLoad = (X = new B.Vector3,
- function(e, t, i, n, r, o, a, s) {
- if (!e)
- throw new p("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
- return X.copy(T.FORWARD),
- this.getDirection(X),
- !e.isLoaded(t) && (o && this.model.waitForLoad(e, function() {
- return e.isLoaded(t)
- }),
- e.loadTiledPano(t, X, null, a, s).done(function(e, t) {
- i && i(e, t)
- }
- .bind(this)).fail(function(e) {
- n && n(e)
- }
- .bind(this)).progress(function(e, t, i) {
- r && r(e, t, i)
- }
- .bind(this)),
- !0)
- }
- ),
- t.prototype.switchCameraMode = function(e, t) {
- var i = this.cameraControls.controls[e]
- , n = i.camera;
- switch (e) {
- case V.PANORAMA:
- n.position.copy(this.currentPano.position);
- var r = t ? T.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
- i.lookAt(r.add(n.position));
- break;
- case V.DOLLHOUSE:
- /* var o = this.position.clone();
- 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),
- n.position.copy(o),
- i.target.copy(this.target.clone().setY(this.model.center.y));
- break; */
- //for多楼层 且 让模型刚好适应屏幕
-
- var box = this.model.boundingBox.clone();
- box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
- var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
-
- var fov = A.getHFOVFromVFOV(k.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
- var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
-
- console.log(boxSize.x,distance, boxSize.length() / 2)
-
- distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
-
- if(this.mode === V.PANORAMA){
- i.target.copy(this.model.center);
- var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
- }else{
- i.target.copy(this.target.clone().setY(this.model.center.y))
- var vec = T.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
- }
-
- vec.multiplyScalar(distance )
- n.position.copy(i.target.clone().add(vec))
- break
- case V.FLOORPLAN:
- n.position.copy(this.model.center).setY(k.floorplan.cameraHeight),
- i.target.copy(this.model.center).setY(0),
- i.zoomToContain(this.model.size),
- i.rotateToView(this.model.size, this.getDirection())
- }
- i.update(0)
- }
- ,
- t.prototype.update = (new B.Vector3,
- N = {},
- F = [],
- function(e) {
- this.updatePersistentZooming(e),
- this.updateFromControls(e),
- this.getCurrentNodePanos(F)
- if(this.hasChanged(N)){
- this.lastChangeTime = Date.now(),
- !this.mouseDown && this.containsMouse && this.updateIntersect()
- this.emit(W.ViewChanged)
- //add:
- if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)) VisiSet.updateFootIconSize();
- this.intersectHot && this.intersectHot.showTitle()
- for(var i in this.model.hots){
- this.model.hots[i].update(this.camera)
- }
-
- }
- this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
- this.model.supportsTiles && (this.updateTileDownloader(F),
- this.updatePanoRenderer(F)),
- this.updatePreRendering(F),
- this.reticule.update(),
- this.path.update(),
- this.spider.update(),
- this.cachedPanoCandidates && k.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
- this.updateControlLocks(),
- this.model.supportsTiles && this.updateZoomPano()
- }
- ),
- t.prototype.updatePersistentZooming = function(e) {
- 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : -1 === this.zooming && this.zoomBy(1 - this.zoomSpeed * e)
- }
- ,
- t.prototype.updateControlLocks = function() {
- this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[V.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
- }
- ,
- t.prototype.updatePanoRenderer = (D = new B.Vector3,
- function(e) {
- var t = this.nextPano || this.currentPano;
- this.panoRenderer.hasQueuedTiles() && t && (D.copy(T.FORWARD),
- this.getDirection(D),
- this.panoRenderer.updateDirection(D))
- }
- ),
- t.prototype.cleanupInactivePanos = (O = [],
- L = [],
- function() {
- O.length = 0,
- O.push(this.currentPano),
- this.nextPano && O.push(this.nextPano);
- for (var e = L.length = 0; e < this.panoRenderer.activePanos.length; e++)
- L.push(this.panoRenderer.activePanos[e]);
- for (var t = 0; t < L.length; t++) {
- for (var i = L[t], n = !0, r = 0; r < O.length; r++)
- i.id === O[r].id && (n = !1);
- n && i.exit()
- }
- }
- ),
- t.prototype.updatePreRendering = (w = {},
- function(e) {
- if (1 === k.tiling.preRenderTourPanos && this.preRenderingEnabled) {
- var t = this.nextPano || this.currentPano;
- if (t && e && 1 < e.length) {
- var i = e.findIndex(function(e) {
- if (e.id === t.id)
- return !0
- });
- if (0 <= i && i + 1 < e.length) {
- var n = e[i + 1];
- n.isLoaded(this.basePanoSize) || w[n.id] || (window.setTimeout(function(e) {
- this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
- window.setTimeout(function(e) {
- w[e.id] = !1
- }
- .bind(this, e), k.tiling.panoPreRenderRepeatDelay)
- }
- .bind(this, n), k.tiling.panoPreRenderDelay),
- w[n.id] = !0)
- }
- }
- }
- }
- ),
- t.prototype.enablePreRendering = function() {
- this.preRenderingEnabled = !0
- }
- ,
- t.prototype.disablePreRendering = function() {
- this.preRenderingEnabled = !1,
- this.cleanupInactivePanos()
- }
- ,
- t.prototype.updateTileDownloader = (b = new B.Vector3,
- function(e) {
- var t = this.nextPano || this.currentPano;
- t && (b.copy(T.FORWARD),
- this.getDirection(b),
- this.tileDownloader.tilePrioritizer.updateCriteria(t, this.position, b, 0 < e.length ? e : null),
- this.tileDownloader.processPriorityQueue = !0)
- }
- ),
- t.prototype.updateFromControls = function(e) {
- null != e || (e = 0),
- this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
- this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
- this.position.copy(this.cameraControls.activeControl.camera.position),
- this.target.copy(this.cameraControls.activeControl.target),
- this.cameraControls.activeControl.camera.updateProjectionMatrix(),
- this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
- this.camera.position.copy(this.position),
- this.camera.quaternion.copy(this.quaternion),
- this.camera.updateMatrix(),
- this.camera.updateMatrixWorld()
- }
- ,
- t.prototype.hasChanged = function(e) {
- if (!this.previousState)
- return this.previousState = {
- allFloorsVisible: this.model.allFloorsVisible,
- position: this.position.clone(),
- quaternion: this.quaternion.clone(),
- mouse: this.mouse.clone(),
- labelScaleFactor: this.getLabelScaleFactor(),
- currentFloor: this.model.currentFloor,
- projectionMatrix: this.camera.projectionMatrix.clone(),
- worldMatrix: this.camera.matrixWorld.clone(),
- mode: this.mode,
- modelPosition: this.model.position.clone(),
- modelCenter: this.model.center.clone(),
- zoomLevel: this.zoomLevel
- },
- !0;
- 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;
- return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
- e.moved = !this.position.equals(this.previousState.position),
- e.rotated = !this.quaternion.equals(this.previousState.quaternion),
- e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
- e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
- e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
- e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
- e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
- e.modeChanged = this.mode !== this.previousState.mode,
- e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
- e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
- e.nextPanoActive = null !== this.nextPano,
- e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
- this.previousState.allFloorsVisible = this.model.allFloorsVisible,
- this.previousState.position.copy(this.position),
- this.previousState.quaternion.copy(this.quaternion),
- this.previousState.mouse.copy(this.mouse),
- this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
- this.previousState.currentFloor = this.model.currentFloor,
- this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
- this.previousState.worldMatrix.copy(this.camera.matrixWorld),
- this.previousState.mode = this.mode,
- this.previousState.modelPosition.copy(this.model.position),
- this.previousState.modelCenter.copy(this.model.center),
- this.previousState.zoomLevel = this.zoomLevel,
- !t
- }
- ,
- t.prototype.updateIntersect = function() {
- var e = this.flying || this.isWarping()
- , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
- , i = G.getById(q.LookTransition);
- e || t || this.isTouchEvent || i.length && i[0].running;
-
-
- if (window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)) {
- this.intersect = this.getMouseIntersect(null, VisiSet.footIcons);
- if (this.intersect && this.intersect.object.visible )
- $("#player").css("cursor", "pointer");
- else
- $("#player").css("cursor", "")
- return;
- }
-
-
-
-
- this.intersect = this.getMouseIntersect(),
- this.intersect && this.updateClosestPano(this.intersect),
- this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
- k.navigation.panoScores && !k.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
- }
- ,
- t.prototype.checkHotClick = function() {
- if (this.intersectHot){
- if (window.VisiSet && VisiSet.setTagVisible ) {
- VisiSet.SetOneTagVisible(this.intersectHot); //设置这个热点的可见性
- return;
- }
- this.intersectHot.noAction || this.intersectHot.examine(this)
- return !0
-
- }
- }
- ,
- t.prototype.getMouseDirection = function(e) {
- e = e || this.mouse;
- var t = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
- return new B.Vector3(e.x,e.y,1).unproject(this.camera).sub(t).normalize()
- }
- ,
-
- t.prototype.hoverOverlay = function(mesh){
- if(!mesh){
- this.hoveringPlane = null;
- $("#player").css("cursor",this.currentCursor || "" );
- }else{
- var overlay = mesh.parent;
- $("#player").css("cursor","pointer");
- this.hoveringPlane = overlay;
- return true;
- }
-
- },
-
-
- t.prototype.clickOverlay = function(overlay){
- if(this.openOverlay && !overlay)return;
- var plane = overlay.plane;
-
- if(overlay.overlayType == "video"){
- if(plane.material.map.image.paused)plane.material.map.image.play()
- else plane.material.map.image.pause();
- }
-
- if(window.EditOverlay &&EditOverlay.editing){
- if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
-
- $('#overlayProp').removeClass('atRight').removeClass('hide')
- EditOverlay.endAddPlane();
- EditOverlay.updateOverlayPanel(overlay)
- transformControls.attach(overlay)
- return;
- }
-
- },
-
- t.prototype.getMouseIntersect = function(e, t) {
- e = e || this.mouse.clone(),
- t = t || this.model.floors.reduce(function(e, t) {
- return t.hidden ? e : e.concat(t.collider.children)
- }, this.mode === V.PANORAMA ? this.panoMarkers : []),
- t = t.slice(0)
- for (var i in this.model.hots) t.push(this.model.hots[i].mesh);
-
- this.overlayGroup && (t = t.concat(this.overlayGroup.children));
-
- i = new B.Vector3(e.x,e.y,-1).unproject(this.camera);
- this.raycaster.set(i, this.getMouseDirection(e));
- var n = this.raycaster.intersectObjects(t, true);//add true
- if ("add" == g_HotStatus) {
- var r = this.raycaster.intersectObjects(window.player.model.chunks);
- //console.log(r[0]),
- 1 <= r.length ? ($("#player").css("cursor", "cell"),
- window.hotIntersect = r[0]) : ($("#player").css("cursor", "not-allowed"),
- window.hotIntersect = !1)
- return;
- }
- this.intersectHot && this.intersectHot.hideTitle()
- if (0 === n.length)
- return this.intersectHot = null,
- "add" != g_HotStatus && $("#player").css("cursor", ""),
- null;
-
- var o = n[0];
- if ("hotSprite" == o.object.type){
- this.intersectHot = o.object.belongHot
- this.intersectHot.showTitle()
- $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
- this.intersectHot.noAction || $("#player").css("cursor", "pointer");
- return;
- }
- $(".toolRight .spotList ul li").removeClass("active")
- this.intersectHot = null;
-
- /* if(window.EditOverlay && n && n.length){
- if(n[0].object.parent.parent == this.overlayGroup){
- this.hoverOverlay(n[0].object);
- }else()
- } */
-
- var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
-
-
- intersect || "add" != g_HotStatus && $("#player").css("cursor", this.currentCursor),
-
-
-
- o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
- this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
- this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
- o.horizontal = .8 < o.normal.y);
- return o
- }
- ,
- t.prototype.updateClosestPano = function(e) {
- var t = [a.filters.isPanoAligned()];
- if (this.mode === V.PANORAMA) {
- if (!this.currentPano)
- return;
- t.push(a.filters.not(this.currentPano)),
- t.push(a.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
- t.push(a.filters.isNeighbourPanoTo(this.currentPano)),
- t.push(a.filters.isCloseEnoughTo(e.point, k.panoFloorClickRadius)),
- t.push(a.filters.isNotBehindNormal(e.point, e.normal))
- } else{
- t.push((pano)=>{ // add
- return this.checkHasNeighbor(pano)
- })
- t.push(a.filters.isOnVisibleFloor()),
- this.mode !== V.FLOORPLAN && t.push(a.filters.inDirection(this.position, this.getDirection(), .25));
- }
- var i = this.model.panos.find(t, [a.sortFunctions.floorDistanceToPoint(e.point)]);
- i !== this.closestPano ? (i && (this.isPanoHover = !0),
- this.emit(W.ClosestPanoChanging, this.closestPano, i, this.mode),
- this.closestPano = i) : this.isPanoHover = !1
- }
- ,
- t.prototype.dollhouseMode = function(e, t) {
- this.emit(W.ModeChanging, this.mode, V.DOLLHOUSE),
- this.mode = V.DOLLHOUSE,
- this.cameraControls.controls[V.DOLLHOUSE].reset();
- var i = new B.Vector3(this.model.center.x,0,this.model.center.z)
- , n = new B.Vector3(15,10,15);
- if (e && t) {
- var r = T.FORWARD.clone().applyQuaternion(t)
- , o = this.model.center.clone().sub(e).dot(r);
- 0 < o ? (i = r.clone().multiplyScalar(o).add(e),
- n.copy(e)) : Y.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
- }
- this.cameraControls.controls[V.DOLLHOUSE].resetRanges(0, !0),
- this.cameraControls.controls[V.DOLLHOUSE].target.copy(i),
- this.cameraControls.cameras[V.DOLLHOUSE].position.copy(n),
- this.updateFromControls(),
- this.model.alpha = 1,
- this.model.skybox.material.uniforms.opacity.value = 0
- }
- ,
- t.prototype.insideMode = function(e, t) {
- var i = $.Deferred()
- , n = t || null;
- if (this.mode !== V.PANORAMA && this.mode !== V.TRANSITIONING) {
- var r = [a.filters.isPanoAligned()];
- this.model.currentFloor && r.push(a.filters.atFloor(this.model.currentFloor)),
- e = e || this.currentPano || this.model.panos.find(r, [a.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
- this.flyToNewMode({
- mode: V.PANORAMA,
- pano: e,
- callback: n
- }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
- } else {
- var o = this.mode === V.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
- i.reject(o)
- }
- return i.promise()
- }
- ,
- t.prototype.fitDollhouse = function(e, t, i) {
- var maxY = this.model.boundingBox.max.y;//add
- var n = T.FORWARD.clone().applyQuaternion(i);
- i = n.clone().add(e);
- this.cameraControls.activeControl.target.copy(i),
- this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
- }
- ,
- t.prototype.floorplanMode = function(e, t, i) {
- this.mode = V.FLOORPLAN;
- var n = this.cameraControls.controls[V.FLOORPLAN];
- n.reset();
- var r = e || this.model.center;
- if (n.target.copy(r).setY(0),
- n.camera.position.copy(r).setY(k.floorplan.cameraHeight),
- i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
- n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
- t) {
- var o = T.LEFT.clone().applyQuaternion(t);
- n.rotateLeft(-Math.atan2(o.x, o.z))
- } else
- n.rotateToView(this.model.size, this.getDirection());
- n.update(0)
- }
- ,
- t.prototype.nonInterruptingFlyToPano = function(e, t) {
- return e.skipWarpingCheck = !0,
- this.flyToPano(e, t)
- }
- ,
- t.prototype.updateMarkerVisi = function() {//加
- if(this.mode != "panorama")return;
- this.model.panos.list.forEach((pano)=>{
- if(!pano.marker)return;
- pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
- })
- }
- ,
- t.prototype.updateHotVisible = function(pano){
- var hots = this.model.hots;
- pano = pano || this.currentPano;
-
- for (var index in hots){
- var visible;
- if(this.mode != "panorama"){
- visible = true;
- }else{
- //hots[index].mesh.material.depthTest = false;
- visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
- }
- hots[index].mesh.visible = visible;
- }
- },
-
-
- t.prototype.flyToPano = function(e, t) {
- var i, n = e.pano, r = e.lookAtPoint, o = e.duration, a = e.aimDuration, s = e.maxDistanceOverride, l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null;
- if (window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(n),
- this.isWarping() && !l && (this.path.activeTransType === R.BLACK || this.path.activeTransType === R.STD))
- return Y.warn("Player.flyToPano() -> Cannot fly when warping"),
- t && t(),
- !1;
- if (this.updateLastView(),
- this.mode !== V.PANORAMA)
- return r && (i = (new B.Quaternion).setFromUnitVectors(T.FORWARD, r.sub(n.position).normalize())),
- void this.flyToNewMode({
- mode: V.PANORAMA,
- pano: n,
- duration: o,
- quaternion: i,
- callback: t
- });
- if (!n || (h = x.deepExtend(e),
- u = function() {
- j.delayOneFrame(function() {
- this.flyToPano(h, t)
- }
- .bind(this))
- }
- .bind(this),
- !this.checkAndWaitForPanoLoad(n, "high", "low", this.basePanoSize, u))) {
- var d = function(e) {
- t && t(e)
- }
- .bind(this);
- this.currentPano || (this.currentPano = n,
- this.path.placeCpm(),
- this.path.fadeOutCpm(k.path.fadeOutTime),
- this.spider.draw());
- var p = o;
- if ("number" != typeof o) {
- var f = s || k.transition.flytimeMaxDistanceThreshold;
- p = Math.min(this.currentPano.position.distanceTo(n.position), f) * k.transition.flytimeDistanceMultiplier + k.transition.flyTime
- }
- if (.01 < k.transition.flySpeed && (p = 1e3 * this.currentPano.position.distanceTo(n.position) / k.transition.flySpeed),
- 1 !== this.zoomLevel)
- switch (k.zoom.transitionStyle) {
- case 1:
- this.smoothZoomToDefault(p / 2);
- break;
- case 2:
- return h = x.deepExtend(e),
- u = this.flyToPano.bind(this, h, t),
- void this.smoothZoomToDefault(k.zoom.restoreTime * (this.zoomLevel - 1), u)
- }
- if (r) {
- G.cancelById(q.LookTransition),
- p *= k.transition.aimSlowFactor;
- var g = this.cameraControls.activeControl.camera.quaternion.clone()
- , m = (new B.Matrix4).lookAt(n.position, r, T.UP)
- , v = (new B.Quaternion).setFromRotationMatrix(m)
- , y = g.clone()
- , A = new B.Vector3;
- if (n === this.currentPano) {
- var C = T.FORWARD.clone().applyQuaternion(g)
- , I = T.FORWARD.clone().applyQuaternion(v)
- , E = C.angleTo(I);
- return null != a || (a = 1 * Math.sqrt(E) / k.tags.navigate.rotateSpeedFactor * 1e3),
- void G.start(function(e) {
- y.copy(g),
- H.quaternion(y, v)(e),
- A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
- this.cameraControls.activeControl.lookAt(A)
- }
- .bind(this), a, d, 0, z[k.transition.movementEasing], null, q.LookTransition)
- }
- }
- if (n === this.currentPano || this.flying)
- return void d();
- this.flying = !0;
- var _ = this.position.clone()
- , b = this.currentPano;
- Y.debug("Flying to pano ", n.position);
- this.emit(W.PanoChosen, this.currentPano, n);
- this.emit(W.FlyingStarted, n.position, _, n, b);
-
-
-
- this.updateHotVisible(n); //更新热点显示
- this.transitionPos({type:"beforeFlytopano", pano:n, dur:p})//add
-
-
-
-
- r && G.start(function(e) {
- y.copy(g),
- H.quaternion(y, v)(e),
- A.copy(T.FORWARD).applyQuaternion(y).add(this.cameraControls.activeControl.camera.position),
- this.cameraControls.activeControl.lookAt(A)
- }
- .bind(this), p, null, 0, z[k.transition.movementEasing], null, q.LookTransition);
-
- var w = c ? null : z[k.transition.movementEasing];
- this.nextPano = n;
-
-
- G.start(H.uniform(this.model.skybox, "progress", 1), p, null, 0, z[k.transition.blendEasing], "skyFly", q.FlyToPano),
- G.start(H.allUniforms(this.model.chunks, "progress", 1), p, null, 0, z[k.transition.blendEasing], "chunkFly", q.FlyToPano),
- G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, n.position), p, function(e) {
- this.flying = !1,
- this.currentPano !== n && this.currentPano.exit(),
- n.enter(),
- this.currentPano = n,
- this.nextPano = null,
- this.path.placeCpm(),
- this.path.fadeOutCpm(k.path.fadeOutTime),
- this.spider.draw(),
- this.emit(W.FlyingEnded, n.position, _, n, b),
- this.updateMarkerVisi();//add
- d(e)
-
- if(this.mode == "panorama" && EditOverlay.editing){
- EditOverlay.updatePano(this.currentPano)
- }
-
- }
- .bind(this), 0, w, "camFly", q.FlyToPano)
- }
- }
- ,
-
-
-
-
- window._transitionPosId = 9999
-
- t.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
-
- G.cancelById(_transitionPosId)
-
- var begin = function(object, pos, qua, scale){
- if(pos){
- if(!same(object.position, pos, 0.01)){
-
- G.start(H.vector(object.position, pos), o.dur, (e)=>{
-
- },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
- }
-
- if(!same(object.quaternion, qua, 1e-6)){
- G.start(H.quaternion(object.quaternion, qua), o.dur, (e)=>{
-
- },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
- }
-
-
- if(!same(object.scale, scale, 0.001)){
- G.start(H.vector(object.scale, scale), o.dur, (e)=>{
-
- },0, z[k.transition.movementEasing], "transitionPos", _transitionPosId)
- }
-
-
- }
- }
- var same = function(vec1, vec2, diff){
- var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
- if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
- return s
- }
- this.overlayGroup.children.forEach(overlay=>{
- var panoData = o.pano != void 0 && overlay.transformAtPanos[o.pano.id]
- var useCustom = o.type == "beforeFlyOut" || !panoData
- var pos = useCustom ? overlay.posCustom : panoData.pos;
- var qua = useCustom ? overlay.quaCustom : panoData.qua;
- var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
- overlay.getScaleBySize(panoData.width , panoData.height)
- scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
- begin(overlay, pos, qua, scale )
-
- })
-
- }
-
-
- t.prototype.fastForwardActivePanoFlight = function(e) {
- e = e || k.transition.fastForwardFactor / 10 * 4 + 1,
- G.adjustSpeed(q.FlyToPano, e),
- G.adjustSpeed(q.LookTransition, e)
- }
- ,
- t.prototype.flyToPanoClosestToMouse = function() {
- if (50 < Date.now() - this.mouseLastMoveTime && (this.intersect = this.getMouseIntersect(),
- this.intersect && this.updateClosestPano(this.intersect)),
- this.closestPano)
- return this.flyToPano({
- pano: this.closestPano
- });
- var e = this.getMouseDirection();
- this.flyDirection(e) || this.flyToPano({
- pano: this.currentPano
- })
- }
- ,
- t.prototype.flyLocalDirection = function(e) {
- var t = this.getDirection(e)
- , i = 1 === e.z ? .4 : .75
- , n = 1 === Math.abs(e.x);
- return this.flyDirection(t, i, n)
- }
- ,
- t.prototype.flyDirection = function(e, t, i) {
- this.closePopup();
- var n = $.Deferred();
- this.history.invalidate();
- var r = this.closestPanoInDirection(e, t, i);
- return r ? this.flyToPano({
- pano: r
- }, n.resolve.bind(n, !0)) : (this.bump(e),
- n.resolve(!1)),
- n.promise()
- }
- ,
- t.prototype.closestPanoInDirection = function(e, t, i) {
- return this.rankedPanoInDirection(0, e, t, i)
- }
- ,
- t.prototype.rankedPanoInDirection = (_ = {
- pano: null,
- candidates: []
- },
- function(e, t, i, n) {
- e = e || 0,
- i = void 0 !== i ? i : .75;
- var r = n ? "angle" : "direction";
- 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)], _),
- this.cachedPanoCandidates = _.candidates,
- _.pano
- }
- ),
- t.prototype.bump = function(e) {
- if (this.mode === V.PANORAMA && !this.flying && !this.isWarping()) {
- var t, i, n, r = k.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e);
- if (.5 < Math.abs(a))
- t = function() {
- G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 0 < a ? 1.04 : .96), o, i, 0, z.easeInOutSine, "bumpZStart")
- }
- .bind(this),
- i = function() {
- G.start(H.property(this.cameraControls.cameras[V.PANORAMA], "zoom", 1), 5 * o, n, 0, z.easeInOutSine, "bumpZRelax")
- }
- .bind(this);
- else {
- var s = this.camera.position.clone()
- , l = e.clone();
- this.raycaster.set(s, l);
- var c = this.model.floors.reduce(function(e, t) {
- return e.concat(t.collider.children)
- }, [])
- , h = this.raycaster.intersectObjects(c)
- , u = 0 < h.length ? h[0].distance / 25 : .04
- , d = s.clone().add(l.multiplyScalar(u));
- t = function() {
- G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, d), o, i, 0, z.easeInOutSine, "bumpTStart")
- }
- .bind(this),
- i = function() {
- G.start(H.vector(this.cameraControls.cameras[V.PANORAMA].position, s), 5 * o, n, 0, z.easeInOutSine, "bumpTRelax")
- }
- .bind(this)
- }
- n = function() {
- this.flying = !1
- }
- .bind(this),
- this.flying = !0,
- t()
- }
- }
- ,
- t.prototype.changeFloor = function(e) {
- if (!this.is360View(this.mode, this.currentPano))
- if (this.mode === V.PANORAMA) {
- var t = this.history.reversePano(e);
- t && t.isAligned() ? this.flyToPano({
- pano: t
- }) : this.changeFloorByScore(e)
- } else
- this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
- }
- ,
- t.prototype.changeFloorByScore = (E = {
- pano: null,
- candidates: []
- },
- function(e) {
- var t = this.model.nextFloor(e);
- 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),
- void (E.pano ? (this.cachedPanoCandidates = E.candidates,
- this.history.push(e, this.currentPano),
- this.flyToPano({
- pano: E.pano
- })) : Y.warn("No pano found on selected floor, not moving there."))) : void Y.debug("player.changeFloor(" + e + "): no such floor")
- }
- ),
- t.prototype.gotoFloor = function(e) {
- var t = e - this.model.currentFloor.floorIndex;
- this.changeFloor(t)
- }
- ,
- t.prototype.getDirection = function(e) {
- return (e = e || (new B.Vector3).copy(T.FORWARD)).applyQuaternion(this.camera.quaternion)
- }
- ,
- t.prototype.flyToSameMode = function(e, t, i, n, r) {
- if (r = r || $.Deferred(),
- this.mode === V.TRANSITIONING)
- return Y.warn("should not be transitioning here"),
- n && n(!1),
- r.reject().promise();
- var o = i || !1
- , a = i ? i.position : this.position
- , s = this.position.clone()
- , l = this.currentPano;
- if (Y.debug("New pose in mode " + this.mode),
- !e || (retryCallback = function() {
- j.delayOneFrame(function() {
- this.flyToSameMode(e, t, i, n, r)
- }
- .bind(this))
- }
- .bind(this),
- !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
- var c = function() {
- this.emit(W.FlyingEnded, a, s, e, l),
- n && n(!0)
- }
- .bind(this)
- , h = k[this.mode]
- , u = void 0 !== t ? t : h.transitionTime
- , d = new B.Vector3
- , p = new B.Vector3;
- if (this.emit(W.FlyingStarted, a, s, e, l),
- this.mode === V.PANORAMA)
- Y.warn("we should not be here for panorama views");
- else if (this.mode === V.DOLLHOUSE)
- if (o) {
- var f = new B.Vector3(0,1,0);
- this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
- this.model.warpDestFloors(i.floorVisibility),
- p.copy(i.position);
- var g = new B.Vector3(0,0,-1).applyQuaternion(i.quaternion)
- , m = new B.Raycaster(p.clone(),g.clone(),0,1 / 0).intersectObjects(this.model.colliders)
- , v = 3;
- m.length ? (d.copy(m[0].point),
- v = .75 * p.distanceTo(d)) : (d.copy(g).multiplyScalar(3).add(p),
- Y.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
- var y = (new B.Matrix4).lookAt(p, d, f)
- , A = (new B.Euler).setFromRotationMatrix(y, k.warp.eOrder)
- , C = d.distanceTo(p)
- , I = (new B.Matrix4).lookAt(this.cameraControls.cameras[V.DOLLHOUSE].position, this.cameraControls.controls[V.DOLLHOUSE].target, f)
- , E = (new B.Euler).setFromRotationMatrix(I, k.warp.eOrder)
- , _ = this.cameraControls.cameras[V.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[V.DOLLHOUSE].target);
- this.cameraControls.controls[V.DOLLHOUSE].resetRanges(Math.min(_, v), !0);
- var b = new B.Euler(A.x - E.x,A.y - E.y,A.z - E.z,k.warp.eOrder);
- b.y = b.y > Math.PI ? b.y -= 2 * Math.PI : b.y < -Math.PI ? b.y += 2 * Math.PI : b.y,
- this.path.burnsDir = Math.sign(b.y);
- var w = new B.Euler(0,0,0,k.warp.eOrder)
- , T = new B.Vector3;
- G.start(H.vector(this.cameraControls.controls[V.DOLLHOUSE].target, d), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
- G.start(function(e, t) {
- w.x = E.x + e * b.x,
- w.y = E.y + e * b.y,
- w.z = E.z + e * b.z;
- var i = _ + e * (C - _);
- T.set(0, 0, i).applyEuler(w).add(this.cameraControls.controls[V.DOLLHOUSE].target),
- this.cameraControls.cameras[V.DOLLHOUSE].position.copy(T).add(this.model.position)
- }
- .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode),
- G.start(function(e, t) {
- this.cameraControls.controls[V.DOLLHOUSE].update(),
- this.quaternion.copy(this.cameraControls.cameras[V.DOLLHOUSE].quaternion),
- this.position.copy(this.cameraControls.cameras[V.DOLLHOUSE].position)
- }
- .bind(this), u, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToSameMode)
- } else
- Y.warn("invalid warp destination in flyToSameMode()? ignore it then");
- else if (this.path.placeCpm(),
- this.path.fadeInCpm(k.path.fadeInTime),
- i) {
- this.model.warpDestFloors(i.floorVisibility);
- var x = this.cameraControls.cameras[V.FLOORPLAN]
- , S = this.cameraControls.controls[V.FLOORPLAN]
- , M = S.target.clone()
- , R = i.position.clone().sub(M)
- , P = x.position.clone().sub(S.target).length()
- , O = new B.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
- , L = Math.atan2(S.offset.x, S.offset.z)
- , D = Math.atan2(O.x, O.z)
- , N = S.absoluteScale
- , F = U.convertWorkshopOrthoZoom(i.orthoZoom);
- G.start(function(e, t) {
- S.target.copy(R).multiplyScalar(e).add(M);
- var i = L + (D - L) * e;
- S.offset.x = P * Math.sin(i),
- S.offset.z = P * Math.cos(i),
- x.position.copy(S.target).add(S.offset),
- S.absoluteScale = N + e * (F - N),
- S.update(),
- this.quaternion.copy(x.quaternion),
- this.position.copy(x.position),
- this.target.copy(S.target),
- this.camera.projectionMatrix.copy(x.projectionMatrix)
- }
- .bind(this), u, null, 0, z[k.flydown.movementEasing], null, q.FlyToSameMode)
- } else
- Y.info("flyToSameMode() funny floorplan view? skipping");
- return G.setTimeout(function(e) {
- this.mode = e,
- c(),
- r.resolve(!0)
- }
- .bind(this, this.mode), u, q.FlyToSameMode),
- this.mode = V.TRANSITIONING,
- r.promise()
- }
- }
- ,
- t.prototype.flyToNewMode = function(e, t) {
- var i = (e = e || {}).mode
- , n = e.pano
- , r = e.duration
- , o = e.warpDest
- , a = e.callback
- , s = e.force
- , l = e.quaternion;
- if (t = t || $.Deferred(),
- this.isWarping())
- return Y.warn("Player.flyToNewMode() -> Cannot fly when warping"),
- a && a(!1),
- t.reject("Cannot change mode during tour transition").promise();
- if (this.mode === V.TRANSITIONING)
- return a && a(!1),
- t.reject("Cannot change mode during mode transition").promise();
- if (i === this.mode)
- return s ? (this.flyToSameMode(n, r, o, a).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
- t.promise()) : (a && a(!1),
- t.reject("Already in " + i + " mode").promise());
- var c = o || !1;
- Y.debug("Switching mode to " + i);
- var h = function() {
- j.delayOneFrame(function() {
- this.flyToNewMode(e, t)
- }
- .bind(this))
- }
- .bind(this);
- if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, h))
- return t.promise();
- if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
- return Y.info("Waiting for model textures to be loaded before going out to dollhouse"),
- this.model.waitForLoad(this.model, function() {
- return this.model.meshTexturesLoaded
- }
- .bind(this)),
- this.model.loadMeshTextures().done(h),
- t.promise();
- this.history.invalidate(),
- this.updateLastView();
- var u = this.mode
- , d = this.cameraControls.cameras[i];
- e = x.deepExtend({}, k[i], k[u + "-" + i]);
- var p = void 0 !== r ? r : e.transitionTime;
- this.emit(W.ModeChanging, u, i, n),
- n && (this.currentPano = n),
- this.switchCameraMode(i, l),
- G.cancelById(q.LookTransition);
- var f = (new B.Vector3).copy(this.position);
-
-
-
- this.modeTran = this.mode + "-" + i;
- if(this.mode == "floorplan" && window.VisiSet && (VisiSet.setPanoVisible || VisiSet.setTagVisible)){
- VisiSet.finishSetPanoVisible()
- VisiSet.finishSetTagVisible()
- }
-
- if(editTool.atPanel == "screen"){
- if(this.mode == "panorama") $(".confirmSnap").addClass("unable")
- else if(i == "panorama") $(".confirmSnap").removeClass("unable")
- }
-
- if(i == "panorama"){
- this.transitionPos({type:"beforeFlyIn", pano:n, dur:p})//add
- }else{
- this.transitionPos({type:"beforeFlyOut", dur:p/2})//add
- }
-
-
-
- if (i === V.PANORAMA)
- this.emit(W.PanoChosen, n, n),
- setTimeout(function() {
- n.floor.enter(i)
- }
- .bind(this), p / 2),
- this.path.fadeOutCpm(k.path.fadeOutTime);
- else if (i === V.DOLLHOUSE) {
- if (c && (this.model.stayPut = !0),
- o ? (this.cameraControls.controls[V.DOLLHOUSE].resetRanges(1, !0),
- this.model.warpDestFloors(o.floorVisibility)) : this.model.toggleAllFloors(!0),
- this.path.placeCpm(),
- this.path.fadeInCpm(k.path.fadeInTime),
- c) {
- var g = new B.Vector3(this.model.center.x,0,this.model.center.z);
- f.set(15, 10, 15);
- var m = new B.Vector3(0,0,-1).applyQuaternion(o.quaternion)
- , v = new B.Raycaster(o.position.clone(),m.clone(),0,1 / 0).intersectObjects([this.sceneIntersectionPlane]);
- v.length ? (g.copy(v[0].point),
- f.copy(o.position),
- 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),
- this.cameraControls.controls[V.DOLLHOUSE].resetRanges(3, !0)),
- this.cameraControls.controls[V.DOLLHOUSE].target.copy(g),
- f.add(this.model.position),
- d.position.copy(f),
- this.cameraControls.controls[V.DOLLHOUSE].update()
- }
- } else if (this.path.placeCpm(),
- this.path.fadeInCpm(k.path.fadeInTime),
- o) {
- this.model.warpDestFloors(o.floorVisibility);
- var y = this.cameraControls.cameras[V.FLOORPLAN]
- , A = this.cameraControls.controls[V.FLOORPLAN]
- , C = y.position.clone().sub(A.target)
- , I = new B.Vector3(-1,0,0).applyQuaternion(o.quaternion).normalize()
- , E = Math.atan2(I.x, I.z);
- A.target.copy(o.position);
- var _ = C.length();
- A.offset.x = _ * Math.sin(E),
- A.offset.y = 0,
- A.offset.z = _ * Math.cos(E),
- y.position.copy(A.target).add(A.offset),
- A.target.clone().sub(d.position),
- d.quaternion.copy(o.quaternion),
- A.currentScale = U.convertWorkshopOrthoZoom(o.orthoZoom),
- A.absoluteScale = A.currentScale,
- A.update()
- } else
- this.model.currentFloor.enter(i);
- var b = this.currentPano
- , w = this.position.clone();
- return this.emit(W.FlyingStarted, f, w, n, this.currentPano),
- this.flying = !0,
- this.isOutsideMode(i) && this.is360View(u, b) ? (c || i !== V.DOLLHOUSE || (d.position.set(15, 10, 15),
- d.controls.target.set(this.model.center.x, 0, this.model.center.z),
- d.controls.update()),
- e.blackoutStyle = P.FADEIN,
- p = k.show360Views.transitionTime,
- this.fade360View(p, d, e)) : this.isOutsideMode(u) && this.is360View(i, n) ? (c && this.switchCameraMode(i, c.quaternion),
- this.mode = i,
- this.path && this.path.popOutCpm(),
- e.blackoutStyle = P.END,
- p = k.show360Views.transitionTime,
- this.fade360View(p, d, e)) : (G.start(H.property(this.model, "alpha", e.modelAlpha, null), p * e.modelAlphaLength, null, e.modelAlphaDelay, null, q.FlyToNewMode),
- G.start(H.vector(this.position, d.position), p, null, k.flydown.movementDelay, z[k.flydown.movementEasing], null, q.FlyToNewMode),
- G.start(H.quaternion(this.quaternion, d.quaternion), p * e.rotationDuration, null, e.rotationDelay, z[k.flydown.rotationEasing], null, q.FlyToNewMode),
- G.start(H.matrix4(this.camera.projectionMatrix, d.projectionMatrix), p * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, q.FlyToNewMode),
- G.start(H.uniform(this.model.skybox, "opacity", e.skyboxOpacity), p * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, q.FlyToNewMode),
- G.start(H.property(this.reticule.material.uniforms.opacity, "value", 0), p, null, q.FlyToNewMode)),
- G.setTimeout(function() {
- this.flying = !1,
- u === V.PANORAMA && i !== V.PANORAMA ? this.currentPano.exit() : u !== V.PANORAMA && i === V.PANORAMA && (this.currentPano !== b && b.exit(),
- this.currentPano.enter(),
- this.path.placeCpm(),
- this.path.fadeOutCpm(k.path.fadeOutTime),
- this.spider.draw()),
- u === V.DOLLHOUSE && this.cameraControls.controls[V.DOLLHOUSE].resetRanges(),
- this.mode = i,
- this.emit(W.FlyingEnded, f, w, this.currentPano, b)
-
- if (this.afterCModeFuc) {
- //手动加的函数
- var cf = this.afterCModeFuc;
- this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
- cf();
- }
- this.updateMarkerVisi();//add
- (u === V.PANORAMA || i == V.PANORAMA) && this.updateHotVisible()//add
-
- if(this.mode == "panorama" && EditOverlay.editing){
- EditOverlay.updatePano(this.currentPano)
- }
- //this.mode == u.PANORAMA && this.transitionPos({type:"flyDone", this.currentPano})//add
-
-
- c && u !== V.PANORAMA && i === V.PANORAMA ? this.startWarp(M.Retain, S.Retain, R.BLACK, null, null, a) : (a && a(),
- t.resolve())
- }
- .bind(this), p, q.FlyToNewMode),
- this.mode = V.TRANSITIONING,
- t.promise()
- }
- ,
- t.prototype.fade360View = function(e, t, i) {
- this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
- $(this.domElement).fadeOut(.5 * e, function() {
- this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
- this.model.alpha = i.modelAlpha,
- this.position.copy(t.position),
- this.quaternion.copy(t.quaternion),
- this.camera.projectionMatrix.copy(t.projectionMatrix),
- $(this.domElement).fadeIn(.5 * e)
- }
- .bind(this))
- }
- ,
- t.prototype.findDefaultViews = function() {
- this.findDefaultView(this.lastInsideView, !0),
- this.findDefaultView(this.last360View, !1)
- }
- ,
- t.prototype.findDefaultView = function(e, i) {
- var t, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
- if (e.cameraMode !== V.PANORAMA)
- return !1;
- var t = r.get(e.panoId);
- return t && t.isAligned() === i
- });
- 0 <= o ? (t = r.get(n[o].panoId),
- e.update({
- cameraMode: V.PANORAMA,
- pano: t,
- position: n[o].position,
- quaternion: n[o].quaternion
- })) : 0 <= (o = r.list.findIndex(function(e) {
- return e.isAligned() === i
- })) ? (t = r.list[o],
- e.update({
- cameraMode: V.PANORAMA,
- pano: t,
- position: t.position
- })) : Y.warn("There are no", i ? "inside" : "360º", "views in this model")
- }
- ,
- t.prototype.updateLastView = function() {
- this.mode === V.PANORAMA && (this.currentPano.isAligned() ? this.lastInsideView : this.last360View).update({
- pano: this.currentPano,
- position: this.position,
- quaternion: this.quaternion
- })
- }
- ,
- t.prototype.goToLastView = function(e, t) {
- var i = $.Deferred()
- , n = i.resolve.bind(i)
- , r = i.reject.bind(i)
- , o = e ? this.lastInsideView : this.last360View;
- return this.isInMode(V.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
- this.isInMode(V.PANORAMA) ? (this.path && this.path.popOutCpm(),
- this.fadeToView(e, o, k.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
- mode: o.cameraMode,
- pano: o.pano,
- quaternion: o.quaternion,
- callback: t
- }).done(n).fail(r),
- i.promise()
- }
- ,
- t.prototype.fadeToView = function(e, t, i, n) {
- var r = $.Deferred()
- , o = r.resolve.bind(r)
- , a = r.reject.bind(r);
- if (!t.isValid() || t.cameraMode === V.PANORAMA && !t.pano)
- return Y.warn("Tried to fade to an illegal view", t.cameraMode),
- a("Cannot go to illegal view"),
- r.promise();
- var s = (k[t.cameraMode],
- function() {
- $(this.domElement).fadeIn(.5 * i),
- n && n(),
- o()
- }
- .bind(this))
- , l = e ? P.FADEIN : P.END;
- return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
- $(this.domElement).fadeOut(.5 * i, function() {
- this.model.fadePanoMarkers(e ? k.panorama.markerOpacity : 0),
- t.cameraMode === V.PANORAMA ? this.flyToPano({
- pano: t.pano,
- lookAtPoint: T.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
- duration: 0
- }, s) : this.flyToNewMode({
- mode: t.cameraMode,
- quaternion: t.quaternion,
- duration: 0,
- callback: s
- })
- }
- .bind(this)),
- r.promise()
- }
- ,
- t.prototype.startWarp = function(e, t, i, n, r, o) {
- if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
- this.flying)
- return Y.warn("Player.startWarp() -> Cannot warp when flying"),
- o && o(),
- !1;
- null != e || (e = M.Show),
- this.history.invalidate(),
- e !== M.Retain ? this.path.brushToWarpPano(i, R.BLACK) || (i = R.BLACK) : i = this.path.upcomingTransType;
- var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
- return this.emit(W.WarpStarted, a, i, n, r),
- n = n || P.MIDDLE,
- this.path.warpToPano(i, n, r, function() {
- t === S.Slow ? this.path.discardSlow() : t === S.Standard && this.path.discardPathObject(),
- this.emit(W.WarpEnded, i),
- this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
- o && o()
- }
- .bind(this)),
- e === M.Hide && this.path.discardPathObject(),
- !0
- }
- ,
- t.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
- return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (Y.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
- s && s(),
- !1)
- }
- ,
- t.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
- return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (Y.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
- a && a(),
- !1)
- }
- ,
- t.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
- return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
- }
- ,
- t.prototype.warpToNonPanoByHeroIndex = function(e, t) {
- return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
- !0) : (Y.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
- t && t(),
- !1)
- }
- ,
- t.prototype.aimTourCamera = function(e, t, i, n) {
- return Y.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
- this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
- }
- ,
- t.prototype.showPathToHeroLocation = function(e) {
- this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(R.STD, R.BLACK)
- }
- ,
- t.prototype.tourInterlude = function(e, t) {
- this.history.invalidate(),
- this.path.discardSlow();
- var i = g_data2.tourAudio && g_data2.tourAudio[this.model.heroLocations[this.director.currentItem].sid]
- , n = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
- , r = i && i.music ? i.time - n : 2e3;
- this.path.waitNextStep(e, function() {
- t && t()
- }
- .bind(this), r)
- }
- ,
- t.prototype.stopInterlude = function() {
- this.interruptAndFastForward(null, 0)
- }
- ,
- t.prototype.interruptAndFastForward = function(e, t) {
- this.isWarping() && this.emit(W.WarpInterrupted, this.path.activeTransType, e, t),
- this.flying && this.emit(W.FlyingInterrupted),
- this.path.interruptAndFastForward(e, t)
- }
- ,
- t.prototype.setSize = function(e, t) {
- var i = e / t;
- this.baseFov = A.clampVFOV(k.insideFOV, k.insideFOVMax, e, t);
- var n = A.getHFOVFromVFOV(k.insideFOV, e, t);
- for (var r in n > k.insideFOVMax ? this.baseFov = A.getVFOVFromHFOV(k.insideFOVMax, e, t) : this.baseFov = k.insideFOV,
- this.cameraControls.cameras) {
- var o = this.cameraControls.cameras[r];
- o.fov = this.baseFov * (1 / this.zoomLevel),
- o.updateAspect(i)
- }
- }
- ,
- t.prototype.toJSON = function() {
- var e = {};
- return this.cameraControls.activeControl && ((e = this.cameraControls.activeControl.toJSON()).camera_mode = V.toInt(this.mode),
- this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
- return e.hidden ? 0 : 1
- }) : V.PANORAMA && (e.scan_id = this.currentPano.id)),
- e
- }
- ,
- t.prototype.getCurrentNodePanos = function(e) {
- if (this.model.panos.map,
- e.length = 0,
- this.path.nodes)
- for (var t = 0; t < this.path.nodes.length; t++) {
- var i = this.path.nodes[t];
- e.push(this.model.panos.get(i))
- }
- }
- ,
- t.prototype.zoomIncrementally = function(e) {
- var t = this.zoomLevel;
- this.zoomTo(this.zoomLevel + e),
- t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
- }
- ,
- t.prototype.zoomInIncrementally = function(e) {
- e = e || this.defaultZoomIncrement,
- this.zoomIncrementally(e)
- }
- ,
- t.prototype.zoomOutIncrementally = function(e) {
- e = e || -this.defaultZoomIncrement,
- this.zoomIncrementally(e)
- }
- ,
- t.prototype.zoomBy = function(e) {
- this.zoomTo(this.zoomLevel * e)
- }
- ,
- t.prototype.zoomIn = function() {
- this.zoomBy(1 + this.zoomSpeed)
- }
- ,
- t.prototype.zoomOut = function() {
- this.zoomBy(1 - this.zoomSpeed)
- }
- ,
- t.prototype.zoomTo = function(e, t) {
- if ((t || k.zoom.enabled && this.mode === V.PANORAMA && this.zoomEnabled) && (e < k.zoom.min && (e = k.zoom.min),
- e > k.zoom.max && (e = k.zoom.max),
- e > this.zoomLevel ? (this.emit(m.ZoomIn),
- e === k.zoom.max && this.emit(m.ZoomMax)) : e < this.zoomLevel && (this.emit(m.ZoomOut),
- e === k.zoom.min && this.emit(m.ZoomMin)),
- this.cameraControls.activeControl)) {
- var i = this.cameraControls.activeControl.camera;
- this.zoomLevel = e,
- i.fov = this.baseFov * (1 / this.zoomLevel),
- i.updateProjectionMatrix(),
- this.zoomFov = i.fov
- }
- }
- ,
- t.prototype.increaseZoomSpeed = function() {
- this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
- }
- ,
- t.prototype.decreaseZoomSpeed = function() {
- this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
- }
- ,
- t.prototype.clampZoomSpeed = function(e) {
- return e < 0 ? 0 : e
- }
- ,
- t.prototype.activatePersistentZooming = function(e) {
- this.zooming = e ? 1 : -1
- }
- ,
- t.prototype.deactivatePersistentZooming = function() {
- this.zooming = 0
- }
- ,
- t.prototype.zoomDefault = function() {
- this.zoomTo(1, !0)
- }
- ,
- t.prototype.smoothZoomToDefault = function(e, t) {
- var i, n = this.zoomLevel, r = function(e) {
- 1 < e && (e = 1),
- i = n * (1 - e) + e,
- this.zoomTo(i, !0)
- }
- .bind(this), o = function() {
- this.zoomDefault(),
- t && window.setTimeout(t, 50)
- }
- .bind(this);
- G.start(r, e, o, null, 0, z[k.transition.blendEasing])
- }
- ,
- t.prototype.updateZoomPano = function() {
- if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === V.PANORAMA) {
- var e = this.currentPano;
- if (e) {
- var t = this.zoomLevel > k.zoom.activationThreshold
- , i = (this.flying && this.nextPano && this.nextPano !== this.currentPano || this.isWarping(),
- t);
- this.tileDownloader.tilePrioritizer.setZoomingActive(i),
- this.panoRenderer.setZoomingActive(i, e, !0);
- var n = function(e, t) {
- this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
- this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
- this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
- e.setZoomed(t)
- }
- .bind(this);
- i && !e.zoomed ? (n(e, !0),
- this.panoRenderer.enableUltraHighQualityMode(function() {
- this.qualityManager.useUltraHighResolutionPanos && !k.zoom.overridemax && (k.zoom.max = y.ultraHighQualityMaxZoom),
- i && n(e, !0)
- }
- .bind(this))) : !t && e.zoomed && n(e, !1)
- }
- }
- },
-
- //--------
-
- t.prototype.flyToMode = function(mode, f1){ //飞到某个模式后再执行f1函数
- var f2;
- if (this.mode == mode) {
- f1 && f1()
- } else {
- f2 = f1;
-
- if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
- this.afterCModeFuc = function() {
-
- this.afterCModeFuc = f2
- this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano });
- }.bind(this)
- } else {
- this.afterCModeFuc = f2;//飞入后执行
- try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
- this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano});
- }catch(e){}
-
- }
- }
- }
-
- ,
-
- t.prototype.checkHasNeighbor = function(pano){//add
- for(var i in pano.neighbourPanos ){
- if(i == pano.id)continue;
- if(pano.neighbourPanos[i]){
- return true;
- }
- }
- }
-
-
- ,
- ee.exports = t
- }
- ).call(this, "/js/player.js")
- }
- , {
- "./constants": 8,
- "./enum/AlignmentType": 17,
- "./enum/BlackoutStyle": 18,
- "./enum/ControlEvents": 21,
- "./enum/Keys": 30,
- "./enum/ModelManagerEvents": 33,
- "./enum/PanoSizeClass": 36,
- "./enum/PanoramaEvents": 37,
- "./enum/PathDiscardMode": 38,
- "./enum/PathDisplayMode": 39,
- "./enum/PlayerEvents": 40,
- "./enum/TagStates": 44,
- "./enum/Vectors": 50,
- "./enum/Viewmode": 51,
- "./enum/WarpStyle": 52,
- "./enum/ZoomEvents": 53,
- "./exception/BasicException": 55,
- "./model/ModelManager": 140,
- "./objects/NSpider": 147,
- "./objects/Panorama": 148,
- "./objects/Reticule": 149,
- "./objects/ShowPath": 151,
- "./objects/Snapshot": 153,
- "./objects/View": 154,
- "./settings": 166,
- "./shaders": 167,
- "./tile/TileDownloader": 171,
- "./tile/TilePrioritizer": 172,
- "./util/ZoomStats": 179,
- "./util/browser": 182,
- "./util/camera": 183,
- "./util/cameraLight": 184,
- "./util/common": 185,
- "./util/easing": 186,
- "./util/history": 187,
- "./util/lerp": 188,
- "./util/logger": 189,
- "./util/math": 190,
- "./util/transitions": 195,
- hot: "hot",
- scaleImg: "scaleImg",
- events: 202,
- three: 217
- }],
- scaleImg: [function(e, t) {
- var i = t;
- (function() {
- function e(e, t, i, n) {
- function r() {
- (U = "object" == typeof i ? i : t.src || n ? s : document.createElement("canvas")).width = d,
- U.height = p,
- H = U.getContext("2d")
- }
- function o(e) {
- if (e) {
- var t, i = H.getImageData(0, 0, d, p), n = i.data;
- for (t = 0; t < ie; t += 4)
- n[t] = e[t] * ne | 0,
- n[t + 1] = e[t + 1] * ne | 0,
- n[t + 2] = e[t + 2] * ne | 0,
- n[t + 3] = e[t + 3] * ne | 0;
- return delete e,
- i
- }
- return H.getImageData(0, 0, d, p)
- }
- function a(e, t, i, n, r) {
- return .5 * (n - t + (2 * t - 5 * i + 4 * n - r + (3 * (i - n) + r - t) * e) * e) * e + i
- }
- var s, l;
- if (t || (t = e.input,
- i = e.output,
- n = e.inputRemovable,
- e.scale && (e = e.scale)),
- t.src)
- if (s = document.createElement("canvas"),
- null != t.naturalWidth)
- s.width = t.naturalWidth,
- s.height = t.naturalHeight;
- else if (null != t.runtimeStyle) {
- var c = t.runtimeStyle
- , h = c.width
- , u = c.height;
- c.width = "auto",
- c.height = "auto",
- s.width = t.width,
- s.height = t.height,
- c.width = h,
- c.height = u
- } else {
- h = t.width,
- u = t.height;
- t.removeAttribute && (t.removeAttribute("width"),
- t.removeAttribute("height")),
- s.width = t.width,
- s.height = t.height,
- t.width = h,
- t.height = u
- }
- else
- s = t;
- l = s.getContext("2d"),
- t.src && l.drawImage(t, 0, 0);
- var d, p, f = s.width, g = s.height, m = l.getImageData(0, 0, f, g).data;
- if (!f || !g)
- return !1;
- (t.src || n) && s.clearRect(0, 0, f, g),
- p = "object" == typeof e ? e.width ? (d = e.width + .5 | 0,
- e.height + .5 | 0) : (d = f * e.scaleX + .5 | 0,
- g * e.scaleY + .5 | 0) : (d = e * f + .5 | 0,
- e * g + .5 | 0);
- 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;
- if (1 < re || 1 < oe)
- for (r(),
- G = (z = o()).data,
- C = 0; C < p; C++)
- for (V = (y = C / oe) - (w = 0 | y),
- j = w * $,
- W = w < 1 ? j : j - $,
- w < g - 2 ? (Y = j + $,
- q = (2 + w) * $) : Y = q = g - 2 < w ? j : j + $,
- A = 0; A < d; A++,
- te += 4)
- Z = (b = 0 | (v = A / re)) << 2,
- b < f - 2 ? (K = Z + 4,
- Q = Z + 8) : K = Q = f - 2 < b ? Z : Z + 4,
- 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,
- ++Z,
- ++K,
- ++Q,
- 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,
- ++Z,
- ++K,
- ++Q,
- 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,
- ++Z,
- ++K,
- ++Q,
- 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,
- G[te] = 0 <= D ? D < 256 ? D : 255 : 0,
- G[te + 1] = 0 <= F ? F < 256 ? F : 255 : 0,
- G[te + 2] = 0 <= B ? B < 256 ? B : 255 : 0,
- G[te + 3] = 0 <= N ? N < 256 ? N : 255 : 0;
- else {
- if (le.Float32Array)
- L = new Float32Array(ie);
- else
- for (L = [],
- te = 0; te < ie; ++te)
- L[te] = 0;
- for (y = 0; y < g; y++)
- for (I = (_ = 0 | (C = y * oe)) * J,
- (O = !!((_ - (C + oe | 0)) * (g - 1 - y)) << 1) && (M = 1 + _ - C,
- R = C + oe - _ - 1),
- v = 0; v < f; v++,
- ee += 4)
- switch (A = v * re,
- E = 0 | A,
- te = I + (E << 2),
- P = !!((E - (A + re | 0)) * (f - 1 - v)),
- P && (x = 1 + E - A,
- S = A + re - E - 1),
- D = m[ee],
- F = m[ee + 1],
- B = m[ee + 2],
- N = m[ee + 3],
- P + O) {
- case 0:
- L[te] += D * ae,
- L[te + 1] += F * ae,
- L[te + 2] += B * ae,
- L[te + 3] += N * ae;
- break;
- case 1:
- T = x * oe,
- L[te] += D * T,
- L[te + 1] += F * T,
- L[te + 2] += B * T,
- L[te + 3] += N * T,
- T = S * oe,
- L[te + 4] += D * T,
- L[te + 5] += F * T,
- L[te + 6] += B * T,
- L[te + 7] += N * T;
- break;
- case 2:
- T = re * M,
- L[te] += D * T,
- L[te + 1] += F * T,
- L[te + 2] += B * T,
- L[te + 3] += N * T,
- T = re * R,
- L[te += J] += D * T,
- L[te + 1] += F * T,
- L[te + 2] += B * T,
- L[te + 3] += N * T;
- break;
- default:
- T = x * M,
- L[te] += D * T,
- L[te + 1] += F * T,
- L[te + 2] += B * T,
- L[te + 3] += N * T,
- T = S * M,
- L[te + 4] += D * T,
- L[te + 5] += F * T,
- L[te + 6] += B * T,
- L[te + 7] += N * T,
- T = x * R,
- L[te += J] += D * T,
- L[te + 1] += F * T,
- L[te + 2] += B * T,
- L[te + 3] += N * T,
- T = S * R,
- L[te + 4] += D * T,
- L[te + 5] += F * T,
- L[te + 6] += B * T,
- L[te + 7] += N * T
- }
- delete m,
- r(),
- z = o(L)
- }
- if (H.putImageData(z, 0, 0),
- "string" == typeof i) {
- var se;
- if ("png" === i || "jpeg" === i)
- return (se = n && t.src ? t : new Image).width = d,
- se.height = p,
- se.src = U.toDataURL("image/" + i, .85),
- se;
- if ("png-src" === i || "jpeg-src" === i)
- return U.toDataURL("image/" + i.split("-")[0], .85)
- }
- return U
- }
- var le = this;
- "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = e),
- exports.scale = e) : c = e
- }
- ).call(this),
- i.exports = c
- }
- , {}],
- 156: [function(i, n, e) {
- (function(e) {
- "use strict";
- function t(e, t) {
- this.model = e,
- this.panos = e.panos,
- this.player = t,
- this.imagePanos = this.listImagePanos(),
- this.retryMinimumTime = 1e4
- }
- var r = (i("three"),
- i("./enum/Viewmode"))
- , o = (i("./settings"),
- i("./objects/Panorama"))
- , a = new (i("./util/logger"))(e);
- t.prototype.start = function() {
- this.loadNextPano(function(e) {
- e ? this.start() : (a.debug("No suitable pano loaded, waiting a little while before looking again"),
- setTimeout(function() {
- this.start()
- }
- .bind(this), 1e3))
- }
- .bind(this))
- }
- ,
- t.prototype.validLoadTarget = function(e) {
- return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
- }
- ,
- t.prototype.listImagePanos = function() {
- var i = []
- , n = this;
- return this.model.images.forEach(function(e) {
- if (e.metadata && e.metadata.scan_id) {
- var t = n.model.panos.get(e.metadata.scan_id);
- t && !t.isLoaded("high") && i.push(t)
- }
- }),
- i
- }
- ,
- t.prototype.nextNotLoadedImage = function() {
- for (; 0 < this.imagePanos.length; ) {
- var e = this.imagePanos[0];
- if (!e.isLoaded("high"))
- return e;
- this.imagePanos.shift()
- }
- return null
- }
- ,
- t.prototype.loadNextPano = function(e) {
- var t, i, n = this.model.waitQueue.filter(function(e) {
- return e.object instanceof o
- });
- 0 < n.length ? (t = n[0].object,
- a.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
- a.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
- a.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
- t = this.imagePanos[0],
- 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),
- t ? (i = i || t.isLoaded("low") ? "high" : "low",
- a.debug("Preloading " + i + "-res pano " + t.id),
- t.loadCube(i).done(e).fail(function() {
- a.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
- e()
- })) : e && e(null)
- }
- ,
- n.exports = t
- }
- ).call(this, "/js/preloaders.js")
- }
- , {
- "./enum/Viewmode": 51,
- "./objects/Panorama": 148,
- "./settings": 166,
- "./util/logger": 189,
- three: 217
- }],
- 157: [function(a, s, e) {
- (function(e) {
- "use strict";
- function t(e, t, i, n, r) {
- this.qualityManager = e,
- this.scene = t,
- this.camera = i,
- this.container = r,
- this.controls = n,
- this.controls.enabled = !0,
- this.controls.locked = !0,
- this.quickstartCamera = n.camera,
- this.quickstartCamera.fov = d.clampVFOV(o.insideFOV, o.insideFOVMax, $("#player").width(), $("#player").height()),
- this.skybox = null
- }
- var i = a("three")
- , n = a("../util/logger")
- , o = a("../constants")
- , h = (a("../util/transitions"),
- a("../util/lerp"),
- a("../util/easing"),
- a("../enum/Vectors"))
- , u = a("../enum/PanoSizeClass")
- , r = (a("../materials/ModelTextureMaterial"),
- a("../materials/CubemapMaterial"))
- , d = (a("../cameras/PanoramaCamera"),
- a("../controls/PanoramaControls"),
- a("../tile/TileUtils"),
- a("../util/camera"),
- a("../util/cameraLight"))
- , p = (a("../util/browser"),
- a("../settings"),
- a("../gui/helpManager"),
- new n(e));
- t.prototype.load = function(e) {
- e.pano.shouldRedrawOnBaseLoaded = !0;
- var t, i, n = this, r = h.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
- this.controls.lookAt(r.add(this.quickstartCamera.position));
- var a = this.qualityManager.getPanoSize(u.BASE)
- , s = this.qualityManager.getPanoSize(u.STANDARD);
- if (e.pano.tiled) {
- p.warn("Loading startPano, TILED", e.pano.id);
- var l = d.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
- , c = this.quickstartCamera.fov;
- p.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + l + ", vertical FOV: " + c + "]"),
- t = e.pano.loadTiledPano(s, r, {
- hFov: l,
- vFov: c
- }, !1, !1, !0),
- i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
- } else
- p.warn("Loading startPano", e.pano.id),
- t = e.pano.loadCube("high");
- return $.when(t).then(function() {
- n.init(e.pano, e.quaternion),
- e.pano.tiled ? i.done(function() {
- e.pano.lockUntilRenderingComplete = !1,
- this.controls.locked = !1
- }
- .bind(this)) : this.controls.locked = !1
- }
- .bind(this))
- }
- ,
- t.prototype.init = function(e, t) {
- p.info("Quickstart done loading, adding scene objects"),
- e.lockUntilRenderingComplete = !0,
- this.skybox = new i.Mesh(new i.CubeGeometry(1,1,1),new r({
- side: i.BackSide
- })),
- this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
- this.skybox.quaternion.copy(e.quaternion),
- this.scene.add(this.skybox),
- $(this.container).show()
- }
- ,
- t.prototype.update = function(e) {
- this.controls.update(e),
- this.camera.copy(this.quickstartCamera)
- }
- ,
- t.prototype.setSize = function(e, t) {
- this.quickstartCamera.updateAspect(e / t)
- }
- ,
- t.prototype.destroy = function() {
- this.scene.remove(this.skybox)
- }
- ,
- s.exports = t
- }
- ).call(this, "/js/scene/QuickstartManager.js")
- }
- , {
- "../cameras/PanoramaCamera": 7,
- "../constants": 8,
- "../controls/PanoramaControls": 13,
- "../enum/PanoSizeClass": 36,
- "../enum/Vectors": 50,
- "../gui/helpManager": 68,
- "../materials/CubemapMaterial": 117,
- "../materials/ModelTextureMaterial": 118,
- "../settings": 166,
- "../tile/TileUtils": 174,
- "../util/browser": 182,
- "../util/camera": 183,
- "../util/cameraLight": 184,
- "../util/easing": 186,
- "../util/lerp": 188,
- "../util/logger": 189,
- "../util/transitions": 195,
- three: 217
- }],
- 158: [function(e, t, i) {
- "use strict";
- function h(e, t, i) {
- this.scene = e,
- this.camera = t,
- this.renderer = null,
- this.effects = i,
- this.animateCallback = null,
- this.composer = null,
- this.qualityManager = null,
- e.renderWidth = 0,
- e.renderHeight = 0,
- this.updateClock = new M.Clock,
- this.components = [],
- this.updateListeners = [],
- this.resizeListeners = [],
- this.forceUpdateSize = !1,
- this.started = !1,
- this.textures = {},
- this.suspendedObjects = []
- }
- 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;
- window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
- (h.prototype = Object.create(p.prototype)).addComponent = function(e) {
- this.components.push(e),
- e.update && this.updateListeners.push(e),
- e.setSize && (this.resizeListeners.push(e),
- this.forceUpdateSize = !0)
- }
- ,
- h.prototype.removeComponent = function(t) {
- function e(e) {
- return e !== t
- }
- this.components = this.components.filter(e),
- this.updateListeners = this.updateListeners.filter(e),
- this.resizeListeners = this.resizeListeners.filter(e)
- }
- ,
- h.prototype.start = function(e) {
- if (this.started)
- throw new l("Can't start SceneRenderer, already started");
- this.createContext(e),
- //u.isMobile() && this.boluoVrInit(),
- this.initComposer(),
- this.started = !0,
- (b = b.bind(this))()
- }
- ,
- h.prototype.createContext = function(e) {
- try {
- this.renderer = new M.WebGLRenderer({antialias: !u.isMobile()}),
- this.renderer.autoClear = !0,
- this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
- this.renderer.setSize($("#player").width(), $("#player").height(), !1),
- this.emit(r.ContextCreated)
- } catch (e) {
- throw new c("Unable to create a WebGL rendering context")
- }
- d.profiling.enabled && this.overrideTextures(),
- e.appendChild(this.renderer.domElement)
- }
- ,
- h.prototype.overrideTextures = function() {
- var d = this.renderer.context
- , t = 0
- , i = d.createTexture;
- d.createTexture = function() {
- var e = i.call(d);
- return e.id = t++,
- this.textures[e.id] = e
- }
- .bind(this);
- var p = d.texImage2D;
- d.texImage2D = function(e, t, i, n, r, o, a, s, l) {
- var c, h = this.getTextureTypeFromTarget(d, e);
- c = h === f.TextureCube ? d.getParameter(d.TEXTURE_BINDING_CUBE_MAP) : d.getParameter(d.TEXTURE_BINDING_2D),
- void 0 !== a ? p.call(d, e, t, i, n, r, o, a, s, l) : (a = n,
- s = r,
- n = (l = o).naturalWidth,
- r = l.naturalHeight,
- p.call(d, e, t, i, a, s, l));
- var u = this.textures[c.id];
- u.width = h === f.TextureCube ? 6 * n : n,
- u.height = r
- }
- .bind(this);
- var n = d.deleteTexture;
- d.deleteTexture = function(e) {
- delete this.textures[e.id],
- n.call(d, e)
- }
- .bind(this)
- }
- ,
- h.prototype.updateTextureMemory = (n = null,
- function() {
- var e = 0;
- for (var t in this.textures) {
- var i = this.textures[t];
- i.width && i.height && (e += i.width * i.height * 4)
- }
- e !== n && this.emit(r.MemoryUsageUpdated, e),
- n = e
- }
- ),
- h.prototype.getTextureTypeFromTarget = function(e, t) {
- switch (t) {
- case e.TEXTURE_CUBE_MAP_POSITIVE_X:
- case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
- case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
- case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
- case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
- case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
- return f.TextureCube;
- case e.TEXTURE_2D:
- return f.Texture2D;
- default:
- return null
- }
- }
- ,
- h.prototype.initComposer = function() {
- this.composer = new M.EffectComposer(this.renderer),
- this.composer.addPass(new M.RenderPass(this.scene,this.camera)),
- this.composer.addPass(this.effects.hblurPass),
- this.composer.addPass(this.effects.vblurPass)
- }
- ,
- h.prototype.setSize = function(e, t, i) {
- this.renderWidth = e,
- this.renderHeight = t,
- this.effects.aspect = e / t,
- this.renderer.setSize(e, t, !1, i),
- this.composer.setSize(e, t);
- for (var n = 0; n < this.resizeListeners.length; n++)
- this.resizeListeners[n].setSize(e, t)
- }
- ,
- h.prototype.render = function() {
- 0 < this.effects.currentBlur ? this.composer.render() : this.renderer.render(this.scene, this.camera)
- }
- ,
- h.prototype.boluoVrInit = function() {
- console.log("boluoVrInit"),
- this.isHuawei5X = u.detectHUAWEI5X(),
- this.oldRenderer = this.renderer,
- this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera),
- window.panoCamera = this.camera;
- var i = this;
- window._vrEnabled = !1,
- Object.defineProperty(window, "vrEnabled", {
- get: function() {
- return window._vrEnabled
- },
- set: function(e) {
- (e = !!e) ? (i.renderer = i.newRenderer,
- window.vrMarkers.forEach(function(e) {
- e.visible = !0
- })) : (i.renderer = i.oldRenderer,
- window.vrMarkers.forEach(function(e) {
- e.visible = !1
- })),
- i.cursor.visible = e,
- i.setSize(window.innerWidth, window.innerHeight),
- window._vrEnabled = e,
- setTimeout(function() {
- console.log(player.cameraControls.activeControl.camera.fov)
- }, 500)
- }
- }),
- this.createCursor(.5, !1, 1, 16777215, 0);
- var e = {
- setSize: function(e, t) {
- i.camera.aspect = e / t
- }
- };
- this.resizeListeners.push(e),
- this.vrLoadingInit()
- }
- ,
- h.prototype.vrLoadingInit = function() {
- var e = new (e = function(camera) {
- var t = this
- , e = new M.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
- , i = new M.MeshBasicMaterial({
- color: 4967932,
- side: M.DoubleSide
- })
- , n = new M.Mesh(e,i);
- (this.mesh = n).position.z = -2,
- n.scale.set(.08, .08, .08),
- n.visible = !1,
- //window.player.camera.add(n),
- camera.add(n),
- t.enabled = !1,
- this.update = function(e) {
- 1 == t.enabled && (n.rotation.z += 15 * e)
- }
- }
- )(this.camera);
- window.Loading = e,
- this.updateListeners.push(e)
- }
- ,
- h.prototype.createCursor = function(e, t, i, n, r) {
- var o, a = new M.SpriteMaterial({
- opacity: i,
- color: n,
- transparent: t,
- map: this.boluoGetTexture("images/cursor.png"),
- needsUpdate: !0,
- side: M.DoubleSide
- });
- a.map.offset = new M.Vector2(1 / 17 * r,0),
- a.map.repeat = new M.Vector2(1 / 17,1),
- a.depthTest = !1,
- a.blending = M.AdditiveBlending,
- (o = new M.Sprite(a)).scale.set(.3, .3, .3),
- o.position.z = -2,
- o.visible = !1,
- o.name = "cursor",
- this.camera.add(o),
- this.scene.add(this.camera),
- this.cursor = o;
- var s = new this.CursorAnimation(this.scene,o,this.camera);
- this.cursor.triggerTargetEvent = s.triggerTargetEvent,
- this.updateListeners.push(s)
- }
- ,
- h.prototype.CursorAnimation = function(e, t, o) {
- this.cursor = t,
- this.raycaster = new M.Raycaster,
- this.targetEventObj = {},
- this.type = 1,
- this.tweenFlag = !0;
- var s = this;
- this.target = o,
- console.log(o.uuid),
- this.euler = new M.Euler,
- this.q0 = new M.Quaternion,
- this.q1 = new M.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
- this.zee = new M.Vector3(0,0,1),
- this.alpha = -1e3,
- this.beta = -1e3,
- this.gamma = -1e3,
- this.orient = M.Math.degToRad(window.orientation || 0),
- window.addEventListener("orientationchange", function() {
- s.orient = M.Math.degToRad(window.orientation || 0)
- }),
- window.addEventListener("deviceorientation", function(e) {
- var t = M.Math.degToRad(e.alpha)
- , i = M.Math.degToRad(e.beta)
- , n = M.Math.degToRad(e.gamma);
- if (this.isHuawei5X ? (-1e3 === s.alpha && (s.alpha = t),
- -1e3 === s.beta && (s.beta = i),
- -1e3 === s.gamma && (s.gamma = n),
- .06 < Math.abs(t - s.alpha) && (s.alpha = t),
- .006 < Math.abs(i - s.beta) && (s.beta = i),
- .006 < Math.abs(n - s.gamma) && (s.gamma = n)) : (s.alpha = t,
- s.beta = i,
- s.gamma = n),
- h.vrDebug) {
- $("#info-device-orientation").css("display", "block");
- var r = "";
- r += "alpha=(" + s.alpha + ")<BR/>",
- r += "beta=(" + s.beta + ")<BR/>",
- r += "gamma=" + s.gamma + "<BR/>",
- document.getElementById("info-device-orientation").innerHTML = r
- }
- }),
- this.setObjectQuaternion = function(e, t, i, n, r) {
- s.euler.set(i, t, -n, "YXZ"),
- e.setFromEuler(s.euler),
- e.multiply(s.q1),
- e.multiply(s.q0.setFromAxisAngle(s.zee, -r)),
- o.updateMatrixWorld()
- }
- ,
- parent !== window && window.addEventListener("message", function(e) {
- var t, i, n, r, o = JSON.parse(e.data), a = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
- o && o.alpha && o.beta && o.gamma && (t = a,
- i = M.Math.degToRad(o.alpha),
- n = M.Math.degToRad(o.beta),
- r = M.Math.degToRad(o.gamma),
- t ? (-1e3 === s.alpha && (s.alpha = i),
- -1e3 === s.beta && (s.beta = n),
- -1e3 === s.gamma && (s.gamma = r),
- .06 < Math.abs(i - s.alpha) && (s.alpha = i),
- .006 < Math.abs(n - s.beta) && (s.beta = n),
- .006 < Math.abs(r - s.gamma) && (s.gamma = r)) : (s.alpha = i,
- s.beta = n,
- s.gamma = r))
- }),
- this.update = function(e) {
- TWEEN.update(),
- window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient),
- this.triggerTargetEvent())
- }
- ,
- this.triggerTargetEvent = function() {
- var e = this.choseObj()
- , t = e ? e.object : void 0;
- (this.targetEventObj.currentObj = t) !== this.targetEventObj.lastObj && (t && this.autoCursorPosition(e),
- 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
- t && t.enabled && this.startAnimate(function() {
- this.clickCallback(t)
- }
- .bind(this))) : this.type,
- this.targetEventObj.lastObj = t)
- }
- ,
- this.choseObj = function() {
- this.raycaster.setFromCamera({
- x: 0,
- y: 0
- }, o);
- var e = (this.raycaster.ray,
- window.vrMarkers)
- , t = this.raycaster.intersectObjects(e);
- if (0 < t.length)
- return t[0]
- }
- ,
- this.clickCallback = function(e) {
- this.runTHREEAction(e, "onclick")
- }
- ,
- this.runTHREEAction = function(e, t) {
- switch (t) {
- case "onclick":
- e._listeners && e._listeners.click && e._listeners.click.forEach(function(e) {
- e()
- });
- break;
- case "onhover":
- e._listeners && e._listeners.hover && e._listeners.hover.forEach(function(e) {
- e()
- });
- break;
- case "onout":
- e._listeners && e._listeners.out && e._listeners.out.forEach(function(e) {
- e()
- })
- }
- }
- ,
- this.startAnimate = function(e) {
- this.tweenFlag && this.initAnimation(e)
- }
- ,
- this.initAnimation = function(e) {
- var t = this
- , i = this.cursor.material.map.offset;
- t.tweenFlag = !1,
- this.cursorAnimate = new TWEEN.Tween(i).to({
- x: 1
- }, 1e3).onStart(function() {
- t.tweenFlag = !1
- }).onStop(function() {
- t.tweenFlag = !0,
- this.x = 0,
- i.x = 0
- }).onUpdate(function() {}).onComplete(function() {
- e(),
- i.x = 0,
- setTimeout(function() {
- t.tweenFlag = !0
- }, 1500)
- }),
- this.cursorAnimate.easing(function(e) {
- return Math.floor(17 * e) / 17
- }),
- this.cursorAnimate.start()
- }
- ,
- this.autoCursorPosition = function(e) {
- this.cursor.scale.set(.3, .3, .3)
- }
- }
- ,
- h.prototype.vrRenderer = function(a, i, e) {
- var s = new i.vrCamera(e);
- s.bananaAspect = .8,
- this.width,
- this.height;
- i = this;
- this.setSize = function(e, t) {
- a.setSize.call(this, e, t),
- i.width = e,
- i.height = t
- }
- ,
- this.render = function(e, t, i, n) {
- var r, o;
- if (window.cameraQua = t.quaternion.clone(),
- t.__RESS__SKIP__STEREO__)
- return a.render(e, t, i, n);
- if ("PerspectiveCamera" === t.type)
- r = s.cameraL,
- o = s.cameraR,
- e.updateMatrixWorld(),
- null === t.parent && t.updateMatrixWorld(),
- s.vrCameraUpdate(t);
- else {
- if ("OrthographicCamera" !== t.type)
- return DEBUG && console.error("Unsupported renderer: ", t.type);
- r = o = t
- }
- a.setScissorTest(!0),
- a.setScissor(0, 0, this.width / 2, this.height),
- a.setViewport(0, 0, this.width / 2, this.height),
- a.render.call(this, e, r, i, n),
- a.setScissor(this.width / 2, 0, this.width / 2, this.height),
- a.setViewport(this.width / 2, 0, this.width / 2, this.height),
- a.render.call(this, e, o, i, n),
- a.setScissorTest(!1)
- }
- ,
- this.__proto__ = {
- __proto__: a
- }
- }
- ,
- h.prototype.vrCamera = function(e) {
- this.type = "StereoCamera",
- this._aspect = 1,
- this._overlap = .064,
- this.cameraL = new M.PerspectiveCamera,
- this.cameraL.layers.enable(1),
- this.cameraL.matrixAutoUpdate = !1,
- this.cameraR = new M.PerspectiveCamera,
- this.cameraR.layers.enable(2),
- this.cameraR.matrixAutoUpdate = !1,
- this.eyeRight = new M.Matrix4,
- this.eyeLeft = new M.Matrix4,
- this.vrCameraNeedsUpdate = !0,
- window.vrCameraL = this.cameraL,
- Object.defineProperty(this, "bananaAspect", {
- get: function() {
- return this._aspect
- },
- set: function(e) {
- this._aspect !== e && (this.vrCameraNeedsUpdate = !0),
- this._aspect = e
- }
- }),
- Object.defineProperty(this, "overlap", {
- get: function() {
- return this._overlap
- },
- set: function(e) {
- this._overlap !== e && (this.vrCameraNeedsUpdate = !0),
- this._overlap = e
- }
- }),
- this.vrCameraUpdate = function(e) {
- if (this.vrCameraNeedsUpdate = !0,
- this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== e.fov || this.bananaReal_aspect !== e.aspect * this.bananaAspect || this.bananaNear !== e.near || this.bananaFar !== e.far,
- this.vrCameraNeedsUpdate) {
- this.vrCameraNeedsUpdate = !1,
- console.debug("vrCameraUpdate"),
- this.bananaFocus = e.focus,
- this.bananaFov = e.fov,
- this.bananaReal_aspect = e.aspect * this.bananaAspect,
- this.bananaNear = e.near,
- this.bananaFar = e.far,
- console.debug(e.aspect),
- this.bananaFocus = 10;
- 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);
- this.eyeLeft.elements[12] = -r,
- this.eyeRight.elements[12] = r,
- t = -a * this.bananaReal_aspect + o,
- i = a * this.bananaReal_aspect + o,
- n.elements[0] = 2 * this.bananaNear / (i - t),
- n.elements[8] = (i + t) / (i - t),
- this.cameraL.projectionMatrix.copy(n),
- t = -a * this.bananaReal_aspect - o,
- i = a * this.bananaReal_aspect - o,
- n.elements[0] = 2 * this.bananaNear / (i - t),
- n.elements[8] = (i + t) / (i - t),
- this.cameraR.projectionMatrix.copy(n)
- }
- this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(this.eyeLeft),
- this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(this.eyeRight)
- }
- }
- ,
- h.prototype.boluoGetTexture = function(e) {
- var t = new M.TextureLoader;
- return t.crossOrigin = "anonymous",
- t.load(e)
- }
- ,
- h.prototype.updateScreenSize = function(e) {
- var t, i, n, r = !1;
- e && !e.resize && null != e.width && null != e.height ? (i = e.width,
- n = e.height,
- r = !0,
- t = 1) : (i = $("#player").width(),
- n = $("#player").height(),
- e && e.resize && (o = this.renderWidth,
- a = this.renderHeight),
- i === o && n === a && !this.forceUpdateSize || (o = i,
- a = n,
- r = !0,
- t = window.devicePixelRatio)),
- r && (this.setSize(i, n, t),
- this.forceUpdateSize = !1)
- }
- ,
- h.prototype.updateComponents = function() {
- for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
- this.updateListeners[t].update(e)
- }
- ,
- h.prototype.suspend = function() {
- this.started = !1,
- this.suspendedObjects = this.scene.children.map(function(e) {
- return this.scene.remove(e),
- e
- }
- .bind(this)),
- this.render()
- }
- ,
- h.prototype.resume = function() {
- this.suspendedObjects.forEach(function(e) {
- this.scene.add(e)
- }
- .bind(this)),
- this.suspendedObjects = [],
- this.started = !0,
- b()
- }
- ;
- var g, m, v, y, A, C, I, P, O, L, D, N, F, E, _, b = function() {
- this.started && (window.requestAnimationFrame(b),
- this.updateScreenSize(),
- this.updateComponents(),
- this.updateTextureMemory(),
- this.render(),
- this.emit(r.AfterRender))
- };
- h.prototype.getImageData = (E = document.createElement("canvas"),
- _ = E.getContext("2d"),
- function(e, t, i) {
- return E.width === t && E.height === i || (E.width = t,
- E.height = i),
- _.drawImage(e, 0, 0, t, i),
- _.getImageData(0, 0, t, i)
- }
- ),
- h.prototype.initSizedTexture2D = function(e, t, i) {
- var n = this.renderer
- , r = n.context
- , o = n.state
- , a = new M.Texture(null);
- !(a.flipY = !1) !== i && (i = !1),
- a.generateMipmaps = i;
- var s = n.paramThreeToGL(a.format)
- , l = n.paramThreeToGL(a.type)
- , c = n.properties.get(a)
- , h = r.createTexture();
- o.bindTexture(r.TEXTURE_2D, h),
- r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL, a.flipY),
- r.texImage2D(r.TEXTURE_2D, 0, s, e, e, 0, s, l, null),
- a.wrapS = t,
- a.wrapT = t;
- var u = n.paramThreeToGL(t);
- return r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, u),
- r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, u),
- i ? (a.magFilter = M.LinearFilter,
- a.minFilter = M.LinearMipMapLinearFilter,
- r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
- r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR_MIPMAP_NEAREST),
- r.generateMipmap(r.TEXTURE_2D)) : (a.magFilter = M.LinearFilter,
- a.minFilter = M.LinearFilter,
- r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MAG_FILTER, r.LINEAR),
- r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR)),
- o.bindTexture(r.TEXTURE_2D, null),
- c.__webglTexture = h,
- a
- }
- ,
- h.prototype.initSizedCubeMap = function(e, t) {
- var i = this.renderer
- , n = i.context
- , r = i.state
- , o = new M.CubeTexture([null, null, null, null, null, null]);
- o.flipY = !1,
- o.generateMipmaps = t;
- var a = i.paramThreeToGL(o.format)
- , s = i.paramThreeToGL(o.type)
- , l = i.properties.get(o)
- , c = n.createTexture();
- r.bindTexture(n.TEXTURE_CUBE_MAP, c),
- n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, o.flipY);
- for (var h = 0; h < 6; h++)
- n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + h, 0, a, e, e, 0, a, s, null);
- return t ? (o.magFilter = M.LinearFilter,
- o.minFilter = M.LinearMipMapLinearFilter,
- n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
- n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
- n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
- n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (o.magFilter = M.LinearFilter,
- o.minFilter = M.LinearFilter,
- n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
- n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
- r.bindTexture(n.TEXTURE_CUBE_MAP, null),
- l.__image__webglTextureCube = c,
- o
- }
- ,
- h.prototype.deallocateCubeTexture = function(e) {
- var t = this.renderer
- , i = t.context
- , n = t.properties.get(e);
- i.deleteTexture(n.__image__webglTextureCube)
- }
- ,
- h.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
- var a = this.renderer
- , s = a.context
- , l = a.state
- , c = a.properties.get(t);
- l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
- s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
- s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
- s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
- s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
- s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
- s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
- s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
- s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
- t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
- l.bindTexture(s.TEXTURE_2D, null)
- }
- ,
- h.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
- var s = this.renderer
- , l = s.context
- , c = s.state
- , h = s.properties.get(t);
- c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
- l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
- l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
- t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
- c.bindTexture(l.TEXTURE_CUBE_MAP, null)
- }
- ,
- h.prototype.rebuildMipMaps2D = function(e) {
- var t = this.renderer
- , i = t.context
- , n = t.state;
- t.properties.get(e),
- i.generateMipmap(i.TEXTURE_2D),
- n.bindTexture(i.TEXTURE_2D, null)
- }
- ,
- h.prototype.rebuildMipMaps3D = function(e) {
- var t = this.renderer
- , i = t.context
- , n = t.state
- , r = t.properties.get(e);
- n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
- i.generateMipmap(i.TEXTURE_CUBE_MAP),
- n.bindTexture(i.TEXTURE_CUBE_MAP, null)
- }
- ,
- h.prototype.renderToCubeMap = (P = !1,
- F = N = D = L = O = null,
- function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
- this.renderer.context,
- P || ((L = new M.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z = 150,
- (O = new M.Scene).add(L),
- D = new M.ShaderMaterial({
- uniforms: {
- tDiffuse: {
- type: "t",
- value: null
- },
- alpha: {
- type: "f",
- value: 1
- }
- },
- vertexShader: R.basicTextured.vertexShader,
- fragmentShader: R.basicTextured.fragmentShader,
- depthWrite: !1,
- depthTest: !1,
- side: M.DoubleSide
- }),
- N = new M.PlaneBufferGeometry(1,1),
- (F = new M.Mesh(N,D)).position.z = 0,
- O.add(F),
- P = !0);
- var m = N.getAttribute("uv");
- m.setDynamic(!0),
- m.needsUpdate = !0;
- var v = m.array
- , y = r / i
- , A = o / n
- , C = a / i
- , I = s / n;
- v[0] = y,
- v[1] = A + I,
- v[2] = y + C,
- v[3] = A + I,
- v[4] = y,
- v[5] = A,
- v[6] = y + C,
- v[7] = A;
- var E = N.getAttribute("position");
- E.setDynamic(!0),
- E.needsUpdate = !0;
- var _ = E.array
- , b = l / t.width - .5
- , w = c / t.height - .5
- , T = h / t.width
- , x = u / t.height;
- _[0] = b,
- _[1] = w + x,
- _[3] = b + T,
- _[4] = w + x,
- _[6] = b,
- _[7] = w,
- _[9] = b + T,
- _[10] = w,
- this.renderer.properties.get(e),
- D.uniforms.tDiffuse.value = e,
- D.blending = p || M.NoBlending,
- D.transparent = !!f,
- null != g || (g = 1),
- D.uniforms.alpha.value = g,
- D.needUpdate = !0,
- t.activeCubeFace = d,
- t.viewport.set(0, 0, t.width, t.height);
- var S = this.renderer.autoClear;
- this.renderer.autoClear = !1,
- this.renderer.render(O, L, t, !1),
- this.renderer.autoClear = S
- }
- ),
- h.prototype.copyCubeMap = (g = !1,
- C = A = y = v = m = null,
- I = new M.Euler,
- new M.Vector3,
- function(e, t, i, n, r, o, a, s, l) {
- this.renderer,
- g || ((v = new M.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0, 0, 0),
- (m = new M.Scene).add(v),
- y = new M.ShaderMaterial({
- uniforms: {
- tDiffuse: {
- type: "t",
- value: null
- },
- alpha: {
- type: "f",
- value: 1
- }
- },
- vertexShader: R.copyCubeMap.vertexShader,
- fragmentShader: R.copyCubeMap.fragmentShader,
- depthWrite: !1,
- depthTest: !1,
- side: M.DoubleSide
- }),
- A = new M.BoxGeometry(2,2,2),
- C = new M.Mesh(A,y),
- m.add(C),
- g = !0);
- for (var c = 0; c < 6; c++)
- h.getCubeOrientationForCubeFace(c, I),
- C.rotation.copy(I),
- C.matrixWorldNeedsUpdate = !0,
- C.updateMatrixWorld(),
- y.uniforms.tDiffuse.value = e,
- y.blending = a || M.NoBlending,
- y.transparent = !!s,
- null != l || (l = 1),
- y.uniforms.alpha.value = l,
- y.needUpdate = !0,
- t.activeCubeFace = c,
- t.viewport.set(0, 0, r, o),
- this.renderer.render(m, v, t, !1)
- }
- ),
- h.getLookAtForCubeFace = function(e, t) {
- switch (e) {
- case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- t.set(1, 0, 0);
- break;
- case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- t.set(-1, 0, 0);
- break;
- case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- t.set(0, 1, 0);
- break;
- case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- t.set(0, -1, 0);
- break;
- case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- t.set(0, 0, 1);
- break;
- case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- t.set(0, 0, -1)
- }
- }
- ,
- h.getCubeOrientationForCubeFace = function(e, t) {
- switch (e) {
- case s.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- t.set(0, -Math.PI / 2, 0);
- break;
- case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- t.set(0, Math.PI / 2, 0);
- break;
- case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- t.set(Math.PI / 2, Math.PI, 0);
- break;
- case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- t.set(-Math.PI / 2, Math.PI, 0);
- break;
- case s.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- t.set(0, -Math.PI, 0);
- break;
- case s.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- t.set(0, 0, 0)
- }
- }
- ,
- t.exports = h
- }
- , {
- "../enum/GLCubeFaces": 25,
- "../enum/GLTextureType": 26,
- "../enum/SceneRendererEvents": 43,
- "../exception/BasicException": 55,
- "../exception/RendererCreationException": 57,
- "../settings": 166,
- "../shaders": 167,
- "../util/browser": 182,
- events: 202,
- three: 217
- }],
- 159: [function(e, t, i) {
- "use strict";
- function n(e) {
- this.messenger = new a(e),
- this.clientKey = null
- }
- var o = e("../util/ajax")
- , r = e("./PostMessageType")
- , a = e("./postmessage")
- , s = e("./VersionInfo")
- , l = e("events").EventEmitter
- , c = window.location.origin + "/api/v1/user/";
- (n.prototype = Object.create(l.prototype)).bindEvents = function() {
- this.messenger.on(r.ACTION, this.onMessageReceived.bind(this))
- }
- ,
- n.prototype.waitForConnection = function() {
- return new Promise(function(t, i) {
- this.messenger.on(r.CONNECT, function(e) {
- this.onConnectionReceived(e).then(t.bind(this, e.sdkVersion), i.bind())
- }
- .bind(this))
- }
- .bind(this))
- }
- ,
- n.prototype.onConnectionReceived = function(i) {
- return this.messenger.setTarget(i.source, i.origin),
- this.verifyConnection(i).then(function(e, t) {
- this.messenger.send({
- type: r.ACCEPT,
- toId: i.fromId,
- warning: t
- }),
- this.clientKey = e,
- this.messenger.removeAllListeners(r.CONNECT),
- this.bindEvents()
- }
- .bind(this), function(e) {
- this.messenger.send({
- type: r.REJECT,
- toId: i.fromId,
- reason: e
- }),
- this.messenger.setTarget()
- }
- .bind(this))
- }
- ,
- n.prototype.verifyConnection = function(r) {
- return new Promise(function(e, t) {
- var i;
- if (s.isDeprecated(r.sdkVersion))
- i = "这个版本正在被弃用";
- else if (!s.isSupported(r.sdkVersion))
- return t("不支持此版本的SDK");
- var n = {
- cache: !1,
- headers: {
- "X-port-Application-Key": r.applicationKey,
- "X-port-Referrer": r.origin
- }
- };
- o.get(c, n).done(e.bind(this, r.applicationKey, i)).fail(t.bind(this, "key/referrer mismatch"))
- }
- )
- }
- ,
- n.prototype.onMessageReceived = function(t) {
- if (this.validateClientApplicationKey(t.applicationKey)) {
- var i = this;
- t.onDone = function(e) {
- e.toId = t.fromId,
- e.uid = t.uid,
- e.type = r.RESPONSE,
- i.messenger.send(e)
- }
- ,
- this.emit(r.ACTION, t)
- }
- }
- ,
- n.prototype.validateClientApplicationKey = function(e) {
- return this.clientKey === e
- }
- ,
- n.prototype.sendEvent = function(e, t) {
- this.messenger.send({
- type: r.EVENT,
- eventType: e,
- eventData: t
- })
- }
- ,
- t.exports = n
- }
- , {
- "../util/ajax": 181,
- "./PostMessageType": 160,
- "./VersionInfo": 163,
- "./postmessage": 165,
- events: 202
- }],
- 160: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- CONNECT: "postmessage.connect",
- ACCEPT: "postmessage.accept",
- REJECT: "postmessage.reject",
- ACTION: "postmessage.action",
- RESPONSE: "postmessage.response",
- EVENT: "postmessage.event"
- })
- }
- , {}],
- 161: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- MOVE: "sdk.move",
- ENTER_PANO: "sdk.enterpano",
- MODEL_LOADED: "sdk.modelloaded"
- })
- }
- , {}],
- 162: [function(e, t, i) {
- "use strict";
- t.exports = Object.freeze({
- FLY: "transition.fly",
- FADEOUT: "transition.fade",
- INSTANT: "transition.instant"
- })
- }
- , {}],
- 163: [function(e, t, i) {
- "use strict";
- t.exports = {
- current: "1.0",
- supported: ["1.0"],
- deprecated: [],
- isSupported: function(e) {
- return -1 !== this.supported.indexOf(e)
- },
- isDeprecated: function(e) {
- return -1 !== this.deprecated.indexOf(e)
- },
- isValid: function(e) {
- return this.isSupported(e) || this.isDeprecated(e)
- }
- }
- }
- , {}],
- 164: [function(q, X, e) {
- (function(e) {
- "use strict";
- function r(e, t, i) {
- e = e && e.toLowerCase().trim();
- var n = new C.UP.clone
- , r = Math.PI / 3
- , o = Math.PI / 2;
- switch (e) {
- case "left":
- i.copy(t),
- i.applyAxisAngle(n, o);
- break;
- case "right":
- i.copy(t),
- i.applyAxisAngle(n, -o);
- break;
- case "forwardleft":
- i.copy(t),
- i.applyAxisAngle(n, r);
- break;
- case "forwardright":
- i.copy(t),
- i.applyAxisAngle(n, -r);
- break;
- case "forward":
- default:
- i.copy(t)
- }
- return i
- }
- function o(e, t) {
- if (e) {
- var i = {
- pano: e,
- lookAtPoint: null,
- duration: null,
- maxDistanceOverride: null,
- skipWarpingCheck: !1
- };
- this.player.flyToPano(i, function() {
- t && t({
- success: !0,
- message: "Transition complete."
- })
- })
- } else
- M.warn("Showcase -> clickPanoObject: Unable to find pano."),
- t && t({
- success: !1,
- error: "Unable to find pano."
- })
- }
- function a(e, t) {
- t.copy(C.FORWARD),
- e.getDirection(t)
- }
- function c(i) {
- return {
- panos: i.panos.list.map(function(e) {
- var t = y.getCubemapUrls(i.urls, e.id, "high")[A.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
- return {
- uuid: e.id,
- aligned: e.alignmentType === g.ALIGNED,
- neighbourUUIDs: e.neighbourUUIDs.slice(),
- position: function(e) {
- return e.alignmentType !== g.ALIGNED ? null : {
- x: e.position.x,
- y: e.position.y,
- z: e.position.z
- }
- }(e),
- rotation: function(e) {
- var t = (new h.Euler).setFromQuaternion(e.quaternion, "YXZ");
- return {
- x: h.Math.radToDeg(t._x),
- y: h.Math.radToDeg(t._y),
- z: h.Math.radToDeg(t._z)
- }
- }(e),
- thumbnail: t
- }
- })
- }
- }
- 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"),
- q("../enum/PlayerEvents")), b = q("../sdk/SdkEvents"), w = (C = q("../enum/Vectors"),
- q("../enum/ControlEvents")), T = q("../enum/RenderLayers"), x = (q("../constants"),
- q("../settings")), S = q("../lib/jpeg_encoder"), M = new n(e), R = (N.active = !1,
- N.angle = 0,
- N.angleTravelled = 0,
- N.playerDirection = new h.Vector3,
- N.lastFacingDirection = new h.Vector3,
- N.onDone = null,
- N.player = null,
- N.start = function(e, t, i, n) {
- N.active = !0,
- e && t && (t = 0),
- N.angle = e || t,
- N.xAngle = e,
- N.yAngle = t,
- N.angleTravelled = 0,
- N.playerDirection.copy(i.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
- i.getDirection(N.playerDirection),
- N.lastFacingDirection.copy(N.playerDirection),
- N.projectVectors(),
- N.onDone = n,
- N.player = i,
- N()
- }
- ,
- N.projectVectors = function() {
- N.xAngle && (N.playerDirection.projectOnPlane(C.UP),
- N.lastFacingDirection.projectOnPlane(C.UP))
- }
- ,
- N), P = (i = new h.Vector3,
- function(e) {
- e ? (i.copy(e.position),
- i.add(e.discPosition),
- s.projectPositionToCanvas(i, this.player.camera, i),
- this.click(i.x, i.y)) : M.warn("Showcase -> clicktagObject: Unable to find tag.")
- }
- ), O = (l = new h.Vector3,
- function(e) {
- var t = this.player.getDirection();
- l.copy(t);
- var i = l.y;
- l.y = 0,
- l.normalize();
- var n = h.Math.radToDeg(l.angleTo(t)) * (i < 0 ? -1 : 1);
- if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.PANORAMA)
- return 0 !== e && M.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
- 0;
- this.player.mode === I.DOLLHOUSE && (n = -n);
- var r = function() {
- return this.player.mode === I.PANORAMA ? x.insideLookLimitUp : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.minPolarAngle) : null
- }
- .call(this) - .1
- , o = function() {
- return this.player.mode === I.PANORAMA ? x.insideLookLimitDown : this.player.mode === I.DOLLHOUSE ? 90 - h.Math.radToDeg(x.dollhouseDefault.maxPolarAngle) : null
- }
- .call(this) + .1
- , a = n + e;
- r < a ? a = r : a < o && (a = o);
- var s = a - n;
- return 0 < e && s < .01 && (s = 0),
- e < 0 && -.01 < s && (s = 0),
- s
- }
- ), L = (t = new h.Euler,
- function(e) {
- return t.setFromQuaternion(e.quaternion, "YXZ"),
- {
- position: {
- x: e.position.x,
- y: e.position.y,
- z: e.position.z
- },
- rotation: {
- x: h.Math.radToDeg(t.x),
- y: h.Math.radToDeg(t.y),
- z: 0
- },
- pano: e.currentPano ? e.currentPano.id : null,
- mode: e.mode
- }
- }
- ), D = null;
- function N() {
- N.playerDirection.copy(N.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
- N.player.getDirection(N.playerDirection),
- N.projectVectors();
- var e = N.playerDirection.angleTo(N.lastFacingDirection);
- (N.angleTravelled += Math.abs(e)) >= Math.abs(N.angle) ? (N.active = !1,
- N.onDone && (0,
- N.onDone)()) : (N.lastFacingDirection.copy(N.playerDirection),
- window.setTimeout(N, 4))
- }
- X.exports = {
- init: function(e, t, i, n, r) {
- Y.init(e, t, i, r),
- D = new Promise(function(e, t) {
- i.on(_.Ready, function() {
- e()
- })
- }
- .bind(this));
- var o = new u(window)
- , a = o.waitForConnection();
- a.then(function(e) {
- o.on(f.ACTION, Y.onMessageReceive.bind(Y))
- });
- var s, l = (s = Date.now(),
- function() {
- if (!(Date.now() - s < 100)) {
- var e = L(i);
- o.sendEvent(b.MOVE, {
- state: e
- }),
- s = Date.now()
- }
- }
- );
- i.on(_.Move, l),
- i.on(_.ViewChanged, l),
- n.on(p.ActiveModelChanged, function(e) {
- function t(e) {
- var t, i = e.newPano.id;
- e.oldPano && (t = e.oldPano.id),
- i !== t && o.sendEvent(b.ENTER_PANO, {
- oldPano: t,
- newPano: i
- })
- }
- var i = e.model
- , n = e.oldModel;
- Y.model = i,
- a.then(function() {
- o.sendEvent(b.MODEL_LOADED, {
- metadata: c(i)
- })
- }),
- n && n.panos.forEach(function(e) {
- e.removeEventListener("enter", t)
- }),
- i.panos.forEach(function(e) {
- e.on("enter", t)
- })
- })
- }
- };
- var F, B, V, k, U, H, z, G, W, j, Y = {
- director: null,
- player: null,
- controls: null,
- sceneRenderer: null,
- model: null,
- init: function(e, t, i, n) {
- this.director = e,
- this.player = i,
- this.controls = t,
- this.sceneRenderer = n
- },
- handleToObject: {},
- objectToHandle: {},
- handleCount: 0,
- onMessageReceive: function(e) {
- if (e) {
- var t = e.targetFunction
- , i = e.params
- , n = e.onDone;
- t && this[t] && this[t](i, n)
- }
- },
- waitForInit: function(e, t) {
- D.then(t.bind({
- success: !0,
- message: "Init complete."
- }))
- },
- moveToPano: (W = new h.Euler(0,0,0,"YXZ"),
- j = new h.Quaternion,
- function(e, t) {
- var i = e.pano
- , n = e.rotation
- , r = e.transition;
- if (!this.model)
- return t({
- success: !1,
- error: "The model has not been loaded yet"
- });
- var o = this.model.panos.get(i);
- if (!o)
- return t({
- success: !1,
- error: i + " does not exist in this model"
- });
- if (!n)
- return t({
- sucess: !1,
- erorr: n + " is not a valid rotation"
- });
- W.set(h.Math.degToRad(n.x || 0), h.Math.degToRad(n.y || 0), h.Math.degToRad(n.z || 0), "YXZ"),
- console.log(n.z);
- var a = {
- success: !0,
- message: i
- };
- if (r === v.FADEOUT)
- j.setFromEuler(W),
- this.player.warpToPano(o, j, null, null, E.BLACK, null, null, t.bind(this, a));
- else {
- var s, l;
- r === v.INSTANT && (l = s = 0);
- var c = C.FORWARD.clone().applyEuler(W).add(o.position);
- this.player.flyToPano({
- pano: o,
- lookAtPoint: c,
- duration: s,
- aimDuration: l
- }, t.bind(this, a))
- }
- }
- ),
- moveInDirection: function(e, t) {
- var i = e.direction;
- return void 0 === m[i] ? (M.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
- void (t && t({
- success: !1,
- error: "Invalid direction."
- }))) : void this.player.flyLocalDirection(C[i].clone()).then(function(e) {
- t(e ? {
- success: !0,
- message: "moved " + i
- } : {
- success: !1,
- error: "Cannot move in direction: " + i
- })
- })
- },
- getPose: function(e, t) {
- return this.player.camera.position,
- (new h.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ"),
- t({
- success: !0,
- message: L(this.player)
- })
- },
- takeScreenShot: (z = new h.PerspectiveCamera,
- G = new h.WebGLRenderTarget,
- function(e, t) {
- if (!e.resolution)
- return t({
- success: !1,
- error: "An invalid resolution was specified"
- });
- if (-1 === e.resolution.width || -1 === e.resolution.height) {
- var i = this.sceneRenderer.renderer.getSize();
- e.resolution.width = i.width,
- e.resolution.height = i.height
- }
- z.layers.set(T.DEFAULT),
- e.visibleObjects && (e.visibleObjects.showtags && z.layers.enable(T.TAG),
- e.visibleObjects.showPucks && z.layers.enable(T.PANOMARKERS),
- e.visibleObjects.showReticule && z.layers.enable(T.RETICULE));
- var n = e.resolution.width
- , r = e.resolution.height
- , o = n / r;
- z.position.copy(this.sceneRenderer.camera.position),
- z.quaternion.copy(this.sceneRenderer.camera.quaternion),
- z.projectionMatrix.copy(this.player.camera.projectionMatrix),
- z.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / o,
- G.setSize(n, r),
- this.sceneRenderer.renderer.render(this.sceneRenderer.scene, z, G);
- var a = new Uint8Array(n * r * 4);
- this.sceneRenderer.renderer.readRenderTargetPixels(G, 0, 0, n, r, a);
- var s = S.encode({
- data: a,
- width: n,
- height: r,
- heading: 180,
- pitch: 0
- }, {
- quality: 75,
- flipY: !0
- });
- t({
- success: !0,
- message: "data:image/jpg;base64," + d.uint8ToBase64(s.data)
- })
- }
- ),
- findRankedPano: (U = new h.Vector3,
- H = new h.Vector3,
- function(e, t) {
- a(this.player, H),
- r(t, H, U);
- var i = this.player.rankedPanoInDirection(e, U);
- if (i) {
- var n = this.objectToHandle[i.id];
- return n || (this.objectToHandle[i.id] = n = this.handleCount++,
- this.handleToObject[n] = i),
- n
- }
- return M.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
- -1
- }
- ),
- findRankedtag: (V = new h.Vector3,
- k = new h.Vector3,
- function(e, t) {
- a(this.player, k),
- r(t, k, V);
- var i = this.player.rankedtagInDirection(e, V);
- if (i) {
- var n = this.objectToHandle[i.sid];
- return n || (this.objectToHandle[i.sid] = n = this.handleCount++,
- this.handleToObject[n] = i),
- n
- }
- return M.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
- -1
- }
- ),
- clickNearesttag: function(e) {
- this.clickRankedtag(0, e)
- },
- clickRankedtag: function(e, t) {
- var i = function(e, t) {
- var i = this.findRankedtag(e, t);
- return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
- null)
- }
- .call(this, e, t);
- i && P.call(this, i)
- },
- clickNearestPano: function(e, t) {
- this.clickRankedPano(0, e, t)
- },
- clickRankedPano: function(e, t, i) {
- var n = function(e, t) {
- var i = this.findRankedPano(e, t);
- return 0 <= i ? this.handleToObject[i] : (M.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
- null)
- }
- .call(this, e, t);
- n ? o.call(this, n, i) : i(null)
- },
- clickPano: function(e, t) {
- var i = this.handleTable[e];
- i ? o.call(this, i, t) : t(null)
- },
- rotateDirection: function(e, t) {
- var i = e.direction
- , n = e.angle;
- if (!R.active) {
- var r = 0
- , o = 0
- , a = 0
- , s = 0;
- if (!n || isNaN(n))
- return M.warn("Showcase -> rotateDirection: Invalid rotation angle."),
- void (t && t({
- success: !1,
- error: "Invalid rotation angle."
- }));
- if (this.player.mode === I.TRANSITIONING)
- return M.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
- void (t && t({
- success: !1,
- error: "Cannot rotate while transitioning"
- }));
- if (i === m.RIGHT || i === m.LEFT)
- i === m.RIGHT && (n = -n),
- r = 0 < n ? -1 : 1,
- a = n;
- else {
- if (i !== m.UP && i !== m.DOWN)
- return M.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
- void (t && t({
- success: !1,
- error: "Invalid direction for rotation."
- }));
- if (this.player.mode === I.FLOORPLAN)
- return M.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
- void (t && t({
- success: !1,
- error: "Cannot rotate " + i + " in floorplan mode"
- }));
- if (i === m.DOWN && (n = -n),
- 0 === (n = O.call(this, n)))
- return M.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
- void (t && t({
- success: !1,
- error: "Already at maximum rotation in direction: " + i
- }));
- o = 0 < n ? 1 : -1,
- s = n
- }
- var l = n;
- n = h.Math.degToRad(n),
- a = h.Math.degToRad(a),
- s = h.Math.degToRad(s);
- var c = this.controls.activeControl;
- c.startRotating(r, o),
- R.start(a, s, this.player, function() {
- c.stopRotating(!0),
- t && t({
- success: !0,
- message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
- })
- })
- }
- },
- rotate: (F = new h.Vector3,
- B = new h.Vector3,
- function(e, t) {
- var i = e.xAngle
- , n = e.yAngle;
- if (!R.active) {
- if (i = i || 0,
- n = n || 0,
- isNaN(i) || isNaN(n))
- return M.warn("Showcase -> rotate: Invalid rotation angle."),
- void (t && t({
- success: !1,
- error: "Invalid rotation angle."
- }));
- if (this.player.mode === I.TRANSITIONING)
- return M.warn("Automation -> rotate: Cannot rotate while transitioning"),
- void (t && t({
- success: !1,
- error: "Cannot rotate while transitioning"
- }));
- Math.abs(i) < .01 && (i = 0),
- Math.abs(n) < .01 && (n = 0);
- var r = n;
- n = O.call(this, n);
- var o = 0 < r ? "UP" : "DOWN";
- if (!(i = -i) && r && !n)
- return M.warn("Showcase -> rotate: Already at maximum rotation in direction: " + o),
- void (t && t({
- success: !1,
- error: "Already at maximum rotation in direction: " + o
- }));
- n < r && M.warn("Showcase -> rotate: Reached maximum rotation in direction: " + o);
- var a = n;
- n = h.Math.degToRad(n),
- i = h.Math.degToRad(i),
- F.copy(this.player.mode === I.FLOORPLAN ? C.UP : C.FORWARD),
- this.player.getDirection(F),
- B.copy(F).applyAxisAngle(C.UP, i),
- B.applyAxisAngle(C.RIGHT, n);
- var s = (F.angleTo(B),
- 0 < i ? -1 : i < 0 ? 1 : 0)
- , l = 0 < n ? 1 : n < 0 ? -1 : 0;
- Math.abs(i) > Math.abs(n) ? l *= Math.abs(n / i) : Math.abs(n) > Math.abs(i) && (s *= Math.abs(i / n));
- var c = this.controls.activeControl;
- c.startRotating(s, l),
- R.start(i, n, this.player, function() {
- c.stopRotating(!0),
- t && t({
- success: !0,
- message: "Rotated " + e.xAngle.toFixed(2) + "° horizontally, " + a.toFixed(2) + "° vertically"
- })
- })
- }
- }
- ),
- panCamera: function(e, i) {
- function t(e) {
- switch (r.removeAllListeners(w.AutoPanComplete),
- r.removeAllListeners(w.AutoPanInterrupt),
- r.removeAllListeners(w.AutoPanClamped),
- e) {
- case w.AutoPanInterrupt:
- i({
- success: !0,
- message: "Camera panning interrupted."
- });
- break;
- case w.AutoPanClamped:
- if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
- if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
- return void i({
- success: !1,
- error: "Already at edge of current model bounds."
- });
- var t = "The view point is outside the bounds for the current model. ";
- t += "The view point was clamped to " + o(r.target.x, r.target.z),
- console.warn(t)
- }
- case w.AutoPanComplete:
- i({
- success: !0,
- message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
- })
- }
- }
- if (this.player.mode !== I.DOLLHOUSE && this.player.mode !== I.FLOORPLAN)
- return i({
- success: !1,
- error: "Camera panning is not available in the current mode: " + this.player.mode
- });
- var n = e.position
- , r = this.player.control;
- r.setAutoPanPosition(n.x, n.z),
- r.autoPan = !0;
- var o = function(e, t) {
- return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
- };
- r.on(w.AutoPanComplete, t.bind(this, w.AutoPanComplete)),
- r.on(w.AutoPanInterrupt, t.bind(this, w.AutoPanInterrupt)),
- r.on(w.AutoPanClamped, t.bind(this, w.AutoPanClamped))
- },
- click: function(e, t) {
- var i = e.x
- , n = e.y;
- !0 === e.percentage && (i = i / 100 * $("#player").width(),
- n = n / 100 * $("#player").height()),
- this.player.handleInputStart(i, n),
- this.player.updateIntersect(),
- this.player.handleInputEnd(i, n)
- },
- mouseOver: function(e, t) {
- var i = e.x
- , n = e.y;
- !0 === e.percentage && (i = i / 100 * $("#player").width(),
- n = n / 100 * $("#player").height()),
- this.player.handleInputMove(i, n),
- this.player.updateIntersect()
- },
- moveToMode: function(e, t) {
- function i(e) {
- t(e ? {
- success: !1,
- error: "Failed to load new mode: " + e
- } : {
- success: !0,
- message: "Moved to new mode: " + n
- })
- }
- var n = e.mode;
- n === I.PANORAMA || n === I.DOLLHOUSE || n === I.FLOORPLAN ? this.director.changeMode(n).then(function() {
- i()
- }, function(e) {
- i(e)
- }) : t({
- success: !1,
- error: "Invalid mode selection"
- })
- }
- }
- }
- ).call(this, "/js/sdk/automation.js")
- }
- , {
- "../constants": 8,
- "../enum/AlignmentType": 17,
- "../enum/ControlEvents": 21,
- "../enum/Direction": 22,
- "../enum/GLCubeFaces": 25,
- "../enum/Keys": 30,
- "../enum/ModelManagerEvents": 33,
- "../enum/PlayerEvents": 40,
- "../enum/RenderLayers": 41,
- "../enum/Vectors": 50,
- "../enum/Viewmode": 51,
- "../enum/WarpStyle": 52,
- "../lib/jpeg_encoder": 94,
- "../sdk/SdkEvents": 161,
- "../settings": 166,
- "../util/common": 185,
- "../util/logger": 189,
- "../util/math": 190,
- "../util/panorama": 191,
- "./ApiHost": 159,
- "./PostMessageType": 160,
- "./TransitionStyles": 162,
- three: 217
- }],
- 165: [function(e, t, i) {
- "use strict";
- function n(e) {
- this.sourceWindow = e,
- this.targetWindow = null,
- this.targetOrigin = null,
- this.id = Math.floor(1e5 * Math.random()),
- this.bindEvents()
- }
- var r = e("./PostMessageType")
- , o = e("events").EventEmitter;
- (n.prototype = Object.create(o.prototype)).bindEvents = function() {
- this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
- }
- ,
- n.prototype.setTarget = function(e, t) {
- this.targetWindow = e,
- this.targetOrigin = t
- }
- ,
- n.prototype.onPostmessageReceived = function(e) {
- var t = e.origin || e.originalEvent.origin
- , i = e.source;
- switch (e.data.type) {
- case r.CONNECT:
- break;
- case r.RESPONSE:
- if (this.id !== e.data.toId)
- return;
- default:
- if (!this.validateMessageOrigin(t))
- return
- }
- var n = e.data;
- n.source = i,
- n.origin = t,
- n.timestamp = Date.now(),
- this.emit(e.data.type, n)
- }
- ,
- n.prototype.validateMessageOrigin = function(e) {
- return "*" === this.targetOrigin || e === this.targetOrigin
- }
- ,
- n.prototype.send = function(e) {
- this.targetWindow && this.targetOrigin && (e.fromId = this.id,
- this.targetWindow.postMessage(e, this.targetOrigin))
- }
- ,
- t.exports = n
- }
- , {
- "./PostMessageType": 160,
- events: 202
- }],
- 166: [function(e, t, i) {
- "use strict";
- var n = e("three")
- , r = e("./util/browser")
- , o = e("./enum/Viewmode")
- , a = e("./enum/VROption")
- , s = e("./enum/Colors")
- , l = e("./enum/WarpStyle")
- , c = e("./util/easing")
- , h = e("./util/common")
- , u = e("./util/showcase")
- , d = e("./constants")
- , p = {
- debug: !1,
- version: "2.25.6-0-gd87e5b1",
- languageTag: r.valueFromHash("lang", null),
- pageTitle: "四维虚拟漫游",
- authorizationHeader: u.getAuthorizationHeader(),
- autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
- logLevel: r.valueFromHash("log", 2),
- skyboxRadius: 2500,
- modelBoundsPadding: 5,
- showNeighbors: !1,
- brand: r.valueFromHash("brand", !0),
- showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
- startHighlights: r.valueFromHash("hl", -1),
- specialEdition: r.valueFromHash("bn", 0),
- useWheel: r.valueFromHash("wh", !0),
- crossOrigin: "anonymous",
- fancierTransition: !1,
- wireframe: !1,
- skyboxWireframe: !1,
- modelAlpha: 1,
- highlightPanoSelection: !1,
- showSweeps: !0,
- showSkyboxes: !1,
- showMesh: !0,
- showFloors: !1,
- showFloorDuration: 300,
- showFloorDelay: 300,
- hideFloorDuration: 300,
- hideFloorDelay: 0,
- reticuleOpacityTransitionTime: 250,
- reticuleColor: window.MP_PREFETCHED_MODELDATA.mouseMarkerColor || s.newBlue,
- markerOpacityTransitionTime: 500,
- guiAnimationSpeed: 250,
- highlightAnimationDuration: 500,
- modelComponentLoadSpinnerDelay: 150,
- captureErrors: !1,
- maxMobileTextures: 6,
- minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
- startupFlyinDelay: 3e3,
- dollhouseDefault: {
- minDistance: 1,//15, //编辑页面给近一些
- maxDistance: 50,
- minPolarAngle: n.Math.degToRad(10),
- maxPolarAngle: n.Math.degToRad(90)
- },
- hideReticuleTimeout: 1e3,
- analytics: {
- inactivityThreshold: 30,
- sessionTrackingRate: .15,
- maxTrackedErrors: 20,
- sessionDurationPingFrequency: 10,
- sessionDurationTimeout: 15
- },
- flydown: {
- movementEasing: "easeInOutQuad",
- movementDelay: .001,
- rotationEasing: "easeInOutQuad",
- rotationDelay: .5,
- modelTextureDelay: .75,
- skyboxDelay: .75
- },
- transition: {
- flySpeed: .001,
- flyTime: 750,
- flytimeMaxDistanceThreshold: 5,
- flytimeDistanceMultiplier: 150,
- aimTime: 1500,
- aimSlowFactor: 1.5,
- blur: .8,
- movementEasing: "easeInOutQuad",
- blendEasing: "easeInOutQuad",
- fastForwardFactor: 3
- },
- show360Views: {
- enabled: !0,
- transitionTime: 1e3
- },
- quickstart: {
- enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
- animation: 1400,
- showTextDelay: 500,
- fadeOutDelay: 3e3,
- fovChange: 10
- },
- appConfig: {
- webvr_version: null,
- segment_key: null,
- embedly_key: null,
- branch_key: null,
- keen_write_key: null,
- keen_project_id: null
- },
- vr: {
- enabled: !0,
- allowWebVR: !1,
- option: r.valueFromHash("vr", a.CONTEXTUAL)
- },
- share: {
- enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
- },
- input: {
- longTapThreshold: 200,
- moveToleranceNDC: .08,
- touchMoveThreshold: 25
- },
- help: {
- modalStayDuration: 600
- },
- immersive: {
- timeToShowAgain: 1250,
- uiStayDuration: 600
- },
- tourInteraction: {
- disabled: "0" === r.valueFromHash("tourcta", null),
- showPauseButton: 1e3,
- showModal: 1500,
- allowNextClick: 200,
- largeModal: "1" === r.valueFromHash("tourcta", null),
- smallModal: "2" === r.valueFromHash("tourcta", null)
- },
- labels: {
- enabled: !1,
- hideUntilStart: !0,
- fadeInDuration: 250,
- fadeInDelay: 250,
- fadeOutDuration: 250,
- fadeOutDelay: 0,
- zoomHideThreshhold: {
- mobile: r.isSmallScreen() ? .45 : .6,
- desktop: 2
- },
- zoomTruncateThreshhold: {
- mobile: r.isSmallScreen() ? .35 : .45,
- desktop: .85
- },
- minLengthForTruncate: 16,
- truncateLength: 12,
- truncateSuffix: "..."
- },
- tags: {
- enabled: r.valueFromHash("mt", 1),
- startup: {
- hideUntilStart: !0,
- fadeInDuration: 500,
- fadeInDelay: 100
- },
- visibility: {
- anyDistance: !0,
- visibleDistance: 8,
- cameraClearance: .1,
- alphaTestLevel: .05,
- hideViaFloor: !0,
- hideOffScreenDisc: !1,
- hideOffScreenObject: !1
- },
- disc: {
- opacity: 1,
- disabledOpacity: .5,
- scale: {
- nearBound: 1.5,
- farBound: 4.8,
- linkFarBound: !1,
- linkPercent: 40,
- maxSize: 80,
- minSize: 40,
- baseViewportSize: 800,
- responsiveness: 100
- }
- },
- pole: {
- enabled: !0,
- height: .5,
- width: 2,
- opacity: .5,
- color: "white"
- },
- navigate: {
- nearestPano: !0,
- lineOfSight: !0,
- reactivate: !0,
- aimAt: "disc",
- tiltTolerance: 25,
- rotateSpeedFactor: .6
- }
- },
- path: {
- color: window.MP_PREFETCHED_MODELDATA.floorMarkerColor || s.newBlue,
- colorUp: s._desat(s.newBlue, .5),
- colorDown: s._darken(s.newBlue, .35),
- opacity: .5,
- style: "ribbon",
- height: .025,
- ribbonWidth: .24,
- outsideHeight: .5,
- waypointRadius: .5,
- waypointIndoorRadius: .24,
- waypointPulse: 1e3,
- typ: l.BLACK,
- meshFree: r.valueFromHash("mf", 1),
- mapGuides: r.valueFromHash("guides", !0),
- fadeInTime: 400,
- fadeOutTime: 300
- },
- warp: {
- nearPanoDist: .1,
- matchCam: !1,
- blur: .33,
- fastTime: 1500,
- teleportTime: 1500,
- outsideTime: 2e3,
- lookAheadMax: .3,
- lookAheadDist: 2.5,
- softPushDist: .37,
- softPushEnd: .3,
- softBendAngle: 8,
- softBendTilt: 4,
- softBendEnd: .3,
- doBurns: !0,
- burnsAngle: 8,
- minBurnsAngle: 35,
- minDownAngle: -35,
- maxTurnPerSec: 280,
- maxAimPerSec: 35,
- minRotation: 12,
- maxAimRotation: 33.2,
- turnFriction: .2,
- flySpeed: .01,
- minWarpTime: 1200,
- warpInterruptionRedirectTime: 500,
- tourStepDelay: r.valueFromHash("st", 0),
- walkDelay: 0,
- walkMaxDist: 50,
- walkMinDist: .8,
- walkSlideShowThreshhold: 3e3,
- walkExtraPanosDistance: .4,
- timePerMeter: 1200,
- motionLeadTime: 5e3,
- movementEasing: "easeInOutQuad",
- blendEasing: "easeInOutQuad",
- showBunny: !1,
- loop: r.valueFromHash("lp", !1),
- auto: r.valueFromHash("ts", -1),
- eOrder: "YXZ",
- stepFactor: .25,
- brakeStrength: 2,
- minBrakeAngle: .1,
- maxBrakeAngle: 1.8,
- climbEffort: 4
- },
- rotationFriction: .05,
- rotationAccelerationInside: 4.5,
- rotationAccelerationOutside: .15,
- rotationAfterMoveMultiplier: 40,
- rotationAfterMoveHistoryCount: 5,
- panFriction: .09,
- panAccelerationOutside: 60,
- onload: r.valueFromHash("onload", o.PANORAMA),
- zoomNearLimit: .1,
- zoomFarLimit: 10,
- navigation: {
- panoScores: !1,
- mouseDirection: !0,
- filterStrictness: .75,
- angleFactor: -30,
- directionFactor: 10,
- distanceFactor: -1,
- optionalityFactor: 3
- },
- sdkInit: !1,
- secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
- console: r.valueFromHash("console", !1),
- noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
- panoramaNeighbourMaxDistance: 5,
- panoFloorClickRadius: .35,
- showScreenshotLocations: !1,
- showAxis: !1,
- showNeighbourRaycasts: !1,
- colorMarkerOnLoad: !1,
- colorMarkerByFloor: !1,
- tiling: {
- panoPreRenderRepeatDelay: 2500,
- panoPreRenderDelay: 500,
- preRenderTourPanos: r.valueFromHash("tileprerender", 0),
- tilingFlagNames: ["usetiles", "tiles"],
- maxNavPanoQuality: r.valueFromHash("maxtileq", null),
- maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
- overlayStyle: r.valueFromHash("tileoverlay", 0),
- uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
- initialIntervalDelay: r.valueFromHash("itiledelay", 0),
- maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
- maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
- customCompression: r.valueFromHash("tilecustcomp", 0),
- mobileHighQualityOverride: 1,
- allowUltraHighResolution: !0
- },
- zoom: {
- enabled: !0,
- forceOff: r.valueFromHash("nozoom", 0),
- overridemax: r.valueFromHash("maxzoom", null),
- overridemin: r.valueFromHash("minzoom", null),
- max: d.highQualityMaxZoom,
- min: 1,
- transitionStyle: r.valueFromHash("zoomtrans", 1),
- activationThreshold: 1.1,
- restoreTime: 500
- },
- profiling: {
- enabled: r.valueFromHash("mem", !1)
- }
- };
- (p = h.deepExtend(p, d, {
- insideFOV: r.valueFromHash("fov", d.insideFOV),
- insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
- panorama: {
- transitionTime: 1e3,
- modelAlpha: 0,
- modelAlphaDelay: p.flydown.modelTextureDelay,
- modelAlphaLength: 1,
- skyboxOpacity: 1,
- skyboxOpacityDelay: p.flydown.skyboxDelay,
- skyboxOpacityLength: .9,
- fovLength: 1,
- fovDelay: 0,
- cameraMatrixDuration: .8,
- cameraMatrixDelay: 0,
- cameraMatrixEase: c.easeInCubic,
- reticuleOpacity: 1,
- markerOpacity: .3,
- markerOpacityOnHover: 1
- },
- dollhouse: {
- transitionTime: 1e3,
- modelAlpha: 1,
- modelAlphaDelay: 0,
- modelAlphaLength: 1 - p.flydown.modelTextureDelay,
- skyboxOpacity: 0,
- skyboxOpacityDelay: 0,
- skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
- fovLength: 1,
- fovDelay: 0,
- cameraMatrixDuration: .8,
- cameraMatrixDelay: .3,
- cameraMatrixEase: c.easeInCubic,
- reticuleOpacity: 1,
- markerOpacity: 0,
- markerOpacityOnHover: 0
- },
- floorplan: {
- transitionTime: 1e3,
- modelAlpha: 1,
- modelAlphaDelay: 0,
- modelAlphaLength: 1 - p.flydown.modelTextureDelay,
- skyboxOpacity: 0,
- skyboxOpacityDelay: 0,
- skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
- fovLength: 1,
- fovDelay: 0,
- cameraMatrixDuration: .5,
- cameraMatrixDelay: 0,
- cameraMatrixEase: c.easeOutCubic,
- reticuleOpacity: 1,
- markerOpacity: 0,
- markerOpacityOnHover: 0,
- cameraHeight: 50
- },
- transitioning: {
- reticuleOpacity: 0,
- markerOpacity: .3,
- markerOpacityOnHover: 1
- },
- "floorplan-dollhouse": {
- rotationDelay: 0,
- rotationDuration: 1
- },
- "floorplan-panorama": {
- rotationDelay: .5,
- rotationDuration: 1
- },
- "dollhouse-panorama": {
- rotationDelay: .5,
- rotationDuration: 1
- },
- "dollhouse-floorplan": {
- rotationDelay: 0,
- rotationDuration: 1,
- cameraMatrixDuration: 1.05,
- cameraMatrixDelay: .5
- },
- "panorama-dollhouse": {
- rotationDelay: 0,
- rotationDuration: .5
- },
- "panorama-floorplan": {
- transitionTime: 1500,
- rotationDelay: 0,
- rotationDuration: .5
- }
- })).path.meshFree && (p.path.typ = l.WALK),
- p.zoom.max = p.zoom.overridemax || p.zoom.max,
- p.zoom.min = p.zoom.overridemin || p.zoom.min,
- t.exports = p
- }
- , {
- "./constants": 8,
- "./enum/Colors": 19,
- "./enum/VROption": 47,
- "./enum/Viewmode": 51,
- "./enum/WarpStyle": 52,
- "./util/browser": 182,
- "./util/common": 185,
- "./util/easing": 186,
- "./util/showcase": 193,
- three: 217
- }],
- 167: [function(e, t, i) {
- "use strict";
- var n = e("three")
- , r = e("./settings")
- , 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"
- , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
- t.exports = {
- basicTextured: {
- uniforms: {
- tDiffuse: {
- type: "t",
- value: null
- },
- alpha: {
- type: "f",
- value: 1
- }
- },
- vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
- 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}"
- },
- copyCubeMap: {
- uniforms: {
- tDiffuse: {
- type: "t",
- value: null
- },
- alpha: {
- type: "f",
- value: 1
- }
- },
- 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}",
- 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}"
- },
- cube: {
- uniforms: {
- map: {
- type: "t",
- value: null
- },
- opacity: {
- type: "f",
- value: 1
- }
- },
- vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
- 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"
- },
- model: {
- uniforms: {
- map: {
- type: "t",
- value: null
- },
- modelAlpha: {
- type: "f",
- value: r.modelAlpha
- },
- opacity: {
- type: "f",
- value: 1
- },
- progress: {
- type: "f",
- value: 0
- },
- blackout: {
- type: "i",
- value: 0
- },
- pano0Map: {
- type: "t",
- value: null
- },
- pano0Position: {
- type: "v3",
- value: new n.Vector3
- },
- pano0Matrix: {
- type: "m4",
- value: new n.Matrix4
- },
- pano1Map: {
- type: "t",
- value: null
- },
- pano1Position: {
- type: "v3",
- value: new n.Vector3
- },
- pano1Matrix: {
- type: "m4",
- value: new n.Matrix4
- }
- },
- 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",
- 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"
- },
- hot: {
- uniforms: {
- color: {
- type: "c",
- value: new n.Color(16720384)
- },
- opac: {
- type: "f",
- value: 0
- },
- texture1: {
- type: "t",
- value: null
- },
- texture2: {
- type: "t",
- value: null
- }
- },
- vertexShader: "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
- 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"
- },
- modelOutside: {
- uniforms: {
- map: {
- type: "t",
- value: null
- },
- opacity: {
- type: "f",
- value: 1
- }
- },
- vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
- 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"
- },
- ribbon: {
- uniforms: {
- map: {
- type: "t",
- value: null
- },
- opacity: {
- type: "f",
- value: 1
- },
- color: {
- type: "c",
- value: new n.Color(r.path.color)
- }
- },
- 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",
- 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"
- },
- waypoint: {
- uniforms: {
- map: {
- type: "t",
- value: null
- },
- opacity: {
- type: "f",
- value: 1
- },
- pulse: {
- type: "f",
- value: 1
- },
- nearFade: {
- type: "v2",
- value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
- },
- color: {
- type: "c",
- value: new n.Color(r.reticuleColor)
- }
- },
- 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",
- 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"
- },
- modelDebug: {
- uniforms: {
- map: {
- type: "t",
- value: null
- },
- modelAlpha: {
- type: "f",
- value: r.modelAlpha
- },
- depthmapRatio: {
- type: "f",
- value: 0
- },
- opacity: {
- type: "f",
- value: 1
- },
- progress: {
- type: "f",
- value: 0
- },
- considerOcclusion: {
- type: "i",
- value: r.fancierTransition
- },
- highlightPanoSelection: {
- type: "i",
- value: 0
- },
- useThirdPano: {
- type: "i",
- value: r.useThirdPano
- },
- pano0Map: {
- type: "t",
- value: null
- },
- pano0Depth: {
- type: "t",
- value: null
- },
- pano0Position: {
- type: "v3",
- value: new n.Vector3
- },
- pano0Matrix: {
- type: "m4",
- value: new n.Matrix4
- },
- pano0Weight: {
- type: "f",
- value: r.transition.pano0Weight
- },
- pano1Map: {
- type: "t",
- value: null
- },
- pano1Depth: {
- type: "t",
- value: null
- },
- pano1Position: {
- type: "v3",
- value: new n.Vector3
- },
- pano1Matrix: {
- type: "m4",
- value: new n.Matrix4
- },
- pano1Weight: {
- type: "f",
- value: r.transition.pano1Weight
- },
- pano2Map: {
- type: "t",
- value: null
- },
- pano2Depth: {
- type: "t",
- value: null
- },
- pano2Position: {
- type: "v3",
- value: new n.Vector3
- },
- pano2Matrix: {
- type: "m4",
- value: new n.Matrix4
- },
- pano2Weight: {
- type: "f",
- value: r.transition.pano2Weight
- }
- },
- 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",
- 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"
- },
- customDepth: {
- uniforms: {
- panoPosition: {
- type: "v3",
- value: new n.Vector3
- }
- },
- 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",
- 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"
- },
- skysphere: {
- uniforms: {
- radius: {
- type: "f",
- value: 0
- }
- },
- 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",
- 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"
- },
- tagDisc: {
- uniforms: {
- opacity: {
- type: "f",
- value: 0
- },
- color: {
- type: "c",
- value: new n.Color
- },
- bg: {
- type: "t",
- value: null
- },
- mask: {
- type: "t",
- value: null
- }
- },
- vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
- 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"
- }
- }
- window.shaders = t.exports;
- }
- , {
- "./settings": 166,
- three: 217
- }],
- 168: [function(E, _, e) {
- (function(e) {
- "use strict";
- var t = E("three")
- , i = (E("url"),
- E("./util/ajax"))
- , n = E("./settings")
- , r = E("./util/logger")
- , o = E("./util/math")
- , a = E("./util/showcase")
- , s = E("./objects/Panorama")
- , l = new r(e)
- , c = E("./model/Model")
- , h = E("./shaders")
- , u = E("./util/transitions")
- , d = E("./objects/Chunk")
- , p = E("./objects/Reticule")
- , f = E("./objects/Skybox")
- , g = E("./objects/Floor")
- , m = E("./cameras/DollhouseCamera")
- , v = E("./cameras/FloorplanCamera")
- , y = E("./cameras/PanoramaCamera")
- , A = E("./controls/DollhouseControls")
- , C = E("./controls/FloorplanControls")
- , I = E("./controls/PanoramaControls");
- t.ImageUtils.crossOrigin = n.crossOrigin,
- _.exports = {
- shaders: h,
- transitions: u,
- Model: c,
- Chunk: d,
- Floor: g,
- Skybox: f,
- Reticule: p,
- Panorama: s,
- DollhouseCamera: m,
- FloorplanCamera: v,
- PanoramaCamera: y,
- DollhouseControls: A,
- FloorplanControls: C,
- PanoramaControls: I,
- getModel: function(e) {
- if (!e.url)
- throw 'getModel(): missing parameter "url"';
- e.autoload = void 0 === e.autoload || e.autoload;
- var t = a.parseSidUrl(e.url);
- e.urlBase = t.urlBase,
- e.urlModel = t.urlModel,
- e.urlFiles = t.urlFiles;
- var i = this._getPlatformError();
- return i ? $.Deferred().reject(i).promise() : (this.options = e,
- this._loadModel().then(this._buildModel.bind(this)))
- },
- _getPlatformError: function() {
- 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"
- },
- _loadModel: function() {
- return i.get(this.options.urlModel, {
- responseType: "json",
- prefetchFrom: "model",
- auth: a.getAuthorizationHeader()
- }).then(null, function() {
- return l.warn("Model loading failed at initial metadata load"),
- "loading-failed"
- })
- },
- _buildModel: function(e) {
- e = a.normalizeModeldata(e, o);
- var t = new c(this.options,e);
- return this.options.autoload ? t.load(!0) : $.when(t)
- }
- }
- }
- ).call(this, "/js/showcase.js")
- }
- , {
- "./cameras/DollhouseCamera": 5,
- "./cameras/FloorplanCamera": 6,
- "./cameras/PanoramaCamera": 7,
- "./controls/DollhouseControls": 10,
- "./controls/FloorplanControls": 11,
- "./controls/PanoramaControls": 13,
- "./model/Model": 139,
- "./objects/Chunk": 144,
- "./objects/Floor": 146,
- "./objects/Panorama": 148,
- "./objects/Reticule": 149,
- "./objects/Skybox": 152,
- "./settings": 166,
- "./shaders": 167,
- "./util/ajax": 181,
- "./util/logger": 189,
- "./util/math": 190,
- "./util/showcase": 193,
- "./util/transitions": 195,
- three: 217,
- url: 208
- }],
- 169: [function(e, t, i) {
- "use strict";
- function l(e) {
- var t = {
- renderTarget: null,
- inUse: !1,
- size: -1,
- pano: null
- };
- return t.inUse = !0,
- t.size = e,
- function(e) {
- O.push(e)
- }(t),
- t
- }
- function c(e) {
- for (var t = 0; t < O.length; t++) {
- var i = O[t];
- if (i.renderTarget === e)
- return !(i.inUse = !1)
- }
- return !1
- }
- function n() {
- this.tileDirectory = {},
- this.activeRenderTargetDescriptors = {},
- this.activePanos = [],
- this.panoLODDescriptors = {},
- this.panoDescriptors = {},
- this.tileTrees = {},
- this.sceneRenderer = null,
- this.tileDownloader = null,
- this.forceQueue = [],
- this.uploadQueues = {},
- this.uploadInterval = null,
- this.uploadIntervalCancelled = !1,
- this.usingTileOverlay = !1,
- this.overlayTilesLoaded = !1,
- this.overlayTileBase = null,
- this.overlayTilesBasic = {},
- this.overlayTilesEnhanced = {},
- this.zoomRenderTarget = null,
- this.zoomPano = null,
- this.zoomingActive = !1,
- this.zoomPanoId = null,
- this.zoomPanoRenderingDisabled = !1,
- this.direction = new _.Vector3,
- this.initTime = -1,
- this.maxBaseUploadsPerFrame = R,
- this.maxNonBaseUploadsPerFrame = M
- }
- 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"),
- e("../enum/PanoRendererEvents")), f = e("../enum/SceneRendererEvents"), g = e("../enum/TileDownloaderEvents"), m = e("../enum/Vectors"), v = (e("../enum/GLCubeFaces"),
- e("../objects/Panorama"),
- e("./TileTree")), y = (e("./TileDownloader"),
- e("./TilePrioritizer")), A = e("./TileUtils"), C = (p = e("../enum/PanoSizeClass"),
- e("../util/browser"),
- 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 = {
- Base: 0,
- Remaining: 1
- }, O = [];
- function L(e) {
- var t = e.shift();
- return t.uploadQueued = !1,
- t
- }
- (n.prototype = Object.create(w.prototype)).init = function(e, t, i) {
- this.sceneRenderer = e,
- this.tileDownloader = t,
- this.qualityManager = i,
- this.bindEvents(),
- this.sceneRenderer.on(f.ContextCreated, this.loadOverlayTiles.bind(this)),
- this.initTime = performance.now()
- }
- ,
- n.prototype.getActivePanoTextures = function(e) {
- e = e || [];
- for (var t = 0; t < O.length; t++) {
- var i = O[t];
- i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
- }
- }
- ,
- n.prototype.hasQueuedTiles = function() {
- var e = this.peekNextFromUploadQueue();
- return null != e
- }
- ,
- n.prototype.getActiveRenderTargetDescriptor = function(e) {
- return this.activeRenderTargetDescriptors[e]
- }
- ,
- n.prototype.setActiveRenderTargetDescriptor = function(e, t) {
- this.activeRenderTargetDescriptors[e] = t
- }
- ,
- n.prototype.loadOverlayTiles = function() {
- if (0 !== d.tiling.overlayStyle) {
- var n = 0
- , e = function(e, t, i) {
- e = t ? e[t] = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(A.TILE_SIZE, _.ClampToEdgeWrapping),
- this.sceneRenderer.uploadTexture2D(i, e, 0, 0, A.TILE_SIZE, A.TILE_SIZE),
- ++n === r.length && (this.overlayTilesLoaded = !0)
- }
- .bind(this)
- , 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)]];
- r.forEach(function(e) {
- this.tileDownloader.loadImage(e[0], 0, e[1])
- }
- .bind(this)),
- this.usingTileOverlay = !0
- } else
- this.usingTileOverlay = !1
- }
- ,
- n.prototype.bindEvents = function() {
- this.tileDownloader.on(g.TileDownloadSuccess, this.onTileDownloaded.bind(this))
- }
- ,
- n.prototype.setupZoomRenderTarget = function() {
- if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
- if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
- return;
- var e = this.zoomRenderTarget;
- if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
- e) {
- var t = e.width
- , i = this.zoomRenderTarget.width;
- this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
- e.texture.dispose(),
- e.texture.loaded = !1,
- e.texture.version = 0,
- this.sceneRenderer.deallocateCubeTexture(e.texture),
- e.texture = null
- }
- this.zoomPanoRenderingDisabled = !1
- } else
- this.zoomPanoRenderingDisabled = !0
- }
- ,
- n.prototype.enableUltraHighQualityMode = function(t) {
- if (!this.qualityManager.ultraHighQualityModeEnabled()) {
- var e = this.qualityManager.getPanoSize(p.ULTRAHIGH);
- this.tileDownloader.testDownload(e, A.TILE_SIZE, function(e) {
- e && (this.qualityManager.enableUltraHighQualityMode(),
- this.setupZoomRenderTarget(),
- t())
- }
- .bind(this))
- }
- }
- ,
- n.prototype.activateTiledPano = function(e, t, i) {
- i && this.clearAllQueuedUploads();
- for (var n = 0; n < A.FACES_PER_PANO; n++)
- this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
- this.linkAllTilesAndNodes(e);
- var r = this.getActiveRenderTargetDescriptor(e.id)
- , o = t;
- if (o > this.qualityManager.getMaxNavPanoSize() && (o = this.qualityManager.getMaxNavPanoSize()),
- !r || o !== r.size) {
- if (r && c(r.renderTarget),
- !(r = function(e) {
- for (var t = 0; t < O.length; t++) {
- var i = O[t];
- if (!i.inUse && i.size === e)
- return i.inUse = !0,
- i
- }
- return null
- }(o))) {
- var a = this.initTiledPano(o, !1);
- (r = l(a.width)).renderTarget = a
- }
- r.pano = e,
- this.resetPanoDescriptor(e.id),
- this.resetPanoLODDescriptors(e.id),
- this.resetRenderStatus(e.id, !0, !0)
- }
- this.setActiveRenderTargetDescriptor(e.id, r);
- var s = i ? 0 : 1;
- return this.updateActivePanos(e, s),
- r.renderTarget
- }
- ,
- n.prototype.deactivateTiledPano = function(e) {
- var t = this.getActiveRenderTargetDescriptor(e.id);
- this.isRenderTargetDescriptorValid(t) && c(t.renderTarget),
- this.setActiveRenderTargetDescriptor(e.id, null);
- var i = this.getUploadQueueForPano(e.id);
- this.clearUploadQueue(i),
- this.updateActivePanos()
- }
- ,
- n.prototype.updateActivePanos = (s = [],
- function(e, t) {
- for (var i = s.length = 0; i < this.activePanos.length; i++) {
- e && s.length === t && s.push(e);
- var n = this.activePanos[i]
- , r = this.getActiveRenderTargetDescriptor(n.id);
- e && n.id === e.id || !this.isRenderTargetDescriptorValid(r) || s.push(n)
- }
- e && t >= s.length && s.push(e),
- this.activePanos.length = 0,
- this.activePanos.push.apply(this.activePanos, s)
- }
- ),
- n.prototype.getActivePanoCount = function() {
- return this.activePanos.length
- }
- ,
- n.prototype.resetRenderStatus = function(e, r, o, t) {
- var i = null;
- t && (i = v.getLevelCountForSize(A.TILE_SIZE, t) + 1);
- for (var n = function(e, t, i, n) {
- o && (t.tile.zoomUploaded = !1),
- r && (t.tile.uploaded = !1)
- }, a = 0; a < A.FACES_PER_PANO; a++) {
- this.getTileTree(e, a).breadthFirst({
- callback: n.bind(this, a),
- minLevel: i
- })
- }
- }
- ,
- n.prototype.copyBaseRenderStatusToZoomed = function(e) {
- for (var t = v.getLevelCountForSize(A.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
- t.tile.zoomUploaded = t.tile.uploaded,
- t.zoomCovered = t.covered
- }, n = 0; n < A.FACES_PER_PANO; n++) {
- this.getTileTree(e, n).breadthFirst({
- callback: i.bind(this, n),
- maxLevel: t
- })
- }
- }
- ,
- n.prototype.renderPanoTiles = (h = [],
- function(e, t, i, n) {
- this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
- t = t || this.direction || m.FORWARD;
- var r = this.getActiveRenderTargetDescriptor(e);
- if (!this.isRenderTargetDescriptorValid(r))
- throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
- for (var o = 0; o < A.FACES_PER_PANO; o++) {
- var a = this.getTileTree(e, o);
- h.length = 0,
- a.breadthFirst({
- saveVisited: h
- });
- for (var s = 0; s < h.length; s++) {
- var l = h[s];
- this.queueTileUpload(l.tile, !1, n || 0 === s && i)
- }
- }
- this.updateDirection(t)
- }
- ),
- n.prototype.isRenderTargetDescriptorValid = function(e) {
- return e && e.renderTarget
- }
- ,
- n.prototype.isPanoActive = function(e) {
- var t = this.getActiveRenderTargetDescriptor(e);
- return this.isRenderTargetDescriptorValid(t)
- }
- ,
- n.prototype.isPanoZoomed = function(e) {
- return this.zoomingActive && this.zoomPanoId === e
- }
- ,
- n.prototype.initTileTree = function(e, t, i) {
- var n = this.tileTrees[e];
- n || (n = [],
- this.tileTrees[e] = n);
- var r = n[t];
- if (!r) {
- var o = v.getLevelCountForSize(A.TILE_SIZE, i);
- r = new v(A.TILE_SIZE,o),
- n[t] = r
- }
- }
- ,
- n.prototype.getTileTree = function(e, t) {
- var i = this.tileTrees[e];
- if (!i)
- throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
- var n = i[t];
- if (!n)
- throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
- return n
- }
- ,
- n.prototype.initTiledPano = function(e, t) {
- var i = this.sceneRenderer.renderer
- , n = (i.context,
- new _.WebGLRenderTargetCube(e,e,{
- stencilBuffer: !1
- }))
- , r = new _.CubeTexture([]);
- (n.texture = r).image = [null, null, null, null, null, null],
- r.flipY = !0,
- t ? (r.generateMipmaps = !0,
- r.magFilter = _.LinearFilter,
- r.minFilter = _.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
- r.magFilter = _.LinearFilter,
- r.minFilter = _.LinearFilter),
- r.format = _.RGBAFormat,
- i.setRenderTarget(n),
- i.setRenderTarget(null);
- var o = i.properties.get(r);
- return o.__image__webglTextureCube = o.__webglTexture,
- n
- }
- ,
- n.prototype.getUploadQueueForPano = function(e) {
- var t = this.uploadQueues[e];
- return t || (t = [],
- this.uploadQueues[e] = t),
- t
- }
- ,
- n.prototype.isTileUploaded = function(e) {
- return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
- }
- ,
- n.prototype.setUploaded = function(e, t) {
- this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
- }
- ,
- n.prototype.queueTileUpload = function(e, t, i) {
- var n = this.getActiveRenderTargetDescriptor(e.panoId);
- if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
- var r = this.getUploadQueueForPano(e.panoId);
- 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),
- e.uploadQueued = !0,
- this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
- }
- }
- ,
- n.prototype.shoulPushToFrontOfQueue = function(e) {
- return 0 === v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
- }
- ,
- n.prototype.getTopUploadQueue = function() {
- for (var e = null, t = null, i = P.Base; i <= P.Remaining; i++)
- for (var n = 0; n < this.activePanos.length; n++)
- if (e = this.activePanos[n],
- 0 < (t = this.getUploadQueueForPano(e.id)).length)
- switch (i) {
- case P.Base:
- if (0 === t[0].level)
- return t;
- break;
- case P.Remaining:
- return t
- }
- return null
- }
- ,
- n.prototype.getNextFromUploadQueue = function() {
- if (0 < this.forceQueue.length)
- return L(this.forceQueue);
- var e = this.getTopUploadQueue();
- return e && 0 < e.length ? L(e) : null
- }
- ,
- n.prototype.peekNextFromUploadQueue = function() {
- if (0 < this.forceQueue.length)
- return this.forceQueue[0];
- var e = this.getTopUploadQueue();
- return e && 0 < e.length ? e[0] : null
- }
- ,
- n.prototype.clearAllQueuedUploads = function() {
- this.clearAllUploadQueues(null, 0)
- }
- ,
- n.prototype.clearAllQueuedUploadsForPano = function(e) {
- this.clearAllUploadQueues(e, 0)
- }
- ,
- n.prototype.clearAllUploadQueues = function(e, t) {
- if (e)
- this.clearUploadQueue(this.getUploadQueueForPano(e), t),
- this.clearUploadQueue(this.forceQueue, t, e);
- else {
- for (var i = 0; i < this.activePanos.length; i++) {
- var n = this.activePanos[i];
- this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
- }
- this.clearUploadQueue(this.forceQueue, t)
- }
- }
- ,
- n.prototype.clearUploadQueue = function(e, t, i) {
- null != t || (t = 0);
- for (var n = 0; n < e.length; ) {
- var r = e[n];
- (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
- e.splice(n, 1)) : n++
- }
- }
- ,
- n.prototype.refreshUploadInterval = (a = null,
- function(e) {
- this.uploadIntervalCancelled || (a = a || function() {
- this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (T = !0,
- this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
- this.peekNextFromUploadQueue() ? this.refreshUploadInterval(x) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
- }
- .bind(this),
- null != e || (e = x),
- T || (e = S),
- this.uploadInterval = window.setTimeout(a, e),
- this.uploadIntervalDelay = e)
- }
- ),
- n.prototype.update = (r = performance.now(),
- o = 0,
- function() {
- this.uploadIntervalCancelled = !0,
- window.clearTimeout(this.uploadInterval),
- this.uploadInterval = null;
- var e = performance.now() - r;
- !(x < e || 0 === o) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
- r = performance.now()),
- o++
- }
- ),
- n.prototype.updateUploadQueue = function(e, t) {
- e = e || 1;
- for (var i = 0, n = 0; !(t <= n || e <= i); ) {
- var r = this.getNextFromUploadQueue();
- if (!r)
- break;
- if (0 !== r.level ? i++ : n++,
- !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
- var o = this.getActiveRenderTargetDescriptor(r.panoId);
- this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
- }
- }
- }
- ,
- n.prototype.updateDirection = function(e) {
- if (e = e || this.direction) {
- this.direction = e;
- for (var t = 0; t < this.activePanos.length; t++) {
- var i = this.activePanos[t]
- , n = this.getUploadQueueForPano(i.id);
- y.sortPanoTiles(n, i, this.direction)
- }
- }
- }
- ,
- n.prototype.uploadTile = (I = {},
- new _.Vector4,
- E = d.tiling.overlayStyle,
- function(e, t) {
- var i = e.panoId
- , n = e.image
- , r = e.tileSize
- , o = e.panoSize
- , a = e.tileIndex
- , s = (e.faceTileIndex,
- e.totalTiles)
- , l = (e.face,
- e.tileX)
- , c = e.tileY
- , h = !0
- , u = !1
- , d = (this.getPanoDescriptor(i),
- this.getPanoLODDescriptor(i, o))
- , p = this.getActiveRenderTargetDescriptor(i)
- , f = p.renderTarget
- , g = p.size;
- if (this.isPanoZoomed(i) && (f = this.zoomRenderTarget,
- g = this.qualityManager.getMaxZoomPanoSize()),
- this.isRenderTargetDescriptorValid(p) || (u = h = !1),
- t || (this.anyUploaded(e.node) && (u = !(h = !1)),
- this.isTileUploaded(e) && (u = h = !1)),
- h) {
- var m = r / o * g
- , v = l * r / o * g
- , y = c * r / o * g;
- I[r] || (I[r] = this.sceneRenderer.initSizedTexture2D(r, _.ClampToEdgeWrapping));
- var A = I[r];
- if (this.sceneRenderer.uploadTexture2D(n, A, 0, 0, r, r),
- 1 === E || 2 === E) {
- var C = 1 === E ? this.overlayTilesBasic : this.overlayTilesEnhanced;
- this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace),
- this.sceneRenderer.renderToCubeMap(C[o], f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace, _.NormalBlending, !0, .5)
- } else
- this.sceneRenderer.renderToCubeMap(A, f, r, r, 0, 0, r, r, v, y, m, m, e.cubeFace);
- d.uploadCount++,
- this.emit(b.TileRenderSuccess, i, o, a, s),
- d.uploadCount === s && this.emit(b.PanoRenderComplete, i, o, s),
- this.setUploaded(e, !0),
- this.addCoverageForNode(e.node)
- } else
- this.setUploaded(e, !1);
- return e.uploadAttempted || (d.uploadAttempts++,
- this.emit(b.TileUploadAttempted, i, o, a, s)),
- e.uploadAttempted = !0,
- d.uploadAttempts === s && this.emit(b.UploadAttemptedForAllTiles, i, o, s),
- u
- }
- ),
- n.prototype.linkTileAndNode = function(e, t) {
- (t.tile = e).node = t
- }
- ,
- n.prototype.linkAllTilesAndNodes = function(a) {
- for (var e = function(e, t, i, n, r) {
- var o = this.getTileDirectoryEntry(a.id, t, n, r);
- this.linkTileAndNode(o, i)
- }, t = 0; t < A.FACES_PER_PANO; t++) {
- var i = this.getTileTree(a.id, t);
- i.breadthFirst({
- callback: e.bind(this, i, t)
- })
- }
- }
- ,
- n.prototype.anyUploaded = function(e) {
- if (!e)
- return !1;
- if (e.tile && this.isTileUploaded(e.tile))
- return !0;
- if (e.children)
- for (var t = 0; t < e.children.length; t++) {
- var i = e.children[t];
- if (this.anyUploaded(i))
- return !0
- }
- return !1
- }
- ,
- n.prototype.setNodeCovered = function(e, t) {
- this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
- }
- ,
- n.prototype.isNodeCovered = function(e) {
- return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
- }
- ,
- n.prototype.addCoverageForNode = function(e) {
- if (this.setNodeCovered(e, !0),
- e.parent && e.covered) {
- var t = e.parent;
- this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
- }
- }
- ,
- n.prototype.calcFullCoverage = function(e) {
- var t = !1;
- if (e.children)
- for (var i = 0; i < e.children.length; i++) {
- var n = e.children[i];
- t = t || this.calcFullCoverage(n)
- }
- e.covered = e.tile.uploaded || t
- }
- ,
- n.prototype.nodeSubcovered = function(e) {
- if (!e.children)
- return !1;
- for (var t = 0; t < e.children.length; t++)
- if (!e.children[t] || !this.isNodeCovered(e.children[t]))
- return !1;
- return !0
- }
- ,
- n.prototype.resetPanoDescriptor = function(e) {
- this.getPanoDescriptor(e)
- }
- ,
- n.prototype.getPanoDescriptor = function(e) {
- var t = this.panoDescriptors[e];
- return t || (t = {},
- this.panoDescriptors[e] = t),
- t
- }
- ,
- n.prototype.resetPanoLODDescriptors = function(e) {
- var t = this.getPanoLODDescriptors(e);
- for (var i in t)
- if (t.hasOwnProperty(i)) {
- var n = t[i];
- n.uploadCount = 0,
- n.uploadAttempts = 0
- }
- }
- ,
- n.prototype.getPanoLODDescriptor = function(e, t) {
- var i = this.getPanoLODDescriptors(e)
- , n = i[t];
- return n || (n = {
- uploadCount: 0,
- uploadAttempts: 0
- },
- i[t] = n),
- n
- }
- ,
- n.prototype.getPanoLODDescriptors = function(e) {
- var t = this.panoLODDescriptors[e];
- return t || (t = {},
- this.panoLODDescriptors[e] = t),
- t
- }
- ,
- n.prototype.onTileDownloaded = function(e) {
- var t = v.getLevelCountForSize(A.TILE_SIZE, e.panoSize)
- , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
- if (i.downloaded = !0,
- i.image = e.image,
- i.panoSize = e.panoSize,
- i.tileX = e.tileX,
- i.tileY = e.tileY,
- i.totalTiles = e.totalTiles,
- i.tileIndex = e.tileIndex,
- i.faceTileIndex = e.faceTileIndex,
- i.face = e.face,
- i.cubeFace = C.mapFaceToCubemapFace(e.face),
- i.panoId = e.panoId,
- i.tileSize = e.tileSize,
- i.direction = (new _.Vector3).copy(e.direction),
- i.node = null,
- i.level = v.getLevelCountForSize(A.TILE_SIZE, i.panoSize),
- this.isPanoActive(i.panoId)) {
- var n = this.getTileTree(i.panoId, i.face).getSubNode(i.panoSize, i.tileX, i.tileY);
- this.linkTileAndNode(i, n),
- this.queueTileUpload(i, !0)
- }
- }
- ,
- n.prototype.getTileDirectoryEntry = function(e, t, i, n) {
- var r = this.tileDirectory[e];
- r || (r = {},
- this.tileDirectory[e] = r);
- var o = 16384 * t + 1024 * i + n
- , a = r[o];
- return a || (a = {
- downloaded: !1,
- uploaded: !1,
- zoomUploaded: !1
- },
- r[o] = a),
- a._key = e + ":" + t + ":" + i + ":" + n,
- a._tileKey = o,
- a
- }
- ,
- n.prototype.setZoomingActive = function(e, t, i) {
- this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
- this.zoomPanoId = t.id,
- this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
- }
- ,
- n.prototype.updateZoomedPanoFromBase = function(e) {
- if (!this.zoomPanoRenderingDisabled) {
- var t = this.getActiveRenderTargetDescriptor(e.id);
- if (t && t.renderTarget) {
- var i = this.qualityManager.getMaxZoomPanoSize()
- , n = t.renderTarget
- , r = t.size;
- this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
- this.copyBaseRenderStatusToZoomed(e.id)
- }
- }
- }
- ,
- t.exports = n
- }
- , {
- "../enum/GLCubeFaces": 25,
- "../enum/PanoRendererEvents": 35,
- "../enum/PanoSizeClass": 36,
- "../enum/SceneRendererEvents": 43,
- "../enum/TileDownloaderEvents": 45,
- "../enum/Vectors": 50,
- "../exception/BasicException": 55,
- "../objects/Panorama": 148,
- "../settings": 166,
- "../util/browser": 182,
- "../util/panorama": 191,
- "./TileDownloader": 171,
- "./TilePrioritizer": 172,
- "./TileTree": 173,
- "./TileUtils": 174,
- events: 202,
- three: 217
- }],
- 170: [function(e, t, i) {
- "use strict";
- function n(e, t, i) {
- this.maxNavPanoSize = -1,
- this.maxZoomPanoSize = -1,
- this.devicePixelDensity = e,
- this.deviceScreenSize = t,
- this.clientBandwidth = i,
- this.panoSizeClassMap = {},
- this.useHighResolutionPanos = !0,
- this.useUltraHighResolutionPanos = !1,
- this.modelHasUltraHighPanos = !1
- }
- var r = e("../enum/PanoSizeClass")
- , o = e("../settings")
- , a = e("../util/browser")
- , s = e("../constants")
- , l = e("../util/showcase")
- , c = e("../enum/ModelManagerEvents");
- n.prototype.init = function(e) {
- this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
- this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
- this.highSize = this.getPanoSize(r.HIGH),
- this.standardSize = this.getPanoSize(r.STANDARD),
- this.baseSize = this.getPanoSize(r.BASE),
- o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
- this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
- this.updateMaximums(),
- e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
- }
- ,
- n.prototype.updateFromModel = function(e) {
- this.updateHighResolutionSettings(e),
- this.updateUltraHighResolutionSettings(e)
- }
- ,
- n.prototype.updateHighResolutionSettings = function(e) {
- l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
- this.updateMaximums()
- }
- ,
- n.prototype.updateUltraHighResolutionSettings = function(e) {
- o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
- this.updateMaximums()
- }
- ,
- n.prototype.enableUltraHighQualityMode = function() {
- this.modelHasUltraHighPanos = !0,
- this.updateUltraHighResolutionSettings(null)
- }
- ,
- n.prototype.ultraHighQualityModeEnabled = function() {
- return this.modelHasUltraHighPanos
- }
- ,
- n.prototype.onModelChanged = function(e) {
- this.updateFromModel(e.model),
- this.updateMaximums()
- }
- ,
- n.prototype.updateMaximums = function() {
- this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
- this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
- this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
- }
- ,
- n.prototype.buildPanoSizeClassMap = function() {
- this.panoSizeClassMap[r.BASE] = 512,
- this.panoSizeClassMap[r.STANDARD] = 1024,
- this.panoSizeClassMap[r.HIGH] = 2048,
- this.panoSizeClassMap[r.ULTRAHIGH] = 4096
- }
- ,
- n.prototype.getPanoSize = function(e) {
- return this.panoSizeClassMap[e]
- }
- ,
- n.prototype.getMaxPossiblePanoSize = function() {
- return this.getPanoSize(r.ULTRAHIGH)
- }
- ,
- n.prototype.getMaxPanoSize = function() {
- return this.maxZoomPanoSize
- }
- ,
- n.prototype.getMaxNavPanoSize = function() {
- return this.maxNavPanoSize
- }
- ,
- n.prototype.getMaxZoomPanoSize = function() {
- return this.maxZoomPanoSize
- }
- ,
- n.prototype.detectMaxNavPanoSizeClass = function() {
- return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
- }
- ,
- n.prototype.detectMaxNavPanoSize = function() {
- var e = this.detectMaxNavPanoSizeClass();
- return this.getPanoSize(e)
- }
- ,
- n.prototype.detectMaxZoomPanoSize = function() {
- 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)
- }
- ,
- t.exports = n
- }
- , {
- "../constants": 8,
- "../enum/ModelManagerEvents": 33,
- "../enum/PanoSizeClass": 36,
- "../settings": 166,
- "../util/browser": 182,
- "../util/showcase": 193
- }],
- 171: [function(A, C, e) {
- (function(e) {
- "use strict";
- function i(e) {
- this.panos = null,
- this.retryMinimumTime = 1e4,
- this.urls = null,
- this.panoLoadCallbacks = {},
- this.downloadDescriptors = {},
- this.priorityQueue = [],
- this.forceQueue = [],
- this.activeDownloads = [],
- this.qualityManager = null,
- this.tilePrioritizer = null,
- this.refreshInterval = null,
- this.processPriorityQueue = !1,
- this.concurrentDownloads = e.concurrentDownloads || 1,
- this.downloadTestResults = {}
- }
- var c, h, n, p, f, t = A("three"), u = (A("../enum/Viewmode"),
- A("../settings")), r = (A("../objects/Panorama"),
- A("../util/logger")), o = (A("../enum/Vectors"),
- A("../enum/PanoSizeClass"),
- A("../enum/TileDownloaderEvents")), g = A("./TilePrioritizer"), m = A("./TileUtils"), v = (A("../enum/GLCubeFaces"),
- A("../enum/DownloadStatus")), a = A("../util/panorama"), s = A("../util/ajax"), d = A("../ab"), l = A("events").EventEmitter, y = (new r(e),
- Object.freeze({
- Testing: 1,
- Success: 2,
- Fail: 3
- }));
- i.prototype = Object.create(l.prototype),
- i.IDLE_REFRESH_DELAY = 500,
- i.ACTIVE_REFRESH_DELAY = 16,
- i.DOWNLOAD_RETRIES = 4,
- i.prototype.init = function(e) {
- this.qualityManager = e
- }
- ,
- i.prototype.setUrls = function(e) {
- this.urls = e
- }
- ,
- i.prototype.setPanoData = function(e, t, i) {
- this.panos = e,
- this.imagePanos = t,
- this.panoGroupId = i
- }
- ,
- i.prototype.start = function() {
- this.refreshUpdateInterval(0)
- }
- ,
- i.prototype.stop = function() {
- window.cancel(this.refreshInterval)
- }
- ,
- i.prototype.refreshUpdateInterval = function(e) {
- e = e || 0,
- this.refreshInterval = window.setTimeout(function() {
- this.update() ? this.refreshUpdateInterval(i.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(i.IDLE_REFRESH_DELAY)
- }
- .bind(this), e)
- }
- ,
- i.prototype.update = function() {
- var e = 0 < this.forceQueue.length;
- return this.processQueueForDownloading(this.forceQueue),
- this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
- 0 < this.priorityQueue.length && (e = !0),
- this.processQueueForDownloading(this.priorityQueue)),
- e
- }
- ,
- i.prototype.forceQueueTilesForPano = (p = [],
- f = [],
- function(e, t, i, n, r, o) {
- p.length = 0;
- for (var a = this.getTileDownloadDescriptors(e, t), s = 0; s < a.length; s++) {
- var l = a[s];
- l.status !== v.None && l.status !== v.Queued || p.push(l)
- }
- if (i && 0 < p.length) {
- g.sortPanoTiles(p, e, i),
- f.length = 0,
- m.matchingTilesInDirection(e, t, i, n, r, f);
- for (var c = 0, h = function(e) {
- return e.face === u.face && e.faceTileIndex === u.faceTileIndex
- }; c < p.length; ) {
- var u = p[c];
- f.findIndex(h) < 0 ? p.splice(c, 1) : c++
- }
- }
- for (var d = 0; d < p.length; d++)
- this.forceQueue.push(p[d]);
- this.setStatusForAllDescriptors(this.forceQueue, v.ForceQueued),
- this.clearFromQueue(this.priorityQueue, v.ForceQueued, !1),
- o && this.processQueueForDownloading(this.forceQueue, !0)
- }
- ),
- i.prototype.clearForceQueue = function() {
- this.clearQueue(this.forceQueue)
- }
- ,
- i.prototype.queuePrioritizedTilesForPanos = function(e) {
- this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
- this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
- this.clearFromQueue(this.priorityQueue, v.None, !0),
- this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, v.Queued))
- }
- ,
- i.prototype.clearQueue = function(e) {
- this.setStatusForAllDescriptors(e, v.None),
- e.length = 0
- }
- ,
- i.prototype.clearFromQueue = function(e, t, i) {
- for (var n = 0; n < e.length; n++) {
- var r = e[n];
- r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
- }
- }
- ,
- i.prototype.setStatusForAllDescriptors = function(e, t) {
- for (var i = 0; i < e.length; i++) {
- var n = e[i];
- n && (n.status = t)
- }
- }
- ,
- i.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
- for (var i = 0; i < e.length; i++) {
- var n = e[i];
- n && (n.status !== t ? n.status = t : e[i] = null)
- }
- }
- ,
- i.prototype.getTileDownloadDescriptors = function(e, t) {
- var i = this.getAllTileDownloadDescriptorsForPano(e)
- , n = i[t];
- return n || (n = this.buildDownloadDescriptorArray(t),
- i[t] = n,
- this.initTileDownloadDescriptors(n, e, t)),
- n
- }
- ,
- i.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
- var t = this.downloadDescriptors[e.id];
- return t || (t = {},
- this.downloadDescriptors[e.id] = t),
- t
- }
- ,
- i.prototype.processQueueForDownloading = function(e, t) {
- if (this.cleanupActiveDownloads(),
- this.activeDownloads.length < this.concurrentDownloads || t)
- for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0; n < i && 0 < e.length; 0) {
- var r = e.shift();
- r && (this.startDownload(r),
- n++)
- }
- }
- ,
- i.prototype.testDownload = function(t, e, i) {
- var n = this.downloadTestResults[t];
- if (n)
- n === y.Success ? i(!0) : n === y.Fail && i(!1);
- else {
- this.downloadTestResults[t] = y.Testing;
- var r = this.panos.list[0]
- , o = this.getTileUrl(r.id, t, e, 0)
- , a = function(e) {
- this.downloadTestResults[t] = y.Success,
- i(!0)
- }
- .bind(this)
- , s = function() {
- this.downloadTestResults[t] = y.Fail,
- i(!1)
- }
- .bind(this);
- this.loadImage(o, 0, a, s)
- }
- }
- ,
- i.prototype.startDownload = function(e) {
- e.status = v.Downloading;
- var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
- this.activeDownloads.push(e),
- this.loadImage(t, i.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
- }
- ,
- i.prototype.downloadFailed = function(e, t) {}
- ,
- i.prototype.downloadComplete = function(e, t) {
- if (e.panoGroupId === this.panoGroupId) {
- var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
- e.status = v.Downloaded,
- i && i.onProgress && i.onProgress(e.pano, e.panoSize);
- var n = {
- panoId: e.pano.id,
- image: t,
- tileSize: e.tileSize,
- panoSize: e.panoSize,
- tileIndex: e.tileIndex,
- faceTileIndex: e.faceTileIndex,
- totalTiles: e.totalTiles,
- face: e.face,
- tileX: e.tileX,
- tileY: e.tileY,
- direction: e.direction
- };
- e.image = t,
- this.emit(o.TileDownloadSuccess, n),
- this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
- panoId: e.pano.id,
- tileSize: e.tileSize,
- panoSize: e.panoSize
- },
- this.emit(o.PanoDownloadComplete, n),
- i && i.onLoad && i.onLoad(e.pano, e.panoSize))
- }
- }
- ,
- i.prototype.cleanupActiveDownloads = (n = [],
- function() {
- for (var e = n.length = 0; e < this.activeDownloads.length; e++) {
- var t = this.activeDownloads[e];
- t.status !== v.Downloaded && t.status !== v.Failed && n.push(t)
- }
- this.activeDownloads.length = 0,
- this.activeDownloads.push.apply(this.activeDownloads, n)
- }
- ),
- i.prototype.isPanoDownloaded = function(e, t) {
- var i = this.getTileDownloadDescriptors(e, t);
- if (i.length <= 0)
- return !1;
- for (var n = 0; n < i.length; n++) {
- if (i[n].status !== v.Downloaded)
- return !1
- }
- return !0
- }
- ,
- i.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
- var o = e.id + ":" + this.qualityManager.getPanoSize(t);
- this.panoLoadCallbacks[o] = {
- onLoad: i,
- onFail: n,
- onProgress: r
- }
- }
- ,
- i.prototype.getPanoLoadCallbacks = function(e, t) {
- var i = e.id + ":" + t;
- return this.panoLoadCallbacks[i]
- }
- ,
- i.prototype.buildDownloadDescriptorArray = function(e) {
- for (var t = m.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
- var r = this.buildDownloadDescriptor();
- i.push(r)
- }
- return i
- }
- ,
- i.prototype.buildDownloadDescriptor = function() {
- return {
- panoGroupId: null,
- pano: null,
- panoSize: -1,
- tileSize: -1,
- tileIndex: -1,
- totalTiles: -1,
- faceTileIndex: -1,
- status: v.None,
- url: null,
- image: null,
- direction: new t.Vector3,
- face: -1,
- cubeFace: -1,
- tileX: -1,
- tileY: -1
- }
- }
- ,
- i.prototype.initTileDownloadDescriptors = function(e, t, i) {
- for (var n = 0; n < e.length; n++) {
- var r = e[n];
- this.initTileDownloadDescriptor(r, t, i, n)
- }
- }
- ,
- i.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
- var r = i >= m.TILE_SIZE ? m.TILE_SIZE : i;
- e.face = m.getFaceForTile(i, n),
- e.cubeFace = a.mapFaceToCubemapFace(e.face),
- e.panoGroupId = this.panoGroupId,
- e.pano = t,
- e.panoSize = i,
- e.tileSize = r,
- e.tileIndex = n,
- e.totalTiles = m.getTileCountForSize(i),
- e.status = v.None,
- e.image = null,
- m.getTileLocation(e.panoSize, e.tileIndex, e),
- m.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, m.LocationOnTile.Center, 0, e.direction)
- }
- ,
- i.prototype.getTileUrl = (c = {
- 256: "256",
- 512: "512",
- 1024: "1k",
- 2048: "2k",
- 4096: "4k"
- },
- h = {
- face: -1,
- faceTileIndex: -1,
- tileX: -1,
- tileY: -1
- },
- function(e, t, i, n) {
- m.getTileLocation(t, n, h);
- var r = Math.floor(t / i)
- , o = r * r
- , a = Math.floor(n / o)
- , s = "";
- 1 === u.tiling.customCompression && (s = "_" + u.tiling["q" + c[t]]);
- var l = this.urls.get("tiles/" + e + "/" + c[t] + s + "_face" + a + "_" + h.tileX + "_" + h.tileY + ".jpg");
- return d.changeIfTileGenerating(l)
- }
- ),
- i.prototype.loadImage = function(e, t, i, n) {
- s.getImage(e, t).then(function(e) {
- i(e)
- }).fail(n)
- }
- ,
- C.exports = i
- }
- ).call(this, "/js/tile/TileDownloader.js")
- }
- , {
- "../ab": 3,
- "../enum/DownloadStatus": 24,
- "../enum/GLCubeFaces": 25,
- "../enum/PanoSizeClass": 36,
- "../enum/TileDownloaderEvents": 45,
- "../enum/Vectors": 50,
- "../enum/Viewmode": 51,
- "../objects/Panorama": 148,
- "../settings": 166,
- "../util/ajax": 181,
- "../util/logger": 189,
- "../util/panorama": 191,
- "./TilePrioritizer": 172,
- "./TileUtils": 174,
- events: 202,
- three: 217
- }],
- 172: [function(n, C, e) {
- (function(e) {
- "use strict";
- function h(e, t, i, n, r) {
- this.qualityManager = e,
- this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
- this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
- this.baseSize = t,
- this.standardSize = i,
- this.highSize = n,
- this.ultraHighSize = r,
- this.priorityCriteria = new h.PriorityCriteria(null,new o.Vector3(0,0,0),new o.Vector3(0,0,-1),new o.Vector3(0,0,-1))
- }
- var c, s, l, d, r, u, p, f, o = n("three"), g = (n("../enum/Viewmode"),
- n("../settings"),
- n("../settings"),
- n("../objects/Panorama")), t = n("../util/logger"), i = (n("../enum/Vectors"),
- n("../enum/PanoSizeClass"),
- n("../enum/ModelManagerEvents"),
- n("../enum/GLCubeFaces"),
- n("../enum/DownloadStatus")), m = (n("../util/browser"),
- n("./TileUtils")), v = n("../util/math"), a = (n("events").EventEmitter,
- new t(e),
- Object.freeze({
- None: 0,
- DirectionalFOV: 1
- }));
- h.PriorityCriteria = function(e, t, i, n, r) {
- this.pano = e,
- this.cameraPosition = (new o.Vector3).copy(t),
- this.cameraDir = (new o.Vector3).copy(i),
- this.panoSpaceDir = (new o.Vector3).copy(n),
- this.upcomingPanos = r,
- this.copy = function(e) {
- this.pano = e.pano,
- this.cameraPosition.copy(e.cameraPosition),
- this.cameraDir.copy(e.cameraDir),
- this.panoSpaceDir.copy(e.panoSpaceDir),
- this.upcomingPanos = r
- }
- ,
- this.zoomingActive = !1
- }
- ,
- h.DIRECTIONAL_FOV = 180,
- h.DIRECTIONAL_FOV_NARROW = 120,
- h.MAX_SCORED_PANOS_TOCONSIDER = 6,
- h.MAX_SCORED_PANOS_TOADD = 2,
- h.MAX_UPCOMING_PANOS_TOADD = 3,
- h.DIRECTION_SCORE_STRICTNESS = .75,
- h.appendQueue = function(e, t) {
- if (e && t)
- for (var i = 0; i < t.length; i++)
- e.push(t[i])
- }
- ,
- h.prototype.updateCriteria = function(e, t, i, n) {
- this.priorityCriteria.pano = e,
- this.priorityCriteria.cameraPosition.copy(t),
- this.priorityCriteria.cameraDir.copy(i),
- this.priorityCriteria.upcomingPanos = n,
- this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
- this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
- }
- ,
- h.prototype.filterAndPrioritize = (u = [],
- p = [],
- f = [],
- function(e, t, i) {
- this.populateNeighborPanos(this.priorityCriteria.pano, t, u),
- this.populateScoredPanos(this.priorityCriteria.pano, t, p, this.priorityCriteria.cameraDir, h.MAX_SCORED_PANOS_TOCONSIDER);
- var n = this.baseSize
- , r = this.standardSize
- , o = this.highSize
- , a = this.ultraHighSize;
- this.queueTilesForPano(e, i, this.priorityCriteria.pano, n),
- this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(e, this.priorityCriteria.upcomingPanos, i, n, h.MAX_UPCOMING_PANOS_TOADD),
- f.length = 0,
- this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
- h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
- h.appendQueue(e, f),
- this.queueTilesForPanos(e, p, i, n, h.MAX_SCORED_PANOS_TOADD),
- f.length = 0,
- this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
- this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV_NARROW),
- h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
- h.appendQueue(e, f),
- f.length = 0,
- this.canDownloadSize(r) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, r, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
- this.canDownloadSize(o) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, o, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
- this.canDownloadSize(a) && this.queueTilesInDirectionForPano(f, i, this.priorityCriteria.pano, a, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, h.DIRECTIONAL_FOV),
- h.sortPanoTiles(f, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
- h.appendQueue(e, f),
- this.queueTilesForPanos(e, u, i, n)
- }
- ),
- h.prototype.canDownloadSize = function(e) {
- return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
- }
- ,
- h.prototype.populateNeighborPanos = function(e, t, i) {
- (i = i || []).length = 0;
- var n = t.getNeighbours(e);
- for (var r in n)
- if (n.hasOwnProperty(r)) {
- var o = t.get(r);
- i.push(o)
- }
- return i
- }
- ,
- h.prototype.populateScoredPanos = function(e, t, i, n, r) {
- (i = i || []).length = 0;
- var o = [g.filters.inPanoDirection(e.position, n, h.DIRECTION_SCORE_STRICTNESS), g.filters.not(e)]
- , a = [g.scoreFunctions.distanceSquared(e), g.scoreFunctions.direction(e.position, n)]
- , s = t.sortByScore(o, a);
- if (s)
- for (var l = 0; l < s.length && l < r; l++) {
- var c = s[l].pano;
- i.push(c)
- }
- return i
- }
- ,
- h.prototype.queueTilesForPanos = function(e, t, i, n, r) {
- for (var o = 0, a = 0; a < t.length; a++) {
- var s = t[a];
- if (o += 0 < this.queueTilesForPano(e, i, s, n) ? 1 : 0,
- r && r <= o)
- break
- }
- return o
- }
- ,
- h.prototype.queueTilesForPano = (r = {
- filter: a.None
- },
- function(e, t, i, n) {
- return this.filterAndQueueTileDownloadDescriptors(e, t, i, n, r)
- }
- ),
- h.prototype.queueTilesForPanosInDirection = (d = new o.Vector3,
- function(e, t, i, n, r, o, a, s) {
- for (var l = 0, c = 0; c < i.length; c++) {
- var h = i[c];
- d.copy(h.position),
- d.sub(r),
- d.normalize();
- var u = Math.max(Math.min(o.dot(d), 1), -1);
- if (v.getFOVDotThreshold(a) <= u && (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, r, o, a) ? 1 : 0,
- s && s <= l))
- break
- }
- return l
- }
- ),
- h.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
- for (var l = 0, c = 0; c < i.length; c++) {
- var h = i[c];
- if (l += 0 < this.queueTilesInDirectionForPano(e, t, h, n, o, a) ? 1 : 0,
- s && s <= l)
- break
- }
- return l
- }
- ,
- h.prototype.queueTilesInDirectionForPano = (s = {
- filter: a.DirectionalFOV,
- direction: new o.Vector3,
- fov: 60
- },
- l = new o.Vector3,
- function(e, t, i, n, r, o, a) {
- return l.copy(o),
- m.getRelativeDirection(i.quaternion, l),
- s.direction.copy(l),
- s.fov = a,
- this.filterAndQueueTileDownloadDescriptors(e, t, i, n, s)
- }
- ),
- h.prototype.filterAndQueueTileDownloadDescriptors = (c = [],
- function(e, t, i, n, r) {
- var o = t.getTileDownloadDescriptors(i, n);
- c.length = 0,
- this.filterTileDownloadDescriptors(i, o, c, r);
- for (var a = 0, s = 0; s < c.length; s++) {
- var l = c[s];
- l && (e.push(l),
- a++)
- }
- return a
- }
- ),
- h.prototype.filterTileDownloadDescriptors = (new o.Vector3,
- function(e, t, i, n) {
- var r, o;
- switch (n.filter) {
- case a.DirectionalFOV:
- for (r = 0; r < t.length; r++)
- o = t[r],
- m.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
- break;
- default:
- for (r = 0; r < t.length; r++)
- o = t[r],
- i.push(o)
- }
- for (r = 0; r < i.length; r++)
- o = i[r],
- this.canIncludeDescriptor(o) || (i[r] = null)
- }
- ),
- h.prototype.canIncludeDescriptor = function(e) {
- return e.status !== i.Downloading && e.status !== i.Downloaded
- }
- ,
- h.prototype.canIncludePano = function(e, t) {
- return !e.isLoaded(t)
- }
- ,
- h.getFOVDotThreshold = function(e) {
- return Math.cos(o.Math.degToRad(e / 2))
- }
- ;
- var y = (A._panoSpaceDir = new o.Vector3,
- A._fovThreshold = -1,
- A._fovThresholdNarrow = -1,
- A);
- function A(e, t) {
- var i = A._panoSpaceDir
- , n = A._fovThreshold
- , r = A._fovThresholdNarrow
- , o = Math.max(Math.min(i.dot(e.direction), 1), -1)
- , a = Math.max(Math.min(i.dot(t.direction), 1), -1);
- return e._dot = o,
- t._dot = a,
- 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)
- }
- h.sortPanoTiles = function(e, t, i) {
- y._panoSpaceDir.copy(i),
- m.getRelativeDirection(t.quaternion, y._panoSpaceDir),
- y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
- y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV),
- e.sort(y)
- }
- ,
- h.insertSortedPanoTile = function(e, t, i, n) {
- y._panoSpaceDir.copy(n),
- m.getRelativeDirection(i.quaternion, y._panoSpaceDir),
- y._fovThresholdNarrow = v.getFOVDotThreshold(h.DIRECTIONAL_FOV_NARROW),
- y._fovThreshold = v.getFOVDotThreshold(h.DIRECTIONAL_FOV);
- for (var r = -1, o = 0; o < e.length; o++) {
- if (y(t, e[o]) <= 0) {
- r = o;
- break
- }
- }
- if (-1 === r)
- e[e.length] = t;
- else {
- for (var a = e.length; r < a; a--)
- e[a] = e[a - 1];
- e[r] = t
- }
- }
- ,
- h.prototype.setZoomingActive = function(e) {
- e !== this.zoomingActive && (this.zoomingActive = e)
- }
- ,
- C.exports = h
- }
- ).call(this, "/js/tile/TilePrioritizer.js")
- }
- , {
- "../enum/DownloadStatus": 24,
- "../enum/GLCubeFaces": 25,
- "../enum/ModelManagerEvents": 33,
- "../enum/PanoSizeClass": 36,
- "../enum/Vectors": 50,
- "../enum/Viewmode": 51,
- "../objects/Panorama": 148,
- "../settings": 166,
- "../util/browser": 182,
- "../util/logger": 189,
- "../util/math": 190,
- "./TileUtils": 174,
- events: 202,
- three: 217
- }],
- 173: [function(e, t, i) {
- "use strict";
- function f(e, t) {
- this.levels = t,
- this.tileSize = e,
- this.root = null,
- this.allNodes = [],
- function(e) {
- e.root = function e(t, i, n) {
- if (n > t.levels)
- return null;
- var r = new a(t,i);
- t.allNodes.push(r);
- for (var o = 0; o < s; o++)
- r.children[o] = e(t, r, n + 1);
- return r
- }(e, null, 0)
- }(this)
- }
- function a(e, t) {
- this.tree = e,
- this.parent = t,
- this.children = [],
- this.id = ++n
- }
- var g = (e("three"),
- e("./TileUtils"),
- e("../objects/Panorama"),
- e("../util/panorama"),
- e("events").EventEmitter,
- 2)
- , s = g * g;
- f.TraversalType = Object.freeze({
- PreOrder: 0,
- PostOrder: 1
- });
- var n = 0;
- f.getLevelCountForSize = function(e, t) {
- var i = 0;
- for (t < e && (t = e); !((t /= g) < e); )
- i++;
- return i
- }
- ,
- f.getSizeForLevel = function(e, t) {
- return Math.pow(g, t) * e
- }
- ,
- f.prototype.getSubNode = function(e, t, i) {
- (!t || e < this.tileSize) && (t = 0),
- (!i || e < this.tileSize) && (i = 0),
- e < this.tileSize && (e = this.tileSize);
- var n = f.getLevelCountForSize(this.tileSize, e);
- return function e(t, i, n, r, o) {
- if (!t)
- return null;
- if (0 === n)
- return t;
- if (!t.children || 0 === t.children.length)
- return null;
- var a = Math.pow(g, n) / g
- , s = r % a
- , l = o % a
- , c = Math.floor(o / a)
- , h = Math.floor(r / a)
- , u = c * g + h;
- return e(t.children[u], i + 1, n - 1, s, l)
- }(this.root, 0, n, t, i)
- }
- ,
- f.prototype.breadthFirst = function(e) {
- var t = !!(e = e || {}).nullLevelEnd
- , i = e.maxLevel
- , n = e.minLevel
- , r = e.callback
- , o = e.saveVisited
- , a = []
- , s = {}
- , l = 0;
- for (a.push(this.root),
- a.push(s); 0 < a.length && !(i && i < l); ) {
- var c = a.shift();
- if (c === s)
- (!n || n <= l) && (r && t && r(null),
- o && t && o.push(null)),
- 0 < a.length && a.push(s),
- l++,
- 0;
- else {
- if (c.children)
- for (var h = 0; h < c.children.length; h++) {
- c.children[h] && a.push(c.children[h])
- }
- var u = this.getFaceIndexFromNode(c);
- (!n || n <= l) && (r && r(c, l, u),
- o && o.push(c)),
- 0
- }
- }
- }
- ,
- f.prototype.getFaceIndexFromNode = function(e) {
- if (!e)
- return -1;
- for (var t = 1, i = e, n = 0, r = 0; ; ) {
- var o = i.parent;
- if (!o)
- break;
- for (var a = -1, s = 0; s < o.children.length; s++)
- o.children[s] === i && (a = s);
- n = a % g * t + n,
- r = Math.floor(a / g) * t + r,
- t *= g,
- i = o
- }
- return r * t + n
- }
- ,
- f.prototype.depthFirst = function(e, t, i) {
- !function e(t, i, n, r, o, a, s, l) {
- if (t) {
- s = s || f.TraversalType.PreOrder;
- var c = r * g + n;
- if (s === f.TraversalType.PreOrder && (o && o(t, i, c, n, r),
- a && a.push(t)),
- t.children && 0 !== t.children.length) {
- for (var h = r * g, u = n * g, d = 0; d < g; d++)
- for (var p = 0; p < g; p++)
- e(t.children[p * g + d], i + 1, u + d, h + p, o, a, s, l);
- s === f.TraversalType.PostOrder && (o && o(t, i, c, n, r),
- a && a.push(t))
- }
- }
- }(this.root, 0, 0, 0, e, t, i, this.tileSize)
- }
- ,
- t.exports = f
- }
- , {
- "../objects/Panorama": 148,
- "../util/panorama": 191,
- "./TileUtils": 174,
- events: 202,
- three: 217
- }],
- 174: [function(e, t, i) {
- "use strict";
- var n, a, s, p, f, g, E, l, c, h, u, d, r, o, m = e("../enum/GLCubeFaces"), _ = e("../util/MathLight"), b = {};
- b.TILE_SIZE = 512,
- b.FACES_PER_PANO = 6,
- b.LocationOnTile = {
- Center: 0,
- UpperLeft: 1,
- UpperRight: 2,
- LowerRight: 3,
- LowerLeft: 4
- },
- b.getTileVector = function(e, t, i, n, r, o, a, s) {
- var l = e / t
- , c = t / e * 2
- , h = c / 2
- , u = n / l * 2 - 1 + h
- , d = (r = l - 1 - r) / l * 2 - 1 + h;
- switch (o = o || b.LocationOnTile.Center) {
- case b.LocationOnTile.UpperLeft:
- u -= h,
- d += h,
- u += a * c;
- break;
- case b.LocationOnTile.UpperRight:
- u += h,
- d += h,
- d -= a * c;
- break;
- case b.LocationOnTile.LowerRight:
- u += h,
- d -= h,
- u -= a * c;
- break;
- case b.LocationOnTile.LowerLeft:
- u -= h,
- d -= h,
- d += a * c;
- break;
- case b.LocationOnTile.Center:
- }
- switch (i) {
- case m.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- _.setVector(s, -1, d, -u);
- break;
- case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- _.setVector(s, 1, d, u);
- break;
- case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- _.setVector(s, -u, 1, -d);
- break;
- case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- _.setVector(s, -u, -1, d);
- break;
- case m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- _.setVector(s, -u, d, 1);
- break;
- case m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- _.setVector(s, u, d, -1)
- }
- _.normalize(s)
- }
- ,
- b.getFaceForTile = function(e, t) {
- var i = b.TILE_SIZE;
- e < b.TILE_SIZE && (i = e);
- var n = Math.floor(e / i)
- , r = n * n;
- return Math.floor(t / r)
- }
- ,
- b.getTileLocation = function(e, t, i) {
- var n = b.TILE_SIZE;
- e < b.TILE_SIZE && (n = e);
- var r = b.getFaceForTile(e, t)
- , o = Math.floor(e / n)
- , a = t - r * (o * o);
- i.tileX = a % o,
- i.tileY = Math.floor(a / o),
- i.face = r,
- i.faceTileIndex = a
- }
- ,
- b.getTileCountForSize = function(e) {
- if (e <= b.TILE_SIZE)
- return b.FACES_PER_PANO;
- var t = Math.floor(e / b.TILE_SIZE);
- return t * t * b.FACES_PER_PANO
- }
- ,
- b.getRelativeDirection = (r = new _.Matrix4,
- o = new _.Quaternion,
- function(e, t) {
- o.copy(e),
- o.inverse(),
- r.makeRotationFromQuaternion(o),
- r.applyToVector3(t),
- _.normalize(t)
- }
- ),
- b.matchingTilesInDirection = (c = new _.Vector3,
- h = new _.Vector3(0,0,-1),
- u = new _.Quaternion,
- l = {
- face: -1,
- faceTileIndex: -1,
- tileX: -1,
- tileY: -1
- },
- d = function(e, t, i) {
- for (var n = b.getTileCountForSize(e), r = 0, o = 0; o < n; o++)
- b.getTileLocation(e, o, l),
- t && !t(l) || (r++,
- i && (a = l,
- i.push({
- face: a.face,
- faceTileIndex: a.faceTileIndex,
- tileX: a.tileX,
- tileY: a.tileY
- })));
- var a;
- return r
- }
- ,
- function(e, t, i, n, r, o) {
- var a = t < b.TILE_SIZE ? t : b.TILE_SIZE;
- if (b.getTileCountForSize(t),
- !n && !r)
- return d(t, null, o);
- var s = !!r;
- return r = r || n,
- r = Math.max(0, Math.min(r, 360)),
- n = Math.max(0, Math.min(n, 360)),
- _.copyVector(i, c),
- b.getRelativeDirection(e.quaternion, c),
- s ? (u.setFromUnitVectors(c, h),
- d(t, function(e) {
- return b.isTileWithinFrustum(t, a, e.face, e.tileX, e.tileY, u, n, r)
- }, o)) : d(t, function(e) {
- return b.isTileWithinFOV(t, a, e.face, e.tileX, e.tileY, c, n)
- }, o)
- }
- ),
- b.isTileWithinFrustum = (E = new _.Vector3,
- function(e, t, i, n, r, o, a, s) {
- 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++)
- if (b.getTileVector(e, t, d, n, r, y, 0, E),
- _.applyQuaternionToVector(o, E),
- -1e-5 <= E.z)
- ;
- else {
- var A = -1 / E.z
- , C = E.x * A
- , I = E.y * A;
- l < I ? p++ : I < c && f++,
- h < C ? g++ : C < u && m++,
- v++
- }
- return f !== v && p !== v && g !== v && m !== v
- }
- ),
- b.isTileWithinFOV = (p = new _.Vector3,
- f = new _.Vector3(0,1,0),
- g = new _.Vector3(1,0,0),
- function(e, t, i, n, r, o, a) {
- var s = b.mapFaceToCubemapFace(i);
- if (_.cross(o, f, g),
- b.getTileVector(e, t, s, n, r, b.LocationOnTile.Center, 0, p),
- b.isWithinFOV(p, o, a, null))
- return !0;
- for (var l = a / 360, c = Math.floor(1 / l), h = 0, u = 0; u < c; u++) {
- for (var d = b.LocationOnTile.UpperLeft; d <= b.LocationOnTile.LowerLeft; d++)
- if (b.getTileVector(e, t, s, n, r, d, h, p),
- b.isWithinFOV(p, o, a, null))
- return !0;
- h += l
- }
- return !1
- }
- ),
- b.isWithinFOV = (a = new _.Vector3,
- s = new _.Vector3,
- function(e, t, i, n) {
- if (_.copyVector(e, s),
- n) {
- _.copyVector(n, a),
- _.normalize(a);
- var r = _.dot(a, e);
- a.x *= r,
- a.y *= r,
- a.z *= r,
- _.subVector(s, a)
- }
- var o = i / 2 * _.RADIANS_PER_DEGREE;
- return Math.cos(o) <= _.dot(s, t)
- }
- ),
- b.mapFaceToCubemapFace = (n = {
- 0: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
- 1: m.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
- 2: m.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
- 3: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
- 4: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
- 5: m.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
- },
- function(e) {
- return n[e]
- }
- ),
- t.exports = b
- }
- , {
- "../enum/GLCubeFaces": 25,
- "../util/MathLight": 176
- }],
- 175: [function(i, n, e) {
- (function(e) {
- "use strict";
- function t() {
- this.list = [],
- this.index = {},
- Object.defineProperty(this, "length", {
- get: function() {
- return this.list.length
- }
- })
- }
- new (i("./common"),
- i("./logger"))(e),
- t.prototype.forEach = function(e) {
- this.list.forEach(e)
- }
- ,
- t.prototype.add = function(e) {
- this.list.push(e),
- this.index[this.getIndex(e)] = e
- }
- ,
- t.prototype.getIndex = function(e) {
- throw new Error("IndexedCollection.getIndex not implemented in subclass.")
- }
- ,
- t.prototype.extend = function(e) {
- for (var t = 0; t < e.length; t++)
- this.add(e[t])
- }
- ,
- t.prototype.get = function(e) {
- return this.index[e]
- }
- ,
- t.prototype.first = function() {
- return this.list[0]
- }
- ,
- t.prototype.last = function() {
- return this.list[this.list.length - 1]
- }
- ,
- t.prototype.reIndex = function() {
- this.index = {};
- var t = this;
- this.forEach(function(e) {
- t.index[t.getIndex(e)] = e
- })
- }
- ,
- t.prototype.filter = function(e) {
- var t = this.list.filter(e);
- return this.reIndex(),
- t
- }
- ,
- t.prototype.reduce = function(e, t) {
- return this.list.reduce(e, t)
- }
- ,
- t.prototype.sort = function(e) {
- return this.list.sort(e)
- }
- ,
- t.prototype.indexOf = function(e) {
- for (var t = 0; t < this.list.length; ++t)
- if (this.list[t] === e)
- return t;
- return -1
- }
- ,
- n.exports = t
- }
- ).call(this, "/js/util/IndexedCollection.js")
- }
- , {
- "./common": 185,
- "./logger": 189
- }],
- 176: [function(e, t, i) {
- "use strict";
- e("../constants");
- var n, r, o = {};
- o.RADIANS_PER_DEGREE = Math.PI / 180,
- o.DEGREES_PER_RADIAN = 180 / Math.PI,
- o.Vector3 = function(e, t, i) {
- this.x = e || 0,
- this.y = t || 0,
- this.z = i || 0
- }
- ,
- o.Matrix4 = function() {
- this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
- 0 < arguments.length && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
- }
- ,
- o.Matrix4.prototype = {
- identity: function() {
- return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
- this
- },
- copy: function(e) {
- return this.elements.set(e.elements),
- this
- },
- applyToVector3: function(e) {
- var t = e.x
- , i = e.y
- , n = e.z
- , r = this.elements;
- return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
- e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
- e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
- this
- },
- getInverse: function(e, t) {
- var i = this.elements
- , n = e.elements
- , r = n[0]
- , o = n[1]
- , a = n[2]
- , s = n[3]
- , l = n[4]
- , c = n[5]
- , h = n[6]
- , u = n[7]
- , d = n[8]
- , p = n[9]
- , f = n[10]
- , g = n[11]
- , m = n[12]
- , v = n[13]
- , y = n[14]
- , A = n[15]
- , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
- , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
- , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
- , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
- , b = r * C + o * I + a * E + s * _;
- if (0 == b) {
- var w = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
- if (t)
- throw new Error(w);
- return console.warn(w),
- this.identity()
- }
- var T = 1 / b;
- return i[0] = C * T,
- i[1] = (v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A) * T,
- i[2] = (c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A) * T,
- i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
- i[4] = I * T,
- i[5] = (d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A) * T,
- i[6] = (m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A) * T,
- i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
- i[8] = E * T,
- i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A) * T,
- i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A) * T,
- i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
- i[12] = _ * T,
- i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y) * T,
- i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y) * T,
- i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
- this
- },
- makeRotationFromQuaternion: function(e) {
- var t = this.elements
- , i = e.x
- , n = e.y
- , r = e.z
- , o = e.w
- , a = i + i
- , s = n + n
- , l = r + r
- , c = i * a
- , h = i * s
- , u = i * l
- , d = n * s
- , p = n * l
- , f = r * l
- , g = o * a
- , m = o * s
- , v = o * l;
- return t[0] = 1 - (d + f),
- t[4] = h - v,
- t[8] = u + m,
- t[1] = h + v,
- t[5] = 1 - (c + f),
- t[9] = p - g,
- t[2] = u - m,
- t[6] = p + g,
- t[10] = 1 - (c + d),
- t[3] = 0,
- t[7] = 0,
- t[11] = 0,
- t[12] = 0,
- t[13] = 0,
- t[14] = 0,
- t[15] = 1,
- this
- }
- },
- o.Quaternion = function(e, t, i, n) {
- this._x = e || 0,
- this._y = t || 0,
- this._z = i || 0,
- this._w = void 0 !== n ? n : 1
- }
- ,
- o.Quaternion.prototype = {
- get x() {
- return this._x
- },
- set x(e) {
- this._x = e
- },
- get y() {
- return this._y
- },
- set y(e) {
- this._y = e
- },
- get z() {
- return this._z
- },
- set z(e) {
- this._z = e
- },
- get w() {
- return this._w
- },
- set w(e) {
- this._w = e
- },
- copy: function(e) {
- this._x = e.x,
- this._y = e.y,
- this._z = e.z,
- this._w = e.w
- },
- inverse: function() {
- return this.conjugate().normalize()
- },
- conjugate: function() {
- return this._x *= -1,
- this._y *= -1,
- this._z *= -1,
- this
- },
- length: function() {
- return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
- },
- normalize: function() {
- var e = this.length();
- return 0 === e ? (this._x = 0,
- this._y = 0,
- this._z = 0,
- this._w = 1) : (e = 1 / e,
- this._x = this._x * e,
- this._y = this._y * e,
- this._z = this._z * e,
- this._w = this._w * e),
- this
- },
- setFromAxisAngle: function(e, t) {
- var i = t / 2
- , n = Math.sin(i);
- return this._x = e.x * n,
- this._y = e.y * n,
- this._z = e.z * n,
- this._w = Math.cos(i),
- this
- },
- setFromUnitVectors: function(e, t) {
- return void 0 === n && (n = new o.Vector3),
- (r = o.dot(e, t) + 1) < 1e-6 ? (r = 0,
- 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),
- this._x = n.x,
- this._y = n.y,
- this._z = n.z,
- this._w = r,
- this.normalize()
- },
- multiply: function(e) {
- return this.multiplyQuaternions(this, e)
- },
- premultiply: function(e) {
- return this.multiplyQuaternions(e, this)
- },
- multiplyQuaternions: function(e, t) {
- var i = e._x
- , n = e._y
- , r = e._z
- , o = e._w
- , a = t._x
- , s = t._y
- , l = t._z
- , c = t._w;
- return this._x = i * c + o * a + n * l - r * s,
- this._y = n * c + o * s + r * a - i * l,
- this._z = r * c + o * l + i * s - n * a,
- this._w = o * c - i * a - n * s - r * l,
- this
- }
- },
- o.convertWorkshopVector = function(e) {
- return new o.Vector3(-e.x,e.y,e.z)
- }
- ,
- o.convertWorkshopQuaternion = function(e) {
- 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))
- }
- ,
- o.convertWorkshopOrthoZoom = function(e) {
- return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
- }
- ,
- o.convertWorkshopPanoramaQuaternion = function(e) {
- 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))
- }
- ,
- o.normalize = function(e) {
- var t = e.x * e.x + e.y * e.y + e.z * e.z
- , i = Math.sqrt(t);
- e.x /= i,
- e.y /= i,
- e.z /= i
- }
- ,
- o.dot = function(e, t) {
- return e.x * t.x + e.y * t.y + e.z * t.z
- }
- ,
- o.cross = function(e, t, i) {
- var n = e.x
- , r = e.y
- , o = e.z;
- i.x = r * t.z - o * t.y,
- i.y = o * t.x - n * t.z,
- i.z = n * t.y - r * t.x
- }
- ,
- o.setVector = function(e, t, i, n) {
- e.x = t,
- e.y = i,
- e.z = n
- }
- ,
- o.copyVector = function(e, t) {
- t.x = e.x,
- t.y = e.y,
- t.z = e.z
- }
- ,
- o.addVector = function(e, t) {
- e.x += t.x,
- e.y += t.y,
- e.z += t.z
- }
- ,
- o.subVector = function(e, t) {
- e.x -= t.x,
- e.y -= t.y,
- e.z -= t.z
- }
- ,
- o.applyQuaternionToVector = function(e, t) {
- var i = t.x
- , n = t.y
- , r = t.z
- , o = e.x
- , a = e.y
- , s = e.z
- , l = e.w
- , c = l * i + a * r - s * n
- , h = l * n + s * i - o * r
- , u = l * r + o * n - a * i
- , d = -o * i - a * n - s * r;
- t.x = c * l + d * -o + h * -s - u * -a,
- t.y = h * l + d * -a + u * -o - c * -s,
- t.z = u * l + d * -s + c * -a - h * -o
- }
- ,
- o.angleBetweenVectors = function(e, t) {
- return Math.acos(o.dot(e, t))
- }
- ,
- t.exports = o
- }
- , {
- "../constants": 8
- }],
- 177: [function(c, h, e) {
- (function(e) {
- "use strict";
- function t(e) {
- this.cache = null,
- this.expires = 0
- }
- function i() {
- this.baseUrl = null,
- this.cache = null,
- this.expires = 0
- }
- function n() {
- this.baseUrl = null,
- this.expires = 0
- }
- function r(e) {
- this.initialLoadingPromise = null,
- this.endpoint = e + "?type=3",
- this.urlContainer = null,
- this.authorizationHeader = s.getAuthorizationHeader(),
- this.containerClasses = [n, i, t]
- }
- c("./ajax");
- var o = c("./logger")
- , a = c("../constants")
- , s = c("./showcase")
- , l = (c("../ab"),
- new o(e));
- t.prototype = {
- version: 1,
- validate: function(e) {
- return "catalog.json"in e && 0 < Object.keys(e).length
- },
- update: function(e) {
- return this.cache = e,
- this.expires = Date.now() + a.signedUrlDefaultExpireTime,
- $.when()
- },
- get: function(e) {
- return this.cache[e]
- }
- },
- i.prototype = {
- version: 2,
- validate: function(e) {
- return "catalog.json"in e && "base.url"in e && 1 < Object.keys(e).length
- },
- update: function(e) {
- return this.baseUrl = e["base.url"],
- this.cache = e,
- this.expires = Date.now() + a.signedUrlDefaultExpireTime,
- $.when()
- },
- get: function(e) {
- var t = this.cache[e];
- return t ? this.baseUrl.replace("{{filename}}", e) + t : null
- }
- },
- n.prototype = {
- version: 3,
- validate: function(e) {
- return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
- },
- update: function(e) {
- return this.baseUrl = e.templates[0],
- e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + a.signedUrlDefaultExpireTime,
- $.when()
- },
- get: function(e) {
- return this.baseUrl.replace("{{filename}}", e)
- }
- },
- r.prototype = {
- init: function() {
- return this.initialLoadingPromise || (setInterval(function() {
- var e = this.urlContainer ? this.urlContainer.expires : Date.now();
- Date.now() + a.signedUrlRefreshBuffer > e && (l.debug("Refreshing urls..."),
- this.refresh().done(function() {
- l.debug("Refreshed")
- }).fail(function() {
- l.error("Failed url refresh, urls might go stale soon")
- }))
- }
- .bind(this), a.signedUrlCheckInterval),
- this.initialLoadingPromise = this.refresh()),
- this.initialLoadingPromise
- },
- refresh: function(e) {
- return {},
- $.Deferred().resolve()
- },
- get: function(e) {
- return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
- }
- },
- h.exports = r
- }
- ).call(this, "/js/util/ModelUrls.js")
- }
- , {
- "../ab": 3,
- "../constants": 8,
- "./ajax": 181,
- "./logger": 189,
- "./showcase": 193
- }],
- 178: [function(l, c, e) {
- (function(e) {
- "use strict";
- function t() {
- i.call(this),
- this.neighbourMap = {},
- this.map = null
- }
- 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"),
- l("./aStar")), T = new (l("./logger"))(e), i = l("./IndexedCollection"), s = l("./transitions");
- n.inherit(t, i),
- t.prototype.getIndex = function(e) {
- return e.id
- }
- ,
- t.prototype.find = function(e, t) {
- var i = n.filterAll(this.list, e);
- return 0 === i.length ? null : (t && t.forEach(function(e) {
- i = n.stableSort(i, e)
- }),
- i[0])
- }
- ,
- t.prototype.sortByScore = function(e, t) {
- var i = n.filterAll(this.list, e);
- return 0 === i.length ? null : i = i.map(function(i) {
- return {
- pano: i,
- score: t.reduce(function(e, t) {
- return e + t(i)
- }, 0)
- }
- }).sort(function(e, t) {
- return t.score - e.score
- })
- }
- ,
- t.prototype.lowestByScore = function(e, t, i) {
- return this.findRankedByScore(0, e, t, i)
- }
- ,
- t.prototype.findRankedByScore = function(e, t, i, n) {
- n && (n.candidates = null,
- n.pano = null),
- e = e || 0;
- var r = this.sortByScore(t, i);
- return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
- n.pano = r[e].pano),
- r[e].pano)
- }
- ,
- t.prototype.showPanoScores = function(e) {
- this.list.forEach(function(e) {
- e.removeTextSprite()
- });
- var t = 6344768;
- e.forEach(function(e) {
- e.pano.addTextSprite(e.score.toFixed(2), t),
- t = 16428055
- })
- }
- ,
- t.prototype.isNeighbour = function(e, t) {
- return this.neighbourMap[e.id][t.id]
- }
- ,
- t.prototype.getNeighbours = function(e) {
- return this.neighbourMap[e.id]
- }
- ,
- t.prototype.setNeighbour = function(e, t, i) {
- return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
- this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
- this.neighbourMap[e.id][e.id] = !0,
- this.neighbourMap[t.id][t.id] = !0,
- this.neighbourMap[e.id][t.id] = i,
- this.neighbourMap[t.id][e.id] = i,
- this.neighbourMap[e.id]
- }
- ,
- t.prototype.findClosest = function(e, t) {
- var i = [r.filters.isPanoAligned()];
- return t && i.push(r.filters.inDirection(e, t, .75)),
- this.find(i, [r.sortFunctions.distanceToPoint(e)])
- }
- ,
- t.prototype.dualNeighbors = function(e, t) {
- var i, n = [];
- for (i in this.neighbourMap[e.id])
- this.neighbourMap[t.id][i] && n.push(i);
- return n
- }
- ,
- t.prototype.populate_path_graph = function() {
- var e, t, i, n, r, o, a, s, l = Date.now(), c = {}, h = 0, u = new w.Vector3(0,0,0);
- for (e = 0; e < this.list.length; e += 1) {
- for (t in s = !(a = {}),
- i = (r = this.list[e]).neighbourPanos || r.findNeighourPanos())
- if (i[t]) {
- o = this.index[t],
- u.copy(r.floorPosition),
- u.sub(o.floorPosition);
- var d = Math.sqrt(u.x * u.x + u.z * u.z)
- , p = (Math.abs(u.y),
- Math.max(d, .01),
- Math.max(0, Math.abs(u.y) - .2));
- n = 0 < p ? (1,
- p = Math.pow(4 * p, 2),
- d = Math.pow(d, 2),
- Math.sqrt(p * p + d * d)) : (1,
- u.length()),
- a[o.id] = n,
- s = !0
- }
- s ? c[r.id] = a : h += 1
- }
- this.map = c,
- T.info("graph ready in " + (Date.now() - l) + "ms, " + h + " had no neighbors")
- }
- ,
- t.prototype.aStarSearch = function(e, t) {
- var i = Date.now()
- , n = new o({
- start: e,
- isEnd: function(e) {
- return e === t
- },
- neighbor: function(e) {
- var t = e.neighbourPanos || e.findNeighourPanos()
- , i = [];
- for (var n in t)
- i.push(this.index[n]);
- return i
- }
- .bind(this),
- distance: function(e, t) {
- return this.map[e.id][t.id]
- }
- .bind(this),
- heuristic: function(e, t) {
- return 1
- }
- .bind(this),
- hash: function(e) {
- return e.id
- },
- timeout: 5e3
- });
- if (T.debug("A* search in " + (Date.now() - i) + "ms"),
- "success" !== n.status)
- return T.debug("Did not find A* path from " + e + " to " + t),
- null;
- T.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
- var r = [];
- return n.path.forEach(function(e) {
- r.push(e.id)
- }),
- r
- }
- ,
- t.prototype.includeNodesNearPath = (f = new w.Vector3,
- g = new w.Vector3,
- m = new w.Vector3,
- v = new w.Vector3,
- y = new w.Vector3,
- A = new w.Vector3,
- C = new w.Vector3,
- I = new w.Vector3,
- E = [],
- _ = new w.Vector3,
- b = new w.Vector3,
- function(e, t) {
- if (e)
- for (var i = function(e, t, i) {
- return y.copy(t).sub(e),
- y.dot(i)
- }, n = function(e, t) {
- return i(_, e.position, m) - i(_, t.position, m)
- }, r = 0; r < e.length - 1; ) {
- var o = e[r]
- , a = e[r + 1]
- , s = this.index[o]
- , l = this.index[a];
- _.copy(s.position),
- b.copy(l.position),
- E.length = 0,
- f.copy(b).sub(_),
- m.copy(f).normalize();
- for (var c = 0; c < this.list.length; c++) {
- var h = this.list[c];
- y.copy(h.position).sub(_);
- var u = y.dot(m);
- 0 < u && (C.copy(m),
- C.multiplyScalar(u),
- A.copy(y),
- A.sub(C),
- A.length() < t && (g.copy(f).negate(),
- v.copy(g).normalize(),
- I.copy(h.position).sub(b),
- 0 < I.dot(v) && E.push(h)))
- }
- if (0 < E.length) {
- E.sort(n);
- for (var d = e.length + E.length - 1; d >= r + E.length; d--)
- e[d] = e[d - E.length];
- for (var p = 0; p < E.length; p++)
- e[p + r + 1] = E[p].id
- }
- r += E.length + 1
- }
- }
- ),
- t.prototype.fadeMarkerOpacity = function(e, t) {
- var i = void 0 === e ? a.panorama.markerOpacity : e
- , n = this.list.findIndex(function(e) {
- return e.marker
- });
- if (!(n < 0)) {
- var r = this.list[n].marker.material.opacity;
- if (r !== e) {
- var o = i - r;
- s.trigger({
- func: function(e, t) {
- var i = r + e * o;
- this.forEach(function(e) {
- e.marker && (e.marker.material.opacity = i)
- })
- }
- .bind(this),
- duration: void 0 === t ? a.markerOpacityTransitionTime : t,
- name: "_fpm"
- })
- }
- }
- }
- ,
- c.exports = t
- }
- ).call(this, "/js/util/PanoramaCollection.js")
- }
- , {
- "../objects/Panorama": 148,
- "../settings": 166,
- "./IndexedCollection": 175,
- "./aStar": 180,
- "./common": 185,
- "./logger": 189,
- "./transitions": 195,
- three: 217
- }],
- 179: [function(e, t, i) {
- "use strict";
- function n() {
- this.actionSequence = [],
- this.actionSequenceInProgress = !1
- }
- function r(e, t, i, n) {
- c.trackAlways("zoom_" + e, {
- from: t,
- to: i,
- pano: n
- })
- }
- var o, a, s, l, c = e("../analytics");
- n.prototype.reset = function(e) {
- this.actionSequenceInProgress = !1,
- this.actionSequence.length = 0
- }
- ,
- n.prototype.addZoomAction = (a = o = null,
- s = !1,
- l = function() {
- if (o = null,
- 0 < this.actionSequence.length) {
- var e = this.actionSequence[0].start
- , t = this.actionSequence[this.actionSequence.length - 1].end;
- 1 === e ? function(e, t) {
- r("initial", 1, e, t)
- }(t, a) : function(e, t, i) {
- r("followup", e, t, i)
- }(e, t, a)
- }
- this.reset()
- }
- ,
- function(e, t, i) {
- if (e !== t) {
- s || (l = l.bind(this),
- s = !0),
- o && (window.clearTimeout(o),
- o = null),
- i === a && this.actionSequenceInProgress || (this.reset(),
- a = i),
- this.actionSequenceInProgress = !0;
- var n = {
- start: e,
- end: t
- };
- this.actionSequence.push(n),
- o = window.setTimeout(l, 150)
- }
- }
- ),
- t.exports = n
- }
- , {
- "../analytics": 4
- }],
- 180: [function(e, t, i) {
- "use strict";
- function g(e) {
- if (void 0 === e.parent)
- return [e.data];
- var t = g(e.parent);
- return t.push(e.data),
- t
- }
- function m(e) {
- return e.toString()
- }
- function v(e, t) {
- return e.f - t.f
- }
- var y = e("Set")
- , A = e("heap")
- , C = e("dict");
- t.exports = function(e) {
- void 0 === e.timeout && (e.timeout = 1 / 0);
- var t = e.hash || m
- , i = {
- data: e.start,
- g: 0,
- h: e.heuristic(e.start)
- }
- , n = i;
- i.f = i.h;
- var r = new y
- , o = new A(v)
- , a = C();
- o.push(i),
- a.set(t(i.data), i);
- for (var s = new Date; o.size(); ) {
- if (new Date - s > e.timeout)
- return {
- status: "timeout",
- cost: n.g,
- path: g(n)
- };
- var l = o.pop();
- if (a.delete(t(l.data)),
- e.isEnd(l.data))
- return {
- status: "success",
- cost: l.g,
- path: g(l)
- };
- r.add(t(l.data));
- for (var c = e.neighbor(l.data), h = 0; h < c.length; h++) {
- var u = c[h];
- if (!r.contains(t(u))) {
- var d = l.g + e.distance(l.data, u)
- , p = a.get(t(u))
- , f = !1;
- if (void 0 === p)
- p = {
- data: u
- },
- a.set(t(u), p);
- else {
- if (p.g < d)
- continue;
- f = !0
- }
- p.parent = l,
- p.g = d,
- p.h = e.heuristic(u),
- p.f = d + p.h,
- p.h < n.h && (n = p),
- f ? o.heapify() : o.push(p)
- }
- }
- }
- return {
- status: "noPath",
- cost: n.g,
- path: g(n)
- }
- }
- }
- , {
- Set: 196,
- dict: 210,
- heap: 211
- }],
- 181: [function(i, n, e) {
- (function(e) {
- "use strict";
- function s(e, t, i) {
- function n() {
- l.warn("Retrying ", t),
- s(e, t, i).done(a.resolve.bind(a)).progress(a.notify.bind(a)).fail(a.reject.bind(a))
- }
- var r = function(e, t, i) {
- var n = new XMLHttpRequest;
- if (i && "withCredentials"in n)
- n.open(e, t, i);
- else if ("undefined" != typeof XDomainRequest)
- (n = new XDomainRequest).open(e, t);
- else {
- if (i)
- throw "Browser does not support CORS!";
- n.open(e, t)
- }
- return n
- }(e, t, !1);
- if ((i = i || {}).retries = void 0 !== i.retries ? i.retries : 0,
- i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
- i.responseType)
- if (-1 < ["arraybuffer", "text", "json"].indexOf(i.responseType))
- r.responseType = i.responseType;
- else {
- if ("image/jpeg" !== i.responseType)
- throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
- r.responseType = "arraybuffer"
- }
- if ("json" === i.responseType && r.setRequestHeader("Accept", "application/json"),
- i.auth && r.setRequestHeader("Authorization", i.auth),
- "object" == typeof i.data && (i.data = JSON.stringify(i.data),
- r.setRequestHeader("Content-Type", "application/json")),
- "object" == typeof i.headers)
- for (var o in i.headers)
- r.setRequestHeader(o, i.headers[o]);
- var a = $.Deferred();
- return r.onreadystatechange = function(e) {
- if (4 === this.readyState)
- if (500 <= this.status && this.status <= 600 && i.retry && i.retries < 3)
- i.retries++,
- setTimeout(n, 1e3);
- else if (200 === this.status) {
- var t = function(e, t) {
- var i = e.response;
- if ("json" === t && "object" != typeof i)
- try {
- i = JSON.parse(e.responseText)
- } catch (e) {
- return void a.reject({
- error: "Failed parsing JSON"
- })
- }
- else if ("image/jpeg" === t) {
- var n = new Uint8Array(e.response)
- , r = new Blob([n],{
- type: "image/jpeg"
- })
- , o = URL.createObjectURL(r);
- (i = new Image).src = o,
- i.crossOrigin = "Anonymous",
- i.onload = function() {
- URL.revokeObjectURL(o)
- }
- }
- return i
- }(this, i.responseType);
- a.resolve(t)
- } else
- a.reject(this)
- }
- ,
- r.onprogress = function(e) {
- a.notify(e)
- }
- ,
- r.send(i.data),
- a.promise()
- }
- function o(e, t) {
- var i = e + "__" + (t.responseType || null) + "__" + (t.auth || null) + "__" + (t.prefetchFrom || null);
- return t.headers && function(t) {
- return Object.keys(t).sort().map(function(e) {
- return {
- key: e,
- value: t[e]
- }
- })
- }(t.headers).forEach(function(e) {
- i += "__" + e.key + ":" + e.value
- }),
- i
- }
- var t = i("./logger")
- , a = i("../ab")
- , l = new t(e);
- window.URL = window.URL || window.webkitURL,
- window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
- window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {},
- n.exports = {
- get: function(e, t) {
- var i, n = void 0 === (t = t || {}).cache || t.cache;
- if (n) {
- var r = function(e, t) {
- return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[o(e, t)] : null
- }(e, t);
- if (r)
- return r
- }
- return i = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : s("GET", e, t),
- n && function(e, t, i) {
- window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[o(e, t)] = i)
- }(e, t, i),
- i
- },
- post: function(e, t) {
- return s("POST", e, t)
- },
- patch: function(e, t) {
- return s("PATCH", e, t)
- },
- getImage: function(e, t) {
- function i() {
- l.warn("Retrying ", e),
- o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
- }
- var n = $.Deferred()
- , r = new Image
- , o = this;
- return e = a.changeIfImageOptimzing(e),
- null != t || (t = 3),
- r.onerror = function() {
- 0 < t ? setTimeout(i, 1e3) : n.reject()
- }
- ,
- r.onload = function() {
- n.resolve(r)
- }
- ,
- r.crossOrigin = "anonymous",
- r.src = e,
- n
- }
- }
- }
- ).call(this, "/js/util/ajax.js")
- }
- , {
- "../ab": 3,
- "./logger": 189
- }],
- 182: [function(e, t, i) {
- "use strict";
- function n(e, t) {
- var i = window.navigator.userAgent.match(e);
- return i = i ? i[1].split(t) : [],
- {
- major: parseInt(i[0]) || 0,
- minor: parseInt(i[1]) || 0,
- patch: parseInt(i[2]) || 0
- }
- }
- var r = e("../exception/DeviceMismatchException");
- t.exports = {
- isFullscreen: function() {
- return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
- },
- supportsFullscreen: function() {
- return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
- },
- isPointerLocked: function() {
- return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
- },
- requestFullscreen: function(e, t) {
- e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
- t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
- },
- requestPointerLock: function() {
- var e;
- if (document.fullscreenElement)
- e = document.fullscreenElement();
- else if (document.mozFullscreenElement)
- e = document.mozFullscreenElement();
- else if (document.mozFullScreenElement)
- e = document.mozFullScreenElement();
- else {
- if (!document.webkitFullscreenElement)
- return;
- e = document.webkitFullscreenElement()
- }
- e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
- e.requestPointerLock(),
- $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
- },
- exitPointerLock: function() {
- document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
- document.exitPointerLock()
- },
- exitFullscreen: function() {
- document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
- },
- details: function() {
- var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
- return e ? {
- name: e[1],
- version: parseInt(e[2]),
- platform: navigator.platform
- } : {}
- },
- is: function(e) {
- return this.details() && this.details().name === e
- },
- inIframe: function() {
- return window.parent !== window
- },
- aspectRatio: function() {
- var e = $("#player").width() / $("#player").height();
- return isFinite(e) ? e : 0
- },
- userAgent: function() {
- return window.navigator.userAgent
- },
- isMobile: function() {
- var e = navigator.userAgent || navigator.vendor || window.opera;
- 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))
- },
- isLandscape: function() {
- return this.isMobile && 1 < this.aspectRatio()
- },
- isSmallScreen: function() {
- return screen.width / window.devicePixelRatio < 240
- },
- detectIE: function() {
- return -1 !== window.navigator.userAgent.indexOf("MSIE ") || !!navigator.userAgent.match(/Trident.*rv\:11\./)
- },
- detectSafari: function() {
- return -1 !== window.navigator.userAgent.indexOf("Safari") && !this.detectChrome()
- },
- detectFirefox: function() {
- return -1 !== window.navigator.userAgent.indexOf("Firefox")
- },
- detectChrome: function() {
- return -1 !== window.navigator.userAgent.indexOf("Chrome") && !this.detectOpera()
- },
- detectOpera: function() {
- return -1 !== window.navigator.userAgent.indexOf("OPR")
- },
- detectIOS: function() {
- return this.detectIPhone() || this.detectIPad() || this.detectIPod()
- },
- detectIPad: function() {
- var e = window.navigator.userAgent;
- return /iPad/.test(e)
- },
- detectIPod: function() {
- var e = window.navigator.userAgent;
- return /iPod/.test(e)
- },
- detectIPhone: function() {
- var e = window.navigator.userAgent;
- return /iPhone/.test(e)
- },
- detectAndroid: function() {
- return -1 !== window.navigator.userAgent.indexOf("Android")
- },
- detectAndroidMobile: function() {
- var e = window.navigator.userAgent;
- return this.detectAndroid() && -1 !== e.indexOf("Mobile")
- },
- detectSamsungNative: function() {
- var e = window.navigator.userAgent;
- return -1 !== e.indexOf("SM-G900H") || -1 !== e.indexOf("GT-I9500") || -1 !== e.indexOf("SM-N900")
- },
- detectSamsungS6: function() {
- return -1 !== window.navigator.userAgent.indexOf("SM-G92")
- },
- detectHUAWEI5X: function() {
- return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
- },
- detectWebVR: function() {
- return !(!window.navigator.getVRDisplays || !window.VRDisplay)
- },
- getVRDisplay: function() {
- var t = $.Deferred();
- return this.detectWebVR() ? (navigator.getVRDisplays().then(function(e) {
- 1 <= e.length && t.resolve(e[0]),
- t.reject(null)
- }),
- t) : t.reject(null)
- },
- iosVersion: function() {
- if (!this.detectIOS())
- throw new r("Did not detect an iDevice");
- return n(/((?:\d+\_?){1,3}) like Mac OS/, "_")
- },
- androidVersion: function() {
- if (!this.detectAndroid())
- throw new r("Did not detect an Android based device");
- return n(/Android ((?:\d+\.?){1,3})/, ".")
- },
- valueFromCookie: function(e, t) {
- var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
- if (!i)
- return t;
- var n = i[1];
- return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
- },
- valueFromHash: function(e, t) {
- var i = new RegExp("[#&?]" + e + "=([^#&?]*)").exec(window.location.href);
- if (!i)
- return t;
- var n = i[1];
- return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : window.decodeURIComponent(n)
- }
- }
- }
- , {
- "../exception/DeviceMismatchException": 56
- }],
- 183: [function(i, n, e) {
- (function(e) {
- "use strict";
- var o = i("../controls/serializer")
- , a = i("../util/math")
- , s = i("./browser")
- , l = i("../enum/Viewmode")
- , t = i("../util/logger")
- , c = i("three")
- , h = new t(e);
- n.exports = {
- getStartCameraOptions: function(e, t) {
- var i = function(e) {
- var t = s.valueFromHash("start", "")
- , i = {};
- if ("" !== t) {
- h.debug("Start override found in parameters, trying to parse..."),
- i = function(e) {
- return o.deserialize(e)
- }(t) || {};
- var n = s.valueFromHash("tag", null);
- n && (i.tag = n),
- i.panoId && (i.pano = e.get(i.panoId))
- }
- return i
- }(t);
- if (0 < Object.keys(i).length)
- return i;
- if (e.heroImage)
- i = function(e, t) {
- if (!e.heroImage || !e.heroImage.metadata.camera_position)
- return {};
- var i = {}
- , n = e.heroImage.metadata;
- h.debug("Using start position from thumbnail image"),
- i.position = n.camera_position,
- i.quaternion = n.camera_quaternion;
- try {
- i.mode = l.convertWorkshopModeInt(n.camera_mode),
- i.mode === l.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
- } catch (e) {
- h.debug(e.message)
- }
- return i
- }(e, t);
- else if (window.MP_PREFETCHED_MODELDATA.camera_start) {
- var n = window.MP_PREFETCHED_MODELDATA.camera_start;
- try {
- 0 < Object.keys(n).length && !a.isEmptyQuaternion(n.camera.quaternion) && (i.mode = l.convertWorkshopModeInt(n.mode),
- i.position = (new c.Vector3).fromArray(n.camera.position),
- i.quaternion = (new c.Quaternion).fromArray(n.camera.quaternion),
- i.zoom = a.convertWorkshopOrthoZoom(n.camera.zoom),
- n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
- h.debug("Using camera_start"),
- h.debug("Modeldata pano: ", i.pano.quaternion),
- h.debug("Camera start pano: ", n.pano.quaternion)),
- i.mode !== l.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility));
-
- } catch (e) {
- h.warn(e.message)
- if(i.mode == "panorama" && !i.pano){
- i.pano = t.list[0]
- }
- }
- }
- if (e.outsideAllowed() || i.mode === l.PANORAMA || (i = {}),
- i.mode === l.MESH && i.position && (i.mode = l.PANORAMA,
- i.pano = t.findClosest(i.position) ,
- i.quaternion = i.pano.quaternion),
- 0 === Object.keys(i).length) {
- var r = t.list[0];
- r && (i.mode = l.PANORAMA,
- i.pano = r,
- i.position = r.position,
- i.quaternion = r.quaternion,
- h.info("Starting at 1st pano " + r.id))
- }
-
-
-
-
- return i.mode = i.mode || l.DOLLHOUSE,
- i
- }
- }
- }
- ).call(this, "/js/util/camera.js")
- }
- , {
- "../controls/serializer": 14,
- "../enum/Viewmode": 51,
- "../util/logger": 189,
- "../util/math": 190,
- "./browser": 182,
- three: 217
- }],
- 184: [function(e, t, i) {
- "use strict";
- function r(e, t, i) {
- var n = t
- , r = i;
- return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (n / r)) * a.DEGREES_PER_RADIAN
- }
- function o(e, t, i) {
- var n = t
- , r = i;
- return 2 * Math.atan(Math.tan(e * a.RADIANS_PER_DEGREE / 2) * (r / n)) * a.DEGREES_PER_RADIAN
- }
- var a = e("./MathLight");
- t.exports = {
- clampVFOV: function(e, t, i, n) {
- return t < r(e, i, n) ? o(t, i, n) : e
- },
- getHFOVForCamera: function(e, t, i) {
- return r(e.fov, t, i)
- },
- getHFOVFromVFOV: r,
- getVFOVFromHFOV: o
- }
- }
- , {
- "./MathLight": 176
- }],
- 185: [function(e, t, i) {
- "use strict";
- var a = e("three");
- t.exports = {
- delayOneFrame: function(e) {
- window.setTimeout(e, 1)
- },
- normalizeUrl: function(e) {
- return e.replace("https://", "http://")
- },
- domainFromUrl: function(e) {
- var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
- return t ? t[3] : e
- },
- average: function(e, t) {
- if (0 === e.length)
- return null;
- for (var i = 0, n = 0, r = 0; r < e.length; r++) {
- i += t ? e[r][t] : e[r],
- n++
- }
- return i / n
- },
- countUnique: function(e) {
- for (var t = {}, i = 0; i < e.length; i++)
- t[e[i]] = 1 + (t[e[i]] || 0);
- return Object.keys(t).length
- },
- averageVectors: function(e, t) {
- var i = new a.Vector3;
- if (0 === e.length)
- return i;
- for (var n = 0, r = 0; r < e.length; r++) {
- var o = t ? e[r][t] : e[r];
- i.add(o),
- n++
- }
- return i.divideScalar(n)
- },
- equalLists: function(e, t) {
- if (e.length !== t.length)
- return !1;
- for (var i = 0; i < e.length; i++)
- if (e[i] !== t[i])
- return !1;
- return !0
- },
- lowerMedian: function(e, t) {
- return 0 === e.length ? null : (t = t || 2,
- e.sort(function(e, t) {
- return e - t
- }),
- e[Math.floor(e.length / t)])
- },
- stableSort: function(e, n) {
- return e.map(function(e, t) {
- return {
- value: e,
- index: t
- }
- }).sort(function(e, t) {
- var i = n(e.value, t.value);
- return 0 !== i ? i : e.index - t.index
- }).map(function(e) {
- return e.value
- })
- },
- filterAll: function(e, i) {
- return e.filter(function(t) {
- return i.every(function(e) {
- return e(t)
- })
- })
- },
- formatDate: function(e) {
- return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
- },
- formatDatetime: function(e) {
- return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
- },
- randomString: function(e) {
- for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
- t += i.charAt(Math.floor(Math.random() * i.length));
- return t
- },
- uint8ToBase64: function(e, t) {
- t && "number" == typeof t || (t = 8192);
- for (var i = [], n = 0; n < e.length; n += t)
- i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
- return btoa(i.join(""))
- },
- uuid4: function e(t) {
- return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
- },
- nth: function(e) {
- return 1 === (e %= 10) ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
- },
- extendObject: function(t, i) {
- return Object.keys(i).forEach(function(e) {
- t[e] = i[e]
- }),
- t
- },
- deepExtend: function e(t) {
- t = t || {};
- for (var i = 1; i < arguments.length; i++) {
- var n = arguments[i];
- if (n)
- for (var r in n)
- n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
- }
- return t
- },
- inherit: function(e, t) {
- e.prototype = Object.create(t.prototype),
- e.prototype.constructor = e
- },
- extend: function(e, t) {
- for (var i in t.prototype)
- e.prototype[i] = t.prototype[i]
- }
- },
- Math.sign = function(e) {
- return e < 0 ? -1 : 1
- }
- }
- , {
- three: 217
- }],
- 186: [function(e, t, i) {
- "use strict";
- var r = {
- linearTween: function(e, t, i, n) {
- return i * e / n + t
- },
- easeInQuad: function(e, t, i, n) {
- return i * (e /= n) * e + t
- },
- easeOutQuad: function(e, t, i, n) {
- return -i * (e /= n) * (e - 2) + t
- },
- easeInOutQuad: function(e, t, i, n) {
- return (e /= n / 2) < 1 ? i / 2 * e * e + t : -i / 2 * (--e * (e - 2) - 1) + t
- },
- easeInCubic: function(e, t, i, n) {
- return i * (e /= n) * e * e + t
- },
- easeOutCubic: function(e, t, i, n) {
- return e /= n,
- i * (--e * e * e + 1) + t
- },
- easeInOutCubic: function(e, t, i, n) {
- return (e /= n / 2) < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t
- },
- easeInQuart: function(e, t, i, n) {
- return i * (e /= n) * e * e * e + t
- },
- easeOutQuart: function(e, t, i, n) {
- return e /= n,
- -i * (--e * e * e * e - 1) + t
- },
- easeInOutQuart: function(e, t, i, n) {
- return (e /= n / 2) < 1 ? i / 2 * e * e * e * e + t : -i / 2 * ((e -= 2) * e * e * e - 2) + t
- },
- easeInQuint: function(e, t, i, n) {
- return i * (e /= n) * e * e * e * e + t
- },
- easeOutQuint: function(e, t, i, n) {
- return e /= n,
- i * (--e * e * e * e * e + 1) + t
- },
- easeInOutQuint: function(e, t, i, n) {
- return (e /= n / 2) < 1 ? i / 2 * e * e * e * e * e + t : i / 2 * ((e -= 2) * e * e * e * e + 2) + t
- },
- easeInSine: function(e, t, i, n) {
- return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
- },
- easeOutSine: function(e, t, i, n) {
- return i * Math.sin(e / n * (Math.PI / 2)) + t
- },
- easeInOutSine: function(e, t, i, n) {
- return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
- },
- easeInExpo: function(e, t, i, n) {
- return i * Math.pow(2, 10 * (e / n - 1)) + t
- },
- easeOutExpo: function(e, t, i, n) {
- return i * (1 - Math.pow(2, -10 * e / n)) + t
- },
- easeInOutExpo: function(e, t, i, n) {
- return (e /= n / 2) < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
- i / 2 * (2 - Math.pow(2, -10 * e)) + t)
- },
- easeInCirc: function(e, t, i, n) {
- return e /= n,
- -i * (Math.sqrt(1 - e * e) - 1) + t
- },
- easeOutCirc: function(e, t, i, n) {
- return e /= n,
- e--,
- i * Math.sqrt(1 - e * e) + t
- },
- easeInOutCirc: function(e, t, i, n) {
- return (e /= n / 2) < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
- i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
- },
- easeInElastic: function(e, t, i, n) {
- var r = 1.70158
- , o = 0
- , a = i;
- return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
- r = a < Math.abs(i) ? (a = i,
- o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
- -a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) + t)
- },
- easeOutElastic: function(e, t, i, n) {
- var r = 1.70158
- , o = 0
- , a = i;
- return 0 === e ? t : 1 == (e /= n) ? t + i : (o = o || .3 * n,
- r = a < Math.abs(i) ? (a = i,
- o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
- a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
- },
- easeInOutElastic: function(e, t, i, n) {
- var r = 1.70158
- , o = 0
- , a = i;
- return 0 === e ? t : 2 == (e /= n / 2) ? t + i : (o = o || n * (.3 * 1.5),
- r = a < Math.abs(i) ? (a = i,
- o / 4) : o / (2 * Math.PI) * Math.asin(i / a),
- 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)
- },
- easeInBack: function(e, t, i, n, r) {
- return void 0 === r && (r = 1.70158),
- i * (e /= n) * e * ((r + 1) * e - r) + t
- },
- easeOutBack: function(e, t, i, n, r) {
- return void 0 === r && (r = 1.70158),
- i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
- },
- easeInOutBack: function(e, t, i, n, r) {
- return void 0 === r && (r = 1.70158),
- (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
- },
- easeOutBounce: function(e, t, i, n) {
- 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
- },
- easeInBounce: function(e, t, i, n) {
- return i - r.easeOutBounce(n - e, 0, i, n) + t
- },
- easeInOutBounce: function(e, t, i, n) {
- 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
- }
- };
- t.exports = r
- }
- , {}],
- 187: [function(e, t, i) {
- "use strict";
- function n() {
- this.events = [],
- this.valid = !1
- }
- var r = e("../enum/Joystick");
- n.prototype.push = function(e, t) {
- this.events.push({
- direction: e,
- pano: t
- }),
- this.valid = !0
- }
- ,
- n.prototype.pop = function(e) {
- var t = this.events.pop();
- return this.events.length < 1 && (this.valid = !1),
- t
- }
- ,
- n.prototype.peek = function() {
- return this.events.length ? this.events[this.events.length - 1] : {
- direction: null,
- pano: null
- }
- }
- ,
- n.prototype.invalidate = function() {
- this.events = [],
- this.valid = !1
- }
- ,
- n.prototype.reversePano = function(e) {
- if (!this.valid)
- return null;
- var t = this.peek();
- return r.opposite(e) === t.direction ? (this.pop(),
- t.pano) : null
- }
- ,
- t.exports = n
- }
- , {
- "../enum/Joystick": 29
- }],
- 188: [function(e, t, i) {
- "use strict";
- t.exports = {
- vector: function(t, i) {
- var n = t.clone();
- return i = i.clone(),
- function(e) {
- t.set(n.x * (1 - e) + i.x * e, n.y * (1 - e) + i.y * e, n.z * (1 - e) + i.z * e)
- }
- },
- quaternion: function(t, i) {
- var n = t.clone();
- return function(e) {
- t.copy(n).slerp(i, e)
- }
- },
- property: function(t, i, n, r) {
- var o = t[i];
- return function(e) {
- t[i] = o * (1 - e) + n * e,
- r && r(t[i])
- }
- },
- uniform: function(t, i, n) {
- var r = t.material.uniforms[i].value;
- return function(e) {
- t.material.uniforms[i] && (t.material.uniforms[i].value = r * (1 - e) + n * e)
- }
- },
- matrix4: function(o, a) {
- var s = o.clone();
- return function(e) {
- for (var t = o.elements, i = s.elements, n = a.elements, r = 0; r < 16; r++)
- t[r] = i[r] * (1 - e) + n[r] * e
- }
- },
- allUniforms: function(e, t, i) {
- var n = e.map(function(e) {
- return this.uniform(e, t, i)
- }
- .bind(this));
- return function(t) {
- n.forEach(function(e) {
- e(t)
- })
- }
- }
- }
- }
- , {}],
- 189: [function(e, t, i) {
- "use strict";
- function h(n) {
- var e, t, i, r, o = n.split("/"), a = "[" + o[o.length - 1].replace(".js", "") + "]", s = {};
- if (h.consoleEnabled) {
- var l = function(e) {
- $("#debug-console").append("<p>" + e + "</p>"),
- $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
- };
- e = function(e) {
- l(Array.prototype.slice.call(arguments).join(" "))
- }
- ,
- t = function(e) {
- l(Array.prototype.slice.call(arguments).join(" "))
- }
- ,
- i = function(e) {
- l("WARN: " + Array.prototype.slice.call(arguments).join(" "))
- }
- ,
- r = function(e) {
- l("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
- }
- } else
- console.log ? (e = console.log,
- t = console.info ? console.info : console.log,
- i = console.warn ? console.warn : console.log,
- r = console.error ? console.error : console.log) : e = t = i = r = function() {}
- ;
- function c(e) {
- return [a, h.timestamp()].concat(Array.prototype.slice.call(e))
- }
- return {
- debug: function() {
- h.level >= h.levels.debug && e.apply(console, c(arguments))
- },
- info: function() {
- h.level >= h.levels.info && t.apply(console, c(arguments))
- },
- warn: function() {
- (function(e, t) {
- if (u) {
- var i = Array.prototype.slice.call(e).join(" ");
- u.captureMessage(i, {
- level: t,
- path: n,
- timestamp: h.timestamp()
- })
- }
- }
- )(arguments, "warn"),
- h.level >= h.levels.warn && i.apply(console, c(arguments))
- },
- error: function() {
- (function(e, t) {
- if (u) {
- var i = Array.prototype.slice.call(e).join(" ");
- u.captureException(new Error(i), {
- level: t,
- path: n,
- timestamp: h.timestamp()
- })
- }
- }
- )(arguments, "error"),
- h.level >= h.levels.error && r.apply(console, c(arguments))
- },
- v3str: function(e, t) {
- var i = void 0 === t ? 2 : t;
- return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
- },
- eulstr: function(e, t) {
- var i = void 0 === t ? 2 : t;
- return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
- },
- time: function(e) {
- h.level >= h.levels.debug && (s[e] = Date.now())
- },
- timeEnd: function(e) {
- if (h.level >= h.levels.debug) {
- var t = s[e];
- if (!t)
- return;
- var i = (Date.now() - t) / 1e3;
- this.debug(e, i + "s")
- }
- }
- }
- }
- var u = window.Raven;
- h.timestamp = function() {
- return (Date.now() - window.navigationStart) / 1e3 + "s"
- }
- ,
- h.level = (h.levels = {
- debug: 3,
- info: 2,
- warn: 1,
- error: 0
- }).info,
- t.exports = h
- }
- , {}],
- 190: [function(e, t, i) {
- "use strict";
- var o = e("three")
- , r = e("../enum/GLCubeFaces");
- e("../constants");
- t.exports = {
- convertVisionVector: function(e) {
- return new o.Vector3(e.x,e.z,-e.y)
- },
- convertVisionQuaternion: function(e) {
- 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)))
- },
- convertWorkshopVector: function(e) {
- return new o.Vector3(-e.x,e.y,e.z)
- },
- convertWorkshopQuaternion: function(e) {
- 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))
- },
- convertWorkshopPanoramaQuaternion: function(e) {
- 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)))
- },
- convertWorkshopOrthoZoom: function(e) {
- return -1 === e ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight
- },
- toPrecision: function(e, t) {
- function i(e, t) {
- var i = Math.pow(10, t);
- return Math.round(e * i) / i
- }
- if (e instanceof Array) {
- for (var n = 0; n < e.length; n++)
- e[n] = i(e[n], t);
- return e
- }
- return i(e, t)
- },
- isEmptyQuaternion: function(e) {
- return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
- },
- projectPositionToCanvas: function(e, t, i) {
- (i = i || new o.Vector3).copy(e);
- var n = .5 * $("#player").width()
- , r = .5 * $("#player").height();
- return i.project(t),
- i.x = i.x * n + n,
- i.y = -i.y * r + r,
- i
- },
- convertScreenPositionToNDC: function(e, t, i) {
- return (i = i || new o.Vector2).x = e / $("#player").width() * 2 - 1,
- i.y = -t / $("#player").height() * 2 + 1,
- i
- },
- constrainedTurn: function(e) {
- var t = e % (2 * Math.PI);
- return t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
- },
- getFOVDotThreshold: function(e) {
- return Math.cos(o.Math.degToRad(e / 2))
- },
- transform2DForwardVectorByCubeFace: function(e, t, i, n) {
- switch (e) {
- case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
- i.set(1, t.y, t.x);
- break;
- case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
- i.set(-1, t.y, -t.x);
- break;
- case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
- i.set(-t.x, 1, -t.y);
- break;
- case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
- i.set(-t.x, -1, t.y);
- break;
- case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
- i.set(-t.x, t.y, 1);
- break;
- case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
- i.set(t.x, t.y, -1)
- }
- n && i.normalize()
- },
- //add:
- getPos2d : function(point, camera, dom){
- var camera = camera ;
- var dom = dom;
- 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);
-
- var x,y;
- x = (pos.x + 1) / 2 * dom.clientWidth;
- y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
-
- var inSight = x <= dom.clientWidth && x >= 0
- && y <= dom.clientHeight && y >= 0
-
-
- return {
- pos: new THREE.Vector2(x,y),
- vector: pos,
- trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
- inSight : inSight //在屏幕范围内可见
- };
- },
- }
- }
- , {
- "../constants": 8,
- "../enum/GLCubeFaces": 25,
- three: 217
- }],
- 191: [function(e, t, i) {
- "use strict";
- function o(e) {
- return r[e]
- }
- var n = e("../enum/GLCubeFaces")
- , a = [0, 1, 2, 3, 4, 5]
- , r = {
- 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
- 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
- 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
- 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
- 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
- 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
- };
- t.exports = {
- mapFaceToCubemapFace: o,
- getCubemapUrls: function(i, n, r) {
- return a.map(function(e, t) {
- return i.get("pan/" + r + "/" + n + "_skybox" + o(e) + ".jpg")
- }
- .bind(this))
- }
- }
- }
- , {
- "../enum/GLCubeFaces": 25
- }],
- 192: [function(e, t, i) {
- "use strict";
- t.exports = {
- captureErrors: function(e, t, i) {
- if ("Raven"in window) {
- Raven.config(e, t).install(),
- i && Raven.setTagsContext(i);
- var n = console.warn
- , r = console.error;
- console.warn = function() {
- var e = Array.prototype.slice.call(arguments);
- Raven.captureMessage(e.join(" "), {
- level: "warning"
- }),
- n.apply(console, e)
- }
- ,
- console.error = function() {
- var e = Array.prototype.slice.call(arguments);
- Raven.captureException(new Error(e.join(" ")), {
- level: "error"
- }),
- r.apply(console, e)
- }
- } else
- console.error("Raven not found, not capturing errors.")
- }
- }
- }
- , {}],
- 193: [function(c, h, e) {
- (function(e) {
- "use strict";
- var i, n = c("./browser"), r = c("../constants"), o = c("url"), t = c("./logger"), a = c("three"), s = new t(e), l = {
- getAuthorizationHeader: function() {
- var e = n.valueFromHash("auth");
- if (e)
- return e.replace(",", " ");
- var t = n.valueFromCookie("token");
- return t ? "Token " + t : null
- },
- parseSidUrl: function(e) {
- var t, i;
- if (t = g_Prefix,
- (e = e || "").match(/^https?/)) {
- o.parse(e);
- t = g_Prefix,
- i = e
- } else
- i = (t = g_Prefix) + "data/" + e;
- return {
- urlBase: t,
- urlModel: i,
- urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
- urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
- }
- },
- getModelIDFromQueryString: function() {
- return n.valueFromHash("model") || n.valueFromHash("m")
- },
- /* normalizeModeldata: function(e, i) {
- e = JSON.parse(JSON.stringify(e));
- var n = null;
- if (e.images.forEach(function(t) {
- if (t.metadata) {
- if ("string" == typeof t.metadata)
- try {
- t.metadata = JSON.parse(t.metadata)
- } catch (e) {
- s.warn("Unable to parse image metadata"),
- t.metadata = null
- }
- else
- "object" == typeof t.metadata && s.debug("image.metadata already a JSON object");
- t.metadata.camera_position instanceof Array ? (t.metadata.camera_position = (new a.Vector3).fromArray(t.metadata.camera_position),
- 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)),
- t.metadata.camera_position && (t.metadata.camera_position = i.convertWorkshopVector(t.metadata.camera_position)),
- t.metadata.zoom = t.metadata.zoom || 1),
- !n && e.icon && e.icon === t.sid && (n = t.metadata)
- }
- }),
- n && n.camera_quaternion && n.camera_position && n.scan_position && n.scan_quaternion) {
- var t = {};
- t.pano = {
- quaternion: i.convertWorkshopPanoramaQuaternion(n.scan_quaternion),
- position: i.convertWorkshopVector(n.scan_position),
- uuid: n.scan_id
- },
- t.camera = {
- quaternion: n.camera_quaternion,
- position: n.camera_position
- },
- e.startPano = t
- }
- return e
- }, */
-
-
-
- normalizeModeldata: function(e, t) {//xzw 修改导览images数据
- e = JSON.parse(JSON.stringify(e));
- var i = null;
- if (e.images.forEach(function(n) {
- if(!n.metadata) return;
- if ("string" == typeof n.metadata)
- try {
- n.metadata = JSON.parse(n.metadata)
- } catch (e) {
- s.warn("Unable to parse image metadata"),
- n.metadata = null
- }
- else{
- "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
- }
- if(n.metadata.camera_position instanceof Array){//xzw 改的格式
- n.metadata.camera_position = new a.Vector3().fromArray(n.metadata.camera_position);
- n.metadata.camera_quaternion = new a.Quaternion().fromArray(n.metadata.camera_quaternion);
- }else{
- n.metadata.camera_position = new a.Vector3().copy(n.metadata.camera_position)
- n.metadata.camera_quaternion = new a.Quaternion().copy(n.metadata.camera_quaternion)
- /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
- n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
- }
- !i && e.icon && e.icon === n.sid && (i = n.metadata)
- }),
- //icon初始视角的:
- i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
- var n = {};
- n.pano = {
- quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
- position: t.convertWorkshopVector(i.scan_position),
- uuid: i.scan_id
- },
- n.camera = {
- quaternion: i.camera_quaternion,
- position: i.camera_position
- },
- e.startPano = n
- }
- return e
- },
-
-
-
-
-
-
- visionVersionToInt: (i = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join("")),
- function(e) {
- if (!e)
- throw new Error("Vision version is required");
- var t = i.exec(e);
- if (null === t)
- throw new Error("String is not a vision version: " + e);
- return parseInt(t[1])
- }
- ),
- modelDataPromisesTiles: function(e) {
- var t = e.vision_version || window.MP_PREFETCHED_MODELDATA.vision_version;
- if (t)
- try {
- return l.visionVersionToInt(t) >= l.visionVersionToInt(r.visionTilingStartVersion)
- } catch (e) {
- s.warn("Invalid vision version: " + t)
- }
- return !1
- }
- };
- h.exports = l
- }
- ).call(this, "/js/util/showcase.js")
- }
- , {
- "../constants": 8,
- "./browser": 182,
- "./logger": 189,
- three: 217,
- url: 208
- }],
- 194: [function(e, t, i) {
- "use strict";
- var r = e("../util/ajax")
- , o = e("three")
- , a = e("../settings")
- , s = {};
- t.exports = {
- load: function(e, t, i) {
- var n = s[e];
- return n ? t && setTimeout(function() {
- t(n)
- }, 1) : (n = new o.Texture,
- a.minimalMemoryMode && (n.minFilter = o.LinearFilter,
- n.magFilter = o.LinearFilter,
- n.generateMipmaps = !1),
- n.sourceFile = e,
- s[e] = n,
- r.getImage(e).then(function(e) {
- n.image = e,
- n.needsUpdate = !0,
- t && t(n)
- }).fail(i)),
- n
- },
- loadBase64: function(e, t) {
- t = t || "png";
- var i = new o.Texture;
- return i.image = document.createElement("img"),
- i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
- a.minimalMemoryMode && (i.minFilter = o.LinearFilter,
- i.magFilter = o.LinearFilter,
- i.generateMipmaps = !1),
- i.needsUpdate = !0,
- i
- },
- isLoaded: function(e) {
- return !!s[e]
- }
- }
- window.Texture = t.exports
- }
- , {
- "../settings": 166,
- "../util/ajax": 181,
- three: 217
- }],
- 195: [function(e, t, i) {
- "use strict";
- var l = e("./easing");
- t.exports = {
- globalDone: null,
- funcs: [],
- counter: 0,
- uniqueID: 0,
- start: function(e, t, i, n, r, o, a) {
- return n = n || 0,
- this.funcs.push({
- func: e,
- current: -n * Math.abs(t),
- duration: (1 - Math.max(n, 0)) * Math.abs(t),
- done: i,
- easing: r || l.linearTween,
- cycling: t < 0,
- running: !0,
- debug: n < 0,
- name: o || "T" + this.counter,
- id: void 0 === a ? this.counter : a,
- paused: !1
- }),
- e(0, 16),
- this.counter += 1,
- e
- },
- trigger: function(e) {
- var t = void 0 === e.delayRatio ? 0 : e.delayRatio
- , i = e.func || function() {}
- , n = void 0 === e.duration ? 0 : e.duration;
- void 0 !== e.cycling && e.cycling && (n = -Math.abs(n));
- var r = e.done || null
- , o = e.easing || l.linearTween
- , a = e.name || "R" + this.counter
- , s = void 0 === e.id ? this.counter : e.id;
- return this.start(i, n, r, t, o, a, s)
- },
- setTimeout: function(e, t, i) {
- var n = void 0 === i ? this.counter : i;
- return this.trigger({
- done: e,
- duration: void 0 === t ? 0 : t,
- name: "O" + this.counter,
- id: n
- })
- },
- pause: function() {
- this.paused = !0
- },
- resume: function() {
- this.paused = !1
- },
- update: function(n) {
- this.funcs.forEach(function(e) {
- if (!(e.paused || (e.current += 1e3 * n,
- e.current < 0)))
- if (e.current >= e.duration && !e.cycling) {
- var t = e.easing(1, 0, 1, 1);
- e.func(t, 1e3 * n),
- e.done && e.done(),
- e.running = !1
- } else {
- var i = e.easing(e.current % e.duration / e.duration, 0, 1, 1);
- (e.func(i, 1e3 * n) || !1) && (e.done && e.done(),
- e.running = !1)
- }
- });
- var e = this.funcs.length;
- this.funcs = this.funcs.filter(function(e) {
- return e.running
- });
- var t = this.funcs.length;
- if (0 < e && 0 === t && this.globalDone) {
- var i = this.globalDone;
- this.globalDone = null,
- i()
- }
- },
- adjustSpeed: function(e, t) {
- for (var i = this.getById(e), n = 0; n < i.length; n++) {
- var r = i[n];
- r.duration /= t,
- r.current /= t
- }
- },
- getById: function(t) {
- return this.funcs.filter(function(e) {
- return t === e.id
- })
- },
- get: function(e) {
- for (var t = 0; t < this.funcs.length; t += 1)
- if (this.funcs[t].func === e)
- return this.funcs[t];
- return null
- },
- isRunning: function(e) {
- var t = this.get(e);
- return null !== t && t.running
- },
- countActive: function() {
- for (var e = 0, t = 0; t < this.funcs.length; t += 1)
- e += this.funcs[t].running;
- return e
- },
- listActive: function() {
- for (var e = [], t = 0; t < this.funcs.length; t += 1)
- this.funcs[t].running && e.push(this.funcs[t].name);
- return e
- },
- done: function(e) {
- this.globalDone = e
- },
- cancelById: function(e) {
- var t = void 0 === e ? 0 : e;
- this.funcs = this.funcs.filter(function(e) {
- return e.id !== t
- })
- },
- cancel: function(t) {
- this.funcs = this.funcs.filter(function(e) {
- return e.func !== t
- })
- },
- getUniqueId: function() {
- return this.uniqueID -= 1,
- this.uniqueID
- }
- }
- }
- , {
- "./easing": 186
- }],
- 196: [function(e, t, i) {
- function n(e) {
- if (this.set = {},
- this.infContains = function() {
- return !0
- }
- ,
- "object" == typeof e)
- if (e instanceof Array)
- for (var t = 0; t < e.length; t++)
- this.set[e[t]] = !0;
- else
- this.set = e;
- else if ("function" == typeof e)
- this.infContains = e;
- else if (void 0 !== e)
- throw new Error("set must be either an array or an object.")
- }
- (t.exports = n).prototype.has = n.prototype.contains = function(e) {
- return !!this.set[e]
- }
- ,
- n.prototype.add = function(e) {
- if (1 == arguments.length)
- this.set[e] = !0;
- else
- for (var t = 0; t < arguments.length; t++)
- this.set[arguments[t]] = !0
- }
- ,
- n.prototype.addAll = function(e) {
- if ("object" != typeof e && !(e instanceof Array))
- throw new Error("arr must be an array.");
- for (var t = 0; t < e.length; t++)
- this.add(e[t])
- }
- ,
- n.prototype.delete = n.prototype.remove = function(e) {
- if (1 == arguments.length)
- delete this.set[e];
- else
- for (var t = 0; t < arguments.length; t++)
- delete this.set[arguments[t]]
- }
- ,
- n.prototype.clear = function() {
- this.set = {}
- }
- ,
- n.prototype.size = function() {
- return Object.keys(this.set).length
- }
- ,
- n.prototype.toString = function() {
- return "{" + Object.keys(this.set).toString() + "}"
- }
- ,
- n.prototype["*values"] = n.prototype.toArray = function() {
- return void 0 === this.set ? [] : Object.keys(this.set)
- }
- }
- , {}],
- 197: [function(e, t, i) {}
- , {}],
- 198: [function(N, e, F) {
- (function(e) {
- "use strict";
- function i() {
- return u.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
- }
- function o(e, t) {
- if (i() < t)
- throw new RangeError("Invalid typed array length");
- return u.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t)).__proto__ = u.prototype : (null === e && (e = new u(t)),
- e.length = t),
- e
- }
- function u(e, t, i) {
- if (!(u.TYPED_ARRAY_SUPPORT || this instanceof u))
- return new u(e,t,i);
- if ("number" != typeof e)
- return n(this, e, t, i);
- if ("string" == typeof t)
- throw new Error("If encoding is specified then the first argument must be a string");
- return a(this, e)
- }
- function n(e, t, i, n) {
- if ("number" == typeof t)
- throw new TypeError('"value" argument must not be a number');
- return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? function(e, t, i, n) {
- if (t.byteLength,
- i < 0 || t.byteLength < i)
- throw new RangeError("'offset' is out of bounds");
- if (t.byteLength < i + (n || 0))
- throw new RangeError("'length' is out of bounds");
- return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
- u.TYPED_ARRAY_SUPPORT ? (e = t).__proto__ = u.prototype : e = s(e, t),
- e
- }(e, t, i, n) : "string" == typeof t ? function(e, t, i) {
- if ("string" == typeof i && "" !== i || (i = "utf8"),
- !u.isEncoding(i))
- throw new TypeError('"encoding" must be a valid string encoding');
- var n = 0 | c(t, i)
- , r = (e = o(e, n)).write(t, i);
- return r !== n && (e = e.slice(0, r)),
- e
- }(e, t, i) : function(e, t) {
- if (u.isBuffer(t)) {
- var i = 0 | l(t.length);
- return 0 === (e = o(e, i)).length || t.copy(e, 0, 0, i),
- e
- }
- if (t) {
- if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
- return "number" != typeof t.length || function(e) {
- return e != e
- }(t.length) ? o(e, 0) : s(e, t);
- if ("Buffer" === t.type && L(t.data))
- return s(e, t.data)
- }
- throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
- }(e, t)
- }
- function r(e) {
- if ("number" != typeof e)
- throw new TypeError('"size" argument must be a number');
- if (e < 0)
- throw new RangeError('"size" argument must not be negative')
- }
- function a(e, t) {
- if (r(t),
- e = o(e, t < 0 ? 0 : 0 | l(t)),
- !u.TYPED_ARRAY_SUPPORT)
- for (var i = 0; i < t; ++i)
- e[i] = 0;
- return e
- }
- function s(e, t) {
- var i = t.length < 0 ? 0 : 0 | l(t.length);
- e = o(e, i);
- for (var n = 0; n < i; n += 1)
- e[n] = 255 & t[n];
- return e
- }
- function l(e) {
- if (e >= i())
- throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i().toString(16) + " bytes");
- return 0 | e
- }
- function c(e, t) {
- if (u.isBuffer(e))
- return e.length;
- if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
- return e.byteLength;
- "string" != typeof e && (e = "" + e);
- var i = e.length;
- if (0 === i)
- return 0;
- for (var n = !1; ; )
- switch (t) {
- case "ascii":
- case "latin1":
- case "binary":
- return i;
- case "utf8":
- case "utf-8":
- case void 0:
- return S(e).length;
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return 2 * i;
- case "hex":
- return i >>> 1;
- case "base64":
- return M(e).length;
- default:
- if (n)
- return S(e).length;
- t = ("" + t).toLowerCase(),
- n = !0
- }
- }
- function h(e, t, i) {
- var n = e[t];
- e[t] = e[i],
- e[i] = n
- }
- function d(e, t, i, n, r) {
- if (0 === e.length)
- return -1;
- if ("string" == typeof i ? (n = i,
- i = 0) : 2147483647 < i ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
- i = +i,
- isNaN(i) && (i = r ? 0 : e.length - 1),
- i < 0 && (i = e.length + i),
- i >= e.length) {
- if (r)
- return -1;
- i = e.length - 1
- } else if (i < 0) {
- if (!r)
- return -1;
- i = 0
- }
- if ("string" == typeof t && (t = u.from(t, n)),
- u.isBuffer(t))
- return 0 === t.length ? -1 : p(e, t, i, n, r);
- if ("number" == typeof t)
- return t &= 255,
- 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);
- throw new TypeError("val must be string, number or Buffer")
- }
- function p(e, t, i, n, r) {
- function o(e, t) {
- return 1 === s ? e[t] : e.readUInt16BE(t * s)
- }
- var a, s = 1, l = e.length, c = t.length;
- if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
- if (e.length < 2 || t.length < 2)
- return -1;
- l /= s = 2,
- c /= 2,
- i /= 2
- }
- if (r) {
- var h = -1;
- for (a = i; a < l; a++)
- if (o(e, a) === o(t, -1 === h ? 0 : a - h)) {
- if (-1 === h && (h = a),
- a - h + 1 === c)
- return h * s
- } else
- -1 !== h && (a -= a - h),
- h = -1
- } else
- for (l < i + c && (i = l - c),
- a = i; 0 <= a; a--) {
- for (var u = !0, d = 0; d < c; d++)
- if (o(e, a + d) !== o(t, d)) {
- u = !1;
- break
- }
- if (u)
- return a
- }
- return -1
- }
- function g(e, t, i, n) {
- i = Number(i) || 0;
- var r = e.length - i;
- n ? r < (n = Number(n)) && (n = r) : n = r;
- var o = t.length;
- if (o % 2 != 0)
- throw new TypeError("Invalid hex string");
- o / 2 < n && (n = o / 2);
- for (var a = 0; a < n; ++a) {
- var s = parseInt(t.substr(2 * a, 2), 16);
- if (isNaN(s))
- return a;
- e[i + a] = s
- }
- return a
- }
- function m(e, t, i, n) {
- return R(function(e) {
- for (var t = [], i = 0; i < e.length; ++i)
- t.push(255 & e.charCodeAt(i));
- return t
- }(t), e, i, n)
- }
- function f(e, t, i) {
- i = Math.min(e.length, i);
- for (var n = [], r = t; r < i; ) {
- var o, a, s, l, c = e[r], h = null, u = 239 < c ? 4 : 223 < c ? 3 : 191 < c ? 2 : 1;
- if (r + u <= i)
- switch (u) {
- case 1:
- c < 128 && (h = c);
- break;
- case 2:
- 128 == (192 & (o = e[r + 1])) && (127 < (l = (31 & c) << 6 | 63 & o) && (h = l));
- break;
- case 3:
- o = e[r + 1],
- a = e[r + 2],
- 128 == (192 & o) && 128 == (192 & a) && (2047 < (l = (15 & c) << 12 | (63 & o) << 6 | 63 & a) && (l < 55296 || 57343 < l) && (h = l));
- break;
- case 4:
- o = e[r + 1],
- a = e[r + 2],
- s = e[r + 3],
- 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))
- }
- null === h ? (h = 65533,
- u = 1) : 65535 < h && (h -= 65536,
- n.push(h >>> 10 & 1023 | 55296),
- h = 56320 | 1023 & h),
- n.push(h),
- r += u
- }
- return function(e) {
- var t = e.length;
- if (t <= D)
- return String.fromCharCode.apply(String, e);
- for (var i = "", n = 0; n < t; )
- i += String.fromCharCode.apply(String, e.slice(n, n += D));
- return i
- }(n)
- }
- function v(e, t, i) {
- var n = "";
- i = Math.min(e.length, i);
- for (var r = t; r < i; ++r)
- n += String.fromCharCode(127 & e[r]);
- return n
- }
- function y(e, t, i) {
- var n = "";
- i = Math.min(e.length, i);
- for (var r = t; r < i; ++r)
- n += String.fromCharCode(e[r]);
- return n
- }
- function A(e, t, i) {
- var n, r = e.length;
- (!t || t < 0) && (t = 0),
- (!i || i < 0 || r < i) && (i = r);
- for (var o = "", a = t; a < i; ++a)
- o += (n = e[a]) < 16 ? "0" + n.toString(16) : n.toString(16);
- return o
- }
- function C(e, t, i) {
- for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
- r += String.fromCharCode(n[o] + 256 * n[o + 1]);
- return r
- }
- function I(e, t, i) {
- if (e % 1 != 0 || e < 0)
- throw new RangeError("offset is not uint");
- if (i < e + t)
- throw new RangeError("Trying to access beyond buffer length")
- }
- function E(e, t, i, n, r, o) {
- if (!u.isBuffer(e))
- throw new TypeError('"buffer" argument must be a Buffer instance');
- if (r < t || t < o)
- throw new RangeError('"value" argument is out of bounds');
- if (i + n > e.length)
- throw new RangeError("Index out of range")
- }
- function _(e, t, i, n) {
- t < 0 && (t = 65535 + t + 1);
- for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
- e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
- }
- function b(e, t, i, n) {
- t < 0 && (t = 4294967295 + t + 1);
- for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
- e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
- }
- function w(e, t, i, n) {
- if (i + n > e.length)
- throw new RangeError("Index out of range");
- if (i < 0)
- throw new RangeError("Index out of range")
- }
- function T(e, t, i, n, r) {
- return r || w(e, 0, i, 4),
- O.write(e, t, i, n, 23, 4),
- i + 4
- }
- function x(e, t, i, n, r) {
- return r || w(e, 0, i, 8),
- O.write(e, t, i, n, 52, 8),
- i + 8
- }
- function S(e, t) {
- t = t || 1 / 0;
- for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
- if (55295 < (i = e.charCodeAt(a)) && i < 57344) {
- if (!r) {
- if (56319 < i) {
- -1 < (t -= 3) && o.push(239, 191, 189);
- continue
- }
- if (a + 1 === n) {
- -1 < (t -= 3) && o.push(239, 191, 189);
- continue
- }
- r = i;
- continue
- }
- if (i < 56320) {
- -1 < (t -= 3) && o.push(239, 191, 189),
- r = i;
- continue
- }
- i = 65536 + (r - 55296 << 10 | i - 56320)
- } else
- r && -1 < (t -= 3) && o.push(239, 191, 189);
- if (r = null,
- i < 128) {
- if ((t -= 1) < 0)
- break;
- o.push(i)
- } else if (i < 2048) {
- if ((t -= 2) < 0)
- break;
- o.push(i >> 6 | 192, 63 & i | 128)
- } else if (i < 65536) {
- if ((t -= 3) < 0)
- break;
- o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
- } else {
- if (!(i < 1114112))
- throw new Error("Invalid code point");
- if ((t -= 4) < 0)
- break;
- o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
- }
- }
- return o
- }
- function M(e) {
- return P.toByteArray(function(e) {
- if ((e = function(e) {
- return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
- }(e).replace(t, "")).length < 2)
- return "";
- for (; e.length % 4 != 0; )
- e += "=";
- return e
- }(e))
- }
- function R(e, t, i, n) {
- for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
- t[r + i] = e[r];
- return r
- }
- var P = N("base64-js")
- , O = N("ieee754")
- , L = N("isarray");
- F.Buffer = u,
- F.SlowBuffer = function(e) {
- return +e != e && (e = 0),
- u.alloc(+e)
- }
- ,
- F.INSPECT_MAX_BYTES = 50,
- u.TYPED_ARRAY_SUPPORT = void 0 !== e.TYPED_ARRAY_SUPPORT ? e.TYPED_ARRAY_SUPPORT : function() {
- try {
- var e = new Uint8Array(1);
- return e.__proto__ = {
- __proto__: Uint8Array.prototype,
- foo: function() {
- return 42
- }
- },
- 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
- } catch (e) {
- return !1
- }
- }(),
- F.kMaxLength = i(),
- u.poolSize = 8192,
- u._augment = function(e) {
- return e.__proto__ = u.prototype,
- e
- }
- ,
- u.from = function(e, t, i) {
- return n(null, e, t, i)
- }
- ,
- u.TYPED_ARRAY_SUPPORT && (u.prototype.__proto__ = Uint8Array.prototype,
- u.__proto__ = Uint8Array,
- "undefined" != typeof Symbol && Symbol.species && u[Symbol.species] === u && Object.defineProperty(u, Symbol.species, {
- value: null,
- configurable: !0
- })),
- u.alloc = function(e, t, i) {
- return function(e, t, i, n) {
- return r(t),
- 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)
- }(null, e, t, i)
- }
- ,
- u.allocUnsafe = function(e) {
- return a(null, e)
- }
- ,
- u.allocUnsafeSlow = function(e) {
- return a(null, e)
- }
- ,
- u.isBuffer = function(e) {
- return !(null == e || !e._isBuffer)
- }
- ,
- u.compare = function(e, t) {
- if (!u.isBuffer(e) || !u.isBuffer(t))
- throw new TypeError("Arguments must be Buffers");
- if (e === t)
- return 0;
- for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
- if (e[r] !== t[r]) {
- i = e[r],
- n = t[r];
- break
- }
- return i < n ? -1 : n < i ? 1 : 0
- }
- ,
- u.isEncoding = function(e) {
- switch (String(e).toLowerCase()) {
- case "hex":
- case "utf8":
- case "utf-8":
- case "ascii":
- case "latin1":
- case "binary":
- case "base64":
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return !0;
- default:
- return !1
- }
- }
- ,
- u.concat = function(e, t) {
- if (!L(e))
- throw new TypeError('"list" argument must be an Array of Buffers');
- if (0 === e.length)
- return u.alloc(0);
- var i;
- if (void 0 === t)
- for (i = t = 0; i < e.length; ++i)
- t += e[i].length;
- var n = u.allocUnsafe(t)
- , r = 0;
- for (i = 0; i < e.length; ++i) {
- var o = e[i];
- if (!u.isBuffer(o))
- throw new TypeError('"list" argument must be an Array of Buffers');
- o.copy(n, r),
- r += o.length
- }
- return n
- }
- ,
- u.byteLength = c,
- u.prototype._isBuffer = !0,
- u.prototype.swap16 = function() {
- var e = this.length;
- if (e % 2 != 0)
- throw new RangeError("Buffer size must be a multiple of 16-bits");
- for (var t = 0; t < e; t += 2)
- h(this, t, t + 1);
- return this
- }
- ,
- u.prototype.swap32 = function() {
- var e = this.length;
- if (e % 4 != 0)
- throw new RangeError("Buffer size must be a multiple of 32-bits");
- for (var t = 0; t < e; t += 4)
- h(this, t, t + 3),
- h(this, t + 1, t + 2);
- return this
- }
- ,
- u.prototype.swap64 = function() {
- var e = this.length;
- if (e % 8 != 0)
- throw new RangeError("Buffer size must be a multiple of 64-bits");
- for (var t = 0; t < e; t += 8)
- h(this, t, t + 7),
- h(this, t + 1, t + 6),
- h(this, t + 2, t + 5),
- h(this, t + 3, t + 4);
- return this
- }
- ,
- u.prototype.toString = function() {
- var e = 0 | this.length;
- return 0 == e ? "" : 0 === arguments.length ? f(this, 0, e) : function(e, t, i) {
- var n, r, o, a = !1;
- if ((void 0 === t || t < 0) && (t = 0),
- t > this.length)
- return "";
- if ((void 0 === i || i > this.length) && (i = this.length),
- i <= 0)
- return "";
- if ((i >>>= 0) <= (t >>>= 0))
- return "";
- for (e = e || "utf8"; ; )
- switch (e) {
- case "hex":
- return A(this, t, i);
- case "utf8":
- case "utf-8":
- return f(this, t, i);
- case "ascii":
- return v(this, t, i);
- case "latin1":
- case "binary":
- return y(this, t, i);
- case "base64":
- return n = this,
- o = i,
- 0 === (r = t) && o === n.length ? P.fromByteArray(n) : P.fromByteArray(n.slice(r, o));
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return C(this, t, i);
- default:
- if (a)
- throw new TypeError("Unknown encoding: " + e);
- e = (e + "").toLowerCase(),
- a = !0
- }
- }
- .apply(this, arguments)
- }
- ,
- u.prototype.equals = function(e) {
- if (!u.isBuffer(e))
- throw new TypeError("Argument must be a Buffer");
- return this === e || 0 === u.compare(this, e)
- }
- ,
- u.prototype.inspect = function() {
- var e = ""
- , t = F.INSPECT_MAX_BYTES;
- return 0 < this.length && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
- this.length > t && (e += " ... ")),
- "<Buffer " + e + ">"
- }
- ,
- u.prototype.compare = function(e, t, i, n, r) {
- if (!u.isBuffer(e))
- throw new TypeError("Argument must be a Buffer");
- if (void 0 === t && (t = 0),
- void 0 === i && (i = e ? e.length : 0),
- void 0 === n && (n = 0),
- void 0 === r && (r = this.length),
- t < 0 || i > e.length || n < 0 || r > this.length)
- throw new RangeError("out of range index");
- if (r <= n && i <= t)
- return 0;
- if (r <= n)
- return -1;
- if (i <= t)
- return 1;
- if (this === e)
- return 0;
- 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)
- if (l[h] !== c[h]) {
- o = l[h],
- a = c[h];
- break
- }
- return o < a ? -1 : a < o ? 1 : 0
- }
- ,
- u.prototype.includes = function(e, t, i) {
- return -1 !== this.indexOf(e, t, i)
- }
- ,
- u.prototype.indexOf = function(e, t, i) {
- return d(this, e, t, i, !0)
- }
- ,
- u.prototype.lastIndexOf = function(e, t, i) {
- return d(this, e, t, i, !1)
- }
- ,
- u.prototype.write = function(e, t, i, n) {
- if (void 0 === t)
- n = "utf8",
- i = this.length,
- t = 0;
- else if (void 0 === i && "string" == typeof t)
- n = t,
- i = this.length,
- t = 0;
- else {
- if (!isFinite(t))
- throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
- t |= 0,
- isFinite(i) ? (i |= 0,
- void 0 === n && (n = "utf8")) : (n = i,
- i = void 0)
- }
- var r, o, a, s, l, c, h, u, d, p = this.length - t;
- if ((void 0 === i || p < i) && (i = p),
- 0 < e.length && (i < 0 || t < 0) || t > this.length)
- throw new RangeError("Attempt to write outside buffer bounds");
- n = n || "utf8";
- for (var f = !1; ; )
- switch (n) {
- case "hex":
- return g(this, e, t, i);
- case "utf8":
- case "utf-8":
- return u = t,
- d = i,
- R(S(e, (h = this).length - u), h, u, d);
- case "ascii":
- return m(this, e, t, i);
- case "latin1":
- case "binary":
- return m(this, e, t, i);
- case "base64":
- return s = this,
- l = t,
- c = i,
- R(M(e), s, l, c);
- case "ucs2":
- case "ucs-2":
- case "utf16le":
- case "utf-16le":
- return o = t,
- a = i,
- R(function(e, t) {
- for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
- i = e.charCodeAt(a),
- n = i >> 8,
- r = i % 256,
- o.push(r),
- o.push(n);
- return o
- }(e, (r = this).length - o), r, o, a);
- default:
- if (f)
- throw new TypeError("Unknown encoding: " + n);
- n = ("" + n).toLowerCase(),
- f = !0
- }
- }
- ,
- u.prototype.toJSON = function() {
- return {
- type: "Buffer",
- data: Array.prototype.slice.call(this._arr || this, 0)
- }
- }
- ;
- var D = 4096;
- u.prototype.slice = function(e, t) {
- var i, n = this.length;
- if ((e = ~~e) < 0 ? (e += n) < 0 && (e = 0) : n < e && (e = n),
- (t = void 0 === t ? n : ~~t) < 0 ? (t += n) < 0 && (t = 0) : n < t && (t = n),
- t < e && (t = e),
- u.TYPED_ARRAY_SUPPORT)
- (i = this.subarray(e, t)).__proto__ = u.prototype;
- else {
- var r = t - e;
- i = new u(r,void 0);
- for (var o = 0; o < r; ++o)
- i[o] = this[o + e]
- }
- return i
- }
- ,
- u.prototype.readUIntLE = function(e, t, i) {
- e |= 0,
- t |= 0,
- i || I(e, t, this.length);
- for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
- n += this[e + o] * r;
- return n
- }
- ,
- u.prototype.readUIntBE = function(e, t, i) {
- e |= 0,
- t |= 0,
- i || I(e, t, this.length);
- for (var n = this[e + --t], r = 1; 0 < t && (r *= 256); )
- n += this[e + --t] * r;
- return n
- }
- ,
- u.prototype.readUInt8 = function(e, t) {
- return t || I(e, 1, this.length),
- this[e]
- }
- ,
- u.prototype.readUInt16LE = function(e, t) {
- return t || I(e, 2, this.length),
- this[e] | this[e + 1] << 8
- }
- ,
- u.prototype.readUInt16BE = function(e, t) {
- return t || I(e, 2, this.length),
- this[e] << 8 | this[e + 1]
- }
- ,
- u.prototype.readUInt32LE = function(e, t) {
- return t || I(e, 4, this.length),
- (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
- }
- ,
- u.prototype.readUInt32BE = function(e, t) {
- return t || I(e, 4, this.length),
- 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
- }
- ,
- u.prototype.readIntLE = function(e, t, i) {
- e |= 0,
- t |= 0,
- i || I(e, t, this.length);
- for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
- n += this[e + o] * r;
- return (r *= 128) <= n && (n -= Math.pow(2, 8 * t)),
- n
- }
- ,
- u.prototype.readIntBE = function(e, t, i) {
- e |= 0,
- t |= 0,
- i || I(e, t, this.length);
- for (var n = t, r = 1, o = this[e + --n]; 0 < n && (r *= 256); )
- o += this[e + --n] * r;
- return (r *= 128) <= o && (o -= Math.pow(2, 8 * t)),
- o
- }
- ,
- u.prototype.readInt8 = function(e, t) {
- return t || I(e, 1, this.length),
- 128 & this[e] ? -1 * (255 - this[e] + 1) : this[e]
- }
- ,
- u.prototype.readInt16LE = function(e, t) {
- t || I(e, 2, this.length);
- var i = this[e] | this[e + 1] << 8;
- return 32768 & i ? 4294901760 | i : i
- }
- ,
- u.prototype.readInt16BE = function(e, t) {
- t || I(e, 2, this.length);
- var i = this[e + 1] | this[e] << 8;
- return 32768 & i ? 4294901760 | i : i
- }
- ,
- u.prototype.readInt32LE = function(e, t) {
- return t || I(e, 4, this.length),
- this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
- }
- ,
- u.prototype.readInt32BE = function(e, t) {
- return t || I(e, 4, this.length),
- this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
- }
- ,
- u.prototype.readFloatLE = function(e, t) {
- return t || I(e, 4, this.length),
- O.read(this, e, !0, 23, 4)
- }
- ,
- u.prototype.readFloatBE = function(e, t) {
- return t || I(e, 4, this.length),
- O.read(this, e, !1, 23, 4)
- }
- ,
- u.prototype.readDoubleLE = function(e, t) {
- return t || I(e, 8, this.length),
- O.read(this, e, !0, 52, 8)
- }
- ,
- u.prototype.readDoubleBE = function(e, t) {
- return t || I(e, 8, this.length),
- O.read(this, e, !1, 52, 8)
- }
- ,
- u.prototype.writeUIntLE = function(e, t, i, n) {
- e = +e,
- t |= 0,
- i |= 0,
- n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
- var r = 1
- , o = 0;
- for (this[t] = 255 & e; ++o < i && (r *= 256); )
- this[t + o] = e / r & 255;
- return t + i
- }
- ,
- u.prototype.writeUIntBE = function(e, t, i, n) {
- e = +e,
- t |= 0,
- i |= 0,
- n || E(this, e, t, i, Math.pow(2, 8 * i) - 1, 0);
- var r = i - 1
- , o = 1;
- for (this[t + r] = 255 & e; 0 <= --r && (o *= 256); )
- this[t + r] = e / o & 255;
- return t + i
- }
- ,
- u.prototype.writeUInt8 = function(e, t, i) {
- return e = +e,
- t |= 0,
- i || E(this, e, t, 1, 255, 0),
- u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
- this[t] = 255 & e,
- t + 1
- }
- ,
- u.prototype.writeUInt16LE = function(e, t, i) {
- return e = +e,
- t |= 0,
- i || E(this, e, t, 2, 65535, 0),
- u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
- this[t + 1] = e >>> 8) : _(this, e, t, !0),
- t + 2
- }
- ,
- u.prototype.writeUInt16BE = function(e, t, i) {
- return e = +e,
- t |= 0,
- i || E(this, e, t, 2, 65535, 0),
- u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
- this[t + 1] = 255 & e) : _(this, e, t, !1),
- t + 2
- }
- ,
- u.prototype.writeUInt32LE = function(e, t, i) {
- return e = +e,
- t |= 0,
- i || E(this, e, t, 4, 4294967295, 0),
- u.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
- this[t + 2] = e >>> 16,
- this[t + 1] = e >>> 8,
- this[t] = 255 & e) : b(this, e, t, !0),
- t + 4
- }
- ,
- u.prototype.writeUInt32BE = function(e, t, i) {
- return e = +e,
- t |= 0,
- i || E(this, e, t, 4, 4294967295, 0),
- u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
- this[t + 1] = e >>> 16,
- this[t + 2] = e >>> 8,
- this[t + 3] = 255 & e) : b(this, e, t, !1),
- t + 4
- }
- ,
- u.prototype.writeIntLE = function(e, t, i, n) {
- if (e = +e,
- t |= 0,
- !n) {
- var r = Math.pow(2, 8 * i - 1);
- E(this, e, t, i, r - 1, -r)
- }
- var o = 0
- , a = 1
- , s = 0;
- for (this[t] = 255 & e; ++o < i && (a *= 256); )
- e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
- this[t + o] = (e / a >> 0) - s & 255;
- return t + i
- }
- ,
- u.prototype.writeIntBE = function(e, t, i, n) {
- if (e = +e,
- t |= 0,
- !n) {
- var r = Math.pow(2, 8 * i - 1);
- E(this, e, t, i, r - 1, -r)
- }
- var o = i - 1
- , a = 1
- , s = 0;
- for (this[t + o] = 255 & e; 0 <= --o && (a *= 256); )
- e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
- this[t + o] = (e / a >> 0) - s & 255;
- return t + i
- }
- ,
- u.prototype.writeInt8 = function(e, t, i) {
- return e = +e,
- t |= 0,
- i || E(this, e, t, 1, 127, -128),
- u.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
- e < 0 && (e = 255 + e + 1),
- this[t] = 255 & e,
- t + 1
- }
- ,
- u.prototype.writeInt16LE = function(e, t, i) {
- return e = +e,
- t |= 0,
- i || E(this, e, t, 2, 32767, -32768),
- u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
- this[t + 1] = e >>> 8) : _(this, e, t, !0),
- t + 2
- }
- ,
- u.prototype.writeInt16BE = function(e, t, i) {
- return e = +e,
- t |= 0,
- i || E(this, e, t, 2, 32767, -32768),
- u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
- this[t + 1] = 255 & e) : _(this, e, t, !1),
- t + 2
- }
- ,
- u.prototype.writeInt32LE = function(e, t, i) {
- return e = +e,
- t |= 0,
- i || E(this, e, t, 4, 2147483647, -2147483648),
- u.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
- this[t + 1] = e >>> 8,
- this[t + 2] = e >>> 16,
- this[t + 3] = e >>> 24) : b(this, e, t, !0),
- t + 4
- }
- ,
- u.prototype.writeInt32BE = function(e, t, i) {
- return e = +e,
- t |= 0,
- i || E(this, e, t, 4, 2147483647, -2147483648),
- e < 0 && (e = 4294967295 + e + 1),
- u.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
- this[t + 1] = e >>> 16,
- this[t + 2] = e >>> 8,
- this[t + 3] = 255 & e) : b(this, e, t, !1),
- t + 4
- }
- ,
- u.prototype.writeFloatLE = function(e, t, i) {
- return T(this, e, t, !0, i)
- }
- ,
- u.prototype.writeFloatBE = function(e, t, i) {
- return T(this, e, t, !1, i)
- }
- ,
- u.prototype.writeDoubleLE = function(e, t, i) {
- return x(this, e, t, !0, i)
- }
- ,
- u.prototype.writeDoubleBE = function(e, t, i) {
- return x(this, e, t, !1, i)
- }
- ,
- u.prototype.copy = function(e, t, i, n) {
- if (i = i || 0,
- n || 0 === n || (n = this.length),
- t >= e.length && (t = e.length),
- t = t || 0,
- 0 < n && n < i && (n = i),
- n === i)
- return 0;
- if (0 === e.length || 0 === this.length)
- return 0;
- if (t < 0)
- throw new RangeError("targetStart out of bounds");
- if (i < 0 || i >= this.length)
- throw new RangeError("sourceStart out of bounds");
- if (n < 0)
- throw new RangeError("sourceEnd out of bounds");
- n > this.length && (n = this.length),
- e.length - t < n - i && (n = e.length - t + i);
- var r, o = n - i;
- if (this === e && i < t && t < n)
- for (r = o - 1; 0 <= r; --r)
- e[r + t] = this[r + i];
- else if (o < 1e3 || !u.TYPED_ARRAY_SUPPORT)
- for (r = 0; r < o; ++r)
- e[r + t] = this[r + i];
- else
- Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
- return o
- }
- ,
- u.prototype.fill = function(e, t, i, n) {
- if ("string" == typeof e) {
- if ("string" == typeof t ? (n = t,
- t = 0,
- i = this.length) : "string" == typeof i && (n = i,
- i = this.length),
- 1 === e.length) {
- var r = e.charCodeAt(0);
- r < 256 && (e = r)
- }
- if (void 0 !== n && "string" != typeof n)
- throw new TypeError("encoding must be a string");
- if ("string" == typeof n && !u.isEncoding(n))
- throw new TypeError("Unknown encoding: " + n)
- } else
- "number" == typeof e && (e &= 255);
- if (t < 0 || this.length < t || this.length < i)
- throw new RangeError("Out of range index");
- if (i <= t)
- return this;
- var o;
- if (t >>>= 0,
- i = void 0 === i ? this.length : i >>> 0,
- "number" == typeof (e = e || 0))
- for (o = t; o < i; ++o)
- this[o] = e;
- else {
- var a = u.isBuffer(e) ? e : S(new u(e,n).toString())
- , s = a.length;
- for (o = 0; o < i - t; ++o)
- this[o + t] = a[o % s]
- }
- return this
- }
- ;
- var t = /[^+\/0-9A-Za-z-_]/g
- }
- ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
- }
- , {
- "base64-js": 199,
- ieee754: 200,
- isarray: 201
- }],
- 199: [function(e, t, i) {
- "use strict";
- function l(e) {
- var t = e.length;
- if (0 < t % 4)
- throw new Error("Invalid string. Length must be a multiple of 4");
- return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
- }
- function c(e, t, i) {
- for (var n, r = [], o = t; o < i; o += 3)
- n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
- r.push(h[(a = n) >> 18 & 63] + h[a >> 12 & 63] + h[a >> 6 & 63] + h[63 & a]);
- var a;
- return r.join("")
- }
- i.byteLength = function(e) {
- return 3 * e.length / 4 - l(e)
- }
- ,
- i.toByteArray = function(e) {
- var t, i, n, r, o, a = e.length;
- r = l(e),
- o = new d(3 * a / 4 - r),
- i = 0 < r ? a - 4 : a;
- var s = 0;
- for (t = 0; t < i; t += 4,
- 3)
- n = u[e.charCodeAt(t)] << 18 | u[e.charCodeAt(t + 1)] << 12 | u[e.charCodeAt(t + 2)] << 6 | u[e.charCodeAt(t + 3)],
- o[s++] = n >> 16 & 255,
- o[s++] = n >> 8 & 255,
- o[s++] = 255 & n;
- return 2 === r ? (n = u[e.charCodeAt(t)] << 2 | u[e.charCodeAt(t + 1)] >> 4,
- o[s++] = 255 & n) : 1 === r && (n = u[e.charCodeAt(t)] << 10 | u[e.charCodeAt(t + 1)] << 4 | u[e.charCodeAt(t + 2)] >> 2,
- o[s++] = n >> 8 & 255,
- o[s++] = 255 & n),
- o
- }
- ,
- i.fromByteArray = function(e) {
- for (var t, i = e.length, n = i % 3, r = "", o = [], a = 0, s = i - n; a < s; a += 16383)
- o.push(c(e, a, s < a + 16383 ? s : a + 16383));
- return 1 == n ? (t = e[i - 1],
- r += h[t >> 2],
- r += h[t << 4 & 63],
- r += "==") : 2 == n && (t = (e[i - 2] << 8) + e[i - 1],
- r += h[t >> 10],
- r += h[t >> 4 & 63],
- r += h[t << 2 & 63],
- r += "="),
- o.push(r),
- o.join("")
- }
- ;
- for (var h = [], u = [], d = "undefined" != typeof Uint8Array ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, o = n.length; r < o; ++r)
- h[r] = n[r],
- u[n.charCodeAt(r)] = r;
- u["-".charCodeAt(0)] = 62,
- u["_".charCodeAt(0)] = 63
- }
- , {}],
- 200: [function(e, t, i) {
- i.read = function(e, t, i, n, r) {
- 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];
- for (u += d,
- o = p & (1 << -h) - 1,
- p >>= -h,
- h += s; 0 < h; o = 256 * o + e[t + u],
- u += d,
- h -= 8)
- ;
- for (a = o & (1 << -h) - 1,
- o >>= -h,
- h += n; 0 < h; a = 256 * a + e[t + u],
- u += d,
- h -= 8)
- ;
- if (0 === o)
- o = 1 - c;
- else {
- if (o === l)
- return a ? NaN : 1 / 0 * (p ? -1 : 1);
- a += Math.pow(2, n),
- o -= c
- }
- return (p ? -1 : 1) * a * Math.pow(2, o - n)
- }
- ,
- i.write = function(e, t, i, n, r, o) {
- 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;
- for (t = Math.abs(t),
- isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
- a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
- t * (l = Math.pow(2, -a)) < 1 && (a--,
- l *= 2),
- 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
- l /= 2),
- h <= a + u ? (s = 0,
- a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
- a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
- a = 0)); 8 <= r; e[i + p] = 255 & s,
- p += f,
- s /= 256,
- r -= 8)
- ;
- for (a = a << r | s,
- c += r; 0 < c; e[i + p] = 255 & a,
- p += f,
- a /= 256,
- c -= 8)
- ;
- e[i + p - f] |= 128 * g
- }
- }
- , {}],
- 201: [function(e, t, i) {
- var n = {}.toString;
- t.exports = Array.isArray || function(e) {
- return "[object Array]" == n.call(e)
- }
- }
- , {}],
- 202: [function(e, t, i) {
- function n() {
- this._events = this._events || {},
- this._maxListeners = this._maxListeners || void 0
- }
- function l(e) {
- return "function" == typeof e
- }
- function c(e) {
- return "object" == typeof e && null !== e
- }
- function h(e) {
- return void 0 === e
- }
- ((t.exports = n).EventEmitter = n).prototype._events = void 0,
- n.prototype._maxListeners = void 0,
- n.defaultMaxListeners = 10,
- n.prototype.setMaxListeners = function(e) {
- if (!function(e) {
- return "number" == typeof e
- }(e) || e < 0 || isNaN(e))
- throw TypeError("n must be a positive number");
- return this._maxListeners = e,
- this
- }
- ,
- n.prototype.emit = function(e) {
- var t, i, n, r, o, a;
- if (this._events || (this._events = {}),
- "error" === e && (!this._events.error || c(this._events.error) && !this._events.error.length)) {
- if ((t = arguments[1])instanceof Error)
- throw t;
- var s = new Error('Uncaught, unspecified "error" event. (' + t + ")");
- throw s.context = t,
- s
- }
- if (h(i = this._events[e]))
- return !1;
- if (l(i))
- switch (arguments.length) {
- case 1:
- i.call(this);
- break;
- case 2:
- i.call(this, arguments[1]);
- break;
- case 3:
- i.call(this, arguments[1], arguments[2]);
- break;
- default:
- r = Array.prototype.slice.call(arguments, 1),
- i.apply(this, r)
- }
- else if (c(i))
- for (r = Array.prototype.slice.call(arguments, 1),
- n = (a = i.slice()).length,
- o = 0; o < n; o++)
- a[o].apply(this, r);
- return !0
- }
- ,
- n.prototype.on = n.prototype.addListener = function(e, t) {
- var i;
- if (!l(t))
- throw TypeError("listener must be a function");
- return this._events || (this._events = {}),
- this._events.newListener && this.emit("newListener", e, l(t.listener) ? t.listener : t),
- this._events[e] ? c(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
- 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,
- console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
- "function" == typeof console.trace && console.trace())),
- this
- }
- ,
- n.prototype.once = function(e, t) {
- function i() {
- this.removeListener(e, i),
- n || (n = !0,
- t.apply(this, arguments))
- }
- if (!l(t))
- throw TypeError("listener must be a function");
- var n = !1;
- return i.listener = t,
- this.on(e, i),
- this
- }
- ,
- n.prototype.removeListener = function(e, t) {
- var i, n, r, o;
- if (!l(t))
- throw TypeError("listener must be a function");
- if (!this._events || !this._events[e])
- return this;
- if (r = (i = this._events[e]).length,
- n = -1,
- i === t || l(i.listener) && i.listener === t)
- delete this._events[e],
- this._events.removeListener && this.emit("removeListener", e, t);
- else if (c(i)) {
- for (o = r; 0 < o--; )
- if (i[o] === t || i[o].listener && i[o].listener === t) {
- n = o;
- break
- }
- if (n < 0)
- return this;
- 1 === i.length ? (i.length = 0,
- delete this._events[e]) : i.splice(n, 1),
- this._events.removeListener && this.emit("removeListener", e, t)
- }
- return this
- }
- ,
- n.prototype.removeAllListeners = function(e) {
- var t, i;
- if (!this._events)
- return this;
- if (!this._events.removeListener)
- return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
- this;
- if (0 === arguments.length) {
- for (t in this._events)
- "removeListener" !== t && this.removeAllListeners(t);
- return this.removeAllListeners("removeListener"),
- this._events = {},
- this
- }
- if (l(i = this._events[e]))
- this.removeListener(e, i);
- else if (i)
- for (; i.length; )
- this.removeListener(e, i[i.length - 1]);
- return delete this._events[e],
- this
- }
- ,
- n.prototype.listeners = function(e) {
- return this._events && this._events[e] ? l(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
- }
- ,
- n.prototype.listenerCount = function(e) {
- if (this._events) {
- var t = this._events[e];
- if (l(t))
- return 1;
- if (t)
- return t.length
- }
- return 0
- }
- ,
- n.listenerCount = function(e, t) {
- return e.listenerCount(t)
- }
- }
- , {}],
- 203: [function(e, t, i) {
- function n() {
- throw new Error("setTimeout has not been defined")
- }
- function r() {
- throw new Error("clearTimeout has not been defined")
- }
- function o(t) {
- if (h === setTimeout)
- return setTimeout(t, 0);
- if ((h === n || !h) && setTimeout)
- return h = setTimeout,
- setTimeout(t, 0);
- try {
- return h(t, 0)
- } catch (e) {
- try {
- return h.call(null, t, 0)
- } catch (e) {
- return h.call(this, t, 0)
- }
- }
- }
- function a() {
- g && p && (g = !1,
- p.length ? f = p.concat(f) : m = -1,
- f.length && s())
- }
- function s() {
- if (!g) {
- var e = o(a);
- g = !0;
- for (var t = f.length; t; ) {
- for (p = f,
- f = []; ++m < t; )
- p && p[m].run();
- m = -1,
- t = f.length
- }
- p = null,
- g = !1,
- function(t) {
- if (u === clearTimeout)
- return clearTimeout(t);
- if ((u === r || !u) && clearTimeout)
- return u = clearTimeout,
- clearTimeout(t);
- try {
- u(t)
- } catch (e) {
- try {
- return u.call(null, t)
- } catch (e) {
- return u.call(this, t)
- }
- }
- }(e)
- }
- }
- function l(e, t) {
- this.fun = e,
- this.array = t
- }
- function c() {}
- var h, u, d = t.exports = {};
- !function() {
- try {
- h = "function" == typeof setTimeout ? setTimeout : n
- } catch (e) {
- h = n
- }
- try {
- u = "function" == typeof clearTimeout ? clearTimeout : r
- } catch (e) {
- u = r
- }
- }();
- var p, f = [], g = !1, m = -1;
- d.nextTick = function(e) {
- var t = new Array(arguments.length - 1);
- if (1 < arguments.length)
- for (var i = 1; i < arguments.length; i++)
- t[i - 1] = arguments[i];
- f.push(new l(e,t)),
- 1 !== f.length || g || o(s)
- }
- ,
- l.prototype.run = function() {
- this.fun.apply(null, this.array)
- }
- ,
- d.title = "browser",
- d.browser = !0,
- d.env = {},
- d.argv = [],
- d.version = "",
- d.versions = {},
- d.on = c,
- d.addListener = c,
- d.once = c,
- d.off = c,
- d.removeListener = c,
- d.removeAllListeners = c,
- d.emit = c,
- d.binding = function(e) {
- throw new Error("process.binding is not supported")
- }
- ,
- d.cwd = function() {
- return "/"
- }
- ,
- d.chdir = function(e) {
- throw new Error("process.chdir is not supported")
- }
- ,
- d.umask = function() {
- return 0
- }
- }
- , {}],
- 204: [function(e, O, L) {
- (function(P) {
- !function(e) {
- function v(e) {
- throw new RangeError(g[e])
- }
- function r(e, t) {
- for (var i = e.length, n = []; i--; )
- n[i] = t(e[i]);
- return n
- }
- function t(e, t) {
- var i = e.split("@")
- , n = "";
- return 1 < i.length && (n = i[0] + "@",
- e = i[1]),
- n + r((e = e.replace(f, ".")).split("."), t).join(".")
- }
- function y(e) {
- for (var t, i, n = [], r = 0, o = e.length; r < o; )
- 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),
- r--) : n.push(t);
- return n
- }
- function A(e) {
- return r(e, function(e) {
- var t = "";
- return 65535 < e && (t += R((e -= 65536) >>> 10 & 1023 | 55296),
- e = 56320 | 1023 & e),
- t + R(e)
- }).join("")
- }
- function C(e, t) {
- return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
- }
- function I(e, t, i) {
- var n = 0;
- for (e = i ? M(e / u) : e >> 1,
- e += M(e / t); m * w >> 1 < e; n += _)
- e = M(e / m);
- return M(n + (m + 1) * e / (e + h))
- }
- function i(e) {
- var t, i, n, r, o, a, s, l, c, h, u, d = [], p = e.length, f = 0, g = x, m = T;
- for ((i = e.lastIndexOf(S)) < 0 && (i = 0),
- n = 0; n < i; ++n)
- 128 <= e.charCodeAt(n) && v("not-basic"),
- d.push(e.charCodeAt(n));
- for (r = 0 < i ? i + 1 : 0; r < p; ) {
- for (o = f,
- a = 1,
- s = _; p <= r && v("invalid-input"),
- u = e.charCodeAt(r++),
- (_ <= (l = u - 48 < 10 ? u - 22 : u - 65 < 26 ? u - 65 : u - 97 < 26 ? u - 97 : _) || l > M((E - f) / a)) && v("overflow"),
- f += l * a,
- !(l < (c = s <= m ? b : m + w <= s ? w : s - m)); s += _)
- a > M(E / (h = _ - c)) && v("overflow"),
- a *= h;
- m = I(f - o, t = d.length + 1, 0 == o),
- M(f / t) > E - g && v("overflow"),
- g += M(f / t),
- f %= t,
- d.splice(f++, 0, g)
- }
- return A(d)
- }
- function n(e) {
- var t, i, n, r, o, a, s, l, c, h, u, d, p, f, g, m = [];
- for (d = (e = y(e)).length,
- t = x,
- o = T,
- a = i = 0; a < d; ++a)
- (u = e[a]) < 128 && m.push(R(u));
- for (n = r = m.length,
- r && m.push(S); n < d; ) {
- for (s = E,
- a = 0; a < d; ++a)
- t <= (u = e[a]) && u < s && (s = u);
- for (s - t > M((E - i) / (p = n + 1)) && v("overflow"),
- i += (s - t) * p,
- t = s,
- a = 0; a < d; ++a)
- if ((u = e[a]) < t && ++i > E && v("overflow"),
- u == t) {
- for (l = i,
- c = _; !(l < (h = c <= o ? b : o + w <= c ? w : c - o)); c += _)
- g = l - h,
- f = _ - h,
- m.push(R(C(h + g % f, 0))),
- l = M(g / f);
- m.push(R(C(l, 0))),
- o = I(i, p, n == r),
- i = 0,
- ++n
- }
- ++i,
- ++t
- }
- return m.join("")
- }
- var o = "object" == typeof L && L && !L.nodeType && L
- , a = "object" == typeof O && O && !O.nodeType && O
- , s = "object" == typeof P && P;
- s.global !== s && s.window !== s && s.self !== s || (e = s);
- 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 = {
- overflow: "Overflow: input needs wider integers to process",
- "not-basic": "Illegal input >= 0x80 (not a basic code point)",
- "invalid-input": "Invalid input"
- }, m = _ - b, M = Math.floor, R = String.fromCharCode;
- if (l = {
- version: "1.4.1",
- ucs2: {
- decode: y,
- encode: A
- },
- decode: i,
- encode: n,
- toASCII: function(e) {
- return t(e, function(e) {
- return p.test(e) ? "xn--" + n(e) : e
- })
- },
- toUnicode: function(e) {
- return t(e, function(e) {
- return d.test(e) ? i(e.slice(4).toLowerCase()) : e
- })
- }
- },
- "function" == typeof define && "object" == typeof define.amd && define.amd)
- define("punycode", function() {
- return l
- });
- else if (o && a)
- if (O.exports == o)
- a.exports = l;
- else
- for (c in l)
- l.hasOwnProperty(c) && (o[c] = l[c]);
- else
- e.punycode = l
- }(this)
- }
- ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
- }
- , {}],
- 205: [function(e, t, i) {
- "use strict";
- t.exports = function(e, t, i, n) {
- t = t || "&",
- i = i || "=";
- var r = {};
- if ("string" != typeof e || 0 === e.length)
- return r;
- var o = /\+/g;
- e = e.split(t);
- var a = 1e3;
- n && "number" == typeof n.maxKeys && (a = n.maxKeys);
- var s, l, c = e.length;
- 0 < a && a < c && (c = a);
- for (var h = 0; h < c; ++h) {
- var u, d, p, f, g = e[h].replace(o, "%20"), m = g.indexOf(i);
- d = 0 <= m ? (u = g.substr(0, m),
- g.substr(m + 1)) : (u = g,
- ""),
- p = decodeURIComponent(u),
- f = decodeURIComponent(d),
- s = r,
- l = p,
- Object.prototype.hasOwnProperty.call(s, l) ? v(r[p]) ? r[p].push(f) : r[p] = [r[p], f] : r[p] = f
- }
- return r
- }
- ;
- var v = Array.isArray || function(e) {
- return "[object Array]" === Object.prototype.toString.call(e)
- }
- }
- , {}],
- 206: [function(e, t, i) {
- "use strict";
- function o(e, t) {
- if (e.map)
- return e.map(t);
- for (var i = [], n = 0; n < e.length; n++)
- i.push(t(e[n], n));
- return i
- }
- function a(e) {
- switch (typeof e) {
- case "string":
- return e;
- case "boolean":
- return e ? "true" : "false";
- case "number":
- return isFinite(e) ? e : "";
- default:
- return ""
- }
- }
- t.exports = function(i, n, r, e) {
- return n = n || "&",
- r = r || "=",
- null === i && (i = void 0),
- "object" == typeof i ? o(l(i), function(e) {
- var t = encodeURIComponent(a(e)) + r;
- return s(i[e]) ? o(i[e], function(e) {
- return t + encodeURIComponent(a(e))
- }).join(n) : t + encodeURIComponent(a(i[e]))
- }).join(n) : e ? encodeURIComponent(a(e)) + r + encodeURIComponent(a(i)) : ""
- }
- ;
- var s = Array.isArray || function(e) {
- return "[object Array]" === Object.prototype.toString.call(e)
- }
- , l = Object.keys || function(e) {
- var t = [];
- for (var i in e)
- Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
- return t
- }
- }
- , {}],
- 207: [function(e, t, i) {
- "use strict";
- i.decode = i.parse = e("./decode"),
- i.encode = i.stringify = e("./encode")
- }
- , {
- "./decode": 205,
- "./encode": 206
- }],
- 208: [function(e, t, i) {
- "use strict";
- function x() {
- this.protocol = null,
- this.slashes = null,
- this.auth = null,
- this.host = null,
- this.port = null,
- this.hostname = null,
- this.hash = null,
- this.search = null,
- this.query = null,
- this.pathname = null,
- this.path = null,
- this.href = null
- }
- function n(e, t, i) {
- if (e && D.isObject(e) && e instanceof x)
- return e;
- var n = new x;
- return n.parse(e, t, i),
- n
- }
- var L = e("punycode")
- , D = e("./util");
- i.parse = n,
- i.resolve = function(e, t) {
- return n(e, !1, !0).resolve(t)
- }
- ,
- i.resolveObject = function(e, t) {
- return e ? n(e, !1, !0).resolveObject(t) : t
- }
- ,
- i.format = function(e) {
- return D.isString(e) && (e = n(e)),
- e instanceof x ? e.format() : x.prototype.format.call(e)
- }
- ,
- i.Url = x;
- var N = /^([a-z0-9.+-]+:)/i
- , r = /:[0-9]*$/
- , F = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
- , o = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"])
- , B = ["'"].concat(o)
- , V = ["%", "/", "?", ";", "#"].concat(B)
- , k = ["/", "?", "#"]
- , U = /^[+a-z0-9A-Z_-]{0,63}$/
- , H = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
- , z = {
- javascript: !0,
- "javascript:": !0
- }
- , G = {
- javascript: !0,
- "javascript:": !0
- }
- , W = {
- http: !0,
- https: !0,
- ftp: !0,
- gopher: !0,
- file: !0,
- "http:": !0,
- "https:": !0,
- "ftp:": !0,
- "gopher:": !0,
- "file:": !0
- }
- , j = e("querystring");
- x.prototype.parse = function(e, t, i) {
- if (!D.isString(e))
- throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
- var n = e.indexOf("?")
- , r = -1 !== n && n < e.indexOf("#") ? "?" : "#"
- , o = e.split(r);
- o[0] = o[0].replace(/\\/g, "/");
- var a = e = o.join(r);
- if (a = a.trim(),
- !i && 1 === e.split("#").length) {
- var s = F.exec(a);
- if (s)
- return this.path = a,
- this.href = a,
- this.pathname = s[1],
- s[2] ? (this.search = s[2],
- this.query = t ? j.parse(this.search.substr(1)) : this.search.substr(1)) : t && (this.search = "",
- this.query = {}),
- this
- }
- var l = N.exec(a);
- if (l) {
- var c = (l = l[0]).toLowerCase();
- this.protocol = c,
- a = a.substr(l.length)
- }
- if (i || l || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
- var h = "//" === a.substr(0, 2);
- !h || l && G[l] || (a = a.substr(2),
- this.slashes = !0)
- }
- if (!G[l] && (h || l && !W[l])) {
- for (var u = -1, d = 0; d < k.length; d++) {
- -1 !== (g = a.indexOf(k[d])) && (-1 === u || g < u) && (u = g)
- }
- var p, f;
- -1 !== (f = -1 === u ? a.lastIndexOf("@") : a.lastIndexOf("@", u)) && (p = a.slice(0, f),
- a = a.slice(f + 1),
- this.auth = decodeURIComponent(p)),
- u = -1;
- for (d = 0; d < V.length; d++) {
- var g;
- -1 !== (g = a.indexOf(V[d])) && (-1 === u || g < u) && (u = g)
- }
- -1 === u && (u = a.length),
- this.host = a.slice(0, u),
- a = a.slice(u),
- this.parseHost(),
- this.hostname = this.hostname || "";
- var m = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
- if (!m)
- for (var v = this.hostname.split(/\./), y = (d = 0,
- v.length); d < y; d++) {
- var A = v[d];
- if (A && !A.match(U)) {
- for (var C = "", I = 0, E = A.length; I < E; I++)
- C += 127 < A.charCodeAt(I) ? "x" : A[I];
- if (!C.match(U)) {
- var _ = v.slice(0, d)
- , b = v.slice(d + 1)
- , w = A.match(H);
- w && (_.push(w[1]),
- b.unshift(w[2])),
- b.length && (a = "/" + b.join(".") + a),
- this.hostname = _.join(".");
- break
- }
- }
- }
- 255 < this.hostname.length ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
- m || (this.hostname = L.toASCII(this.hostname));
- var T = this.port ? ":" + this.port : ""
- , x = this.hostname || "";
- this.host = x + T,
- this.href += this.host,
- m && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
- "/" !== a[0] && (a = "/" + a))
- }
- if (!z[c])
- for (d = 0,
- y = B.length; d < y; d++) {
- var S = B[d];
- if (-1 !== a.indexOf(S)) {
- var M = encodeURIComponent(S);
- M === S && (M = escape(S)),
- a = a.split(S).join(M)
- }
- }
- var R = a.indexOf("#");
- -1 !== R && (this.hash = a.substr(R),
- a = a.slice(0, R));
- var P = a.indexOf("?");
- if (-1 !== P ? (this.search = a.substr(P),
- this.query = a.substr(P + 1),
- t && (this.query = j.parse(this.query)),
- a = a.slice(0, P)) : t && (this.search = "",
- this.query = {}),
- a && (this.pathname = a),
- W[c] && this.hostname && !this.pathname && (this.pathname = "/"),
- this.pathname || this.search) {
- T = this.pathname || "";
- var O = this.search || "";
- this.path = T + O
- }
- return this.href = this.format(),
- this
- }
- ,
- x.prototype.format = function() {
- var e = this.auth || "";
- e && (e = (e = encodeURIComponent(e)).replace(/%3A/i, ":"),
- e += "@");
- var t = this.protocol || ""
- , i = this.pathname || ""
- , n = this.hash || ""
- , r = !1
- , o = "";
- this.host ? r = e + this.host : this.hostname && (r = e + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"),
- this.port && (r += ":" + this.port)),
- this.query && D.isObject(this.query) && Object.keys(this.query).length && (o = j.stringify(this.query));
- var a = this.search || o && "?" + o || "";
- return t && ":" !== t.substr(-1) && (t += ":"),
- this.slashes || (!t || W[t]) && !1 !== r ? (r = "//" + (r || ""),
- i && "/" !== i.charAt(0) && (i = "/" + i)) : r = r || "",
- n && "#" !== n.charAt(0) && (n = "#" + n),
- a && "?" !== a.charAt(0) && (a = "?" + a),
- t + r + (i = i.replace(/[?#]/g, function(e) {
- return encodeURIComponent(e)
- })) + (a = a.replace("#", "%23")) + n
- }
- ,
- x.prototype.resolve = function(e) {
- return this.resolveObject(n(e, !1, !0)).format()
- }
- ,
- x.prototype.resolveObject = function(e) {
- if (D.isString(e)) {
- var t = new x;
- t.parse(e, !1, !0),
- e = t
- }
- for (var i = new x, n = Object.keys(this), r = 0; r < n.length; r++) {
- var o = n[r];
- i[o] = this[o]
- }
- if (i.hash = e.hash,
- "" === e.href)
- return i.href = i.format(),
- i;
- if (e.slashes && !e.protocol) {
- for (var a = Object.keys(e), s = 0; s < a.length; s++) {
- var l = a[s];
- "protocol" !== l && (i[l] = e[l])
- }
- return W[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
- i.href = i.format(),
- i
- }
- if (e.protocol && e.protocol !== i.protocol) {
- if (!W[e.protocol]) {
- for (var c = Object.keys(e), h = 0; h < c.length; h++) {
- var u = c[h];
- i[u] = e[u]
- }
- return i.href = i.format(),
- i
- }
- if (i.protocol = e.protocol,
- e.host || G[e.protocol])
- i.pathname = e.pathname;
- else {
- for (var d = (e.pathname || "").split("/"); d.length && !(e.host = d.shift()); )
- ;
- e.host || (e.host = ""),
- e.hostname || (e.hostname = ""),
- "" !== d[0] && d.unshift(""),
- d.length < 2 && d.unshift(""),
- i.pathname = d.join("/")
- }
- if (i.search = e.search,
- i.query = e.query,
- i.host = e.host || "",
- i.auth = e.auth,
- i.hostname = e.hostname || e.host,
- i.port = e.port,
- i.pathname || i.search) {
- var p = i.pathname || ""
- , f = i.search || "";
- i.path = p + f
- }
- return i.slashes = i.slashes || e.slashes,
- i.href = i.format(),
- i
- }
- var g = i.pathname && "/" === i.pathname.charAt(0)
- , m = e.host || e.pathname && "/" === e.pathname.charAt(0)
- , v = m || g || i.host && e.pathname
- , y = v
- , A = i.pathname && i.pathname.split("/") || []
- , C = (d = e.pathname && e.pathname.split("/") || [],
- i.protocol && !W[i.protocol]);
- if (C && (i.hostname = "",
- i.port = null,
- i.host && ("" === A[0] ? A[0] = i.host : A.unshift(i.host)),
- i.host = "",
- e.protocol && (e.hostname = null,
- e.port = null,
- e.host && ("" === d[0] ? d[0] = e.host : d.unshift(e.host)),
- e.host = null),
- v = v && ("" === d[0] || "" === A[0])),
- m)
- i.host = e.host || "" === e.host ? e.host : i.host,
- i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
- i.search = e.search,
- i.query = e.query,
- A = d;
- else if (d.length)
- (A = A || []).pop(),
- A = A.concat(d),
- i.search = e.search,
- i.query = e.query;
- else if (!D.isNullOrUndefined(e.search)) {
- if (C)
- i.hostname = i.host = A.shift(),
- (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
- i.host = i.hostname = w.shift());
- return i.search = e.search,
- i.query = e.query,
- D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
- i.href = i.format(),
- i
- }
- if (!A.length)
- return i.pathname = null,
- i.search ? i.path = "/" + i.search : i.path = null,
- i.href = i.format(),
- i;
- 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--)
- "." === (I = A[b]) ? A.splice(b, 1) : ".." === I ? (A.splice(b, 1),
- _++) : _ && (A.splice(b, 1),
- _--);
- if (!v && !y)
- for (; _--; )
- A.unshift("..");
- !v || "" === A[0] || A[0] && "/" === A[0].charAt(0) || A.unshift(""),
- E && "/" !== A.join("/").substr(-1) && A.push("");
- var w, T = "" === A[0] || A[0] && "/" === A[0].charAt(0);
- C && (i.hostname = i.host = T ? "" : A.length ? A.shift() : "",
- (w = !!(i.host && 0 < i.host.indexOf("@")) && i.host.split("@")) && (i.auth = w.shift(),
- i.host = i.hostname = w.shift()));
- return (v = v || i.host && A.length) && !T && A.unshift(""),
- A.length ? i.pathname = A.join("/") : (i.pathname = null,
- i.path = null),
- D.isNull(i.pathname) && D.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
- i.auth = e.auth || i.auth,
- i.slashes = i.slashes || e.slashes,
- i.href = i.format(),
- i
- }
- ,
- x.prototype.parseHost = function() {
- var e = this.host
- , t = r.exec(e);
- t && (":" !== (t = t[0]) && (this.port = t.substr(1)),
- e = e.substr(0, e.length - t.length)),
- e && (this.hostname = e)
- }
- }
- , {
- "./util": 209,
- punycode: 204,
- querystring: 207
- }],
- 209: [function(e, t, i) {
- "use strict";
- t.exports = {
- isString: function(e) {
- return "string" == typeof e
- },
- isObject: function(e) {
- return "object" == typeof e && null !== e
- },
- isNull: function(e) {
- return null === e
- },
- isNullOrUndefined: function(e) {
- return null == e
- }
- }
- }
- , {}],
- 210: [function(e, t, i) {
- "use strict";
- function r(e) {
- return c + e
- }
- function s(e) {
- if ("string" != typeof e)
- throw new TypeError("key must be a string.")
- }
- var l = Object.prototype.hasOwnProperty
- , c = "~";
- t.exports = function(t) {
- var o = Object.create(null)
- , n = 0
- , a = {};
- return function(e, t) {
- for (var i in t)
- Object.defineProperty(e, i, {
- value: t[i],
- configurable: !0,
- writable: !0
- })
- }(a, {
- get: function(e, t) {
- s(e);
- var i = r(e);
- return i in o ? o[i] : t
- },
- set: function(e, t) {
- s(e);
- var i = r(e);
- return i in o || ++n,
- o[i] = t
- },
- has: function(e) {
- return s(e),
- r(e)in o
- },
- delete: function(e) {
- s(e);
- var t = r(e);
- return t in o && (--n,
- delete o[t],
- !0)
- },
- clear: function() {
- o = Object.create(null),
- n = 0
- },
- forEach: function(e, t) {
- if ("function" != typeof e)
- throw new TypeError("`callback` must be a function");
- for (var i in o)
- if (l.call(o, i)) {
- var n = i.substring(c.length)
- , r = o[i];
- e.call(t, r, n, a)
- }
- }
- }),
- Object.defineProperty(a, "size", {
- get: function() {
- return n
- },
- configurable: !0
- }),
- "object" == typeof t && null !== t && Object.keys(t).forEach(function(e) {
- a.set(e, t[e])
- }),
- a
- }
- }
- , {}],
- 211: [function(e, t, i) {
- t.exports = e("./lib/heap")
- }
- , {
- "./lib/heap": 212
- }],
- 212: [function(e, y, A) {
- (function() {
- var e, d, l, p, f, t, c, i, g, m, n, r, o, h, u, a, s;
- function v(e) {
- this.cmp = null != e ? e : d,
- this.nodes = []
- }
- l = Math.floor,
- m = Math.min,
- d = function(e, t) {
- return e < t ? -1 : t < e ? 1 : 0
- }
- ,
- g = function(e, t, i, n, r) {
- var o;
- if (null == i && (i = 0),
- null == r && (r = d),
- i < 0)
- throw new Error("lo must be non-negative");
- for (null == n && (n = e.length); i < n; )
- r(t, e[o = l((i + n) / 2)]) < 0 ? n = o : i = o + 1;
- return [].splice.apply(e, [i, i - i].concat(t)),
- t
- }
- ,
- t = function(e, t, i) {
- return null == i && (i = d),
- e.push(t),
- h(e, 0, e.length - 1, i)
- }
- ,
- f = function(e, t) {
- var i, n;
- return null == t && (t = d),
- i = e.pop(),
- e.length ? (n = e[0],
- e[0] = i,
- u(e, 0, t)) : n = i,
- n
- }
- ,
- i = function(e, t, i) {
- var n;
- return null == i && (i = d),
- n = e[0],
- e[0] = t,
- u(e, 0, i),
- n
- }
- ,
- c = function(e, t, i) {
- var n;
- return null == i && (i = d),
- e.length && i(e[0], t) < 0 && (t = (n = [e[0], t])[0],
- e[0] = n[1],
- u(e, 0, i)),
- t
- }
- ,
- p = function(i, e) {
- var t, n, r, o, a, s;
- for (null == e && (e = d),
- a = [],
- n = 0,
- r = (o = function() {
- s = [];
- for (var e = 0, t = l(i.length / 2); 0 <= t ? e < t : t < e; 0 <= t ? e++ : e--)
- s.push(e);
- return s
- }
- .apply(this).reverse()).length; n < r; n++)
- t = o[n],
- a.push(u(i, t, e));
- return a
- }
- ,
- o = function(e, t, i) {
- var n;
- if (null == i && (i = d),
- -1 !== (n = e.indexOf(t)))
- return h(e, 0, n, i),
- u(e, n, i)
- }
- ,
- n = function(e, t, i) {
- var n, r, o, a, s;
- if (null == i && (i = d),
- !(r = e.slice(0, t)).length)
- return r;
- for (p(r, i),
- o = 0,
- a = (s = e.slice(t)).length; o < a; o++)
- n = s[o],
- c(r, n, i);
- return r.sort(i).reverse()
- }
- ,
- r = function(e, t, i) {
- var n, r, o, a, s, l, c, h, u;
- if (null == i && (i = d),
- 10 * t <= e.length) {
- if (!(o = e.slice(0, t).sort(i)).length)
- return o;
- for (r = o[o.length - 1],
- a = 0,
- l = (c = e.slice(t)).length; a < l; a++)
- i(n = c[a], r) < 0 && (g(o, n, 0, null, i),
- o.pop(),
- r = o[o.length - 1]);
- return o
- }
- for (p(e, i),
- u = [],
- s = 0,
- h = m(t, e.length); 0 <= h ? s < h : h < s; 0 <= h ? ++s : --s)
- u.push(f(e, i));
- return u
- }
- ,
- h = function(e, t, i, n) {
- var r, o, a;
- for (null == n && (n = d),
- r = e[i]; t < i && n(r, o = e[a = i - 1 >> 1]) < 0; )
- e[i] = o,
- i = a;
- return e[i] = r
- }
- ,
- u = function(e, t, i) {
- var n, r, o, a, s;
- for (null == i && (i = d),
- r = e.length,
- o = e[s = t],
- n = 2 * t + 1; n < r; )
- (a = n + 1) < r && !(i(e[n], e[a]) < 0) && (n = a),
- e[t] = e[n],
- n = 2 * (t = n) + 1;
- return e[t] = o,
- h(e, s, t, i)
- }
- ,
- v.push = t,
- v.pop = f,
- v.replace = i,
- v.pushpop = c,
- v.heapify = p,
- v.updateItem = o,
- v.nlargest = n,
- v.nsmallest = r,
- v.prototype.push = function(e) {
- return t(this.nodes, e, this.cmp)
- }
- ,
- v.prototype.pop = function() {
- return f(this.nodes, this.cmp)
- }
- ,
- v.prototype.peek = function() {
- return this.nodes[0]
- }
- ,
- v.prototype.contains = function(e) {
- return -1 !== this.nodes.indexOf(e)
- }
- ,
- v.prototype.replace = function(e) {
- return i(this.nodes, e, this.cmp)
- }
- ,
- v.prototype.pushpop = function(e) {
- return c(this.nodes, e, this.cmp)
- }
- ,
- v.prototype.heapify = function() {
- return p(this.nodes, this.cmp)
- }
- ,
- v.prototype.updateItem = function(e) {
- return o(this.nodes, e, this.cmp)
- }
- ,
- v.prototype.clear = function() {
- return this.nodes = []
- }
- ,
- v.prototype.empty = function() {
- return 0 === this.nodes.length
- }
- ,
- v.prototype.size = function() {
- return this.nodes.length
- }
- ,
- v.prototype.clone = function() {
- var e;
- return (e = new v).nodes = this.nodes.slice(0),
- e
- }
- ,
- v.prototype.toArray = function() {
- return this.nodes.slice(0)
- }
- ,
- v.prototype.insert = v.prototype.push,
- v.prototype.top = v.prototype.peek,
- v.prototype.front = v.prototype.peek,
- v.prototype.has = v.prototype.contains,
- v.prototype.copy = v.prototype.clone,
- e = v,
- a = this,
- s = function() {
- return e
- }
- ,
- "function" == typeof define && define.amd ? define([], s) : "object" == typeof A ? y.exports = s() : a.Heap = s()
- }
- ).call(this)
- }
- , {}],
- 213: [function(e, t, i) {
- function n() {}
- function o(e) {
- if ("object" != typeof this)
- throw new TypeError("Promises must be constructed via new");
- if ("function" != typeof e)
- throw new TypeError("not a function");
- this._state = 0,
- this._handled = !1,
- this._value = void 0,
- this._deferreds = [],
- h(e, this)
- }
- function r(i, n) {
- for (; 3 === i._state; )
- i = i._value;
- return 0 === i._state ? void i._deferreds.push(n) : (i._handled = !0,
- void o._immediateFn(function() {
- var e = 1 === i._state ? n.onFulfilled : n.onRejected;
- if (null !== e) {
- var t;
- try {
- t = e(i._value)
- } catch (e) {
- return void s(n.promise, e)
- }
- a(n.promise, t)
- } else
- (1 === i._state ? a : s)(n.promise, i._value)
- }))
- }
- function a(e, t) {
- try {
- if (t === e)
- throw new TypeError("A promise cannot be resolved with itself.");
- if (t && ("object" == typeof t || "function" == typeof t)) {
- var i = t.then;
- if (t instanceof o)
- return e._state = 3,
- e._value = t,
- void l(e);
- if ("function" == typeof i)
- return void h(function(e, t) {
- return function() {
- e.apply(t, arguments)
- }
- }(i, t), e)
- }
- e._state = 1,
- e._value = t,
- l(e)
- } catch (t) {
- s(e, t)
- }
- }
- function s(e, t) {
- e._state = 2,
- e._value = t,
- l(e)
- }
- function l(e) {
- 2 === e._state && 0 === e._deferreds.length && o._immediateFn(function() {
- e._handled || o._unhandledRejectionFn(e._value)
- });
- for (var t = 0, i = e._deferreds.length; t < i; t++)
- r(e, e._deferreds[t]);
- e._deferreds = null
- }
- function c(e, t, i) {
- this.onFulfilled = "function" == typeof e ? e : null,
- this.onRejected = "function" == typeof t ? t : null,
- this.promise = i
- }
- function h(e, t) {
- var i = !1;
- try {
- e(function(e) {
- i || (i = !0,
- a(t, e))
- }, function(e) {
- i || (i = !0,
- s(t, e))
- })
- } catch (e) {
- if (i)
- return;
- i = !0,
- s(t, e)
- }
- }
- var u, d;
- u = this,
- d = setTimeout,
- o.prototype.catch = function(e) {
- return this.then(null, e)
- }
- ,
- o.prototype.then = function(e, t) {
- var i = new this.constructor(n);
- return r(this, new c(e,t,i)),
- i
- }
- ,
- o.all = function(e) {
- var s = Array.prototype.slice.call(e);
- return new o(function(n, r) {
- function o(t, e) {
- try {
- if (e && ("object" == typeof e || "function" == typeof e)) {
- var i = e.then;
- if ("function" == typeof i)
- return void i.call(e, function(e) {
- o(t, e)
- }, r)
- }
- s[t] = e,
- 0 == --a && n(s)
- } catch (e) {
- r(e)
- }
- }
- if (0 === s.length)
- return n([]);
- for (var a = s.length, e = 0; e < s.length; e++)
- o(e, s[e])
- }
- )
- }
- ,
- o.resolve = function(t) {
- return t && "object" == typeof t && t.constructor === o ? t : new o(function(e) {
- e(t)
- }
- )
- }
- ,
- o.reject = function(i) {
- return new o(function(e, t) {
- t(i)
- }
- )
- }
- ,
- o.race = function(r) {
- return new o(function(e, t) {
- for (var i = 0, n = r.length; i < n; i++)
- r[i].then(e, t)
- }
- )
- }
- ,
- o._immediateFn = "function" == typeof setImmediate && function(e) {
- setImmediate(e)
- }
- || function(e) {
- d(e, 0)
- }
- ,
- o._unhandledRejectionFn = function(e) {
- "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
- }
- ,
- o._setImmediateFn = function(e) {
- o._immediateFn = e
- }
- ,
- o._setUnhandledRejectionFn = function(e) {
- o._unhandledRejectionFn = e
- }
- ,
- void 0 !== t && t.exports ? t.exports = o : u.Promise || (u.Promise = o)
- }
- , {}],
- 214: [function(p, i, e) {
- (function(d) {
- var e, t;
- e = this,
- t = function(I, e) {
- "use strict";
- var a, t, u, i, s, n, r, o = {};
- return o.ByteBuffer = I,
- o.Long = I.Long || null,
- o.VERSION = "5.0.1",
- o.WIRE_TYPES = {},
- o.WIRE_TYPES.VARINT = 0,
- o.WIRE_TYPES.BITS64 = 1,
- o.WIRE_TYPES.LDELIM = 2,
- o.WIRE_TYPES.STARTGROUP = 3,
- o.WIRE_TYPES.ENDGROUP = 4,
- o.WIRE_TYPES.BITS32 = 5,
- o.PACKABLE_WIRE_TYPES = [o.WIRE_TYPES.VARINT, o.WIRE_TYPES.BITS64, o.WIRE_TYPES.BITS32],
- o.TYPES = {
- int32: {
- name: "int32",
- wireType: o.WIRE_TYPES.VARINT,
- defaultValue: 0
- },
- uint32: {
- name: "uint32",
- wireType: o.WIRE_TYPES.VARINT,
- defaultValue: 0
- },
- sint32: {
- name: "sint32",
- wireType: o.WIRE_TYPES.VARINT,
- defaultValue: 0
- },
- int64: {
- name: "int64",
- wireType: o.WIRE_TYPES.VARINT,
- defaultValue: o.Long ? o.Long.ZERO : void 0
- },
- uint64: {
- name: "uint64",
- wireType: o.WIRE_TYPES.VARINT,
- defaultValue: o.Long ? o.Long.UZERO : void 0
- },
- sint64: {
- name: "sint64",
- wireType: o.WIRE_TYPES.VARINT,
- defaultValue: o.Long ? o.Long.ZERO : void 0
- },
- bool: {
- name: "bool",
- wireType: o.WIRE_TYPES.VARINT,
- defaultValue: !1
- },
- double: {
- name: "double",
- wireType: o.WIRE_TYPES.BITS64,
- defaultValue: 0
- },
- string: {
- name: "string",
- wireType: o.WIRE_TYPES.LDELIM,
- defaultValue: ""
- },
- bytes: {
- name: "bytes",
- wireType: o.WIRE_TYPES.LDELIM,
- defaultValue: null
- },
- fixed32: {
- name: "fixed32",
- wireType: o.WIRE_TYPES.BITS32,
- defaultValue: 0
- },
- sfixed32: {
- name: "sfixed32",
- wireType: o.WIRE_TYPES.BITS32,
- defaultValue: 0
- },
- fixed64: {
- name: "fixed64",
- wireType: o.WIRE_TYPES.BITS64,
- defaultValue: o.Long ? o.Long.UZERO : void 0
- },
- sfixed64: {
- name: "sfixed64",
- wireType: o.WIRE_TYPES.BITS64,
- defaultValue: o.Long ? o.Long.ZERO : void 0
- },
- float: {
- name: "float",
- wireType: o.WIRE_TYPES.BITS32,
- defaultValue: 0
- },
- enum: {
- name: "enum",
- wireType: o.WIRE_TYPES.VARINT,
- defaultValue: 0
- },
- message: {
- name: "message",
- wireType: o.WIRE_TYPES.LDELIM,
- defaultValue: null
- },
- group: {
- name: "group",
- wireType: o.WIRE_TYPES.STARTGROUP,
- defaultValue: null
- }
- },
- 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],
- o.ID_MIN = 1,
- o.ID_MAX = 536870911,
- o.convertFieldsToCamelCase = !1,
- o.populateAccessors = !0,
- o.populateDefaults = !0,
- o.Util = ((r = {}).IS_NODE = !("object" != typeof d || d + "" != "[object process]" || d.browser),
- r.XHR = function() {
- for (var e = [function() {
- return new XMLHttpRequest
- }
- , function() {
- return new ActiveXObject("Msxml2.XMLHTTP")
- }
- , function() {
- return new ActiveXObject("Msxml3.XMLHTTP")
- }
- , function() {
- return new ActiveXObject("Microsoft.XMLHTTP")
- }
- ], t = null, i = 0; i < e.length; i++) {
- try {
- t = e[i]()
- } catch (e) {
- continue
- }
- break
- }
- if (!t)
- throw Error("XMLHttpRequest is not supported");
- return t
- }
- ,
- r.fetch = function(e, i) {
- if (i && "function" != typeof i && (i = null),
- r.IS_NODE) {
- var t = p("fs");
- if (i)
- t.readFile(e, function(e, t) {
- i(e ? null : "" + t)
- });
- else
- try {
- return t.readFileSync(e)
- } catch (e) {
- return null
- }
- } else {
- var n = r.XHR();
- if (n.open("GET", e, !!i),
- n.setRequestHeader("Accept", "text/plain"),
- "function" == typeof n.overrideMimeType && n.overrideMimeType("text/plain"),
- !i)
- return n.send(null),
- 200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null;
- if (n.onreadystatechange = function() {
- 4 == n.readyState && i(200 == n.status || 0 == n.status && "string" == typeof n.responseText ? n.responseText : null)
- }
- ,
- 4 == n.readyState)
- return;
- n.send(null)
- }
- }
- ,
- r.toCamelCase = function(e) {
- return e.replace(/_([a-zA-Z])/g, function(e, t) {
- return t.toUpperCase()
- })
- }
- ,
- r),
- o.Lang = {
- DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
- RULE: /^(?:required|optional|repeated|map)$/,
- TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
- NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
- TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
- TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
- FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
- NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
- NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
- NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
- NUMBER_OCT: /^0[0-7]+$/,
- NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
- BOOL: /^(?:true|false)$/i,
- ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
- NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
- WHITESPACE: /\s/,
- STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
- STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
- STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
- },
- o.DotProto = function(r, a) {
- function s(e, t) {
- var i = -1
- , n = 1;
- if ("-" == e.charAt(0) && (n = -1,
- e = e.substring(1)),
- a.NUMBER_DEC.test(e))
- i = parseInt(e);
- else if (a.NUMBER_HEX.test(e))
- i = parseInt(e.substring(2), 16);
- else {
- if (!a.NUMBER_OCT.test(e))
- throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
- i = parseInt(e.substring(1), 8)
- }
- if (i = n * i | 0,
- !t && i < 0)
- throw Error("illegal id value: " + (n < 0 ? "-" : "") + e);
- return i
- }
- function o(e) {
- var t = 1;
- if ("-" == e.charAt(0) && (t = -1,
- e = e.substring(1)),
- a.NUMBER_DEC.test(e))
- return t * parseInt(e, 10);
- if (a.NUMBER_HEX.test(e))
- return t * parseInt(e.substring(2), 16);
- if (a.NUMBER_OCT.test(e))
- return t * parseInt(e.substring(1), 8);
- if ("inf" === e)
- return t * (1 / 0);
- if ("nan" === e)
- return NaN;
- if (a.NUMBER_FLT.test(e))
- return t * parseFloat(e);
- throw Error("illegal number value: " + (t < 0 ? "-" : "") + e)
- }
- function n(e, t, i) {
- void 0 === e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
- e[t].push(i))
- }
- function t(e) {
- this.source = e + "",
- this.index = 0,
- this.line = 1,
- this.stack = [],
- this._stringOpen = null
- }
- var e = {}
- , i = t.prototype;
- i._readString = function() {
- var e = '"' === this._stringOpen ? a.STRING_DQ : a.STRING_SQ;
- e.lastIndex = this.index - 1;
- var t = e.exec(this.source);
- if (!t)
- throw Error("unterminated string");
- return this.index = e.lastIndex,
- this.stack.push(this._stringOpen),
- this._stringOpen = null,
- t[1]
- }
- ,
- i.next = function() {
- if (0 < this.stack.length)
- return this.stack.shift();
- if (this.index >= this.source.length)
- return null;
- if (null !== this._stringOpen)
- return this._readString();
- var e, t, i;
- do {
- for (e = !1; a.WHITESPACE.test(i = this.source.charAt(this.index)); )
- if ("\n" === i && ++this.line,
- ++this.index === this.source.length)
- return null;
- if ("/" === this.source.charAt(this.index))
- if (++this.index,
- "/" === this.source.charAt(this.index)) {
- for (; "\n" !== this.source.charAt(++this.index); )
- if (this.index == this.source.length)
- return null;
- ++this.index,
- ++this.line,
- e = !0
- } else {
- if ("*" !== (i = this.source.charAt(this.index)))
- return "/";
- do {
- if ("\n" === i && ++this.line,
- ++this.index === this.source.length)
- return null;
- t = i,
- i = this.source.charAt(this.index)
- } while ("*" !== t || "/" !== i);++this.index,
- e = !0
- }
- } while (e);if (this.index === this.source.length)
- return null;
- var n = this.index;
- if (a.DELIM.lastIndex = 0,
- !a.DELIM.test(this.source.charAt(n++)))
- for (; n < this.source.length && !a.DELIM.test(this.source.charAt(n)); )
- ++n;
- var r = this.source.substring(this.index, this.index = n);
- return '"' !== r && "'" !== r || (this._stringOpen = r),
- r
- }
- ,
- i.peek = function() {
- if (0 === this.stack.length) {
- var e = this.next();
- if (null === e)
- return null;
- this.stack.push(e)
- }
- return this.stack[0]
- }
- ,
- i.skip = function(e) {
- var t = this.next();
- if (t !== e)
- throw Error("illegal '" + t + "', '" + e + "' expected")
- }
- ,
- i.omit = function(e) {
- return this.peek() === e && (this.next(),
- !0)
- }
- ,
- i.toString = function() {
- return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
- }
- ,
- e.Tokenizer = t;
- function l(e) {
- this.tn = new t(e),
- this.proto3 = !1
- }
- var c = l.prototype;
- return c.parse = function() {
- var e, t, i = {
- name: "[ROOT]",
- package: null,
- messages: [],
- enums: [],
- imports: [],
- options: {},
- services: []
- }, n = !0;
- try {
- for (; e = this.tn.next(); )
- switch (e) {
- case "package":
- if (!n || null !== i.package)
- throw Error("unexpected 'package'");
- if (e = this.tn.next(),
- !a.TYPEREF.test(e))
- throw Error("illegal package name: " + e);
- this.tn.skip(";"),
- i.package = e;
- break;
- case "import":
- if (!n)
- throw Error("unexpected 'import'");
- "public" !== (e = this.tn.peek()) && !(t = "weak" === e) || this.tn.next(),
- e = this._readString(),
- this.tn.skip(";"),
- t || i.imports.push(e);
- break;
- case "syntax":
- if (!n)
- throw Error("unexpected 'syntax'");
- this.tn.skip("="),
- "proto3" === (i.syntax = this._readString()) && (this.proto3 = !0),
- this.tn.skip(";");
- break;
- case "message":
- this._parseMessage(i, null),
- n = !1;
- break;
- case "enum":
- this._parseEnum(i),
- n = !1;
- break;
- case "option":
- this._parseOption(i);
- break;
- case "service":
- this._parseService(i);
- break;
- case "extend":
- this._parseExtend(i);
- break;
- default:
- throw Error("unexpected '" + e + "'")
- }
- } catch (e) {
- throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
- e
- }
- return delete i.name,
- i
- }
- ,
- l.parse = function(e) {
- return new l(e).parse()
- }
- ,
- c._readString = function() {
- var e, t, i = "";
- do {
- if ("'" !== (t = this.tn.next()) && '"' !== t)
- throw Error("illegal string delimiter: " + t);
- i += this.tn.next(),
- this.tn.skip(t),
- e = this.tn.peek()
- } while ('"' === e || '"' === e);return i
- }
- ,
- c._readValue = function(e) {
- var t = this.tn.peek();
- if ('"' === t || "'" === t)
- return this._readString();
- if (this.tn.next(),
- a.NUMBER.test(t))
- return o(t);
- if (a.BOOL.test(t))
- return "true" === t.toLowerCase();
- if (e && a.TYPEREF.test(t))
- return t;
- throw Error("illegal value: " + t)
- }
- ,
- c._parseOption = function(e, t) {
- var i = this.tn.next()
- , n = !1;
- if ("(" === i && (n = !0,
- i = this.tn.next()),
- !a.TYPEREF.test(i))
- throw Error("illegal option name: " + i);
- var r = i;
- n && (this.tn.skip(")"),
- r = "(" + r + ")",
- i = this.tn.peek(),
- a.FQTYPEREF.test(i) && (r += i,
- this.tn.next())),
- this.tn.skip("="),
- this._parseOptionValue(e, r),
- t || this.tn.skip(";")
- }
- ,
- c._parseOptionValue = function(e, t) {
- var i = this.tn.peek();
- if ("{" !== i)
- n(e.options, t, this._readValue(!0));
- else
- for (this.tn.skip("{"); "}" !== (i = this.tn.next()); ) {
- if (!a.NAME.test(i))
- throw Error("illegal option name: " + t + "." + i);
- this.tn.omit(":") ? n(e.options, t + "." + i, this._readValue(!0)) : this._parseOptionValue(e, t + "." + i)
- }
- }
- ,
- c._parseService = function(e) {
- var t = this.tn.next();
- if (!a.NAME.test(t))
- throw Error("illegal service name at line " + this.tn.line + ": " + t);
- var i = {
- name: t,
- rpc: {},
- options: {}
- };
- for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
- if ("option" === t)
- this._parseOption(i);
- else {
- if ("rpc" !== t)
- throw Error("illegal service token: " + t);
- this._parseServiceRPC(i)
- }
- this.tn.omit(";"),
- e.services.push(i)
- }
- ,
- c._parseServiceRPC = function(e) {
- var t = this.tn.next();
- if (!a.NAME.test(t))
- throw Error("illegal rpc service method name: " + t);
- var i = t
- , n = {
- request: null,
- response: null,
- request_stream: !1,
- response_stream: !1,
- options: {}
- };
- if (this.tn.skip("("),
- "stream" === (t = this.tn.next()).toLowerCase() && (n.request_stream = !0,
- t = this.tn.next()),
- !a.TYPEREF.test(t))
- throw Error("illegal rpc service request type: " + t);
- if (n.request = t,
- this.tn.skip(")"),
- "returns" !== (t = this.tn.next()).toLowerCase())
- throw Error("illegal rpc service request type delimiter: " + t);
- if (this.tn.skip("("),
- "stream" === (t = this.tn.next()).toLowerCase() && (n.response_stream = !0,
- t = this.tn.next()),
- n.response = t,
- this.tn.skip(")"),
- "{" === (t = this.tn.peek())) {
- for (this.tn.next(); "}" !== (t = this.tn.next()); ) {
- if ("option" !== t)
- throw Error("illegal rpc service token: " + t);
- this._parseOption(n)
- }
- this.tn.omit(";")
- } else
- this.tn.skip(";");
- void 0 === e.rpc && (e.rpc = {}),
- e.rpc[i] = n
- }
- ,
- c._parseMessage = function(e, t) {
- var i = !!t
- , n = this.tn.next()
- , r = {
- name: "",
- fields: [],
- enums: [],
- messages: [],
- options: {},
- services: [],
- oneofs: {}
- };
- if (!a.NAME.test(n))
- throw Error("illegal " + (i ? "group" : "message") + " name: " + n);
- for (r.name = n,
- i && (this.tn.skip("="),
- t.id = s(this.tn.next()),
- r.isGroup = !0),
- "[" === (n = this.tn.peek()) && t && this._parseFieldOptions(t),
- this.tn.skip("{"); "}" !== (n = this.tn.next()); )
- if (a.RULE.test(n))
- this._parseMessageField(r, n);
- else if ("oneof" === n)
- this._parseMessageOneOf(r);
- else if ("enum" === n)
- this._parseEnum(r);
- else if ("message" === n)
- this._parseMessage(r);
- else if ("option" === n)
- this._parseOption(r);
- else if ("service" === n)
- this._parseService(r);
- else if ("extensions" === n)
- r.extensions = this._parseExtensionRanges();
- else if ("reserved" === n)
- this._parseIgnored();
- else if ("extend" === n)
- this._parseExtend(r);
- else {
- if (!a.TYPEREF.test(n))
- throw Error("illegal message token: " + n);
- if (!this.proto3)
- throw Error("illegal field rule: " + n);
- this._parseMessageField(r, "optional", n)
- }
- return this.tn.omit(";"),
- e.messages.push(r),
- r
- }
- ,
- c._parseIgnored = function() {
- for (; ";" !== this.tn.peek(); )
- this.tn.next();
- this.tn.skip(";")
- }
- ,
- c._parseMessageField = function(e, t, i) {
- if (!a.RULE.test(t))
- throw Error("illegal message field rule: " + t);
- var n, r = {
- rule: t,
- type: "",
- name: "",
- options: {},
- id: 0
- };
- if ("map" === t) {
- if (i)
- throw Error("illegal type: " + i);
- if (this.tn.skip("<"),
- n = this.tn.next(),
- !a.TYPE.test(n) && !a.TYPEREF.test(n))
- throw Error("illegal message field type: " + n);
- if (r.keytype = n,
- this.tn.skip(","),
- n = this.tn.next(),
- !a.TYPE.test(n) && !a.TYPEREF.test(n))
- throw Error("illegal message field: " + n);
- if (r.type = n,
- this.tn.skip(">"),
- n = this.tn.next(),
- !a.NAME.test(n))
- throw Error("illegal message field name: " + n);
- r.name = n,
- this.tn.skip("="),
- r.id = s(this.tn.next()),
- "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
- this.tn.skip(";")
- } else if ("group" === (i = void 0 !== i ? i : this.tn.next())) {
- var o = this._parseMessage(e, r);
- if (!/^[A-Z]/.test(o.name))
- throw Error("illegal group name: " + o.name);
- r.type = o.name,
- r.name = o.name.toLowerCase(),
- this.tn.omit(";")
- } else {
- if (!a.TYPE.test(i) && !a.TYPEREF.test(i))
- throw Error("illegal message field type: " + i);
- if (r.type = i,
- n = this.tn.next(),
- !a.NAME.test(n))
- throw Error("illegal message field name: " + n);
- r.name = n,
- this.tn.skip("="),
- r.id = s(this.tn.next()),
- "[" === (n = this.tn.peek()) && this._parseFieldOptions(r),
- this.tn.skip(";")
- }
- return e.fields.push(r),
- r
- }
- ,
- c._parseMessageOneOf = function(e) {
- var t = this.tn.next();
- if (!a.NAME.test(t))
- throw Error("illegal oneof name: " + t);
- var i, n = t, r = [];
- for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
- (i = this._parseMessageField(e, "optional", t)).oneof = n,
- r.push(i.id);
- this.tn.omit(";"),
- e.oneofs[n] = r
- }
- ,
- c._parseFieldOptions = function(e) {
- this.tn.skip("[");
- for (var t = !0; "]" !== this.tn.peek(); )
- t || this.tn.skip(","),
- this._parseOption(e, !0),
- t = !1;
- this.tn.next()
- }
- ,
- c._parseEnum = function(e) {
- var t = {
- name: "",
- values: [],
- options: {}
- }
- , i = this.tn.next();
- if (!a.NAME.test(i))
- throw Error("illegal name: " + i);
- for (t.name = i,
- this.tn.skip("{"); "}" !== (i = this.tn.next()); )
- if ("option" === i)
- this._parseOption(t);
- else {
- if (!a.NAME.test(i))
- throw Error("illegal name: " + i);
- this.tn.skip("=");
- var n = {
- name: i,
- id: s(this.tn.next(), !0)
- };
- "[" === (i = this.tn.peek()) && this._parseFieldOptions({
- options: {}
- }),
- this.tn.skip(";"),
- t.values.push(n)
- }
- this.tn.omit(";"),
- e.enums.push(t)
- }
- ,
- c._parseExtensionRanges = function() {
- var e, t, i, n = [];
- do {
- for (t = []; ; ) {
- switch (e = this.tn.next()) {
- case "min":
- i = r.ID_MIN;
- break;
- case "max":
- i = r.ID_MAX;
- break;
- default:
- i = o(e)
- }
- if (t.push(i),
- 2 === t.length)
- break;
- if ("to" !== this.tn.peek()) {
- t.push(i);
- break
- }
- this.tn.next()
- }
- n.push(t)
- } while (this.tn.omit(","));return this.tn.skip(";"),
- n
- }
- ,
- c._parseExtend = function(e) {
- var t = this.tn.next();
- if (!a.TYPEREF.test(t))
- throw Error("illegal extend reference: " + t);
- var i = {
- ref: t,
- fields: []
- };
- for (this.tn.skip("{"); "}" !== (t = this.tn.next()); )
- if (a.RULE.test(t))
- this._parseMessageField(i, t);
- else {
- if (!a.TYPEREF.test(t))
- throw Error("illegal extend token: " + t);
- if (!this.proto3)
- throw Error("illegal field rule: " + t);
- this._parseMessageField(i, "optional", t)
- }
- return this.tn.omit(";"),
- e.messages.push(i),
- i
- }
- ,
- c.toString = function() {
- return "Parser at line " + this.tn.line
- }
- ,
- e.Parser = l,
- e
- }(o, o.Lang),
- o.Reflect = function(g) {
- function a(e, t) {
- if (e && "number" == typeof e.low && "number" == typeof e.high && "boolean" == typeof e.unsigned && e.low == e.low && e.high == e.high)
- return new g.Long(e.low,e.high,void 0 === t ? e.unsigned : t);
- if ("string" == typeof e)
- return g.Long.fromString(e, t || !1, 10);
- if ("number" == typeof e)
- return g.Long.fromNumber(e, t || !1);
- throw Error("not convertible to Long")
- }
- function m(e, t) {
- var i = t.readVarint32()
- , n = 7 & i
- , r = i >>> 3;
- switch (n) {
- case g.WIRE_TYPES.VARINT:
- for (; 128 == (128 & (i = t.readUint8())); )
- ;
- break;
- case g.WIRE_TYPES.BITS64:
- t.offset += 8;
- break;
- case g.WIRE_TYPES.LDELIM:
- i = t.readVarint32(),
- t.offset += i;
- break;
- case g.WIRE_TYPES.STARTGROUP:
- m(r, t);
- break;
- case g.WIRE_TYPES.ENDGROUP:
- if (r === e)
- return !1;
- throw Error("Illegal GROUPEND after unknown group: " + r + " (" + e + " expected)");
- case g.WIRE_TYPES.BITS32:
- t.offset += 4;
- break;
- default:
- throw Error("Illegal wire type in unknown group " + e + ": " + n)
- }
- return !0
- }
- function h(e, t, i) {
- this.builder = e,
- this.parent = t,
- this.name = i,
- this.className
- }
- var s = {}
- , e = h.prototype;
- e.fqn = function() {
- for (var e = this.name, t = this; null != (t = t.parent); )
- e = t.name + "." + e;
- return e
- }
- ,
- e.toString = function(e) {
- return (e ? this.className + " " : "") + this.fqn()
- }
- ,
- e.build = function() {
- throw Error(this.toString(!0) + " cannot be built directly")
- }
- ,
- s.T = h;
- function l(e, t, i, n, r) {
- h.call(this, e, t, i),
- this.className = "Namespace",
- this.children = [],
- this.options = n || {},
- this.syntax = r || "proto2"
- }
- var t = l.prototype = Object.create(h.prototype);
- t.getChildren = function(e) {
- if (null == (e = e || null))
- return this.children.slice();
- for (var t = [], i = 0, n = this.children.length; i < n; ++i)
- this.children[i]instanceof e && t.push(this.children[i]);
- return t
- }
- ,
- t.addChild = function(e) {
- var t;
- if (t = this.getChild(e.name))
- if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
- t.name = t.originalName;
- else {
- if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
- throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
- e.name = e.originalName
- }
- this.children.push(e)
- }
- ,
- t.getChild = function(e) {
- for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
- if (this.children[i][t] === e)
- return this.children[i];
- return null
- }
- ,
- t.resolve = function(e, t) {
- var i, n = "string" == typeof e ? e.split(".") : e, r = this, o = 0;
- if ("" === n[o]) {
- for (; null !== r.parent; )
- r = r.parent;
- o++
- }
- do {
- do {
- if (!(r instanceof s.Namespace)) {
- r = null;
- break
- }
- if (!(i = r.getChild(n[o])) || !(i instanceof s.T) || t && !(i instanceof s.Namespace)) {
- r = null;
- break
- }
- r = i,
- o++
- } while (o < n.length);if (null != r)
- break;
- if (null !== this.parent)
- return this.parent.resolve(e, t)
- } while (null != r);return r
- }
- ,
- t.qn = function(e) {
- for (var t = [], i = e; t.unshift(i.name),
- null !== (i = i.parent); )
- ;
- for (var n = 1; n <= t.length; n++) {
- var r = t.slice(t.length - n);
- if (e === this.resolve(r, e instanceof s.Namespace))
- return r.join(".")
- }
- return e.fqn()
- }
- ,
- t.build = function() {
- for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
- (e = i[n])instanceof l && (t[e.name] = e.build());
- return Object.defineProperty && Object.defineProperty(t, "$options", {
- value: this.buildOpt()
- }),
- t
- }
- ,
- t.buildOpt = function() {
- for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
- var r = t[i]
- , o = this.options[t[i]];
- e[r] = o
- }
- return e
- }
- ,
- t.getOption = function(e) {
- return void 0 === e ? this.options : void 0 !== this.options[e] ? this.options[e] : null
- }
- ,
- s.Namespace = l;
- function u(e, t, i, n) {
- if (this.type = e,
- this.resolvedType = t,
- this.isMapKey = i,
- this.syntax = n,
- i && g.MAP_KEY_TYPES.indexOf(e) < 0)
- throw Error("Invalid map key type: " + e.name)
- }
- var i = u.prototype;
- u.defaultFieldValue = function(e) {
- if ("string" == typeof e && (e = g.TYPES[e]),
- void 0 === e.defaultValue)
- throw Error("default value for type " + e.name + " is not supported");
- return e == g.TYPES.bytes ? new I(0) : e.defaultValue
- }
- ,
- i.verifyValue = function(t) {
- function i(e, t) {
- throw Error("Illegal value for " + n.toString(!0) + " of type " + n.type.name + ": " + e + " (" + t + ")")
- }
- var n = this;
- switch (this.type) {
- case g.TYPES.int32:
- case g.TYPES.sint32:
- case g.TYPES.sfixed32:
- return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
- 4294967295 < t ? 0 | t : t;
- case g.TYPES.uint32:
- case g.TYPES.fixed32:
- return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
- t < 0 ? t >>> 0 : t;
- case g.TYPES.int64:
- case g.TYPES.sint64:
- case g.TYPES.sfixed64:
- if (g.Long)
- try {
- return a(t, !1)
- } catch (e) {
- i(typeof t, e.message)
- }
- else
- i(typeof t, "requires Long.js");
- case g.TYPES.uint64:
- case g.TYPES.fixed64:
- if (g.Long)
- try {
- return a(t, !0)
- } catch (e) {
- i(typeof t, e.message)
- }
- else
- i(typeof t, "requires Long.js");
- case g.TYPES.bool:
- return "boolean" != typeof t && i(typeof t, "not a boolean"),
- t;
- case g.TYPES.float:
- case g.TYPES.double:
- return "number" != typeof t && i(typeof t, "not a number"),
- t;
- case g.TYPES.string:
- return "string" == typeof t || t && t instanceof String || i(typeof t, "not a string"),
- "" + t;
- case g.TYPES.bytes:
- return I.isByteBuffer(t) ? t : I.wrap(t, "base64");
- case g.TYPES.enum:
- var e = this.resolvedType.getChildren(g.Reflect.Enum.Value);
- for (o = 0; o < e.length; o++) {
- if (e[o].name == t)
- return e[o].id;
- if (e[o].id == t)
- return e[o].id
- }
- if ("proto3" === this.syntax)
- return ("number" != typeof t || t == t && t % 1 != 0) && i(typeof t, "not an integer"),
- (4294967295 < t || t < 0) && i(typeof t, "not in range for uint32"),
- t;
- i(t, "not a valid enum value");
- case g.TYPES.group:
- case g.TYPES.message:
- if (t && "object" == typeof t || i(typeof t, "object expected"),
- t instanceof this.resolvedType.clazz)
- return t;
- if (t instanceof g.Builder.Message) {
- var r = {};
- for (var o in t)
- t.hasOwnProperty(o) && (r[o] = t[o]);
- t = r
- }
- return new this.resolvedType.clazz(t)
- }
- throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + t + " (undefined type " + this.type + ")")
- }
- ,
- i.calculateLength = function(e, t) {
- if (null === t)
- return 0;
- var i;
- switch (this.type) {
- case g.TYPES.int32:
- return t < 0 ? I.calculateVarint64(t) : I.calculateVarint32(t);
- case g.TYPES.uint32:
- return I.calculateVarint32(t);
- case g.TYPES.sint32:
- return I.calculateVarint32(I.zigZagEncode32(t));
- case g.TYPES.fixed32:
- case g.TYPES.sfixed32:
- case g.TYPES.float:
- return 4;
- case g.TYPES.int64:
- case g.TYPES.uint64:
- return I.calculateVarint64(t);
- case g.TYPES.sint64:
- return I.calculateVarint64(I.zigZagEncode64(t));
- case g.TYPES.fixed64:
- case g.TYPES.sfixed64:
- return 8;
- case g.TYPES.bool:
- return 1;
- case g.TYPES.enum:
- return I.calculateVarint32(t);
- case g.TYPES.double:
- return 8;
- case g.TYPES.string:
- return i = I.calculateUTF8Bytes(t),
- I.calculateVarint32(i) + i;
- case g.TYPES.bytes:
- if (t.remaining() < 0)
- throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
- return I.calculateVarint32(t.remaining()) + t.remaining();
- case g.TYPES.message:
- return i = this.resolvedType.calculate(t),
- I.calculateVarint32(i) + i;
- case g.TYPES.group:
- return (i = this.resolvedType.calculate(t)) + I.calculateVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP)
- }
- throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
- }
- ,
- i.encodeValue = function(e, t, i) {
- if (null === t)
- return i;
- switch (this.type) {
- case g.TYPES.int32:
- t < 0 ? i.writeVarint64(t) : i.writeVarint32(t);
- break;
- case g.TYPES.uint32:
- i.writeVarint32(t);
- break;
- case g.TYPES.sint32:
- i.writeVarint32ZigZag(t);
- break;
- case g.TYPES.fixed32:
- i.writeUint32(t);
- break;
- case g.TYPES.sfixed32:
- i.writeInt32(t);
- break;
- case g.TYPES.int64:
- case g.TYPES.uint64:
- i.writeVarint64(t);
- break;
- case g.TYPES.sint64:
- i.writeVarint64ZigZag(t);
- break;
- case g.TYPES.fixed64:
- i.writeUint64(t);
- break;
- case g.TYPES.sfixed64:
- i.writeInt64(t);
- break;
- case g.TYPES.bool:
- "string" == typeof t ? i.writeVarint32("false" === t.toLowerCase() ? 0 : !!t) : i.writeVarint32(t ? 1 : 0);
- break;
- case g.TYPES.enum:
- i.writeVarint32(t);
- break;
- case g.TYPES.float:
- i.writeFloat32(t);
- break;
- case g.TYPES.double:
- i.writeFloat64(t);
- break;
- case g.TYPES.string:
- i.writeVString(t);
- break;
- case g.TYPES.bytes:
- if (t.remaining() < 0)
- throw Error("Illegal value for " + this.toString(!0) + ": " + t.remaining() + " bytes remaining");
- var n = t.offset;
- i.writeVarint32(t.remaining()),
- i.append(t),
- t.offset = n;
- break;
- case g.TYPES.message:
- var r = (new I).LE();
- this.resolvedType.encode(t, r),
- i.writeVarint32(r.offset),
- i.append(r.flip());
- break;
- case g.TYPES.group:
- this.resolvedType.encode(t, i),
- i.writeVarint32(e << 3 | g.WIRE_TYPES.ENDGROUP);
- break;
- default:
- throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + t + " (unknown type)")
- }
- return i
- }
- ,
- i.decode = function(e, t, i) {
- if (t != this.type.wireType)
- throw Error("Unexpected wire type for element");
- var n, r;
- switch (this.type) {
- case g.TYPES.int32:
- return 0 | e.readVarint32();
- case g.TYPES.uint32:
- return e.readVarint32() >>> 0;
- case g.TYPES.sint32:
- return 0 | e.readVarint32ZigZag();
- case g.TYPES.fixed32:
- return e.readUint32() >>> 0;
- case g.TYPES.sfixed32:
- return 0 | e.readInt32();
- case g.TYPES.int64:
- return e.readVarint64();
- case g.TYPES.uint64:
- return e.readVarint64().toUnsigned();
- case g.TYPES.sint64:
- return e.readVarint64ZigZag();
- case g.TYPES.fixed64:
- return e.readUint64();
- case g.TYPES.sfixed64:
- return e.readInt64();
- case g.TYPES.bool:
- return !!e.readVarint32();
- case g.TYPES.enum:
- return e.readVarint32();
- case g.TYPES.float:
- return e.readFloat();
- case g.TYPES.double:
- return e.readDouble();
- case g.TYPES.string:
- return e.readVString();
- case g.TYPES.bytes:
- if (r = e.readVarint32(),
- e.remaining() < r)
- throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + e.remaining());
- return (n = e.clone()).limit = n.offset + r,
- e.offset += r,
- n;
- case g.TYPES.message:
- return r = e.readVarint32(),
- this.resolvedType.decode(e, r);
- case g.TYPES.group:
- return this.resolvedType.decode(e, -1, i)
- }
- throw Error("[INTERNAL] Illegal decode type")
- }
- ,
- i.valueFromString = function(e) {
- if (!this.isMapKey)
- throw Error("valueFromString() called on non-map-key element");
- switch (this.type) {
- case g.TYPES.int32:
- case g.TYPES.sint32:
- case g.TYPES.sfixed32:
- case g.TYPES.uint32:
- case g.TYPES.fixed32:
- return this.verifyValue(parseInt(e));
- case g.TYPES.int64:
- case g.TYPES.sint64:
- case g.TYPES.sfixed64:
- case g.TYPES.uint64:
- case g.TYPES.fixed64:
- return this.verifyValue(e);
- case g.TYPES.bool:
- return "true" === e;
- case g.TYPES.string:
- return this.verifyValue(e);
- case g.TYPES.bytes:
- return I.fromBinary(e)
- }
- }
- ,
- i.valueToString = function(e) {
- if (!this.isMapKey)
- throw Error("valueToString() called on non-map-key element");
- return this.type === g.TYPES.bytes ? e.toString("binary") : e.toString()
- }
- ,
- s.Element = u;
- var d = function(e, t, i, n, r, o) {
- l.call(this, e, t, i, n, o),
- this.className = "Message",
- this.extensions = void 0,
- this.clazz = null,
- this.isGroup = !!r,
- this._fields = null,
- this._fieldsById = null,
- this._fieldsByName = null
- }
- , n = d.prototype = Object.create(l.prototype);
- n.build = function(e) {
- if (this.clazz && !e)
- return this.clazz;
- var t = function(u, a) {
- function d(e, i, n, r) {
- if (null === e || "object" != typeof e) {
- if (r && r instanceof u.Reflect.Enum) {
- var t = u.Reflect.Enum.getName(r.object, e);
- if (null !== t)
- return t
- }
- return e
- }
- if (I.isByteBuffer(e))
- return i ? e.toBase64() : e.toBuffer();
- if (u.Long.isLong(e))
- return n ? e.toString() : u.Long.fromValue(e);
- var o;
- if (Array.isArray(e))
- return o = [],
- e.forEach(function(e, t) {
- o[t] = d(e, i, n, r)
- }),
- o;
- if (o = {},
- e instanceof u.Map) {
- for (var a = e.entries(), s = a.next(); !s.done; s = a.next())
- o[e.keyElem.valueToString(s.value[0])] = d(s.value[1], i, n, e.valueElem.resolvedType);
- return o
- }
- var l = e.$type
- , c = void 0;
- for (var h in e)
- e.hasOwnProperty(h) && (l && (c = l.getChild(h)) ? o[h] = d(e[h], i, n, c.resolvedType) : o[h] = d(e[h], i, n));
- return o
- }
- var s = a.getChildren(u.Reflect.Message.Field)
- , l = a.getChildren(u.Reflect.Message.OneOf)
- , c = function(e, t) {
- u.Builder.Message.call(this);
- for (var i = 0, n = l.length; i < n; ++i)
- this[l[i].name] = null;
- for (i = 0,
- n = s.length; i < n; ++i) {
- var r = s[i];
- this[r.name] = r.repeated ? [] : r.map ? new u.Map(r) : null,
- !r.required && "proto3" !== a.syntax || null === r.defaultValue || (this[r.name] = r.defaultValue)
- }
- var o;
- if (0 < arguments.length)
- 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)
- for (i = 0,
- n = arguments.length; i < n; ++i)
- void 0 !== (o = arguments[i]) && this.$set(s[i].name, o);
- else
- this.$set(e)
- }
- , o = c.prototype = Object.create(u.Builder.Message.prototype);
- o.add = function(e, t, i) {
- var n = a._fieldsByName[e];
- if (!i) {
- if (!n)
- throw Error(this + "#" + e + " is undefined");
- if (!(n instanceof u.Reflect.Message.Field))
- throw Error(this + "#" + e + " is not a field: " + n.toString(!0));
- if (!n.repeated)
- throw Error(this + "#" + e + " is not a repeated field");
- t = n.verifyValue(t, !0)
- }
- return null === this[e] && (this[e] = []),
- this[e].push(t),
- this
- }
- ,
- o.$add = o.add,
- o.set = function(e, t, i) {
- if (e && "object" == typeof e) {
- for (var n in i = t,
- e)
- e.hasOwnProperty(n) && void 0 !== (t = e[n]) && this.$set(n, t, i);
- return this
- }
- var r = a._fieldsByName[e];
- if (i)
- this[e] = t;
- else {
- if (!r)
- throw Error(this + "#" + e + " is not a field: undefined");
- if (!(r instanceof u.Reflect.Message.Field))
- throw Error(this + "#" + e + " is not a field: " + r.toString(!0));
- this[r.name] = t = r.verifyValue(t)
- }
- if (r && r.oneof) {
- var o = this[r.oneof.name];
- null !== t ? (null !== o && o !== r.name && (this[o] = null),
- this[r.oneof.name] = r.name) : o === e && (this[r.oneof.name] = null)
- }
- return this
- }
- ,
- o.$set = o.set,
- o.get = function(e, t) {
- if (t)
- return this[e];
- var i = a._fieldsByName[e];
- if (!(i && i instanceof u.Reflect.Message.Field))
- throw Error(this + "#" + e + " is not a field: undefined");
- if (!(i instanceof u.Reflect.Message.Field))
- throw Error(this + "#" + e + " is not a field: " + i.toString(!0));
- return this[i.name]
- }
- ,
- o.$get = o.get;
- for (var e = 0; e < s.length; e++) {
- var t = s[e];
- t instanceof u.Reflect.Message.ExtensionField || a.builder.options.populateAccessors && function(i) {
- var e = i.originalName.replace(/(_[a-zA-Z])/g, function(e) {
- return e.toUpperCase().replace("_", "")
- });
- e = e.substring(0, 1).toUpperCase() + e.substring(1);
- function t(e, t) {
- return this[i.name] = t ? e : i.verifyValue(e),
- this
- }
- function n() {
- return this[i.name]
- }
- var r = i.originalName.replace(/([A-Z])/g, function(e) {
- return "_" + e
- });
- null === a.getChild("set" + e) && (o["set" + e] = t),
- null === a.getChild("set_" + r) && (o["set_" + r] = t),
- null === a.getChild("get" + e) && (o["get" + e] = n),
- null === a.getChild("get_" + r) && (o["get_" + r] = n)
- }(t)
- }
- return o.encode = function(t, e) {
- "boolean" == typeof t && (e = t,
- t = void 0);
- var i = !1;
- t || (t = new I,
- i = !0);
- var n = t.littleEndian;
- try {
- return a.encode(this, t.LE(), e),
- (i ? t.flip() : t).LE(n)
- } catch (e) {
- throw t.LE(n),
- e
- }
- }
- ,
- c.encode = function(e, t, i) {
- return new c(e).encode(t, i)
- }
- ,
- o.calculate = function() {
- return a.calculate(this)
- }
- ,
- o.encodeDelimited = function(e, t) {
- var i = !1;
- e || (e = new I,
- i = !0);
- var n = (new I).LE();
- return a.encode(this, n, t).flip(),
- e.writeVarint32(n.remaining()),
- e.append(n),
- i ? e.flip() : e
- }
- ,
- o.encodeAB = function() {
- try {
- return this.encode().toArrayBuffer()
- } catch (e) {
- throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
- e
- }
- }
- ,
- o.toArrayBuffer = o.encodeAB,
- o.encodeNB = function() {
- try {
- return this.encode().toBuffer()
- } catch (e) {
- throw e.encoded && (e.encoded = e.encoded.toBuffer()),
- e
- }
- }
- ,
- o.toBuffer = o.encodeNB,
- o.encode64 = function() {
- try {
- return this.encode().toBase64()
- } catch (e) {
- throw e.encoded && (e.encoded = e.encoded.toBase64()),
- e
- }
- }
- ,
- o.toBase64 = o.encode64,
- o.encodeHex = function() {
- try {
- return this.encode().toHex()
- } catch (e) {
- throw e.encoded && (e.encoded = e.encoded.toHex()),
- e
- }
- }
- ,
- o.toHex = o.encodeHex,
- o.toRaw = function(e, t) {
- return d(this, !!e, !!t, this.$type)
- }
- ,
- o.encodeJSON = function() {
- return JSON.stringify(d(this, !0, !0, this.$type))
- }
- ,
- c.decode = function(t, e, i) {
- "string" == typeof e && (i = e,
- e = -1),
- "string" == typeof t && (t = I.wrap(t, i || "base64"));
- var n = (t = I.isByteBuffer(t) ? t : I.wrap(t)).littleEndian;
- try {
- var r = a.decode(t.LE());
- return t.LE(n),
- r
- } catch (e) {
- throw t.LE(n),
- e
- }
- }
- ,
- c.decodeDelimited = function(t, e) {
- if ("string" == typeof t && (t = I.wrap(t, e || "base64")),
- (t = I.isByteBuffer(t) ? t : I.wrap(t)).remaining() < 1)
- return null;
- var i = t.offset
- , n = t.readVarint32();
- if (t.remaining() < n)
- return t.offset = i,
- null;
- try {
- var r = a.decode(t.slice(t.offset, t.offset + n).LE());
- return t.offset += n,
- r
- } catch (e) {
- throw t.offset += n,
- e
- }
- }
- ,
- c.decode64 = function(e) {
- return c.decode(e, "base64")
- }
- ,
- c.decodeHex = function(e) {
- return c.decode(e, "hex")
- }
- ,
- c.decodeJSON = function(e) {
- return new c(JSON.parse(e))
- }
- ,
- o.toString = function() {
- return a.toString()
- }
- ,
- Object.defineProperty && (Object.defineProperty(c, "$options", {
- value: a.buildOpt()
- }),
- Object.defineProperty(o, "$options", {
- value: c.$options
- }),
- Object.defineProperty(c, "$type", {
- value: a
- }),
- Object.defineProperty(o, "$type", {
- value: a
- })),
- c
- }(g, this);
- this._fields = [],
- this._fieldsById = {},
- this._fieldsByName = {};
- for (var i, n = 0, r = this.children.length; n < r; n++)
- if ((i = this.children[n])instanceof p || i instanceof d || i instanceof y) {
- if (t.hasOwnProperty(i.name))
- throw Error("Illegal reflect child of " + this.toString(!0) + ": " + i.toString(!0) + " cannot override static property '" + i.name + "'");
- t[i.name] = i.build()
- } else if (i instanceof d.Field)
- i.build(),
- this._fields.push(i),
- this._fieldsById[i.id] = i,
- this._fieldsByName[i.name] = i;
- else if (!(i instanceof d.OneOf || i instanceof v))
- throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[n].toString(!0));
- return this.clazz = t
- }
- ,
- n.encode = function(e, t, i) {
- for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
- r = e[(n = this._fields[a]).name],
- n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
- if (null === o)
- return t;
- var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
- throw l.encoded = t,
- l
- }
- ,
- n.calculate = function(e) {
- for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
- if (i = e[(t = this._fields[r]).name],
- t.required && null === i)
- throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
- n += t.calculate(i, e)
- }
- return n
- }
- ,
- n.decode = function(e, t, i) {
- t = "number" == typeof t ? t : -1;
- for (var n, r, o, a, s = e.offset, l = new this.clazz; e.offset < s + t || -1 === t && 0 < e.remaining(); ) {
- if (o = (n = e.readVarint32()) >>> 3,
- (r = 7 & n) === g.WIRE_TYPES.ENDGROUP) {
- if (o !== i)
- throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + o + " (" + (i ? i + " expected" : "not a group") + ")");
- break
- }
- if (a = this._fieldsById[o]) {
- if (a.repeated && !a.options.packed)
- l[a.name].push(a.decode(r, e));
- else if (a.map) {
- var c = a.decode(r, e);
- l[a.name].set(c[0], c[1])
- } else if (l[a.name] = a.decode(r, e),
- a.oneof) {
- var h = l[a.oneof.name];
- null !== h && h !== a.name && (l[h] = null),
- l[a.oneof.name] = a.name
- }
- } else
- switch (r) {
- case g.WIRE_TYPES.VARINT:
- e.readVarint32();
- break;
- case g.WIRE_TYPES.BITS32:
- e.offset += 4;
- break;
- case g.WIRE_TYPES.BITS64:
- e.offset += 8;
- break;
- case g.WIRE_TYPES.LDELIM:
- var u = e.readVarint32();
- e.offset += u;
- break;
- case g.WIRE_TYPES.STARTGROUP:
- for (; m(o, e); )
- ;
- break;
- default:
- throw Error("Illegal wire type for unknown field " + o + " in " + this.toString(!0) + "#decode: " + r)
- }
- }
- for (var d = 0, p = this._fields.length; d < p; ++d)
- if (null === l[(a = this._fields[d]).name])
- if ("proto3" === this.syntax)
- l[a.name] = a.defaultValue;
- else {
- if (a.required) {
- var f = Error("Missing at least one required field for " + this.toString(!0) + ": " + a.name);
- throw f.decoded = l,
- f
- }
- g.populateDefaults && null !== a.defaultValue && (l[a.name] = a.defaultValue)
- }
- return l
- }
- ,
- s.Message = d;
- function c(e, t, i, n, r, o, a, s, l, c) {
- h.call(this, e, t, o),
- this.className = "Message.Field",
- this.required = "required" === i,
- this.repeated = "repeated" === i,
- this.map = "map" === i,
- this.keyType = n || null,
- this.type = r,
- this.resolvedType = null,
- this.id = a,
- this.options = s || {},
- this.defaultValue = null,
- this.oneof = l || null,
- this.syntax = c || "proto2",
- this.originalName = this.name,
- this.element = null,
- this.keyElement = null,
- !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = g.Util.toCamelCase(this.name))
- }
- var r = c.prototype = Object.create(h.prototype);
- r.build = function() {
- this.element = new u(this.type,this.resolvedType,!1,this.syntax),
- this.map && (this.keyElement = new u(this.keyType,void 0,!0,this.syntax)),
- "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)
- }
- ,
- r.verifyValue = function(e, t) {
- function i(e, t) {
- throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
- }
- t = t || !1;
- var n, r = this;
- if (null === e)
- return this.required && i(typeof e, "required"),
- "proto3" === this.syntax && this.type !== g.TYPES.message && i(typeof e, "proto3 field without field presence cannot be null"),
- null;
- if (!this.repeated || t)
- return this.map && !t ? e instanceof g.Map ? e : (e instanceof Object || i(typeof e, "expected ProtoBuf.Map or raw object for map field"),
- new g.Map(this,e)) : (!this.repeated && Array.isArray(e) && i(typeof e, "no array expected"),
- this.element.verifyValue(e));
- Array.isArray(e) || (e = [e]);
- var o = [];
- for (n = 0; n < e.length; n++)
- o.push(this.element.verifyValue(e[n]));
- return o
- }
- ,
- r.hasWirePresence = function(e, t) {
- if ("proto3" !== this.syntax)
- return null !== e;
- if (this.oneof && t[this.oneof.name] === this.name)
- return !0;
- switch (this.type) {
- case g.TYPES.int32:
- case g.TYPES.sint32:
- case g.TYPES.sfixed32:
- case g.TYPES.uint32:
- case g.TYPES.fixed32:
- return 0 !== e;
- case g.TYPES.int64:
- case g.TYPES.sint64:
- case g.TYPES.sfixed64:
- case g.TYPES.uint64:
- case g.TYPES.fixed64:
- return 0 !== e.low || 0 !== e.high;
- case g.TYPES.bool:
- return e;
- case g.TYPES.float:
- case g.TYPES.double:
- return 0 !== e;
- case g.TYPES.string:
- return 0 < e.length;
- case g.TYPES.bytes:
- return 0 < e.remaining();
- case g.TYPES.enum:
- return 0 !== e;
- case g.TYPES.message:
- return null !== e;
- default:
- return !0
- }
- }
- ,
- r.encode = function(t, r, e) {
- if (null === this.type || "object" != typeof this.type)
- throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
- if (null === t || this.repeated && 0 == t.length)
- return r;
- try {
- var i;
- if (this.repeated)
- if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
- r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
- r.ensureCapacity(r.offset += 1);
- var n = r.offset;
- for (i = 0; i < t.length; i++)
- this.element.encodeValue(this.id, t[i], r);
- var o = r.offset - n
- , a = I.calculateVarint32(o);
- if (1 < a) {
- var s = r.slice(n, r.offset);
- n += a - 1,
- r.offset = n,
- r.append(s)
- }
- r.writeVarint32(o, n - a)
- } else
- for (i = 0; i < t.length; i++)
- r.writeVarint32(this.id << 3 | this.type.wireType),
- this.element.encodeValue(this.id, t[i], r);
- else
- this.map ? t.forEach(function(e, t, i) {
- var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
- r.writeVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
- r.writeVarint32(n),
- r.writeVarint32(8 | this.keyType.wireType),
- this.keyElement.encodeValue(1, t, r),
- r.writeVarint32(16 | this.type.wireType),
- this.element.encodeValue(2, e, r)
- }, this) : this.hasWirePresence(t, e) && (r.writeVarint32(this.id << 3 | this.type.wireType),
- this.element.encodeValue(this.id, t, r))
- } catch (e) {
- throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
- }
- return r
- }
- ,
- r.calculate = function(t, e) {
- if (t = this.verifyValue(t),
- null === this.type || "object" != typeof this.type)
- throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
- if (null === t || this.repeated && 0 == t.length)
- return 0;
- var r = 0;
- try {
- var i, n;
- if (this.repeated)
- if (this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)) {
- for (r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
- i = n = 0; i < t.length; i++)
- n += this.element.calculateLength(this.id, t[i]);
- r += I.calculateVarint32(n),
- r += n
- } else
- for (i = 0; i < t.length; i++)
- r += I.calculateVarint32(this.id << 3 | this.type.wireType),
- r += this.element.calculateLength(this.id, t[i]);
- else
- this.map ? t.forEach(function(e, t, i) {
- var n = I.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, t) + I.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, e);
- r += I.calculateVarint32(this.id << 3 | g.WIRE_TYPES.LDELIM),
- r += I.calculateVarint32(n),
- r += n
- }, this) : this.hasWirePresence(t, e) && (r += I.calculateVarint32(this.id << 3 | this.type.wireType),
- r += this.element.calculateLength(this.id, t))
- } catch (e) {
- throw Error("Illegal value for " + this.toString(!0) + ": " + t + " (" + e + ")")
- }
- return r
- }
- ,
- r.decode = function(e, t, i) {
- var n, r;
- 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))
- throw Error("Illegal wire type for field " + this.toString(!0) + ": " + e + " (" + this.type.wireType + " expected)");
- if (e == g.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && 0 <= g.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) && !i) {
- r = t.readVarint32(),
- r = t.offset + r;
- for (var o = []; t.offset < r; )
- o.push(this.decode(this.type.wireType, t, !0));
- return o
- }
- if (this.map) {
- var a = u.defaultFieldValue(this.keyType);
- if (n = u.defaultFieldValue(this.type),
- r = t.readVarint32(),
- t.remaining() < r)
- throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + r + " required but got only " + t.remaining());
- var s = t.clone();
- for (s.limit = s.offset + r,
- t.offset += r; 0 < s.remaining(); ) {
- var l = s.readVarint32();
- e = 7 & l;
- var c = l >>> 3;
- if (1 == c)
- a = this.keyElement.decode(s, e, c);
- else {
- if (2 != c)
- throw Error("Unexpected tag in map field key/value submessage");
- n = this.element.decode(s, e, c)
- }
- }
- return [a, n]
- }
- return this.element.decode(t, e, this.id)
- }
- ,
- s.Message.Field = c;
- function o(e, t, i, n, r, o, a) {
- c.call(this, e, t, i, null, n, r, o, a),
- this.extension
- }
- o.prototype = Object.create(c.prototype),
- s.Message.ExtensionField = o;
- s.Message.OneOf = function(e, t, i) {
- h.call(this, e, t, i),
- this.fields = []
- }
- ;
- var p = function(e, t, i, n, r) {
- l.call(this, e, t, i, n, r),
- this.className = "Enum",
- this.object = null
- };
- p.getName = function(e, t) {
- for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
- if (e[i = n[r]] === t)
- return i;
- return null
- }
- ,
- (p.prototype = Object.create(l.prototype)).build = function(e) {
- if (this.object && !e)
- return this.object;
- for (var t = new g.Builder.Enum, i = this.getChildren(p.Value), n = 0, r = i.length; n < r; ++n)
- t[i[n].name] = i[n].id;
- return Object.defineProperty && Object.defineProperty(t, "$options", {
- value: this.buildOpt(),
- enumerable: !1
- }),
- this.object = t
- }
- ,
- s.Enum = p;
- function f(e, t, i, n) {
- h.call(this, e, t, i),
- this.className = "Enum.Value",
- this.id = n
- }
- f.prototype = Object.create(h.prototype),
- s.Enum.Value = f;
- var v = function(e, t, i, n) {
- h.call(this, e, t, i),
- this.field = n
- };
- v.prototype = Object.create(h.prototype),
- s.Extension = v;
- var y = function(e, t, i, n) {
- l.call(this, e, t, i, n),
- this.className = "Service",
- this.clazz = null
- };
- (y.prototype = Object.create(l.prototype)).build = function(e) {
- return this.clazz && !e ? this.clazz : this.clazz = function(t, r) {
- for (var o = function(e) {
- t.Builder.Service.call(this),
- this.rpcImpl = e || function(e, t, i) {
- setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
- }
- }, e = o.prototype = Object.create(t.Builder.Service.prototype), i = r.getChildren(t.Reflect.Service.RPCMethod), n = 0; n < i.length; n++)
- !function(n) {
- e[n.name] = function(e, i) {
- try {
- try {
- e = n.resolvedRequestType.clazz.decode(I.wrap(e))
- } catch (e) {
- if (!(e instanceof TypeError))
- throw e
- }
- if (null === e || "object" != typeof e)
- throw Error("Illegal arguments");
- e instanceof n.resolvedRequestType.clazz || (e = new n.resolvedRequestType.clazz(e)),
- this.rpcImpl(n.fqn(), e, function(e, t) {
- if (!e) {
- null === t && (t = "");
- try {
- t = n.resolvedResponseType.clazz.decode(t)
- } catch (e) {}
- 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))
- }
- i(e)
- })
- } catch (e) {
- setTimeout(i.bind(this, e), 0)
- }
- }
- ,
- o[n.name] = function(e, t, i) {
- new o(e)[n.name](t, i)
- }
- ,
- Object.defineProperty && (Object.defineProperty(o[n.name], "$options", {
- value: n.buildOpt()
- }),
- Object.defineProperty(e[n.name], "$options", {
- value: o[n.name].$options
- }))
- }(i[n]);
- return Object.defineProperty && (Object.defineProperty(o, "$options", {
- value: r.buildOpt()
- }),
- Object.defineProperty(e, "$options", {
- value: o.$options
- }),
- Object.defineProperty(o, "$type", {
- value: r
- }),
- Object.defineProperty(e, "$type", {
- value: r
- })),
- o
- }(g, this)
- }
- ,
- s.Service = y;
- function A(e, t, i, n) {
- h.call(this, e, t, i),
- this.className = "Service.Method",
- this.options = n || {}
- }
- (A.prototype = Object.create(h.prototype)).buildOpt = t.buildOpt,
- s.Service.Method = A;
- function C(e, t, i, n, r, o, a, s) {
- A.call(this, e, t, i, s),
- this.className = "Service.RPCMethod",
- this.requestName = n,
- this.responseName = r,
- this.requestStream = o,
- this.responseStream = a,
- this.resolvedRequestType = null,
- this.resolvedResponseType = null
- }
- return C.prototype = Object.create(A.prototype),
- s.Service.RPCMethod = C,
- s
- }(o),
- o.Builder = (i = (u = o).Lang,
- s = o.Reflect,
- n = h.prototype,
- h.isMessage = function(e) {
- return "string" == typeof e.name && void 0 === e.values && void 0 === e.rpc
- }
- ,
- h.isMessageField = function(e) {
- return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && void 0 !== e.id
- }
- ,
- h.isEnum = function(e) {
- return "string" == typeof e.name && !(void 0 === e.values || !Array.isArray(e.values) || 0 === e.values.length)
- }
- ,
- h.isService = function(e) {
- return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
- }
- ,
- h.isExtend = function(e) {
- return "string" == typeof e.ref
- }
- ,
- n.reset = function() {
- return this.ptr = this.ns,
- this
- }
- ,
- n.define = function(e) {
- if ("string" != typeof e || !i.TYPEREF.test(e))
- throw Error("illegal namespace: " + e);
- return e.split(".").forEach(function(e) {
- var t = this.ptr.getChild(e);
- null === t && this.ptr.addChild(t = new s.Namespace(this,this.ptr,e)),
- this.ptr = t
- }, this),
- this
- }
- ,
- n.create = function(e) {
- if (!e)
- return this;
- if (Array.isArray(e)) {
- if (0 === e.length)
- return this;
- e = e.slice()
- } else
- e = [e];
- for (var t = [e]; 0 < t.length; ) {
- if (e = t.pop(),
- !Array.isArray(e))
- throw Error("not a valid namespace: " + JSON.stringify(e));
- for (; 0 < e.length; ) {
- var i = e.shift();
- if (h.isMessage(i)) {
- var o = new s.Message(this,this.ptr,i.name,i.options,i.isGroup,i.syntax)
- , n = {};
- i.oneofs && Object.keys(i.oneofs).forEach(function(e) {
- o.addChild(n[e] = new s.Message.OneOf(this,o,e))
- }, this),
- i.fields && i.fields.forEach(function(e) {
- if (null !== o.getChild(0 | e.id))
- throw Error("duplicate or invalid field id in " + o.name + ": " + e.id);
- if (e.options && "object" != typeof e.options)
- throw Error("illegal field options in " + o.name + "#" + e.name);
- var t = null;
- if ("string" == typeof e.oneof && !(t = n[e.oneof]))
- throw Error("illegal oneof in " + o.name + "#" + e.name + ": " + e.oneof);
- e = new s.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,i.syntax),
- t && t.fields.push(e),
- o.addChild(e)
- }, this);
- var r = [];
- if (i.enums && i.enums.forEach(function(e) {
- r.push(e)
- }),
- i.messages && i.messages.forEach(function(e) {
- r.push(e)
- }),
- i.services && i.services.forEach(function(e) {
- r.push(e)
- }),
- i.extensions && ("number" == typeof i.extensions[0] ? o.extensions = [i.extensions] : o.extensions = i.extensions),
- this.ptr.addChild(o),
- 0 < r.length) {
- t.push(e),
- e = r,
- r = null,
- this.ptr = o,
- o = null;
- continue
- }
- r = null
- } else if (h.isEnum(i))
- o = new s.Enum(this,this.ptr,i.name,i.options,i.syntax),
- i.values.forEach(function(e) {
- o.addChild(new s.Enum.Value(this,o,e.name,e.id))
- }, this),
- this.ptr.addChild(o);
- else if (h.isService(i))
- o = new s.Service(this,this.ptr,i.name,i.options),
- Object.keys(i.rpc).forEach(function(e) {
- var t = i.rpc[e];
- o.addChild(new s.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
- }, this),
- this.ptr.addChild(o);
- else {
- if (!h.isExtend(i))
- throw Error("not a valid definition: " + JSON.stringify(i));
- if (o = this.ptr.resolve(i.ref, !0))
- i.fields.forEach(function(t) {
- if (null !== o.getChild(0 | t.id))
- throw Error("duplicate extended field id in " + o.name + ": " + t.id);
- if (o.extensions) {
- var i = !1;
- if (o.extensions.forEach(function(e) {
- t.id >= e[0] && t.id <= e[1] && (i = !0)
- }),
- !i)
- throw Error("illegal extended field id in " + o.name + ": " + t.id + " (not within valid ranges)")
- }
- var e = t.name;
- this.options.convertFieldsToCamelCase && (e = u.Util.toCamelCase(e));
- var n = new s.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn() + "." + e,t.id,t.options)
- , r = new s.Extension(this,this.ptr,t.name,n);
- n.extension = r,
- this.ptr.addChild(r),
- o.addChild(n)
- }, this);
- else if (!/\.?google\.protobuf\./.test(i.ref))
- throw Error("extended message " + i.ref + " is not defined")
- }
- o = i = null
- }
- e = null,
- this.ptr = this.ptr.parent
- }
- return this.resolved = !1,
- this.result = null,
- this
- }
- ,
- n.import = function(t, e) {
- var i = "/";
- if ("string" == typeof e) {
- if (u.Util.IS_NODE && (e = p("path").resolve(e)),
- !0 === this.files[e])
- return this.reset();
- this.files[e] = !0
- } else if ("object" == typeof e) {
- var n = e.root;
- u.Util.IS_NODE && (n = p("path").resolve(n)),
- (0 <= n.indexOf("\\") || 0 <= e.file.indexOf("\\")) && (i = "\\");
- var r = n + i + e.file;
- if (!0 === this.files[r])
- return this.reset();
- this.files[r] = !0
- }
- if (t.imports && 0 < t.imports.length) {
- var o, a = !1;
- "object" == typeof e ? (this.importRoot = e.root,
- a = !0,
- o = this.importRoot,
- e = e.file,
- (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(/\\[^\\]*$/, ""),
- i = "\\") : o = "." : o = null;
- for (var s = 0; s < t.imports.length; s++)
- if ("string" == typeof t.imports[s]) {
- if (!o)
- throw Error("cannot determine import root");
- var l = t.imports[s];
- if ("google/protobuf/descriptor.proto" === l)
- continue;
- if (l = o + i + l,
- !0 === this.files[l])
- continue;
- /\.proto$/i.test(l) && !u.DotProto && (l = l.replace(/\.proto$/, ".json"));
- var c = u.Util.fetch(l);
- if (null === c)
- throw Error("failed to import '" + l + "' in '" + e + "': file not found");
- /\.json$/i.test(l) ? this.import(JSON.parse(c + ""), l) : this.import(u.DotProto.Parser.parse(c), l)
- } else
- e ? /\.(\w+)$/.test(e) ? this.import(t.imports[s], e.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
- return t + "_import" + s + "." + i
- })) : this.import(t.imports[s], e + "_import" + s) : this.import(t.imports[s]);
- a && (this.importRoot = null)
- }
- t.package && this.define(t.package),
- t.syntax && function t(i) {
- i.messages && i.messages.forEach(function(e) {
- e.syntax = i.syntax,
- t(e)
- }),
- i.enums && i.enums.forEach(function(e) {
- e.syntax = i.syntax
- })
- }(t);
- var h = this.ptr;
- return t.options && Object.keys(t.options).forEach(function(e) {
- h.options[e] = t.options[e]
- }),
- t.messages && (this.create(t.messages),
- this.ptr = h),
- t.enums && (this.create(t.enums),
- this.ptr = h),
- t.services && (this.create(t.services),
- this.ptr = h),
- t.extends && this.create(t.extends),
- this.reset()
- }
- ,
- n.resolveAll = function() {
- var e;
- if (null == this.ptr || "object" == typeof this.ptr.type)
- return this;
- if (this.ptr instanceof s.Namespace)
- this.ptr.children.forEach(function(e) {
- this.ptr = e,
- this.resolveAll()
- }, this);
- else if (this.ptr instanceof s.Message.Field) {
- if (i.TYPE.test(this.ptr.type))
- this.ptr.type = u.TYPES[this.ptr.type];
- else {
- if (!i.TYPEREF.test(this.ptr.type))
- throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
- if (!(e = (this.ptr instanceof s.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)))
- throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
- if ((this.ptr.resolvedType = e)instanceof s.Enum) {
- if (this.ptr.type = u.TYPES.enum,
- "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
- throw Error("proto3 message cannot reference proto2 enum")
- } else {
- if (!(e instanceof s.Message))
- throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
- this.ptr.type = e.isGroup ? u.TYPES.group : u.TYPES.message
- }
- }
- if (this.ptr.map) {
- if (!i.TYPE.test(this.ptr.keyType))
- throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
- this.ptr.keyType = u.TYPES[this.ptr.keyType]
- }
- } else if (this.ptr instanceof u.Reflect.Service.Method) {
- if (!(this.ptr instanceof u.Reflect.Service.RPCMethod))
- throw Error("illegal service type in " + this.ptr.toString(!0));
- if (!((e = this.ptr.parent.resolve(this.ptr.requestName, !0)) && e instanceof u.Reflect.Message))
- throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
- if (this.ptr.resolvedRequestType = e,
- !((e = this.ptr.parent.resolve(this.ptr.responseName, !0)) && e instanceof u.Reflect.Message))
- throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
- this.ptr.resolvedResponseType = e
- } else if (!(this.ptr instanceof u.Reflect.Message.OneOf || this.ptr instanceof u.Reflect.Extension || this.ptr instanceof u.Reflect.Enum.Value))
- throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
- return this.reset()
- }
- ,
- n.build = function(e) {
- if (this.reset(),
- this.resolved || (this.resolveAll(),
- this.resolved = !0,
- this.result = null),
- null === this.result && (this.result = this.ns.build()),
- !e)
- return this.result;
- for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
- if (!i[t[n]]) {
- i = null;
- break
- }
- i = i[t[n]]
- }
- return i
- }
- ,
- n.lookup = function(e, t) {
- return e ? this.ns.resolve(e, t) : this.ns
- }
- ,
- n.toString = function() {
- return "Builder"
- }
- ,
- h.Message = function() {}
- ,
- h.Enum = function() {}
- ,
- h.Service = function() {}
- ,
- h),
- o.Map = (a = o.Reflect,
- (t = c.prototype).clear = function() {
- this.map = {}
- }
- ,
- t.delete = function(e) {
- var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
- , i = t in this.map;
- return delete this.map[t],
- i
- }
- ,
- t.entries = function() {
- for (var e, t = [], i = Object.keys(this.map), n = 0; n < i.length; n++)
- t.push([(e = this.map[i[n]]).key, e.value]);
- return l(t)
- }
- ,
- t.keys = function() {
- for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
- e.push(this.map[t[i]].key);
- return l(e)
- }
- ,
- t.values = function() {
- for (var e = [], t = Object.keys(this.map), i = 0; i < t.length; i++)
- e.push(this.map[t[i]].value);
- return l(e)
- }
- ,
- t.forEach = function(e, t) {
- for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
- e.call(t, (i = this.map[n[r]]).value, i.key, this)
- }
- ,
- t.set = function(e, t) {
- var i = this.keyElem.verifyValue(e)
- , n = this.valueElem.verifyValue(t);
- return this.map[this.keyElem.valueToString(i)] = {
- key: i,
- value: n
- },
- this
- }
- ,
- t.get = function(e) {
- var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
- if (t in this.map)
- return this.map[t].value
- }
- ,
- t.has = function(e) {
- return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map
- }
- ,
- c),
- o.loadProto = function(e, t, i) {
- return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
- t = void 0),
- o.loadJson(o.DotProto.Parser.parse(e), t, i)
- }
- ,
- o.protoFromString = o.loadProto,
- o.loadProtoFile = function(t, i, n) {
- if (i && "object" == typeof i ? (n = i,
- i = null) : i && "function" == typeof i || (i = null),
- i)
- return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
- if (null !== e)
- try {
- i(null, o.loadProto(e, n, t))
- } catch (e) {
- i(e)
- }
- else
- i(Error("Failed to fetch file"))
- });
- var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
- return null === e ? null : o.loadProto(e, n, t)
- }
- ,
- o.protoFromFile = o.loadProtoFile,
- o.newBuilder = function(e) {
- return void 0 === (e = e || {}).convertFieldsToCamelCase && (e.convertFieldsToCamelCase = o.convertFieldsToCamelCase),
- void 0 === e.populateAccessors && (e.populateAccessors = o.populateAccessors),
- new o.Builder(e)
- }
- ,
- o.loadJson = function(e, t, i) {
- return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
- t = null),
- t && "object" == typeof t || (t = o.newBuilder()),
- "string" == typeof e && (e = JSON.parse(e)),
- t.import(e, i),
- t.resolveAll(),
- t
- }
- ,
- o.loadJsonFile = function(t, i, n) {
- if (i && "object" == typeof i ? (n = i,
- i = null) : i && "function" == typeof i || (i = null),
- i)
- return o.Util.fetch("string" == typeof t ? t : t.root + "/" + t.file, function(e) {
- if (null !== e)
- try {
- i(null, o.loadJson(JSON.parse(e), n, t))
- } catch (e) {
- i(e)
- }
- else
- i(Error("Failed to fetch file"))
- });
- var e = o.Util.fetch("object" == typeof t ? t.root + "/" + t.file : t);
- return null === e ? null : o.loadJson(JSON.parse(e), n, t)
- }
- ,
- o;
- function l(e) {
- var t = 0;
- return {
- next: function() {
- return t < e.length ? {
- done: !1,
- value: e[t++]
- } : {
- done: !0
- }
- }
- }
- }
- function c(e, t) {
- if (!e.map)
- throw Error("field is not a map");
- if (this.field = e,
- this.keyElem = new a.Element(e.keyType,null,!0,e.syntax),
- this.valueElem = new a.Element(e.type,e.resolvedType,!1,e.syntax),
- this.map = {},
- Object.defineProperty(this, "size", {
- get: function() {
- return Object.keys(this.map).length
- }
- }),
- t)
- for (var i = Object.keys(t), n = 0; n < i.length; n++) {
- var r = this.keyElem.valueFromString(i[n])
- , o = this.valueElem.verifyValue(t[i[n]]);
- this.map[this.keyElem.valueToString(r)] = {
- key: r,
- value: o
- }
- }
- }
- function h(e) {
- this.ns = new s.Namespace(this,null,""),
- this.ptr = this.ns,
- this.resolved = !1,
- this.result = null,
- this.files = {},
- this.importRoot = null,
- this.options = e || {}
- }
- }
- ,
- "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)
- }
- ).call(this, p("_process"))
- }
- , {
- _process: 203,
- bytebuffer: 215,
- fs: 197,
- path: 197
- }],
- 215: [function(t, e, i) {
- var n, r;
- n = this,
- r = function(l) {
- "use strict";
- function s(e) {
- var t = 0;
- return function() {
- return t < e.length ? e.charCodeAt(t++) : null
- }
- }
- function c() {
- var e = []
- , t = [];
- return function() {
- return 0 === arguments.length ? t.join("") + i.apply(String, e) : (1024 < e.length + arguments.length && (t.push(i.apply(String, e)),
- e.length = 0),
- void Array.prototype.push.apply(e, arguments))
- }
- }
- function n(e, t, i, n, r) {
- 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];
- for (u += d,
- o = p & (1 << -h) - 1,
- p >>= -h,
- h += s; 0 < h; o = 256 * o + e[t + u],
- u += d,
- h -= 8)
- ;
- for (a = o & (1 << -h) - 1,
- o >>= -h,
- h += n; 0 < h; a = 256 * a + e[t + u],
- u += d,
- h -= 8)
- ;
- if (0 === o)
- o = 1 - c;
- else {
- if (o === l)
- return a ? NaN : 1 / 0 * (p ? -1 : 1);
- a += Math.pow(2, n),
- o -= c
- }
- return (p ? -1 : 1) * a * Math.pow(2, o - n)
- }
- function r(e, t, i, n, r, o) {
- 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;
- for (t = Math.abs(t),
- isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
- a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
- t * (l = Math.pow(2, -a)) < 1 && (a--,
- l *= 2),
- 2 <= (t += 1 <= a + u ? d / l : d * Math.pow(2, 1 - u)) * l && (a++,
- l /= 2),
- h <= a + u ? (s = 0,
- a = h) : 1 <= a + u ? (s = (t * l - 1) * Math.pow(2, r),
- a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
- a = 0)); 8 <= r; e[i + p] = 255 & s,
- p += f,
- s /= 256,
- r -= 8)
- ;
- for (a = a << r | s,
- c += r; 0 < c; e[i + p] = 255 & a,
- p += f,
- a /= 256,
- c -= 8)
- ;
- e[i + p - f] |= 128 * g
- }
- var f = function(e, t, i) {
- if (void 0 === e && (e = f.DEFAULT_CAPACITY),
- void 0 === t && (t = f.DEFAULT_ENDIAN),
- void 0 === i && (i = f.DEFAULT_NOASSERT),
- !i) {
- if ((e |= 0) < 0)
- throw RangeError("Illegal capacity");
- t = !!t,
- i = !!i
- }
- this.buffer = 0 === e ? o : new ArrayBuffer(e),
- this.view = 0 === e ? null : new Uint8Array(this.buffer),
- this.offset = 0,
- this.markedOffset = -1,
- this.limit = e,
- this.littleEndian = t,
- this.noAssert = i
- };
- f.VERSION = "5.0.1",
- f.LITTLE_ENDIAN = !0,
- f.BIG_ENDIAN = !1,
- f.DEFAULT_CAPACITY = 16,
- f.DEFAULT_ENDIAN = f.BIG_ENDIAN,
- f.DEFAULT_NOASSERT = !1,
- f.Long = l || null;
- var a = f.prototype;
- a.__isByteBuffer__,
- Object.defineProperty(a, "__isByteBuffer__", {
- value: !0,
- enumerable: !1,
- configurable: !1
- });
- var o = new ArrayBuffer(0)
- , i = String.fromCharCode;
- f.accessor = function() {
- return Uint8Array
- }
- ,
- f.allocate = function(e, t, i) {
- return new f(e,t,i)
- }
- ,
- f.concat = function(e, t, i, n) {
- "boolean" != typeof t && "string" == typeof t || (n = i,
- i = t,
- t = void 0);
- for (var r, o = 0, a = 0, s = e.length; a < s; ++a)
- f.isByteBuffer(e[a]) || (e[a] = f.wrap(e[a], t)),
- 0 < (r = e[a].limit - e[a].offset) && (o += r);
- if (0 === o)
- return new f(0,i,n);
- var l, c = new f(o,i,n);
- for (a = 0; a < s; )
- (r = (l = e[a++]).limit - l.offset) <= 0 || (c.view.set(l.view.subarray(l.offset, l.limit), c.offset),
- c.offset += r);
- return c.limit = c.offset,
- c.offset = 0,
- c
- }
- ,
- f.isByteBuffer = function(e) {
- return !0 === (e && e.__isByteBuffer__)
- }
- ,
- f.type = function() {
- return ArrayBuffer
- }
- ,
- f.wrap = function(e, t, i, n) {
- if ("string" != typeof t && (n = i,
- i = t,
- t = void 0),
- "string" == typeof e)
- switch (void 0 === t && (t = "utf8"),
- t) {
- case "base64":
- return f.fromBase64(e, i);
- case "hex":
- return f.fromHex(e, i);
- case "binary":
- return f.fromBinary(e, i);
- case "utf8":
- return f.fromUTF8(e, i);
- case "debug":
- return f.fromDebug(e, i);
- default:
- throw Error("Unsupported encoding: " + t)
- }
- if (null === e || "object" != typeof e)
- throw TypeError("Illegal buffer");
- var r;
- if (f.isByteBuffer(e))
- return (r = a.clone.call(e)).markedOffset = -1,
- r;
- if (e instanceof Uint8Array)
- r = new f(0,i,n),
- 0 < e.length && (r.buffer = e.buffer,
- r.offset = e.byteOffset,
- r.limit = e.byteOffset + e.byteLength,
- r.view = new Uint8Array(e.buffer));
- else if (e instanceof ArrayBuffer)
- r = new f(0,i,n),
- 0 < e.byteLength && (r.buffer = e,
- r.offset = 0,
- r.limit = e.byteLength,
- r.view = 0 < e.byteLength ? new Uint8Array(e) : null);
- else {
- if ("[object Array]" !== Object.prototype.toString.call(e))
- throw TypeError("Illegal buffer");
- (r = new f(e.length,i,n)).limit = e.length;
- for (var o = 0; o < e.length; ++o)
- r.view[o] = e[o]
- }
- return r
- }
- ,
- a.writeBitSet = function(e, t) {
- var i = void 0 === t;
- if (i && (t = this.offset),
- !this.noAssert) {
- if (!(e instanceof Array))
- throw TypeError("Illegal BitSet: Not an array");
- if ("number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
- }
- var n, r = t, o = e.length, a = o >> 3, s = 0;
- for (t += this.writeVarint32(o, t); a--; )
- 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,
- this.writeByte(n, t++);
- if (s < o) {
- var l = 0;
- for (n = 0; s < o; )
- n |= (1 & !!e[s++]) << l++;
- this.writeByte(n, t++)
- }
- return i ? (this.offset = t,
- this) : t - r
- }
- ,
- a.readBitSet = function(e) {
- var t = void 0 === e;
- t && (e = this.offset);
- var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
- for (e += n.length; o--; )
- i = this.readByte(e++),
- s[a++] = !!(1 & i),
- s[a++] = !!(2 & i),
- s[a++] = !!(4 & i),
- s[a++] = !!(8 & i),
- s[a++] = !!(16 & i),
- s[a++] = !!(32 & i),
- s[a++] = !!(64 & i),
- s[a++] = !!(128 & i);
- if (a < r) {
- var l = 0;
- for (i = this.readByte(e++); a < r; )
- s[a++] = !!(i >> l++ & 1)
- }
- return t && (this.offset = e),
- s
- }
- ,
- a.readBytes = function(e, t) {
- var i = void 0 === t;
- if (i && (t = this.offset),
- !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + e > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
- }
- var n = this.slice(t, t + e);
- return i && (this.offset += e),
- n
- }
- ,
- a.writeBytes = a.append,
- a.writeInt8 = function(e, t) {
- var i = void 0 === t;
- if (i && (t = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal value: " + e + " (not an integer)");
- if (e |= 0,
- "number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
- }
- t += 1;
- var n = this.buffer.byteLength;
- return n < t && this.resize((n *= 2) > t ? n : t),
- t -= 1,
- this.view[t] = e,
- i && (this.offset += 1),
- this
- }
- ,
- a.writeByte = a.writeInt8,
- a.readInt8 = function(e) {
- var t = void 0 === e;
- if (t && (e = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
- }
- var i = this.view[e];
- return 128 == (128 & i) && (i = -(255 - i + 1)),
- t && (this.offset += 1),
- i
- }
- ,
- a.readByte = a.readInt8,
- a.writeUint8 = function(e, t) {
- var i = void 0 === t;
- if (i && (t = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal value: " + e + " (not an integer)");
- if (e >>>= 0,
- "number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
- }
- t += 1;
- var n = this.buffer.byteLength;
- return n < t && this.resize((n *= 2) > t ? n : t),
- t -= 1,
- this.view[t] = e,
- i && (this.offset += 1),
- this
- }
- ,
- a.writeUInt8 = a.writeUint8,
- a.readUint8 = function(e) {
- var t = void 0 === e;
- if (t && (e = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
- }
- var i = this.view[e];
- return t && (this.offset += 1),
- i
- }
- ,
- a.readUInt8 = a.readUint8,
- a.writeInt16 = function(e, t) {
- var i = void 0 === t;
- if (i && (t = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal value: " + e + " (not an integer)");
- if (e |= 0,
- "number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
- }
- t += 2;
- var n = this.buffer.byteLength;
- return n < t && this.resize((n *= 2) > t ? n : t),
- t -= 2,
- this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
- this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
- this.view[t + 1] = 255 & e),
- i && (this.offset += 2),
- this
- }
- ,
- a.writeShort = a.writeInt16,
- a.readInt16 = function(e) {
- var t = void 0 === e;
- if (t && (e = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
- }
- var i = 0;
- return this.littleEndian ? (i = this.view[e],
- i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
- i |= this.view[e + 1]),
- 32768 == (32768 & i) && (i = -(65535 - i + 1)),
- t && (this.offset += 2),
- i
- }
- ,
- a.readShort = a.readInt16,
- a.writeUint16 = function(e, t) {
- var i = void 0 === t;
- if (i && (t = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal value: " + e + " (not an integer)");
- if (e >>>= 0,
- "number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
- }
- t += 2;
- var n = this.buffer.byteLength;
- return n < t && this.resize((n *= 2) > t ? n : t),
- t -= 2,
- this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
- this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
- this.view[t + 1] = 255 & e),
- i && (this.offset += 2),
- this
- }
- ,
- a.writeUInt16 = a.writeUint16,
- a.readUint16 = function(e) {
- var t = void 0 === e;
- if (t && (e = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 2 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
- }
- var i = 0;
- return this.littleEndian ? (i = this.view[e],
- i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
- i |= this.view[e + 1]),
- t && (this.offset += 2),
- i
- }
- ,
- a.readUInt16 = a.readUint16,
- a.writeInt32 = function(e, t) {
- var i = void 0 === t;
- if (i && (t = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal value: " + e + " (not an integer)");
- if (e |= 0,
- "number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
- }
- t += 4;
- var n = this.buffer.byteLength;
- return n < t && this.resize((n *= 2) > t ? n : t),
- t -= 4,
- this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
- this.view[t + 2] = e >>> 16 & 255,
- this.view[t + 1] = e >>> 8 & 255,
- this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
- this.view[t + 1] = e >>> 16 & 255,
- this.view[t + 2] = e >>> 8 & 255,
- this.view[t + 3] = 255 & e),
- i && (this.offset += 4),
- this
- }
- ,
- a.writeInt = a.writeInt32,
- a.readInt32 = function(e) {
- var t = void 0 === e;
- if (t && (e = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
- }
- var i = 0;
- return this.littleEndian ? (i = this.view[e + 2] << 16,
- i |= this.view[e + 1] << 8,
- i |= this.view[e],
- i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
- i |= this.view[e + 2] << 8,
- i |= this.view[e + 3],
- i += this.view[e] << 24 >>> 0),
- i |= 0,
- t && (this.offset += 4),
- i
- }
- ,
- a.readInt = a.readInt32,
- a.writeUint32 = function(e, t) {
- var i = void 0 === t;
- if (i && (t = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal value: " + e + " (not an integer)");
- if (e >>>= 0,
- "number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
- }
- t += 4;
- var n = this.buffer.byteLength;
- return n < t && this.resize((n *= 2) > t ? n : t),
- t -= 4,
- this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
- this.view[t + 2] = e >>> 16 & 255,
- this.view[t + 1] = e >>> 8 & 255,
- this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
- this.view[t + 1] = e >>> 16 & 255,
- this.view[t + 2] = e >>> 8 & 255,
- this.view[t + 3] = 255 & e),
- i && (this.offset += 4),
- this
- }
- ,
- a.writeUInt32 = a.writeUint32,
- a.readUint32 = function(e) {
- var t = void 0 === e;
- if (t && (e = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
- }
- var i = 0;
- return this.littleEndian ? (i = this.view[e + 2] << 16,
- i |= this.view[e + 1] << 8,
- i |= this.view[e],
- i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
- i |= this.view[e + 2] << 8,
- i |= this.view[e + 3],
- i += this.view[e] << 24 >>> 0),
- t && (this.offset += 4),
- i
- }
- ,
- a.readUInt32 = a.readUint32,
- l && (a.writeInt64 = function(e, t) {
- var i = void 0 === t;
- if (i && (t = this.offset),
- !this.noAssert) {
- if ("number" == typeof e)
- e = l.fromNumber(e);
- else if ("string" == typeof e)
- e = l.fromString(e);
- else if (!(e && e instanceof l))
- throw TypeError("Illegal value: " + e + " (not an integer or Long)");
- if ("number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
- }
- "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
- t += 8;
- var n = this.buffer.byteLength;
- n < t && this.resize((n *= 2) > t ? n : t),
- t -= 8;
- var r = e.low
- , o = e.high;
- return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
- this.view[t + 2] = r >>> 16 & 255,
- this.view[t + 1] = r >>> 8 & 255,
- this.view[t] = 255 & r,
- t += 4,
- this.view[t + 3] = o >>> 24 & 255,
- this.view[t + 2] = o >>> 16 & 255,
- this.view[t + 1] = o >>> 8 & 255,
- this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
- this.view[t + 1] = o >>> 16 & 255,
- this.view[t + 2] = o >>> 8 & 255,
- this.view[t + 3] = 255 & o,
- t += 4,
- this.view[t] = r >>> 24 & 255,
- this.view[t + 1] = r >>> 16 & 255,
- this.view[t + 2] = r >>> 8 & 255,
- this.view[t + 3] = 255 & r),
- i && (this.offset += 8),
- this
- }
- ,
- a.writeLong = a.writeInt64,
- a.readInt64 = function(e) {
- var t = void 0 === e;
- if (t && (e = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
- }
- var i = 0
- , n = 0;
- this.littleEndian ? (i = this.view[e + 2] << 16,
- i |= this.view[e + 1] << 8,
- i |= this.view[e],
- i += this.view[e + 3] << 24 >>> 0,
- e += 4,
- n = this.view[e + 2] << 16,
- n |= this.view[e + 1] << 8,
- n |= this.view[e],
- n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
- n |= this.view[e + 2] << 8,
- n |= this.view[e + 3],
- n += this.view[e] << 24 >>> 0,
- e += 4,
- i = this.view[e + 1] << 16,
- i |= this.view[e + 2] << 8,
- i |= this.view[e + 3],
- i += this.view[e] << 24 >>> 0);
- var r = new l(i,n,!1);
- return t && (this.offset += 8),
- r
- }
- ,
- a.readLong = a.readInt64,
- a.writeUint64 = function(e, t) {
- var i = void 0 === t;
- if (i && (t = this.offset),
- !this.noAssert) {
- if ("number" == typeof e)
- e = l.fromNumber(e);
- else if ("string" == typeof e)
- e = l.fromString(e);
- else if (!(e && e instanceof l))
- throw TypeError("Illegal value: " + e + " (not an integer or Long)");
- if ("number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
- }
- "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e)),
- t += 8;
- var n = this.buffer.byteLength;
- n < t && this.resize((n *= 2) > t ? n : t),
- t -= 8;
- var r = e.low
- , o = e.high;
- return this.littleEndian ? (this.view[t + 3] = r >>> 24 & 255,
- this.view[t + 2] = r >>> 16 & 255,
- this.view[t + 1] = r >>> 8 & 255,
- this.view[t] = 255 & r,
- t += 4,
- this.view[t + 3] = o >>> 24 & 255,
- this.view[t + 2] = o >>> 16 & 255,
- this.view[t + 1] = o >>> 8 & 255,
- this.view[t] = 255 & o) : (this.view[t] = o >>> 24 & 255,
- this.view[t + 1] = o >>> 16 & 255,
- this.view[t + 2] = o >>> 8 & 255,
- this.view[t + 3] = 255 & o,
- t += 4,
- this.view[t] = r >>> 24 & 255,
- this.view[t + 1] = r >>> 16 & 255,
- this.view[t + 2] = r >>> 8 & 255,
- this.view[t + 3] = 255 & r),
- i && (this.offset += 8),
- this
- }
- ,
- a.writeUInt64 = a.writeUint64,
- a.readUint64 = function(e) {
- var t = void 0 === e;
- if (t && (e = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
- }
- var i = 0
- , n = 0;
- this.littleEndian ? (i = this.view[e + 2] << 16,
- i |= this.view[e + 1] << 8,
- i |= this.view[e],
- i += this.view[e + 3] << 24 >>> 0,
- e += 4,
- n = this.view[e + 2] << 16,
- n |= this.view[e + 1] << 8,
- n |= this.view[e],
- n += this.view[e + 3] << 24 >>> 0) : (n = this.view[e + 1] << 16,
- n |= this.view[e + 2] << 8,
- n |= this.view[e + 3],
- n += this.view[e] << 24 >>> 0,
- e += 4,
- i = this.view[e + 1] << 16,
- i |= this.view[e + 2] << 8,
- i |= this.view[e + 3],
- i += this.view[e] << 24 >>> 0);
- var r = new l(i,n,!0);
- return t && (this.offset += 8),
- r
- }
- ,
- a.readUInt64 = a.readUint64),
- a.writeFloat32 = function(e, t) {
- var i = void 0 === t;
- if (i && (t = this.offset),
- !this.noAssert) {
- if ("number" != typeof e)
- throw TypeError("Illegal value: " + e + " (not a number)");
- if ("number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
- }
- t += 4;
- var n = this.buffer.byteLength;
- return n < t && this.resize((n *= 2) > t ? n : t),
- t -= 4,
- r(this.view, e, t, this.littleEndian, 23, 4),
- i && (this.offset += 4),
- this
- }
- ,
- a.writeFloat = a.writeFloat32,
- a.readFloat32 = function(e) {
- var t = void 0 === e;
- if (t && (e = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
- }
- var i = n(this.view, e, this.littleEndian, 23, 4);
- return t && (this.offset += 4),
- i
- }
- ,
- a.readFloat = a.readFloat32,
- a.writeFloat64 = function(e, t) {
- var i = void 0 === t;
- if (i && (t = this.offset),
- !this.noAssert) {
- if ("number" != typeof e)
- throw TypeError("Illegal value: " + e + " (not a number)");
- if ("number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
- }
- t += 8;
- var n = this.buffer.byteLength;
- return n < t && this.resize((n *= 2) > t ? n : t),
- t -= 8,
- r(this.view, e, t, this.littleEndian, 52, 8),
- i && (this.offset += 8),
- this
- }
- ,
- a.writeDouble = a.writeFloat64,
- a.readFloat64 = function(e) {
- var t = void 0 === e;
- if (t && (e = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 8 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
- }
- var i = n(this.view, e, this.littleEndian, 52, 8);
- return t && (this.offset += 8),
- i
- }
- ,
- a.readDouble = a.readFloat64,
- f.MAX_VARINT32_BYTES = 5,
- f.calculateVarint32 = function(e) {
- return (e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
- }
- ,
- f.zigZagEncode32 = function(e) {
- return ((e |= 0) << 1 ^ e >> 31) >>> 0
- }
- ,
- f.zigZagDecode32 = function(e) {
- return e >>> 1 ^ -(1 & e) | 0
- }
- ,
- a.writeVarint32 = function(e, t) {
- var i = void 0 === t;
- if (i && (t = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal value: " + e + " (not an integer)");
- if (e |= 0,
- "number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
- }
- var n, r = f.calculateVarint32(e);
- t += r;
- var o = this.buffer.byteLength;
- for (o < t && this.resize((o *= 2) > t ? o : t),
- t -= r,
- e >>>= 0; 128 <= e; )
- n = 127 & e | 128,
- this.view[t++] = n,
- e >>>= 7;
- return this.view[t++] = e,
- i ? (this.offset = t,
- this) : r
- }
- ,
- a.writeVarint32ZigZag = function(e, t) {
- return this.writeVarint32(f.zigZagEncode32(e), t)
- }
- ,
- a.readVarint32 = function(e) {
- var t = void 0 === e;
- if (t && (e = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
- }
- var i, n = 0, r = 0;
- do {
- if (!this.noAssert && e > this.limit) {
- var o = Error("Truncated");
- throw o.truncated = !0,
- o
- }
- i = this.view[e++],
- n < 5 && (r |= (127 & i) << 7 * n),
- ++n
- } while (0 != (128 & i));return r |= 0,
- t ? (this.offset = e,
- r) : {
- value: r,
- length: n
- }
- }
- ,
- a.readVarint32ZigZag = function(e) {
- var t = this.readVarint32(e);
- return "object" == typeof t ? t.value = f.zigZagDecode32(t.value) : t = f.zigZagDecode32(t),
- t
- }
- ,
- l && (f.MAX_VARINT64_BYTES = 10,
- f.calculateVarint64 = function(e) {
- "number" == typeof e ? e = l.fromNumber(e) : "string" == typeof e && (e = l.fromString(e));
- var t = e.toInt() >>> 0
- , i = e.shiftRightUnsigned(28).toInt() >>> 0
- , n = e.shiftRightUnsigned(56).toInt() >>> 0;
- 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
- }
- ,
- f.zigZagEncode64 = function(e) {
- return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
- e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()
- }
- ,
- f.zigZagDecode64 = function(e) {
- return "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned()),
- e.shiftRightUnsigned(1).xor(e.and(l.ONE).toSigned().negate()).toSigned()
- }
- ,
- a.writeVarint64 = function(e, t) {
- var i = void 0 === t;
- if (i && (t = this.offset),
- !this.noAssert) {
- if ("number" == typeof e)
- e = l.fromNumber(e);
- else if ("string" == typeof e)
- e = l.fromString(e);
- else if (!(e && e instanceof l))
- throw TypeError("Illegal value: " + e + " (not an integer or Long)");
- if ("number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
- }
- "number" == typeof e ? e = l.fromNumber(e, !1) : "string" == typeof e ? e = l.fromString(e, !1) : !1 !== e.unsigned && (e = e.toSigned());
- var n = f.calculateVarint64(e)
- , r = e.toInt() >>> 0
- , o = e.shiftRightUnsigned(28).toInt() >>> 0
- , a = e.shiftRightUnsigned(56).toInt() >>> 0;
- t += n;
- var s = this.buffer.byteLength;
- switch (s < t && this.resize((s *= 2) > t ? s : t),
- t -= n,
- n) {
- case 10:
- this.view[t + 9] = a >>> 7 & 1;
- case 9:
- this.view[t + 8] = 9 !== n ? 128 | a : 127 & a;
- case 8:
- this.view[t + 7] = 8 !== n ? o >>> 21 | 128 : o >>> 21 & 127;
- case 7:
- this.view[t + 6] = 7 !== n ? o >>> 14 | 128 : o >>> 14 & 127;
- case 6:
- this.view[t + 5] = 6 !== n ? o >>> 7 | 128 : o >>> 7 & 127;
- case 5:
- this.view[t + 4] = 5 !== n ? 128 | o : 127 & o;
- case 4:
- this.view[t + 3] = 4 !== n ? r >>> 21 | 128 : r >>> 21 & 127;
- case 3:
- this.view[t + 2] = 3 !== n ? r >>> 14 | 128 : r >>> 14 & 127;
- case 2:
- this.view[t + 1] = 2 !== n ? r >>> 7 | 128 : r >>> 7 & 127;
- case 1:
- this.view[t] = 1 !== n ? 128 | r : 127 & r
- }
- return i ? (this.offset += n,
- this) : n
- }
- ,
- a.writeVarint64ZigZag = function(e, t) {
- return this.writeVarint64(f.zigZagEncode64(e), t)
- }
- ,
- a.readVarint64 = function(e) {
- var t = void 0 === e;
- if (t && (e = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
- }
- var i = e
- , n = 0
- , r = 0
- , o = 0
- , a = 0;
- if (n = 127 & (a = this.view[e++]),
- 128 & a && (n |= (127 & (a = this.view[e++])) << 7,
- (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 14,
- (128 & a || this.noAssert && void 0 === a) && (n |= (127 & (a = this.view[e++])) << 21,
- (128 & a || this.noAssert && void 0 === a) && (r = 127 & (a = this.view[e++]),
- (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 7,
- (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 14,
- (128 & a || this.noAssert && void 0 === a) && (r |= (127 & (a = this.view[e++])) << 21,
- (128 & a || this.noAssert && void 0 === a) && (o = 127 & (a = this.view[e++]),
- (128 & a || this.noAssert && void 0 === a) && (o |= (127 & (a = this.view[e++])) << 7,
- 128 & a || this.noAssert && void 0 === a))))))))))
- throw Error("Buffer overrun");
- var s = l.fromBits(n | r << 28, r >>> 4 | o << 24, !1);
- return t ? (this.offset = e,
- s) : {
- value: s,
- length: e - i
- }
- }
- ,
- a.readVarint64ZigZag = function(e) {
- var t = this.readVarint64(e);
- return t && t.value instanceof l ? t.value = f.zigZagDecode64(t.value) : t = f.zigZagDecode64(t),
- t
- }
- ),
- a.writeCString = function(e, t) {
- var i = void 0 === t;
- i && (t = this.offset);
- var n, r = e.length;
- if (!this.noAssert) {
- if ("string" != typeof e)
- throw TypeError("Illegal str: Not a string");
- for (n = 0; n < r; ++n)
- if (0 === e.charCodeAt(n))
- throw RangeError("Illegal str: Contains NULL-characters");
- if ("number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
- }
- r = d.calculateUTF16asUTF8(s(e))[1],
- t += r + 1;
- var o = this.buffer.byteLength;
- return o < t && this.resize((o *= 2) > t ? o : t),
- t -= r + 1,
- d.encodeUTF16toUTF8(s(e), function(e) {
- this.view[t++] = e
- }
- .bind(this)),
- this.view[t++] = 0,
- i ? (this.offset = t,
- this) : r
- }
- ,
- a.readCString = function(e) {
- var t = void 0 === e;
- if (t && (e = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
- }
- var i, n = e, r = -1;
- return d.decodeUTF8toUTF16(function() {
- if (0 === r)
- return null;
- if (e >= this.limit)
- throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
- return 0 === (r = this.view[e++]) ? null : r
- }
- .bind(this), i = c(), !0),
- t ? (this.offset = e,
- i()) : {
- string: i(),
- length: e - n
- }
- }
- ,
- a.writeIString = function(e, t) {
- var i = void 0 === t;
- if (i && (t = this.offset),
- !this.noAssert) {
- if ("string" != typeof e)
- throw TypeError("Illegal str: Not a string");
- if ("number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
- }
- var n, r = t;
- n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
- t += 4 + n;
- var o = this.buffer.byteLength;
- if (o < t && this.resize((o *= 2) > t ? o : t),
- t -= 4 + n,
- this.littleEndian ? (this.view[t + 3] = n >>> 24 & 255,
- this.view[t + 2] = n >>> 16 & 255,
- this.view[t + 1] = n >>> 8 & 255,
- this.view[t] = 255 & n) : (this.view[t] = n >>> 24 & 255,
- this.view[t + 1] = n >>> 16 & 255,
- this.view[t + 2] = n >>> 8 & 255,
- this.view[t + 3] = 255 & n),
- t += 4,
- d.encodeUTF16toUTF8(s(e), function(e) {
- this.view[t++] = e
- }
- .bind(this)),
- t !== r + 4 + n)
- throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + 4 + n));
- return i ? (this.offset = t,
- this) : t - r
- }
- ,
- a.readIString = function(e) {
- var t = void 0 === e;
- if (t && (e = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 4 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
- }
- var i = e
- , n = this.readUint32(e)
- , r = this.readUTF8String(n, f.METRICS_BYTES, e += 4);
- return e += r.length,
- t ? (this.offset = e,
- r.string) : {
- string: r.string,
- length: e - i
- }
- }
- ,
- f.METRICS_CHARS = "c",
- f.METRICS_BYTES = "b",
- a.writeUTF8String = function(e, t) {
- var i = void 0 === t;
- if (i && (t = this.offset),
- !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
- }
- var n, r = t;
- n = d.calculateUTF16asUTF8(s(e))[1],
- t += n;
- var o = this.buffer.byteLength;
- return o < t && this.resize((o *= 2) > t ? o : t),
- t -= n,
- d.encodeUTF16toUTF8(s(e), function(e) {
- this.view[t++] = e
- }
- .bind(this)),
- i ? (this.offset = t,
- this) : t - r
- }
- ,
- a.writeString = a.writeUTF8String,
- f.calculateUTF8Chars = function(e) {
- return d.calculateUTF16asUTF8(s(e))[0]
- }
- ,
- f.calculateUTF8Bytes = function(e) {
- return d.calculateUTF16asUTF8(s(e))[1]
- }
- ,
- f.calculateString = f.calculateUTF8Bytes,
- a.readUTF8String = function(e, t, i) {
- "number" == typeof t && (i = t,
- t = void 0);
- var n = void 0 === i;
- if (n && (i = this.offset),
- void 0 === t && (t = f.METRICS_CHARS),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal length: " + e + " (not an integer)");
- if (e |= 0,
- "number" != typeof i || i % 1 != 0)
- throw TypeError("Illegal offset: " + i + " (not an integer)");
- if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
- }
- var r, o = 0, a = i;
- if (t === f.METRICS_CHARS) {
- if (r = c(),
- d.decodeUTF8(function() {
- return o < e && i < this.limit ? this.view[i++] : null
- }
- .bind(this), function(e) {
- ++o,
- d.UTF8toUTF16(e, r)
- }),
- o !== e)
- throw RangeError("Illegal range: Truncated data, " + o + " == " + e);
- return n ? (this.offset = i,
- r()) : {
- string: r(),
- length: i - a
- }
- }
- if (t !== f.METRICS_BYTES)
- throw TypeError("Unsupported metrics: " + t);
- if (!this.noAssert) {
- if ("number" != typeof i || i % 1 != 0)
- throw TypeError("Illegal offset: " + i + " (not an integer)");
- if ((i >>>= 0) < 0 || i + e > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + i + " (+" + e + ") <= " + this.buffer.byteLength)
- }
- var s = i + e;
- if (d.decodeUTF8toUTF16(function() {
- return i < s ? this.view[i++] : null
- }
- .bind(this), r = c(), this.noAssert),
- i !== s)
- throw RangeError("Illegal range: Truncated data, " + i + " == " + s);
- return n ? (this.offset = i,
- r()) : {
- string: r(),
- length: i - a
- }
- }
- ,
- a.readString = a.readUTF8String,
- a.writeVString = function(e, t) {
- var i = void 0 === t;
- if (i && (t = this.offset),
- !this.noAssert) {
- if ("string" != typeof e)
- throw TypeError("Illegal str: Not a string");
- if ("number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal offset: " + t + " (not an integer)");
- if ((t >>>= 0) < 0 || t + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
- }
- var n, r, o = t;
- n = d.calculateUTF16asUTF8(s(e), this.noAssert)[1],
- r = f.calculateVarint32(n),
- t += r + n;
- var a = this.buffer.byteLength;
- if (a < t && this.resize((a *= 2) > t ? a : t),
- t -= r + n,
- t += this.writeVarint32(n, t),
- d.encodeUTF16toUTF8(s(e), function(e) {
- this.view[t++] = e
- }
- .bind(this)),
- t !== o + n + r)
- throw RangeError("Illegal range: Truncated data, " + t + " == " + (t + n + r));
- return i ? (this.offset = t,
- this) : t - o
- }
- ,
- a.readVString = function(e) {
- var t = void 0 === e;
- if (t && (e = this.offset),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 1 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
- }
- var i = e
- , n = this.readVarint32(e)
- , r = this.readUTF8String(n.value, f.METRICS_BYTES, e += n.length);
- return e += r.length,
- t ? (this.offset = e,
- r.string) : {
- string: r.string,
- length: e - i
- }
- }
- ,
- a.append = function(e, t, i) {
- "number" != typeof t && "string" == typeof t || (i = t,
- t = void 0);
- var n = void 0 === i;
- if (n && (i = this.offset),
- !this.noAssert) {
- if ("number" != typeof i || i % 1 != 0)
- throw TypeError("Illegal offset: " + i + " (not an integer)");
- if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
- }
- e instanceof f || (e = f.wrap(e, t));
- var r = e.limit - e.offset;
- if (r <= 0)
- return this;
- i += r;
- var o = this.buffer.byteLength;
- return o < i && this.resize((o *= 2) > i ? o : i),
- i -= r,
- this.view.set(e.view.subarray(e.offset, e.limit), i),
- e.offset += r,
- n && (this.offset += r),
- this
- }
- ,
- a.appendTo = function(e, t) {
- return e.append(this, t),
- this
- }
- ,
- a.assert = function(e) {
- return this.noAssert = !e,
- this
- }
- ,
- a.capacity = function() {
- return this.buffer.byteLength
- }
- ,
- a.clear = function() {
- return this.offset = 0,
- this.limit = this.buffer.byteLength,
- this.markedOffset = -1,
- this
- }
- ,
- a.clone = function(e) {
- var t = new f(0,this.littleEndian,this.noAssert);
- return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
- t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
- t.view = this.view),
- t.offset = this.offset,
- t.markedOffset = this.markedOffset,
- t.limit = this.limit,
- t
- }
- ,
- a.compact = function(e, t) {
- if (void 0 === e && (e = this.offset),
- void 0 === t && (t = this.limit),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal begin: Not an integer");
- if (e >>>= 0,
- "number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal end: Not an integer");
- if (t >>>= 0,
- e < 0 || t < e || t > this.buffer.byteLength)
- throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
- }
- if (0 === e && t === this.buffer.byteLength)
- return this;
- var i = t - e;
- if (0 == i)
- return this.buffer = o,
- this.view = null,
- 0 <= this.markedOffset && (this.markedOffset -= e),
- this.offset = 0,
- this.limit = 0,
- this;
- var n = new ArrayBuffer(i)
- , r = new Uint8Array(n);
- return r.set(this.view.subarray(e, t)),
- this.buffer = n,
- this.view = r,
- 0 <= this.markedOffset && (this.markedOffset -= e),
- this.offset = 0,
- this.limit = i,
- this
- }
- ,
- a.copy = function(e, t) {
- if (void 0 === e && (e = this.offset),
- void 0 === t && (t = this.limit),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal begin: Not an integer");
- if (e >>>= 0,
- "number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal end: Not an integer");
- if (t >>>= 0,
- e < 0 || t < e || t > this.buffer.byteLength)
- throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
- }
- if (e === t)
- return new f(0,this.littleEndian,this.noAssert);
- var i = t - e
- , n = new f(i,this.littleEndian,this.noAssert);
- return n.offset = 0,
- n.limit = i,
- 0 <= n.markedOffset && (n.markedOffset -= e),
- this.copyTo(n, 0, e, t),
- n
- }
- ,
- a.copyTo = function(e, t, i, n) {
- var r, o;
- if (!this.noAssert && !f.isByteBuffer(e))
- throw TypeError("Illegal target: Not a ByteBuffer");
- if (t = (o = void 0 === t) ? e.offset : 0 | t,
- i = (r = void 0 === i) ? this.offset : 0 | i,
- n = void 0 === n ? this.limit : 0 | n,
- t < 0 || t > e.buffer.byteLength)
- throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
- if (i < 0 || n > this.buffer.byteLength)
- throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
- var a = n - i;
- return 0 == a ? e : (e.ensureCapacity(t + a),
- e.view.set(this.view.subarray(i, n), t),
- r && (this.offset += a),
- o && (e.offset += a),
- this)
- }
- ,
- a.ensureCapacity = function(e) {
- var t = this.buffer.byteLength;
- return t < e ? this.resize((t *= 2) > e ? t : e) : this
- }
- ,
- a.fill = function(e, t, i) {
- var n = void 0 === t;
- if (n && (t = this.offset),
- "string" == typeof e && 0 < e.length && (e = e.charCodeAt(0)),
- void 0 === t && (t = this.offset),
- void 0 === i && (i = this.limit),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal value: " + e + " (not an integer)");
- if (e |= 0,
- "number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal begin: Not an integer");
- if (t >>>= 0,
- "number" != typeof i || i % 1 != 0)
- throw TypeError("Illegal end: Not an integer");
- if (i >>>= 0,
- t < 0 || i < t || i > this.buffer.byteLength)
- throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
- }
- if (i <= t)
- return this;
- for (; t < i; )
- this.view[t++] = e;
- return n && (this.offset = t),
- this
- }
- ,
- a.flip = function() {
- return this.limit = this.offset,
- this.offset = 0,
- this
- }
- ,
- a.mark = function(e) {
- if (e = void 0 === e ? this.offset : e,
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal offset: " + e + " (not an integer)");
- if ((e >>>= 0) < 0 || e + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
- }
- return this.markedOffset = e,
- this
- }
- ,
- a.order = function(e) {
- if (!this.noAssert && "boolean" != typeof e)
- throw TypeError("Illegal littleEndian: Not a boolean");
- return this.littleEndian = !!e,
- this
- }
- ,
- a.LE = function(e) {
- return this.littleEndian = void 0 === e || !!e,
- this
- }
- ,
- a.BE = function(e) {
- return this.littleEndian = void 0 !== e && !e,
- this
- }
- ,
- a.prepend = function(e, t, i) {
- "number" != typeof t && "string" == typeof t || (i = t,
- t = void 0);
- var n = void 0 === i;
- if (n && (i = this.offset),
- !this.noAssert) {
- if ("number" != typeof i || i % 1 != 0)
- throw TypeError("Illegal offset: " + i + " (not an integer)");
- if ((i >>>= 0) < 0 || i + 0 > this.buffer.byteLength)
- throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
- }
- e instanceof f || (e = f.wrap(e, t));
- var r = e.limit - e.offset;
- if (r <= 0)
- return this;
- var o = r - i;
- if (0 < o) {
- var a = new ArrayBuffer(this.buffer.byteLength + o)
- , s = new Uint8Array(a);
- s.set(this.view.subarray(i, this.buffer.byteLength), r),
- this.buffer = a,
- this.view = s,
- this.offset += o,
- 0 <= this.markedOffset && (this.markedOffset += o),
- this.limit += o,
- i += o
- } else
- new Uint8Array(this.buffer);
- return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
- e.offset = e.limit,
- n && (this.offset -= r),
- this
- }
- ,
- a.prependTo = function(e, t) {
- return e.prepend(this, t),
- this
- }
- ,
- a.printDebug = function(e) {
- "function" != typeof e && (e = console.log.bind(console)),
- e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
- }
- ,
- a.remaining = function() {
- return this.limit - this.offset
- }
- ,
- a.reset = function() {
- return 0 <= this.markedOffset ? (this.offset = this.markedOffset,
- this.markedOffset = -1) : this.offset = 0,
- this
- }
- ,
- a.resize = function(e) {
- if (!this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal capacity: " + e + " (not an integer)");
- if ((e |= 0) < 0)
- throw RangeError("Illegal capacity: 0 <= " + e)
- }
- if (this.buffer.byteLength < e) {
- var t = new ArrayBuffer(e)
- , i = new Uint8Array(t);
- i.set(this.view),
- this.buffer = t,
- this.view = i
- }
- return this
- }
- ,
- a.reverse = function(e, t) {
- if (void 0 === e && (e = this.offset),
- void 0 === t && (t = this.limit),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal begin: Not an integer");
- if (e >>>= 0,
- "number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal end: Not an integer");
- if (t >>>= 0,
- e < 0 || t < e || t > this.buffer.byteLength)
- throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
- }
- return e === t || Array.prototype.reverse.call(this.view.subarray(e, t)),
- this
- }
- ,
- a.skip = function(e) {
- if (!this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal length: " + e + " (not an integer)");
- e |= 0
- }
- var t = this.offset + e;
- if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
- throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
- return this.offset = t,
- this
- }
- ,
- a.slice = function(e, t) {
- if (void 0 === e && (e = this.offset),
- void 0 === t && (t = this.limit),
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal begin: Not an integer");
- if (e >>>= 0,
- "number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal end: Not an integer");
- if (t >>>= 0,
- e < 0 || t < e || t > this.buffer.byteLength)
- throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
- }
- var i = this.clone();
- return i.offset = e,
- i.limit = t,
- i
- }
- ,
- a.toBuffer = function(e) {
- var t = this.offset
- , i = this.limit;
- if (!this.noAssert) {
- if ("number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal offset: Not an integer");
- if (t >>>= 0,
- "number" != typeof i || i % 1 != 0)
- throw TypeError("Illegal limit: Not an integer");
- if (i >>>= 0,
- t < 0 || i < t || i > this.buffer.byteLength)
- throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
- }
- if (!e && 0 === t && i === this.buffer.byteLength)
- return this.buffer;
- if (t === i)
- return o;
- var n = new ArrayBuffer(i - t);
- return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
- n
- }
- ,
- a.toArrayBuffer = a.toBuffer,
- a.toString = function(e, t, i) {
- if (void 0 === e)
- return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
- switch ("number" == typeof e && (i = t = e = "utf8"),
- e) {
- case "utf8":
- return this.toUTF8(t, i);
- case "base64":
- return this.toBase64(t, i);
- case "hex":
- return this.toHex(t, i);
- case "binary":
- return this.toBinary(t, i);
- case "debug":
- return this.toDebug();
- case "columns":
- return this.toColumns();
- default:
- throw Error("Unsupported encoding: " + e)
- }
- }
- ;
- var h = function() {
- 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)
- a[r[t]] = t;
- return e.encode = function(e, t) {
- for (var i, n; null !== (i = e()); )
- t(r[i >> 2 & 63]),
- n = (3 & i) << 4,
- null !== (i = e()) ? (t(r[63 & ((n |= i >> 4 & 15) | i >> 4 & 15)]),
- n = (15 & i) << 2,
- null !== (i = e()) ? (t(r[63 & (n | i >> 6 & 3)]),
- t(r[63 & i])) : (t(r[63 & n]),
- t(61))) : (t(r[63 & n]),
- t(61),
- t(61))
- }
- ,
- e.decode = function(e, t) {
- function i(e) {
- throw Error("Illegal character code: " + e)
- }
- for (var n, r, o; null !== (n = e()); )
- if (void 0 === (r = a[n]) && i(n),
- null !== (n = e()) && (void 0 === (o = a[n]) && i(n),
- t(r << 2 >>> 0 | (48 & o) >> 4),
- null !== (n = e()))) {
- if (void 0 === (r = a[n])) {
- if (61 === n)
- break;
- i(n)
- }
- if (t((15 & o) << 4 >>> 0 | (60 & r) >> 2),
- null !== (n = e())) {
- if (void 0 === (o = a[n])) {
- if (61 === n)
- break;
- i(n)
- }
- t((3 & r) << 6 >>> 0 | o)
- }
- }
- }
- ,
- e.test = function(e) {
- return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
- }
- ,
- e
- }();
- a.toBase64 = function(e, t) {
- if (void 0 === e && (e = this.offset),
- void 0 === t && (t = this.limit),
- t |= 0,
- (e |= 0) < 0 || t > this.capacity || t < e)
- throw RangeError("begin, end");
- var i;
- return h.encode(function() {
- return e < t ? this.view[e++] : null
- }
- .bind(this), i = c()),
- i()
- }
- ,
- f.fromBase64 = function(e, t) {
- if ("string" != typeof e)
- throw TypeError("str");
- var i = new f(e.length / 4 * 3,t)
- , n = 0;
- return h.decode(s(e), function(e) {
- i.view[n++] = e
- }),
- i.limit = n,
- i
- }
- ,
- f.btoa = function(e) {
- return f.fromBinary(e).toBase64()
- }
- ,
- f.atob = function(e) {
- return f.fromBase64(e).toBinary()
- }
- ,
- a.toBinary = function(e, t) {
- if (void 0 === e && (e = this.offset),
- void 0 === t && (t = this.limit),
- t |= 0,
- (e |= 0) < 0 || t > this.capacity() || t < e)
- throw RangeError("begin, end");
- if (e === t)
- return "";
- for (var i = [], n = []; e < t; )
- i.push(this.view[e++]),
- 1024 <= i.length && (n.push(String.fromCharCode.apply(String, i)),
- i = []);
- return n.join("") + String.fromCharCode.apply(String, i)
- }
- ,
- f.fromBinary = function(e, t) {
- if ("string" != typeof e)
- throw TypeError("str");
- for (var i, n = 0, r = e.length, o = new f(r,t); n < r; ) {
- if (255 < (i = e.charCodeAt(n)))
- throw RangeError("illegal char code: " + i);
- o.view[n++] = i
- }
- return o.limit = r,
- o
- }
- ,
- a.toDebug = function(e) {
- for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
- if (-1 !== i && (r += (t = this.view[i]) < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
- e && (o += 32 < t && t < 127 ? String.fromCharCode(t) : ".")),
- ++i,
- e && 0 < i && i % 16 == 0 && i !== n) {
- for (; r.length < 51; )
- r += " ";
- a += r + o + "\n",
- r = o = ""
- }
- 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 ? " " : ""
- }
- if (e && " " !== r) {
- for (; r.length < 51; )
- r += " ";
- a += r + o + "\n"
- }
- return e ? a : r
- }
- ,
- f.fromDebug = function(e, t, i) {
- 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; ) {
- switch (n = e.charAt(s++)) {
- case "!":
- if (!i) {
- if (h || u || d) {
- p = !0;
- break
- }
- h = u = d = !0
- }
- a.offset = a.markedOffset = a.limit = l,
- c = !1;
- break;
- case "|":
- if (!i) {
- if (h || d) {
- p = !0;
- break
- }
- h = d = !0
- }
- a.offset = a.limit = l,
- c = !1;
- break;
- case "[":
- if (!i) {
- if (h || u) {
- p = !0;
- break
- }
- h = u = !0
- }
- a.offset = a.markedOffset = l,
- c = !1;
- break;
- case "<":
- if (!i) {
- if (h) {
- p = !0;
- break
- }
- h = !0
- }
- a.offset = l,
- c = !1;
- break;
- case "]":
- if (!i) {
- if (d || u) {
- p = !0;
- break
- }
- d = u = !0
- }
- a.limit = a.markedOffset = l,
- c = !1;
- break;
- case ">":
- if (!i) {
- if (d) {
- p = !0;
- break
- }
- d = !0
- }
- a.limit = l,
- c = !1;
- break;
- case "'":
- if (!i) {
- if (u) {
- p = !0;
- break
- }
- u = !0
- }
- a.markedOffset = l,
- c = !1;
- break;
- case " ":
- c = !1;
- break;
- default:
- if (!i && c) {
- p = !0;
- break
- }
- if (r = parseInt(n + e.charAt(s++), 16),
- !i && (isNaN(r) || r < 0 || 255 < r))
- throw TypeError("Illegal str: Not a debug encoded string");
- a.view[l++] = r,
- c = !0
- }
- if (p)
- throw TypeError("Illegal str: Invalid symbol at " + s)
- }
- if (!i) {
- if (!h || !d)
- throw TypeError("Illegal str: Missing offset or limit");
- if (l < a.buffer.byteLength)
- throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + l + " < " + o)
- }
- return a
- }
- ,
- a.toHex = function(e, t) {
- if (e = void 0 === e ? this.offset : e,
- t = void 0 === t ? this.limit : t,
- !this.noAssert) {
- if ("number" != typeof e || e % 1 != 0)
- throw TypeError("Illegal begin: Not an integer");
- if (e >>>= 0,
- "number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal end: Not an integer");
- if (t >>>= 0,
- e < 0 || t < e || t > this.buffer.byteLength)
- throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
- }
- for (var i, n = new Array(t - e); e < t; )
- (i = this.view[e++]) < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
- return n.join("")
- }
- ,
- f.fromHex = function(e, t, i) {
- if (!i) {
- if ("string" != typeof e)
- throw TypeError("Illegal str: Not a string");
- if (e.length % 2 != 0)
- throw TypeError("Illegal str: Length not a multiple of 2")
- }
- for (var n, r = e.length, o = new f(r / 2 | 0,t), a = 0, s = 0; a < r; a += 2) {
- if (n = parseInt(e.substring(a, a + 2), 16),
- !i && (!isFinite(n) || n < 0 || 255 < n))
- throw TypeError("Illegal str: Contains non-hex characters");
- o.view[s++] = n
- }
- return o.limit = s,
- o
- }
- ;
- var u, d = u = {
- MAX_CODEPOINT: 1114111,
- encodeUTF8: function(e, t) {
- var i = null;
- for ("number" == typeof e && (i = e,
- e = function() {
- return null
- }
- ); null !== i || null !== (i = e()); )
- i < 128 ? t(127 & i) : (i < 2048 ? t(i >> 6 & 31 | 192) : (i < 65536 ? t(i >> 12 & 15 | 224) : (t(i >> 18 & 7 | 240),
- t(i >> 12 & 63 | 128)),
- t(i >> 6 & 63 | 128)),
- t(63 & i | 128)),
- i = null
- },
- decodeUTF8: function(e, t) {
- for (var i, n, r, o, a = function(e) {
- e = e.slice(0, e.indexOf(null));
- var t = Error(e.toString());
- throw t.name = "TruncatedError",
- t.bytes = e,
- t
- }; null !== (i = e()); )
- if (0 == (128 & i))
- t(i);
- else if (192 == (224 & i))
- null === (n = e()) && a([i, n]),
- t((31 & i) << 6 | 63 & n);
- else if (224 == (240 & i))
- null !== (n = e()) && null !== (r = e()) || a([i, n, r]),
- t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
- else {
- if (240 != (248 & i))
- throw RangeError("Illegal starting byte: " + i);
- null !== (n = e()) && null !== (r = e()) && null !== (o = e()) || a([i, n, r, o]),
- t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
- }
- },
- UTF16toUTF8: function(e, t) {
- for (var i, n = null; null !== (i = null !== n ? n : e()); )
- 55296 <= i && i <= 57343 && null !== (n = e()) && 56320 <= n && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
- n = null) : t(i);
- null !== n && t(n)
- },
- UTF8toUTF16: function(e, t) {
- var i = null;
- for ("number" == typeof e && (i = e,
- e = function() {
- return null
- }
- ); null !== i || null !== (i = e()); )
- i <= 65535 ? t(i) : (t(55296 + ((i -= 65536) >> 10)),
- t(i % 1024 + 56320)),
- i = null
- },
- encodeUTF16toUTF8: function(e, t) {
- u.UTF16toUTF8(e, function(e) {
- u.encodeUTF8(e, t)
- })
- },
- decodeUTF8toUTF16: function(e, t) {
- u.decodeUTF8(e, function(e) {
- u.UTF8toUTF16(e, t)
- })
- },
- calculateCodePoint: function(e) {
- return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
- },
- calculateUTF8: function(e) {
- for (var t, i = 0; null !== (t = e()); )
- i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
- return i
- },
- calculateUTF16asUTF8: function(e) {
- var t = 0
- , i = 0;
- return u.UTF16toUTF8(e, function(e) {
- ++t,
- i += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
- }),
- [t, i]
- }
- };
- return a.toUTF8 = function(t, i) {
- if (void 0 === t && (t = this.offset),
- void 0 === i && (i = this.limit),
- !this.noAssert) {
- if ("number" != typeof t || t % 1 != 0)
- throw TypeError("Illegal begin: Not an integer");
- if (t >>>= 0,
- "number" != typeof i || i % 1 != 0)
- throw TypeError("Illegal end: Not an integer");
- if (i >>>= 0,
- t < 0 || i < t || i > this.buffer.byteLength)
- throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
- }
- var e;
- try {
- d.decodeUTF8toUTF16(function() {
- return t < i ? this.view[t++] : null
- }
- .bind(this), e = c())
- } catch (e) {
- if (t !== i)
- throw RangeError("Illegal range: Truncated data, " + t + " != " + i)
- }
- return e()
- }
- ,
- f.fromUTF8 = function(e, t, i) {
- if (!i && "string" != typeof e)
- throw TypeError("Illegal str: Not a string");
- var n = new f(d.calculateUTF16asUTF8(s(e), !0)[1],t,i)
- , r = 0;
- return d.encodeUTF16toUTF8(s(e), function(e) {
- n.view[r++] = e
- }),
- n.limit = r,
- n
- }
- ,
- f
- }
- ,
- "function" == typeof define && define.amd ? define(["long"], r) : "function" == typeof t && "object" == typeof e && e && e.exports ? e.exports = function() {
- var e;
- try {
- e = t("long")
- } catch (e) {}
- return r(e)
- }() : (n.dcodeIO = n.dcodeIO || {}).ByteBuffer = r(n.dcodeIO.Long)
- }
- , {
- long: 216
- }],
- 216: [function(e, t, i) {
- var n, r;
- n = this,
- r = function() {
- "use strict";
- function n(e, t, i) {
- this.low = 0 | e,
- this.high = 0 | t,
- this.unsigned = !!i
- }
- function p(e) {
- return !0 === (e && e.__isLong__)
- }
- function e(e, t) {
- var i, n, r;
- return t ? (r = 0 <= (e >>>= 0) && e < 256) && (n = a[e]) ? n : (i = g(e, (0 | e) < 0 ? -1 : 0, !0),
- r && (a[e] = i),
- i) : (r = -128 <= (e |= 0) && e < 128) && (n = o[e]) ? n : (i = g(e, e < 0 ? -1 : 0, !1),
- r && (o[e] = i),
- i)
- }
- function f(e, t) {
- if (isNaN(e) || !isFinite(e))
- return t ? l : y;
- if (t) {
- if (e < 0)
- return l;
- if (r <= e)
- return I
- } else {
- if (e <= -s)
- return E;
- if (s <= e + 1)
- return C
- }
- return e < 0 ? f(-e, t).neg() : g(e % i | 0, e / i | 0, t)
- }
- function g(e, t, i) {
- return new n(e,t,i)
- }
- function h(e, t, i) {
- if (0 === e.length)
- throw Error("empty string");
- if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
- return y;
- if (t = "number" == typeof t ? (i = t,
- !1) : !!t,
- (i = i || 10) < 2 || 36 < i)
- throw RangeError("radix");
- var n;
- if (0 < (n = e.indexOf("-")))
- throw Error("interior hyphen");
- if (0 === n)
- return h(e.substring(1), t, i).neg();
- for (var r = f(u(i, 8)), o = y, a = 0; a < e.length; a += 8) {
- var s = Math.min(8, e.length - a)
- , l = parseInt(e.substring(a, a + s), i);
- if (s < 8) {
- var c = f(u(i, s));
- o = o.mul(c).add(f(l))
- } else
- o = (o = o.mul(r)).add(f(l))
- }
- return o.unsigned = t,
- o
- }
- function m(e) {
- return e instanceof n ? e : "number" == typeof e ? f(e) : "string" == typeof e ? h(e) : g(e.low, e.high, e.unsigned)
- }
- Object.defineProperty(n.prototype, "__isLong__", {
- value: !0,
- enumerable: !1,
- configurable: !1
- }),
- n.isLong = p;
- var o = {}
- , a = {};
- n.fromInt = e,
- n.fromNumber = f,
- n.fromBits = g;
- var u = Math.pow;
- n.fromString = h,
- n.fromValue = m;
- var i = 4294967296
- , r = 0x10000000000000000
- , s = r / 2
- , v = e(1 << 24)
- , y = e(0);
- n.ZERO = y;
- var l = e(0, !0);
- n.UZERO = l;
- var c = e(1);
- n.ONE = c;
- var d = e(1, !0);
- n.UONE = d;
- var A = e(-1);
- n.NEG_ONE = A;
- var C = g(-1, 2147483647, !1);
- n.MAX_VALUE = C;
- var I = g(-1, -1, !0);
- n.MAX_UNSIGNED_VALUE = I;
- var E = g(0, -2147483648, !1);
- n.MIN_VALUE = E;
- var t = n.prototype;
- return t.toInt = function() {
- return this.unsigned ? this.low >>> 0 : this.low
- }
- ,
- t.toNumber = function() {
- return this.unsigned ? (this.high >>> 0) * i + (this.low >>> 0) : this.high * i + (this.low >>> 0)
- }
- ,
- t.toString = function(e) {
- if ((e = e || 10) < 2 || 36 < e)
- throw RangeError("radix");
- if (this.isZero())
- return "0";
- if (this.isNegative()) {
- if (this.eq(E)) {
- var t = f(e)
- , i = this.div(t)
- , n = i.mul(t).sub(this);
- return i.toString(e) + n.toInt().toString(e)
- }
- return "-" + this.neg().toString(e)
- }
- for (var r = f(u(e, 6), this.unsigned), o = this, a = ""; ; ) {
- var s = o.div(r)
- , l = (o.sub(s.mul(r)).toInt() >>> 0).toString(e);
- if ((o = s).isZero())
- return l + a;
- for (; l.length < 6; )
- l = "0" + l;
- a = "" + l + a
- }
- }
- ,
- t.getHighBits = function() {
- return this.high
- }
- ,
- t.getHighBitsUnsigned = function() {
- return this.high >>> 0
- }
- ,
- t.getLowBits = function() {
- return this.low
- }
- ,
- t.getLowBitsUnsigned = function() {
- return this.low >>> 0
- }
- ,
- t.getNumBitsAbs = function() {
- if (this.isNegative())
- return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
- for (var e = 0 != this.high ? this.high : this.low, t = 31; 0 < t && 0 == (e & 1 << t); t--)
- ;
- return 0 != this.high ? t + 33 : t + 1
- }
- ,
- t.isZero = function() {
- return 0 === this.high && 0 === this.low
- }
- ,
- t.isNegative = function() {
- return !this.unsigned && this.high < 0
- }
- ,
- t.isPositive = function() {
- return this.unsigned || 0 <= this.high
- }
- ,
- t.isOdd = function() {
- return 1 == (1 & this.low)
- }
- ,
- t.isEven = function() {
- return 0 == (1 & this.low)
- }
- ,
- t.equals = function(e) {
- return p(e) || (e = m(e)),
- (this.unsigned === e.unsigned || this.high >>> 31 != 1 || e.high >>> 31 != 1) && this.high === e.high && this.low === e.low
- }
- ,
- t.eq = t.equals,
- t.notEquals = function(e) {
- return !this.eq(e)
- }
- ,
- t.neq = t.notEquals,
- t.lessThan = function(e) {
- return this.comp(e) < 0
- }
- ,
- t.lt = t.lessThan,
- t.lessThanOrEqual = function(e) {
- return this.comp(e) <= 0
- }
- ,
- t.lte = t.lessThanOrEqual,
- t.greaterThan = function(e) {
- return 0 < this.comp(e)
- }
- ,
- t.gt = t.greaterThan,
- t.greaterThanOrEqual = function(e) {
- return 0 <= this.comp(e)
- }
- ,
- t.gte = t.greaterThanOrEqual,
- t.compare = function(e) {
- if (p(e) || (e = m(e)),
- this.eq(e))
- return 0;
- var t = this.isNegative()
- , i = e.isNegative();
- 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
- }
- ,
- t.comp = t.compare,
- t.negate = function() {
- return !this.unsigned && this.eq(E) ? E : this.not().add(c)
- }
- ,
- t.neg = t.negate,
- t.add = function(e) {
- p(e) || (e = m(e));
- var t = this.high >>> 16
- , i = 65535 & this.high
- , n = this.low >>> 16
- , r = 65535 & this.low
- , o = e.high >>> 16
- , a = 65535 & e.high
- , s = e.low >>> 16
- , l = 0
- , c = 0
- , h = 0
- , u = 0;
- return h += (u += r + (65535 & e.low)) >>> 16,
- c += (h += n + s) >>> 16,
- l += (c += i + a) >>> 16,
- l += t + o,
- g((h &= 65535) << 16 | (u &= 65535), (l &= 65535) << 16 | (c &= 65535), this.unsigned)
- }
- ,
- t.subtract = function(e) {
- return p(e) || (e = m(e)),
- this.add(e.neg())
- }
- ,
- t.sub = t.subtract,
- t.multiply = function(e) {
- if (this.isZero())
- return y;
- if (p(e) || (e = m(e)),
- e.isZero())
- return y;
- if (this.eq(E))
- return e.isOdd() ? E : y;
- if (e.eq(E))
- return this.isOdd() ? E : y;
- if (this.isNegative())
- return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
- if (e.isNegative())
- return this.mul(e.neg()).neg();
- if (this.lt(v) && e.lt(v))
- return f(this.toNumber() * e.toNumber(), this.unsigned);
- var t = this.high >>> 16
- , i = 65535 & this.high
- , n = this.low >>> 16
- , r = 65535 & this.low
- , o = e.high >>> 16
- , a = 65535 & e.high
- , s = e.low >>> 16
- , l = 65535 & e.low
- , c = 0
- , h = 0
- , u = 0
- , d = 0;
- return u += (d += r * l) >>> 16,
- h += (u += n * l) >>> 16,
- u &= 65535,
- h += (u += r * s) >>> 16,
- c += (h += i * l) >>> 16,
- h &= 65535,
- c += (h += n * s) >>> 16,
- h &= 65535,
- c += (h += r * a) >>> 16,
- c += t * l + i * s + n * a + r * o,
- g((u &= 65535) << 16 | (d &= 65535), (c &= 65535) << 16 | (h &= 65535), this.unsigned)
- }
- ,
- t.mul = t.multiply,
- t.divide = function(e) {
- if (p(e) || (e = m(e)),
- e.isZero())
- throw Error("division by zero");
- if (this.isZero())
- return this.unsigned ? l : y;
- var t, i, n;
- if (this.unsigned) {
- if (e.unsigned || (e = e.toUnsigned()),
- e.gt(this))
- return l;
- if (e.gt(this.shru(1)))
- return d;
- n = l
- } else {
- if (this.eq(E))
- 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)),
- n = t.add(i.div(e)));
- if (e.eq(E))
- return this.unsigned ? l : y;
- if (this.isNegative())
- return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
- if (e.isNegative())
- return this.div(e.neg()).neg();
- n = y
- }
- for (i = this; i.gte(e); ) {
- t = Math.max(1, Math.floor(i.toNumber() / e.toNumber()));
- 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); )
- s = (a = f(t -= o, this.unsigned)).mul(e);
- a.isZero() && (a = c),
- n = n.add(a),
- i = i.sub(s)
- }
- return n
- }
- ,
- t.div = t.divide,
- t.modulo = function(e) {
- return p(e) || (e = m(e)),
- this.sub(this.div(e).mul(e))
- }
- ,
- t.mod = t.modulo,
- t.not = function() {
- return g(~this.low, ~this.high, this.unsigned)
- }
- ,
- t.and = function(e) {
- return p(e) || (e = m(e)),
- g(this.low & e.low, this.high & e.high, this.unsigned)
- }
- ,
- t.or = function(e) {
- return p(e) || (e = m(e)),
- g(this.low | e.low, this.high | e.high, this.unsigned)
- }
- ,
- t.xor = function(e) {
- return p(e) || (e = m(e)),
- g(this.low ^ e.low, this.high ^ e.high, this.unsigned)
- }
- ,
- t.shiftLeft = function(e) {
- return p(e) && (e = e.toInt()),
- 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)
- }
- ,
- t.shl = t.shiftLeft,
- t.shiftRight = function(e) {
- return p(e) && (e = e.toInt()),
- 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)
- }
- ,
- t.shr = t.shiftRight,
- t.shiftRightUnsigned = function(e) {
- if (p(e) && (e = e.toInt()),
- 0 === (e &= 63))
- return this;
- var t = this.high;
- return e < 32 ? g(this.low >>> e | t << 32 - e, t >>> e, this.unsigned) : g(32 === e ? t : t >>> e - 32, 0, this.unsigned)
- }
- ,
- t.shru = t.shiftRightUnsigned,
- t.toSigned = function() {
- return this.unsigned ? g(this.low, this.high, !1) : this
- }
- ,
- t.toUnsigned = function() {
- return this.unsigned ? this : g(this.low, this.high, !0)
- }
- ,
- t.toBytes = function(e) {
- return e ? this.toBytesLE() : this.toBytesBE()
- }
- ,
- t.toBytesLE = function() {
- var e = this.high
- , t = this.low;
- return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
- }
- ,
- t.toBytesBE = function() {
- var e = this.high
- , t = this.low;
- return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
- }
- ,
- n
- }
- ,
- "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()
- }
- , {}],
- 217: [function(e, t, i) {
- 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 = {
- REVISION: "75"
- };
- function Ii(e, t) {
- return e.distance - t.distance
- }
- function Ei(e, t, i, n) {
- if (!1 !== e.visible && (e.raycast(t, i),
- !0 === n))
- for (var r = e.children, o = 0, a = r.length; o < a; o++)
- Ei(r[o], t, i, !0)
- }
- function _i(e, t, i) {
- return i < 0 && (i += 1),
- 1 < i && (i -= 1),
- i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
- }
- function bi(e, t, i, n, r, o, a) {
- return Ci.Triangle.barycoordFromPoint(e, t, i, n, Vt),
- r.multiplyScalar(Vt.x),
- o.multiplyScalar(Vt.y),
- a.multiplyScalar(Vt.z),
- r.add(o).add(a),
- r.clone()
- }
- function wi(e, t, i, n, r, o, a) {
- var s = e.material;
- if (null === (s.side === Ci.BackSide ? i.intersectTriangle(o, r, n, !0, a) : i.intersectTriangle(n, r, o, s.side !== Ci.DoubleSide, a)))
- return null;
- Ut.copy(a),
- Ut.applyMatrix4(e.matrixWorld);
- var l = t.ray.origin.distanceTo(Ut);
- return l < t.near || l > t.far ? null : {
- distance: l,
- point: Ut.clone(),
- object: e
- }
- }
- function Ti(e, t, i, n, r, o, a, s) {
- Mt.fromArray(n, 3 * o),
- Rt.fromArray(n, 3 * a),
- Pt.fromArray(n, 3 * s);
- var l = wi(e, t, i, Mt, Rt, Pt, kt);
- return l && (r && (Nt.fromArray(r, 2 * o),
- Ft.fromArray(r, 2 * a),
- Bt.fromArray(r, 2 * s),
- l.uv = bi(kt, Mt, Rt, Pt, Nt, Ft, Bt)),
- l.face = new Ci.Face3(o,a,s,Ci.Triangle.normal(Mt, Rt, Pt)),
- l.faceIndex = o),
- l
- }
- function xi() {}
- function Si(e, t, i, n, r, o) {
- var a, s, l, c, h, u, d, p, f, g, m, v, y, A, C, I, E;
- if (s = e[o[t]].x,
- l = e[o[t]].y,
- c = e[o[i]].x,
- h = e[o[i]].y,
- u = e[o[n]].x,
- d = e[o[n]].y,
- Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
- return !1;
- for (g = u - c,
- m = d - h,
- v = s - u,
- y = l - d,
- A = c - s,
- C = h - l,
- a = 0; a < r; a++)
- if (p = e[o[a]].x,
- f = e[o[a]].y,
- !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = A * (f - l) - C * (p - s),
- E = v * (f - d) - y * (p - u),
- g * (f - h) - m * (p - c) >= -Number.EPSILON && E >= -Number.EPSILON && I >= -Number.EPSILON))
- return !1;
- return !0
- }
- function Mi(e) {
- switch (e) {
- case Ci.LinearEncoding:
- return ["Linear", "( value )"];
- case Ci.sRGBEncoding:
- return ["sRGB", "( value )"];
- case Ci.RGBEEncoding:
- return ["RGBE", "( value )"];
- case Ci.RGBM7Encoding:
- return ["RGBM", "( value, 7.0 )"];
- case Ci.RGBM16Encoding:
- return ["RGBM", "( value, 16.0 )"];
- case Ci.RGBDEncoding:
- return ["RGBD", "( value, 256.0 )"];
- case Ci.GammaEncoding:
- return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
- default:
- throw new Error("unsupported encoding: " + e)
- }
- }
- function Ri(e, t) {
- var i = Mi(t);
- return "vec4 " + e + "( vec4 value ) { return " + i[0] + "ToLinear" + i[1] + "; }"
- }
- function Pi(e) {
- return "" !== e
- }
- function Oi(e, t) {
- 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)
- }
- function Li(e) {
- return e.replace(/#include +<([\w\d.]+)>/g, function(e, t) {
- var i = Ci.ShaderChunk[t];
- if (void 0 === i)
- throw new Error("Can not resolve #include <" + t + ">");
- return Li(i)
- })
- }
- function Di(e) {
- return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g, function(e, t, i, n) {
- for (var r = "", o = parseInt(t); o < parseInt(i); o++)
- r += n.replace(/\[ i \]/g, "[ " + o + " ]");
- return r
- })
- }
- function Ni(e, t, i, n) {
- gi.set(t, i, n).unproject(mi);
- var r = fi[e];
- if (void 0 !== r)
- for (var o = 0, a = r.length; o < a; o++)
- pi.vertices[r[o]].copy(gi)
- }
- "function" == typeof define && define.amd ? define("three", Ci) : void 0 !== i && void 0 !== t && (t.exports = Ci),
- void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
- void 0 === Math.sign && (Math.sign = function(e) {
- return e < 0 ? -1 : 0 < e ? 1 : +e
- }
- ),
- void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
- get: function() {
- return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
- }
- }),
- void 0 === Object.assign && Object.defineProperty(Object, "assign", {
- writable: !0,
- configurable: !0,
- value: function(e) {
- "use strict";
- if (null == e)
- throw new TypeError("Cannot convert first argument to object");
- for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
- var r = arguments[i];
- if (null != r) {
- r = Object(r);
- for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
- var l = o[a]
- , c = Object.getOwnPropertyDescriptor(r, l);
- void 0 !== c && c.enumerable && (t[l] = r[l])
- }
- }
- }
- return t
- }
- }),
- Ci.MOUSE = {
- LEFT: 0,
- MIDDLE: 1,
- RIGHT: 2
- },
- Ci.CullFaceNone = 0,
- Ci.CullFaceBack = 1,
- Ci.CullFaceFront = 2,
- Ci.CullFaceFrontBack = 3,
- Ci.FrontFaceDirectionCW = 0,
- Ci.FrontFaceDirectionCCW = 1,
- Ci.BasicShadowMap = 0,
- Ci.PCFShadowMap = 1,
- Ci.PCFSoftShadowMap = 2,
- Ci.FrontSide = 0,
- Ci.BackSide = 1,
- Ci.DoubleSide = 2,
- Ci.FlatShading = 1,
- Ci.SmoothShading = 2,
- Ci.NoColors = 0,
- Ci.FaceColors = 1,
- Ci.VertexColors = 2,
- Ci.NoBlending = 0,
- Ci.NormalBlending = 1,
- Ci.AdditiveBlending = 2,
- Ci.SubtractiveBlending = 3,
- Ci.MultiplyBlending = 4,
- Ci.CustomBlending = 5,
- Ci.AddEquation = 100,
- Ci.SubtractEquation = 101,
- Ci.ReverseSubtractEquation = 102,
- Ci.MinEquation = 103,
- Ci.MaxEquation = 104,
- Ci.ZeroFactor = 200,
- Ci.OneFactor = 201,
- Ci.SrcColorFactor = 202,
- Ci.OneMinusSrcColorFactor = 203,
- Ci.SrcAlphaFactor = 204,
- Ci.OneMinusSrcAlphaFactor = 205,
- Ci.DstAlphaFactor = 206,
- Ci.OneMinusDstAlphaFactor = 207,
- Ci.DstColorFactor = 208,
- Ci.OneMinusDstColorFactor = 209,
- Ci.SrcAlphaSaturateFactor = 210,
- Ci.NeverDepth = 0,
- Ci.AlwaysDepth = 1,
- Ci.LessDepth = 2,
- Ci.LessEqualDepth = 3,
- Ci.EqualDepth = 4,
- Ci.GreaterEqualDepth = 5,
- Ci.GreaterDepth = 6,
- Ci.NotEqualDepth = 7,
- Ci.MultiplyOperation = 0,
- Ci.MixOperation = 1,
- Ci.AddOperation = 2,
- Ci.NoToneMapping = 0,
- Ci.LinearToneMapping = 1,
- Ci.ReinhardToneMapping = 2,
- Ci.Uncharted2ToneMapping = 3,
- Ci.CineonToneMapping = 4,
- Ci.UVMapping = 300,
- Ci.CubeReflectionMapping = 301,
- Ci.CubeRefractionMapping = 302,
- Ci.EquirectangularReflectionMapping = 303,
- Ci.EquirectangularRefractionMapping = 304,
- Ci.SphericalReflectionMapping = 305,
- Ci.CubeUVReflectionMapping = 306,
- Ci.CubeUVRefractionMapping = 307,
- Ci.RepeatWrapping = 1e3,
- Ci.ClampToEdgeWrapping = 1001,
- Ci.MirroredRepeatWrapping = 1002,
- Ci.NearestFilter = 1003,
- Ci.NearestMipMapNearestFilter = 1004,
- Ci.NearestMipMapLinearFilter = 1005,
- Ci.LinearFilter = 1006,
- Ci.LinearMipMapNearestFilter = 1007,
- Ci.LinearMipMapLinearFilter = 1008,
- Ci.UnsignedByteType = 1009,
- Ci.ByteType = 1010,
- Ci.ShortType = 1011,
- Ci.UnsignedShortType = 1012,
- Ci.IntType = 1013,
- Ci.UnsignedIntType = 1014,
- Ci.FloatType = 1015,
- Ci.HalfFloatType = 1025,
- Ci.UnsignedShort4444Type = 1016,
- Ci.UnsignedShort5551Type = 1017,
- Ci.UnsignedShort565Type = 1018,
- Ci.AlphaFormat = 1019,
- Ci.RGBFormat = 1020,
- Ci.RGBAFormat = 1021,
- Ci.LuminanceFormat = 1022,
- Ci.LuminanceAlphaFormat = 1023,
- Ci.RGBEFormat = Ci.RGBAFormat,
- Ci.RGB_S3TC_DXT1_Format = 2001,
- Ci.RGBA_S3TC_DXT1_Format = 2002,
- Ci.RGBA_S3TC_DXT3_Format = 2003,
- Ci.RGBA_S3TC_DXT5_Format = 2004,
- Ci.RGB_PVRTC_4BPPV1_Format = 2100,
- Ci.RGB_PVRTC_2BPPV1_Format = 2101,
- Ci.RGBA_PVRTC_4BPPV1_Format = 2102,
- Ci.RGBA_PVRTC_2BPPV1_Format = 2103,
- Ci.RGB_ETC1_Format = 2151,
- Ci.LoopOnce = 2200,
- Ci.LoopRepeat = 2201,
- Ci.LoopPingPong = 2202,
- Ci.InterpolateDiscrete = 2300,
- Ci.InterpolateLinear = 2301,
- Ci.InterpolateSmooth = 2302,
- Ci.ZeroCurvatureEnding = 2400,
- Ci.ZeroSlopeEnding = 2401,
- Ci.WrapAroundEnding = 2402,
- Ci.TrianglesDrawMode = 0,
- Ci.TriangleStripDrawMode = 1,
- Ci.TriangleFanDrawMode = 2,
- Ci.LinearEncoding = 3e3,
- Ci.sRGBEncoding = 3001,
- Ci.GammaEncoding = 3007,
- Ci.RGBEEncoding = 3002,
- Ci.LogLuvEncoding = 3003,
- Ci.RGBM7Encoding = 3004,
- Ci.RGBM16Encoding = 3005,
- Ci.RGBDEncoding = 3006,
- Ci.Color = function(e) {
- return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
- }
- ,
- Ci.Color.prototype = {
- constructor: Ci.Color,
- r: 1,
- g: 1,
- b: 1,
- set: function(e) {
- return e instanceof Ci.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
- this
- },
- setScalar: function(e) {
- this.r = e,
- this.g = e,
- this.b = e
- },
- setHex: function(e) {
- return e = Math.floor(e),
- this.r = (e >> 16 & 255) / 255,
- this.g = (e >> 8 & 255) / 255,
- this.b = (255 & e) / 255,
- this
- },
- setRGB: function(e, t, i) {
- return this.r = e,
- this.g = t,
- this.b = i,
- this
- },
- setHSL: function(e, t, i) {
- if (e = Ci.Math.euclideanModulo(e, 1),
- t = Ci.Math.clamp(t, 0, 1),
- i = Ci.Math.clamp(i, 0, 1),
- 0 === t)
- this.r = this.g = this.b = i;
- else {
- var n = i <= .5 ? i * (1 + t) : i + t - i * t
- , r = 2 * i - n;
- this.r = _i(r, n, e + 1 / 3),
- this.g = _i(r, n, e),
- this.b = _i(r, n, e - 1 / 3)
- }
- return this
- },
- setStyle: function(t) {
- function e(e) {
- void 0 !== e && parseFloat(e) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.")
- }
- var i;
- if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)) {
- var n, r = i[1], o = i[2];
- switch (r) {
- case "rgb":
- case "rgba":
- if (n = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
- return this.r = Math.min(255, parseInt(n[1], 10)) / 255,
- this.g = Math.min(255, parseInt(n[2], 10)) / 255,
- this.b = Math.min(255, parseInt(n[3], 10)) / 255,
- e(n[5]),
- this;
- if (n = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))
- return this.r = Math.min(100, parseInt(n[1], 10)) / 100,
- this.g = Math.min(100, parseInt(n[2], 10)) / 100,
- this.b = Math.min(100, parseInt(n[3], 10)) / 100,
- e(n[5]),
- this;
- break;
- case "hsl":
- case "hsla":
- if (n = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)) {
- var a = parseFloat(n[1]) / 360
- , s = parseInt(n[2], 10) / 100
- , l = parseInt(n[3], 10) / 100;
- return e(n[5]),
- this.setHSL(a, s, l)
- }
- }
- } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(t)) {
- var c, h = (c = i[1]).length;
- if (3 === h)
- return this.r = parseInt(c.charAt(0) + c.charAt(0), 16) / 255,
- this.g = parseInt(c.charAt(1) + c.charAt(1), 16) / 255,
- this.b = parseInt(c.charAt(2) + c.charAt(2), 16) / 255,
- this;
- if (6 === h)
- return this.r = parseInt(c.charAt(0) + c.charAt(1), 16) / 255,
- this.g = parseInt(c.charAt(2) + c.charAt(3), 16) / 255,
- this.b = parseInt(c.charAt(4) + c.charAt(5), 16) / 255,
- this
- }
- t && 0 < t.length && (void 0 !== (c = Ci.ColorKeywords[t]) ? this.setHex(c) : console.warn("THREE.Color: Unknown color " + t));
- return this
- },
- clone: function() {
- return new this.constructor(this.r,this.g,this.b)
- },
- copy: function(e) {
- return this.r = e.r,
- this.g = e.g,
- this.b = e.b,
- this
- },
- copyGammaToLinear: function(e, t) {
- return void 0 === t && (t = 2),
- this.r = Math.pow(e.r, t),
- this.g = Math.pow(e.g, t),
- this.b = Math.pow(e.b, t),
- this
- },
- copyLinearToGamma: function(e, t) {
- void 0 === t && (t = 2);
- var i = 0 < t ? 1 / t : 1;
- return this.r = Math.pow(e.r, i),
- this.g = Math.pow(e.g, i),
- this.b = Math.pow(e.b, i),
- this
- },
- convertGammaToLinear: function() {
- var e = this.r
- , t = this.g
- , i = this.b;
- return this.r = e * e,
- this.g = t * t,
- this.b = i * i,
- this
- },
- convertLinearToGamma: function() {
- return this.r = Math.sqrt(this.r),
- this.g = Math.sqrt(this.g),
- this.b = Math.sqrt(this.b),
- this
- },
- getHex: function() {
- return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
- },
- getHexString: function() {
- return ("000000" + this.getHex().toString(16)).slice(-6)
- },
- getHSL: function(e) {
- var t, i, n = e || {
- h: 0,
- s: 0,
- l: 0
- }, 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;
- if (l === s)
- i = t = 0;
- else {
- var h = s - l;
- switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
- s) {
- case r:
- t = (o - a) / h + (o < a ? 6 : 0);
- break;
- case o:
- t = (a - r) / h + 2;
- break;
- case a:
- t = (r - o) / h + 4
- }
- t /= 6
- }
- return n.h = t,
- n.s = i,
- n.l = c,
- n
- },
- getStyle: function() {
- return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
- },
- offsetHSL: function(e, t, i) {
- var n = this.getHSL();
- return n.h += e,
- n.s += t,
- n.l += i,
- this.setHSL(n.h, n.s, n.l),
- this
- },
- add: function(e) {
- return this.r += e.r,
- this.g += e.g,
- this.b += e.b,
- this
- },
- addColors: function(e, t) {
- return this.r = e.r + t.r,
- this.g = e.g + t.g,
- this.b = e.b + t.b,
- this
- },
- addScalar: function(e) {
- return this.r += e,
- this.g += e,
- this.b += e,
- this
- },
- multiply: function(e) {
- return this.r *= e.r,
- this.g *= e.g,
- this.b *= e.b,
- this
- },
- multiplyScalar: function(e) {
- return this.r *= e,
- this.g *= e,
- this.b *= e,
- this
- },
- lerp: function(e, t) {
- return this.r += (e.r - this.r) * t,
- this.g += (e.g - this.g) * t,
- this.b += (e.b - this.b) * t,
- this
- },
- equals: function(e) {
- return e.r === this.r && e.g === this.g && e.b === this.b
- },
- fromArray: function(e, t) {
- return void 0 === t && (t = 0),
- this.r = e[t],
- this.g = e[t + 1],
- this.b = e[t + 2],
- this
- },
- toArray: function(e, t) {
- return void 0 === e && (e = []),
- void 0 === t && (t = 0),
- e[t] = this.r,
- e[t + 1] = this.g,
- e[t + 2] = this.b,
- e
- }
- },
- Ci.ColorKeywords = {
- aliceblue: 15792383,
- antiquewhite: 16444375,
- aqua: 65535,
- aquamarine: 8388564,
- azure: 15794175,
- beige: 16119260,
- bisque: 16770244,
- black: 0,
- blanchedalmond: 16772045,
- blue: 255,
- blueviolet: 9055202,
- brown: 10824234,
- burlywood: 14596231,
- cadetblue: 6266528,
- chartreuse: 8388352,
- chocolate: 13789470,
- coral: 16744272,
- cornflowerblue: 6591981,
- cornsilk: 16775388,
- crimson: 14423100,
- cyan: 65535,
- darkblue: 139,
- darkcyan: 35723,
- darkgoldenrod: 12092939,
- darkgray: 11119017,
- darkgreen: 25600,
- darkgrey: 11119017,
- darkkhaki: 12433259,
- darkmagenta: 9109643,
- darkolivegreen: 5597999,
- darkorange: 16747520,
- darkorchid: 10040012,
- darkred: 9109504,
- darksalmon: 15308410,
- darkseagreen: 9419919,
- darkslateblue: 4734347,
- darkslategray: 3100495,
- darkslategrey: 3100495,
- darkturquoise: 52945,
- darkviolet: 9699539,
- deeppink: 16716947,
- deepskyblue: 49151,
- dimgray: 6908265,
- dimgrey: 6908265,
- dodgerblue: 2003199,
- firebrick: 11674146,
- floralwhite: 16775920,
- forestgreen: 2263842,
- fuchsia: 16711935,
- gainsboro: 14474460,
- ghostwhite: 16316671,
- gold: 16766720,
- goldenrod: 14329120,
- gray: 8421504,
- green: 32768,
- greenyellow: 11403055,
- grey: 8421504,
- honeydew: 15794160,
- hotpink: 16738740,
- indianred: 13458524,
- indigo: 4915330,
- ivory: 16777200,
- khaki: 15787660,
- lavender: 15132410,
- lavenderblush: 16773365,
- lawngreen: 8190976,
- lemonchiffon: 16775885,
- lightblue: 11393254,
- lightcoral: 15761536,
- lightcyan: 14745599,
- lightgoldenrodyellow: 16448210,
- lightgray: 13882323,
- lightgreen: 9498256,
- lightgrey: 13882323,
- lightpink: 16758465,
- lightsalmon: 16752762,
- lightseagreen: 2142890,
- lightskyblue: 8900346,
- lightslategray: 7833753,
- lightslategrey: 7833753,
- lightsteelblue: 11584734,
- lightyellow: 16777184,
- lime: 65280,
- limegreen: 3329330,
- linen: 16445670,
- magenta: 16711935,
- maroon: 8388608,
- mediumaquamarine: 6737322,
- mediumblue: 205,
- mediumorchid: 12211667,
- mediumpurple: 9662683,
- mediumseagreen: 3978097,
- mediumslateblue: 8087790,
- mediumspringgreen: 64154,
- mediumturquoise: 4772300,
- mediumvioletred: 13047173,
- midnightblue: 1644912,
- mintcream: 16121850,
- mistyrose: 16770273,
- moccasin: 16770229,
- navajowhite: 16768685,
- navy: 128,
- oldlace: 16643558,
- olive: 8421376,
- olivedrab: 7048739,
- orange: 16753920,
- orangered: 16729344,
- orchid: 14315734,
- palegoldenrod: 15657130,
- palegreen: 10025880,
- paleturquoise: 11529966,
- palevioletred: 14381203,
- papayawhip: 16773077,
- peachpuff: 16767673,
- peru: 13468991,
- pink: 16761035,
- plum: 14524637,
- powderblue: 11591910,
- purple: 8388736,
- red: 16711680,
- rosybrown: 12357519,
- royalblue: 4286945,
- saddlebrown: 9127187,
- salmon: 16416882,
- sandybrown: 16032864,
- seagreen: 3050327,
- seashell: 16774638,
- sienna: 10506797,
- silver: 12632256,
- skyblue: 8900331,
- slateblue: 6970061,
- slategray: 7372944,
- slategrey: 7372944,
- snow: 16775930,
- springgreen: 65407,
- steelblue: 4620980,
- tan: 13808780,
- teal: 32896,
- thistle: 14204888,
- tomato: 16737095,
- turquoise: 4251856,
- violet: 15631086,
- wheat: 16113331,
- white: 16777215,
- whitesmoke: 16119285,
- yellow: 16776960,
- yellowgreen: 10145074
- },
- Ci.Quaternion = function(e, t, i, n) {
- this._x = e || 0,
- this._y = t || 0,
- this._z = i || 0,
- this._w = void 0 !== n ? n : 1
- }
- ,
- Ci.Quaternion.prototype = {
- constructor: Ci.Quaternion,
- get x() {
- return this._x
- },
- set x(e) {
- this._x = e,
- this.onChangeCallback()
- },
- get y() {
- return this._y
- },
- set y(e) {
- this._y = e,
- this.onChangeCallback()
- },
- get z() {
- return this._z
- },
- set z(e) {
- this._z = e,
- this.onChangeCallback()
- },
- get w() {
- return this._w
- },
- set w(e) {
- this._w = e,
- this.onChangeCallback()
- },
- set: function(e, t, i, n) {
- return this._x = e,
- this._y = t,
- this._z = i,
- this._w = n,
- this.onChangeCallback(),
- this
- },
- clone: function() {
- return new this.constructor(this._x,this._y,this._z,this._w)
- },
- toObject:function(){//add
- return {x:this.x, y:this.y,z:this.z, w:this.w};
- },
- copy: function(e) {
- return this._x = e.x,
- this._y = e.y,
- this._z = e.z,
- this._w = e.w,
- this.onChangeCallback(),
- this
- },
- setFromEuler: function(e, t) {
- if (e instanceof Ci.Euler == 0)
- throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
- var i = Math.cos(e._x / 2)
- , n = Math.cos(e._y / 2)
- , r = Math.cos(e._z / 2)
- , o = Math.sin(e._x / 2)
- , a = Math.sin(e._y / 2)
- , s = Math.sin(e._z / 2)
- , l = e.order;
- return "XYZ" === l ? (this._x = o * n * r + i * a * s,
- this._y = i * a * r - o * n * s,
- this._z = i * n * s + o * a * r,
- this._w = i * n * r - o * a * s) : "YXZ" === l ? (this._x = o * n * r + i * a * s,
- this._y = i * a * r - o * n * s,
- this._z = i * n * s - o * a * r,
- this._w = i * n * r + o * a * s) : "ZXY" === l ? (this._x = o * n * r - i * a * s,
- this._y = i * a * r + o * n * s,
- this._z = i * n * s + o * a * r,
- this._w = i * n * r - o * a * s) : "ZYX" === l ? (this._x = o * n * r - i * a * s,
- this._y = i * a * r + o * n * s,
- this._z = i * n * s - o * a * r,
- this._w = i * n * r + o * a * s) : "YZX" === l ? (this._x = o * n * r + i * a * s,
- this._y = i * a * r + o * n * s,
- this._z = i * n * s - o * a * r,
- this._w = i * n * r - o * a * s) : "XZY" === l && (this._x = o * n * r - i * a * s,
- this._y = i * a * r - o * n * s,
- this._z = i * n * s + o * a * r,
- this._w = i * n * r + o * a * s),
- !1 !== t && this.onChangeCallback(),
- this
- },
- setFromAxisAngle: function(e, t) {
- var i = t / 2
- , n = Math.sin(i);
- return this._x = e.x * n,
- this._y = e.y * n,
- this._z = e.z * n,
- this._w = Math.cos(i),
- this.onChangeCallback(),
- this
- },
- setFromRotationMatrix: function(e) {
- 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;
- return 0 < d ? (t = .5 / Math.sqrt(d + 1),
- this._w = .25 / t,
- this._x = (h - l) * t,
- this._y = (o - c) * t,
- this._z = (a - r) * t) : s < n && u < n ? (t = 2 * Math.sqrt(1 + n - s - u),
- this._w = (h - l) / t,
- this._x = .25 * t,
- this._y = (r + a) / t,
- this._z = (o + c) / t) : u < s ? (t = 2 * Math.sqrt(1 + s - n - u),
- this._w = (o - c) / t,
- this._x = (r + a) / t,
- this._y = .25 * t,
- this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
- this._w = (a - r) / t,
- this._x = (o + c) / t,
- this._y = (l + h) / t,
- this._z = .25 * t),
- this.onChangeCallback(),
- this
- },
- setFromUnitVectors: function(e, t) {
- return void 0 === Be && (Be = new Ci.Vector3),
- (Ve = e.dot(t) + 1) < 1e-6 ? (Ve = 0,
- 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),
- this._x = Be.x,
- this._y = Be.y,
- this._z = Be.z,
- this._w = Ve,
- this.normalize(),
- this
- },
- inverse: function() {
- return this.conjugate().normalize(),
- this
- },
- conjugate: function() {
- return this._x *= -1,
- this._y *= -1,
- this._z *= -1,
- this.onChangeCallback(),
- this
- },
- dot: function(e) {
- return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
- },
- lengthSq: function() {
- return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
- },
- length: function() {
- return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
- },
- normalize: function() {
- var e = this.length();
- return 0 === e ? (this._x = 0,
- this._y = 0,
- this._z = 0,
- this._w = 1) : (e = 1 / e,
- this._x = this._x * e,
- this._y = this._y * e,
- this._z = this._z * e,
- this._w = this._w * e),
- this.onChangeCallback(),
- this
- },
- multiply: function(e, t) {
- return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
- this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
- },
- multiplyQuaternions: function(e, t) {
- var i = e._x
- , n = e._y
- , r = e._z
- , o = e._w
- , a = t._x
- , s = t._y
- , l = t._z
- , c = t._w;
- return this._x = i * c + o * a + n * l - r * s,
- this._y = n * c + o * s + r * a - i * l,
- this._z = r * c + o * l + i * s - n * a,
- this._w = o * c - i * a - n * s - r * l,
- this.onChangeCallback(),
- this
- },
- slerp: function(e, t) {
- if (0 === t)
- return this;
- if (1 === t)
- return this.copy(e);
- var i = this._x
- , n = this._y
- , r = this._z
- , o = this._w
- , a = o * e._w + i * e._x + n * e._y + r * e._z;
- if (a < 0 ? (this._w = -e._w,
- this._x = -e._x,
- this._y = -e._y,
- this._z = -e._z,
- a = -a) : this.copy(e),
- 1 <= a)
- return this._w = o,
- this._x = i,
- this._y = n,
- this._z = r,
- this;
- var s = Math.sqrt(1 - a * a);
- if (Math.abs(s) < .001)
- return this._w = .5 * (o + this._w),
- this._x = .5 * (i + this._x),
- this._y = .5 * (n + this._y),
- this._z = .5 * (r + this._z),
- this;
- var l = Math.atan2(s, a)
- , c = Math.sin((1 - t) * l) / s
- , h = Math.sin(t * l) / s;
- return this._w = o * c + this._w * h,
- this._x = i * c + this._x * h,
- this._y = n * c + this._y * h,
- this._z = r * c + this._z * h,
- this.onChangeCallback(),
- this
- },
- equals: function(e) {
- return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
- },
- fromArray: function(e, t) {
- return void 0 === t && (t = 0),
- this._x = e[t],
- this._y = e[t + 1],
- this._z = e[t + 2],
- this._w = e[t + 3],
- this.onChangeCallback(),
- this
- },
- toArray: function(e, t) {
- return void 0 === e && (e = []),
- void 0 === t && (t = 0),
- e[t] = this._x,
- e[t + 1] = this._y,
- e[t + 2] = this._z,
- e[t + 3] = this._w,
- e
- },
- onChange: function(e) {
- return this.onChangeCallback = e,
- this
- },
- onChangeCallback: function() {}
- },
- Object.assign(Ci.Quaternion, {
- slerp: function(e, t, i, n) {
- return i.copy(e).slerp(t, n)
- },
- slerpFlat: function(e, t, i, n, r, o, a) {
- var s = i[n + 0]
- , l = i[n + 1]
- , c = i[n + 2]
- , h = i[n + 3]
- , u = r[o + 0]
- , d = r[o + 1]
- , p = r[o + 2]
- , f = r[o + 3];
- if (h !== f || s !== u || l !== d || c !== p) {
- var g = 1 - a
- , m = s * u + l * d + c * p + h * f
- , v = 0 <= m ? 1 : -1
- , y = 1 - m * m;
- if (y > Number.EPSILON) {
- var A = Math.sqrt(y)
- , C = Math.atan2(A, m * v);
- g = Math.sin(g * C) / A,
- a = Math.sin(a * C) / A
- }
- var I = a * v;
- if (s = s * g + u * I,
- l = l * g + d * I,
- c = c * g + p * I,
- h = h * g + f * I,
- g === 1 - a) {
- var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
- s *= E,
- l *= E,
- c *= E,
- h *= E
- }
- }
- e[t] = s,
- e[t + 1] = l,
- e[t + 2] = c,
- e[t + 3] = h
- }
- }),
- Ci.Vector2 = function(e, t) {
- this.x = e || 0,
- this.y = t || 0
- }
- ,
- Ci.Vector2.prototype = {
- constructor: Ci.Vector2,
- get width() {
- return this.x
- },
- set width(e) {
- this.x = e
- },
- get height() {
- return this.y
- },
- set height(e) {
- this.y = e
- },
- set: function(e, t) {
- return this.x = e,
- this.y = t,
- this
- },
- setScalar: function(e) {
- return this.x = e,
- this.y = e,
- this
- },
- setX: function(e) {
- return this.x = e,
- this
- },
- setY: function(e) {
- return this.y = e,
- this
- },
- setComponent: function(e, t) {
- switch (e) {
- case 0:
- this.x = t;
- break;
- case 1:
- this.y = t;
- break;
- default:
- throw new Error("index is out of range: " + e)
- }
- },
- getComponent: function(e) {
- switch (e) {
- case 0:
- return this.x;
- case 1:
- return this.y;
- default:
- throw new Error("index is out of range: " + e)
- }
- },
- clone: function() {
- return new this.constructor(this.x,this.y)
- },
- copy: function(e) {
- return this.x = e.x,
- this.y = e.y,
- this
- },
- add: function(e, t) {
- return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
- this.addVectors(e, t)) : (this.x += e.x,
- this.y += e.y,
- this)
- },
- addScalar: function(e) {
- return this.x += e,
- this.y += e,
- this
- },
- addVectors: function(e, t) {
- return this.x = e.x + t.x,
- this.y = e.y + t.y,
- this
- },
- addScaledVector: function(e, t) {
- return this.x += e.x * t,
- this.y += e.y * t,
- this
- },
- sub: function(e, t) {
- return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
- this.subVectors(e, t)) : (this.x -= e.x,
- this.y -= e.y,
- this)
- },
- subScalar: function(e) {
- return this.x -= e,
- this.y -= e,
- this
- },
- subVectors: function(e, t) {
- return this.x = e.x - t.x,
- this.y = e.y - t.y,
- this
- },
- multiply: function(e) {
- return this.x *= e.x,
- this.y *= e.y,
- this
- },
- multiplyScalar: function(e) {
- return isFinite(e) ? (this.x *= e,
- this.y *= e) : (this.x = 0,
- this.y = 0),
- this
- },
- divide: function(e) {
- return this.x /= e.x,
- this.y /= e.y,
- this
- },
- divideScalar: function(e) {
- return this.multiplyScalar(1 / e)
- },
- min: function(e) {
- return this.x = Math.min(this.x, e.x),
- this.y = Math.min(this.y, e.y),
- this
- },
- max: function(e) {
- return this.x = Math.max(this.x, e.x),
- this.y = Math.max(this.y, e.y),
- this
- },
- clamp: function(e, t) {
- return this.x = Math.max(e.x, Math.min(t.x, this.x)),
- this.y = Math.max(e.y, Math.min(t.y, this.y)),
- this
- },
- clampScalar: function(e, t) {
- return void 0 === Ne && (Ne = new Ci.Vector2,
- Fe = new Ci.Vector2),
- Ne.set(e, e),
- Fe.set(t, t),
- this.clamp(Ne, Fe)
- },
- clampLength: function(e, t) {
- var i = this.length();
- return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
- this
- },
- floor: function() {
- return this.x = Math.floor(this.x),
- this.y = Math.floor(this.y),
- this
- },
- ceil: function() {
- return this.x = Math.ceil(this.x),
- this.y = Math.ceil(this.y),
- this
- },
- round: function() {
- return this.x = Math.round(this.x),
- this.y = Math.round(this.y),
- this
- },
- roundToZero: function() {
- return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
- this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
- this
- },
- negate: function() {
- return this.x = -this.x,
- this.y = -this.y,
- this
- },
- dot: function(e) {
- return this.x * e.x + this.y * e.y
- },
- lengthSq: function() {
- return this.x * this.x + this.y * this.y
- },
- length: function() {
- return Math.sqrt(this.x * this.x + this.y * this.y)
- },
- lengthManhattan: function() {
- return Math.abs(this.x) + Math.abs(this.y)
- },
- normalize: function() {
- return this.divideScalar(this.length())
- },
- angle: function() {
- var e = Math.atan2(this.y, this.x);
- return e < 0 && (e += 2 * Math.PI),
- e
- },
- distanceTo: function(e) {
- return Math.sqrt(this.distanceToSquared(e))
- },
- distanceToSquared: function(e) {
- var t = this.x - e.x
- , i = this.y - e.y;
- return t * t + i * i
- },
- setLength: function(e) {
- return this.multiplyScalar(e / this.length())
- },
- lerp: function(e, t) {
- return this.x += (e.x - this.x) * t,
- this.y += (e.y - this.y) * t,
- this
- },
- lerpVectors: function(e, t, i) {
- return this.subVectors(t, e).multiplyScalar(i).add(e),
- this
- },
- equals: function(e) {
- return e.x === this.x && e.y === this.y
- },
- fromArray: function(e, t) {
- return void 0 === t && (t = 0),
- this.x = e[t],
- this.y = e[t + 1],
- this
- },
- toArray: function(e, t) {
- return void 0 === e && (e = []),
- void 0 === t && (t = 0),
- e[t] = this.x,
- e[t + 1] = this.y,
- e
- },
- fromAttribute: function(e, t, i) {
- return void 0 === i && (i = 0),
- t = t * e.itemSize + i,
- this.x = e.array[t],
- this.y = e.array[t + 1],
- this
- },
- rotateAround: function(e, t) {
- var i = Math.cos(t)
- , n = Math.sin(t)
- , r = this.x - e.x
- , o = this.y - e.y;
- return this.x = r * i - o * n + e.x,
- this.y = r * n + o * i + e.y,
- this
- }
- },
- Ci.Vector3 = function(e, t, i) {
- this.x = e || 0,
- this.y = t || 0,
- this.z = i || 0
- }
- ,
- Ci.Vector3.prototype = {
- constructor: Ci.Vector3,
- set: function(e, t, i) {
- return this.x = e,
- this.y = t,
- this.z = i,
- this
- },
- setScalar: function(e) {
- return this.x = e,
- this.y = e,
- this.z = e,
- this
- },
- setX: function(e) {
- return this.x = e,
- this
- },
- setY: function(e) {
- return this.y = e,
- this
- },
- setZ: function(e) {
- return this.z = e,
- this
- },
- setComponent: function(e, t) {
- switch (e) {
- case 0:
- this.x = t;
- break;
- case 1:
- this.y = t;
- break;
- case 2:
- this.z = t;
- break;
- default:
- throw new Error("index is out of range: " + e)
- }
- },
- getComponent: function(e) {
- switch (e) {
- case 0:
- return this.x;
- case 1:
- return this.y;
- case 2:
- return this.z;
- default:
- throw new Error("index is out of range: " + e)
- }
- },
- clone: function() {
- return new this.constructor(this.x,this.y,this.z)
- },
- copy: function(e) {
- return this.x = e.x,
- this.y = e.y,
- this.z = e.z,
- this
- },
- add: function(e, t) {
- return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
- this.addVectors(e, t)) : (this.x += e.x,
- this.y += e.y,
- this.z += e.z,
- this)
- },
- addScalar: function(e) {
- return this.x += e,
- this.y += e,
- this.z += e,
- this
- },
- addVectors: function(e, t) {
- return this.x = e.x + t.x,
- this.y = e.y + t.y,
- this.z = e.z + t.z,
- this
- },
- addScaledVector: function(e, t) {
- return this.x += e.x * t,
- this.y += e.y * t,
- this.z += e.z * t,
- this
- },
- sub: function(e, t) {
- return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
- this.subVectors(e, t)) : (this.x -= e.x,
- this.y -= e.y,
- this.z -= e.z,
- this)
- },
- subScalar: function(e) {
- return this.x -= e,
- this.y -= e,
- this.z -= e,
- this
- },
- subVectors: function(e, t) {
- return this.x = e.x - t.x,
- this.y = e.y - t.y,
- this.z = e.z - t.z,
- this
- },
- multiply: function(e, t) {
- return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
- this.multiplyVectors(e, t)) : (this.x *= e.x,
- this.y *= e.y,
- this.z *= e.z,
- this)
- },
- multiplyScalar: function(e) {
- return isFinite(e) ? (this.x *= e,
- this.y *= e,
- this.z *= e) : (this.x = 0,
- this.y = 0,
- this.z = 0),
- this
- },
- multiplyVectors: function(e, t) {
- return this.x = e.x * t.x,
- this.y = e.y * t.y,
- this.z = e.z * t.z,
- this
- },
- applyEuler: function(e) {
- return e instanceof Ci.Euler == 0 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
- void 0 === De && (De = new Ci.Quaternion),
- this.applyQuaternion(De.setFromEuler(e)),
- this
- },
- applyAxisAngle: function(e, t) {
- return void 0 === Le && (Le = new Ci.Quaternion),
- this.applyQuaternion(Le.setFromAxisAngle(e, t)),
- this
- },
- applyMatrix3: function(e) {
- var t = this.x
- , i = this.y
- , n = this.z
- , r = e.elements;
- return this.x = r[0] * t + r[3] * i + r[6] * n,
- this.y = r[1] * t + r[4] * i + r[7] * n,
- this.z = r[2] * t + r[5] * i + r[8] * n,
- this
- },
- applyMatrix4: function(e) {
- var t = this.x
- , i = this.y
- , n = this.z
- , r = e.elements;
- return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
- this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
- this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
- this
- },
- applyProjection: function(e) {
- var t = this.x
- , i = this.y
- , n = this.z
- , r = e.elements
- , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
- return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
- this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
- this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
- this
- },
- applyQuaternion: function(e) {
- var t = this.x
- , i = this.y
- , n = this.z
- , r = e.x
- , o = e.y
- , a = e.z
- , s = e.w
- , l = s * t + o * n - a * i
- , c = s * i + a * t - r * n
- , h = s * n + r * i - o * t
- , u = -r * t - o * i - a * n;
- return this.x = l * s + u * -r + c * -a - h * -o,
- this.y = c * s + u * -o + h * -r - l * -a,
- this.z = h * s + u * -a + l * -o - c * -r,
- this
- },
- project: function(e) {
- return void 0 === Oe && (Oe = new Ci.Matrix4),
- Oe.multiplyMatrices(e.projectionMatrix, Oe.getInverse(e.matrixWorld)),
- this.applyProjection(Oe)
- },
- unproject: function(e) {
- return void 0 === Pe && (Pe = new Ci.Matrix4),
- Pe.multiplyMatrices(e.matrixWorld, Pe.getInverse(e.projectionMatrix)),
- this.applyProjection(Pe)
- },
- transformDirection: function(e) {
- var t = this.x
- , i = this.y
- , n = this.z
- , r = e.elements;
- return this.x = r[0] * t + r[4] * i + r[8] * n,
- this.y = r[1] * t + r[5] * i + r[9] * n,
- this.z = r[2] * t + r[6] * i + r[10] * n,
- this.normalize(),
- this
- },
- divide: function(e) {
- return this.x /= e.x,
- this.y /= e.y,
- this.z /= e.z,
- this
- },
- divideScalar: function(e) {
- return this.multiplyScalar(1 / e)
- },
- min: function(e) {
- return this.x = Math.min(this.x, e.x),
- this.y = Math.min(this.y, e.y),
- this.z = Math.min(this.z, e.z),
- this
- },
- max: function(e) {
- return this.x = Math.max(this.x, e.x),
- this.y = Math.max(this.y, e.y),
- this.z = Math.max(this.z, e.z),
- this
- },
- clamp: function(e, t) {
- return this.x = Math.max(e.x, Math.min(t.x, this.x)),
- this.y = Math.max(e.y, Math.min(t.y, this.y)),
- this.z = Math.max(e.z, Math.min(t.z, this.z)),
- this
- },
- clampScalar: function(e, t) {
- return void 0 === Me && (Me = new Ci.Vector3,
- Re = new Ci.Vector3),
- Me.set(e, e, e),
- Re.set(t, t, t),
- this.clamp(Me, Re)
- },
- clampLength: function(e, t) {
- var i = this.length();
- return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
- this
- },
- floor: function() {
- return this.x = Math.floor(this.x),
- this.y = Math.floor(this.y),
- this.z = Math.floor(this.z),
- this
- },
- ceil: function() {
- return this.x = Math.ceil(this.x),
- this.y = Math.ceil(this.y),
- this.z = Math.ceil(this.z),
- this
- },
- round: function() {
- return this.x = Math.round(this.x),
- this.y = Math.round(this.y),
- this.z = Math.round(this.z),
- this
- },
- roundToZero: function() {
- return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
- this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
- this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
- this
- },
- negate: function() {
- return this.x = -this.x,
- this.y = -this.y,
- this.z = -this.z,
- this
- },
- dot: function(e) {
- return this.x * e.x + this.y * e.y + this.z * e.z
- },
- lengthSq: function() {
- return this.x * this.x + this.y * this.y + this.z * this.z
- },
- length: function() {
- return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
- },
- lengthManhattan: function() {
- return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
- },
- normalize: function() {
- return this.divideScalar(this.length())
- },
- setLength: function(e) {
- return this.multiplyScalar(e / this.length())
- },
- lerp: function(e, t) {
- return this.x += (e.x - this.x) * t,
- this.y += (e.y - this.y) * t,
- this.z += (e.z - this.z) * t,
- this
- },
- lerpVectors: function(e, t, i) {
- return this.subVectors(t, e).multiplyScalar(i).add(e),
- this
- },
- cross: function(e, t) {
- if (void 0 !== t)
- return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
- this.crossVectors(e, t);
- var i = this.x
- , n = this.y
- , r = this.z;
- return this.x = n * e.z - r * e.y,
- this.y = r * e.x - i * e.z,
- this.z = i * e.y - n * e.x,
- this
- },
- crossVectors: function(e, t) {
- var i = e.x
- , n = e.y
- , r = e.z
- , o = t.x
- , a = t.y
- , s = t.z;
- return this.x = n * s - r * a,
- this.y = r * o - i * s,
- this.z = i * a - n * o,
- this
- },
- projectOnVector: function(e) {
- return void 0 === xe && (xe = new Ci.Vector3),
- xe.copy(e).normalize(),
- Se = this.dot(xe),
- this.copy(xe).multiplyScalar(Se)
- },
- projectOnPlane: function(e) {
- return void 0 === Te && (Te = new Ci.Vector3),
- Te.copy(this).projectOnVector(e),
- this.sub(Te)
- },
- reflect: function(e) {
- return void 0 === we && (we = new Ci.Vector3),
- this.sub(we.copy(e).multiplyScalar(2 * this.dot(e)))
- },
- angleTo: function(e) {
- var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
- return Math.acos(Ci.Math.clamp(t, -1, 1))
- },
- distanceTo: function(e) {
- return Math.sqrt(this.distanceToSquared(e))
- },
- distanceToSquared: function(e) {
- var t = this.x - e.x
- , i = this.y - e.y
- , n = this.z - e.z;
- return t * t + i * i + n * n
- },
- setFromSpherical: function(e) {
- var t = Math.sin(e.phi) * e.radius;
- return this.x = t * Math.sin(e.theta),
- this.y = Math.cos(e.phi) * e.radius,
- this.z = t * Math.cos(e.theta),
- this
- },
- setFromMatrixPosition: function(e) {
- return this.setFromMatrixColumn(e, 3)
- },
- setFromMatrixScale: function(e) {
- var t = this.setFromMatrixColumn(e, 0).length()
- , i = this.setFromMatrixColumn(e, 1).length()
- , n = this.setFromMatrixColumn(e, 2).length();
- return this.x = t,
- this.y = i,
- this.z = n,
- this
- },
- setFromMatrixColumn: function(e, t) {
- return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
- t = e = t),
- this.fromArray(e.elements, 4 * t)
- },
- equals: function(e) {
- return e.x === this.x && e.y === this.y && e.z === this.z
- },
- fromArray: function(e, t) {
- return void 0 === t && (t = 0),
- this.x = e[t],
- this.y = e[t + 1],
- this.z = e[t + 2],
- this
- },
- toArray: function(e, t) {
- return void 0 === e && (e = []),
- void 0 === t && (t = 0),
- e[t] = this.x,
- e[t + 1] = this.y,
- e[t + 2] = this.z,
- e
- },
- fromAttribute: function(e, t, i) {
- return void 0 === i && (i = 0),
- t = t * e.itemSize + i,
- this.x = e.array[t],
- this.y = e.array[t + 1],
- this.z = e.array[t + 2],
- this
- }
- },
- Ci.Vector4 = function(e, t, i, n) {
- this.x = e || 0,
- this.y = t || 0,
- this.z = i || 0,
- this.w = void 0 !== n ? n : 1
- }
- ,
- Ci.Vector4.prototype = {
- constructor: Ci.Vector4,
- set: function(e, t, i, n) {
- return this.x = e,
- this.y = t,
- this.z = i,
- this.w = n,
- this
- },
- setScalar: function(e) {
- return this.x = e,
- this.y = e,
- this.z = e,
- this.w = e,
- this
- },
- setX: function(e) {
- return this.x = e,
- this
- },
- setY: function(e) {
- return this.y = e,
- this
- },
- setZ: function(e) {
- return this.z = e,
- this
- },
- setW: function(e) {
- return this.w = e,
- this
- },
- setComponent: function(e, t) {
- switch (e) {
- case 0:
- this.x = t;
- break;
- case 1:
- this.y = t;
- break;
- case 2:
- this.z = t;
- break;
- case 3:
- this.w = t;
- break;
- default:
- throw new Error("index is out of range: " + e)
- }
- },
- getComponent: function(e) {
- switch (e) {
- case 0:
- return this.x;
- case 1:
- return this.y;
- case 2:
- return this.z;
- case 3:
- return this.w;
- default:
- throw new Error("index is out of range: " + e)
- }
- },
- clone: function() {
- return new this.constructor(this.x,this.y,this.z,this.w)
- },
- copy: function(e) {
- return this.x = e.x,
- this.y = e.y,
- this.z = e.z,
- this.w = void 0 !== e.w ? e.w : 1,
- this
- },
- add: function(e, t) {
- return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
- this.addVectors(e, t)) : (this.x += e.x,
- this.y += e.y,
- this.z += e.z,
- this.w += e.w,
- this)
- },
- addScalar: function(e) {
- return this.x += e,
- this.y += e,
- this.z += e,
- this.w += e,
- this
- },
- addVectors: function(e, t) {
- return this.x = e.x + t.x,
- this.y = e.y + t.y,
- this.z = e.z + t.z,
- this.w = e.w + t.w,
- this
- },
- addScaledVector: function(e, t) {
- return this.x += e.x * t,
- this.y += e.y * t,
- this.z += e.z * t,
- this.w += e.w * t,
- this
- },
- sub: function(e, t) {
- return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
- this.subVectors(e, t)) : (this.x -= e.x,
- this.y -= e.y,
- this.z -= e.z,
- this.w -= e.w,
- this)
- },
- subScalar: function(e) {
- return this.x -= e,
- this.y -= e,
- this.z -= e,
- this.w -= e,
- this
- },
- subVectors: function(e, t) {
- return this.x = e.x - t.x,
- this.y = e.y - t.y,
- this.z = e.z - t.z,
- this.w = e.w - t.w,
- this
- },
- multiplyScalar: function(e) {
- return isFinite(e) ? (this.x *= e,
- this.y *= e,
- this.z *= e,
- this.w *= e) : (this.x = 0,
- this.y = 0,
- this.z = 0,
- this.w = 0),
- this
- },
- applyMatrix4: function(e) {
- var t = this.x
- , i = this.y
- , n = this.z
- , r = this.w
- , o = e.elements;
- return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
- this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
- this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
- this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
- this
- },
- divideScalar: function(e) {
- return this.multiplyScalar(1 / e)
- },
- setAxisAngleFromQuaternion: function(e) {
- this.w = 2 * Math.acos(e.w);
- var t = Math.sqrt(1 - e.w * e.w);
- return t < 1e-4 ? (this.x = 1,
- this.y = 0,
- this.z = 0) : (this.x = e.x / t,
- this.y = e.y / t,
- this.z = e.z / t),
- this
- },
- setAxisAngleFromRotationMatrix: function(e) {
- 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];
- if (Math.abs(s - c) < .01 && Math.abs(l - d) < .01 && Math.abs(u - p) < .01) {
- if (Math.abs(s + c) < .1 && Math.abs(l + d) < .1 && Math.abs(u + p) < .1 && Math.abs(a + h + f - 3) < .1)
- return this.set(1, 0, 0, 0),
- this;
- t = Math.PI;
- var g = (a + 1) / 2
- , m = (h + 1) / 2
- , v = (f + 1) / 2
- , y = (s + c) / 4
- , A = (l + d) / 4
- , C = (u + p) / 4;
- return m < g && v < g ? r = g < .01 ? (i = 0,
- n = .707106781) : (n = y / (i = Math.sqrt(g)),
- A / i) : v < m ? r = m < .01 ? (n = 0,
- i = .707106781) : (i = y / (n = Math.sqrt(m)),
- C / n) : v < .01 ? (n = i = .707106781,
- r = 0) : (i = A / (r = Math.sqrt(v)),
- n = C / r),
- this.set(i, n, r, t),
- this
- }
- var I = Math.sqrt((p - u) * (p - u) + (l - d) * (l - d) + (c - s) * (c - s));
- return Math.abs(I) < .001 && (I = 1),
- this.x = (p - u) / I,
- this.y = (l - d) / I,
- this.z = (c - s) / I,
- this.w = Math.acos((a + h + f - 1) / 2),
- this
- },
- min: function(e) {
- return this.x = Math.min(this.x, e.x),
- this.y = Math.min(this.y, e.y),
- this.z = Math.min(this.z, e.z),
- this.w = Math.min(this.w, e.w),
- this
- },
- max: function(e) {
- return this.x = Math.max(this.x, e.x),
- this.y = Math.max(this.y, e.y),
- this.z = Math.max(this.z, e.z),
- this.w = Math.max(this.w, e.w),
- this
- },
- clamp: function(e, t) {
- return this.x = Math.max(e.x, Math.min(t.x, this.x)),
- this.y = Math.max(e.y, Math.min(t.y, this.y)),
- this.z = Math.max(e.z, Math.min(t.z, this.z)),
- this.w = Math.max(e.w, Math.min(t.w, this.w)),
- this
- },
- clampScalar: function(e, t) {
- return void 0 === _e && (_e = new Ci.Vector4,
- be = new Ci.Vector4),
- _e.set(e, e, e, e),
- be.set(t, t, t, t),
- this.clamp(_e, be)
- },
- floor: function() {
- return this.x = Math.floor(this.x),
- this.y = Math.floor(this.y),
- this.z = Math.floor(this.z),
- this.w = Math.floor(this.w),
- this
- },
- ceil: function() {
- return this.x = Math.ceil(this.x),
- this.y = Math.ceil(this.y),
- this.z = Math.ceil(this.z),
- this.w = Math.ceil(this.w),
- this
- },
- round: function() {
- return this.x = Math.round(this.x),
- this.y = Math.round(this.y),
- this.z = Math.round(this.z),
- this.w = Math.round(this.w),
- this
- },
- roundToZero: function() {
- return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
- this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
- this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
- this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
- this
- },
- negate: function() {
- return this.x = -this.x,
- this.y = -this.y,
- this.z = -this.z,
- this.w = -this.w,
- this
- },
- dot: function(e) {
- return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
- },
- lengthSq: function() {
- return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
- },
- length: function() {
- return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
- },
- lengthManhattan: function() {
- return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
- },
- normalize: function() {
- return this.divideScalar(this.length())
- },
- setLength: function(e) {
- return this.multiplyScalar(e / this.length())
- },
- lerp: function(e, t) {
- return this.x += (e.x - this.x) * t,
- this.y += (e.y - this.y) * t,
- this.z += (e.z - this.z) * t,
- this.w += (e.w - this.w) * t,
- this
- },
- lerpVectors: function(e, t, i) {
- return this.subVectors(t, e).multiplyScalar(i).add(e),
- this
- },
- equals: function(e) {
- return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
- },
- fromArray: function(e, t) {
- return void 0 === t && (t = 0),
- this.x = e[t],
- this.y = e[t + 1],
- this.z = e[t + 2],
- this.w = e[t + 3],
- this
- },
- toArray: function(e, t) {
- return void 0 === e && (e = []),
- void 0 === t && (t = 0),
- e[t] = this.x,
- e[t + 1] = this.y,
- e[t + 2] = this.z,
- e[t + 3] = this.w,
- e
- },
- fromAttribute: function(e, t, i) {
- return void 0 === i && (i = 0),
- t = t * e.itemSize + i,
- this.x = e.array[t],
- this.y = e.array[t + 1],
- this.z = e.array[t + 2],
- this.w = e.array[t + 3],
- this
- }
- },
- Ci.Euler = function(e, t, i, n) {
- this._x = e || 0,
- this._y = t || 0,
- this._z = i || 0,
- this._order = n || Ci.Euler.DefaultOrder
- }
- ,
- Ci.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
- Ci.Euler.DefaultOrder = "XYZ",
- Ci.Euler.prototype = {
- constructor: Ci.Euler,
- get x() {
- return this._x
- },
- set x(e) {
- this._x = e,
- this.onChangeCallback()
- },
- get y() {
- return this._y
- },
- set y(e) {
- this._y = e,
- this.onChangeCallback()
- },
- get z() {
- return this._z
- },
- set z(e) {
- this._z = e,
- this.onChangeCallback()
- },
- get order() {
- return this._order
- },
- set order(e) {
- this._order = e,
- this.onChangeCallback()
- },
- set: function(e, t, i, n) {
- return this._x = e,
- this._y = t,
- this._z = i,
- this._order = n || this._order,
- this.onChangeCallback(),
- this
- },
- clone: function() {
- return new this.constructor(this._x,this._y,this._z,this._order)
- },
- copy: function(e) {
- return this._x = e._x,
- this._y = e._y,
- this._z = e._z,
- this._order = e._order,
- this.onChangeCallback(),
- this
- },
- toObject: function() {//xzw
- return {x:this.x,y:this.y,z:this.z}
- },
- setFromRotationMatrix: function(e, t, i) {
- var n = Ci.Math.clamp
- , r = e.elements
- , o = r[0]
- , a = r[4]
- , s = r[8]
- , l = r[1]
- , c = r[5]
- , h = r[9]
- , u = r[2]
- , d = r[6]
- , p = r[10];
- return "XYZ" === (t = t || this._order) ? (this._y = Math.asin(n(s, -1, 1)),
- Math.abs(s) < .99999 ? (this._x = Math.atan2(-h, p),
- this._z = Math.atan2(-a, o)) : (this._x = Math.atan2(d, c),
- this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-n(h, -1, 1)),
- Math.abs(h) < .99999 ? (this._y = Math.atan2(s, p),
- this._z = Math.atan2(l, c)) : (this._y = Math.atan2(-u, o),
- this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(n(d, -1, 1)),
- Math.abs(d) < .99999 ? (this._y = Math.atan2(-u, p),
- this._z = Math.atan2(-a, c)) : (this._y = 0,
- this._z = Math.atan2(l, o))) : "ZYX" === t ? (this._y = Math.asin(-n(u, -1, 1)),
- Math.abs(u) < .99999 ? (this._x = Math.atan2(d, p),
- this._z = Math.atan2(l, o)) : (this._x = 0,
- this._z = Math.atan2(-a, c))) : "YZX" === t ? (this._z = Math.asin(n(l, -1, 1)),
- Math.abs(l) < .99999 ? (this._x = Math.atan2(-h, c),
- this._y = Math.atan2(-u, o)) : (this._x = 0,
- this._y = Math.atan2(s, p))) : "XZY" === t ? (this._z = Math.asin(-n(a, -1, 1)),
- Math.abs(a) < .99999 ? (this._x = Math.atan2(d, c),
- this._y = Math.atan2(s, o)) : (this._x = Math.atan2(-h, p),
- this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
- this._order = t,
- !1 !== i && this.onChangeCallback(),
- this
- },
- setFromQuaternion: function(e, t, i) {
- return void 0 === Ee && (Ee = new Ci.Matrix4),
- Ee.makeRotationFromQuaternion(e),
- this.setFromRotationMatrix(Ee, t, i),
- this
- },
- setFromVector3: function(e, t) {
- return this.set(e.x, e.y, e.z, t || this._order)
- },
- reorder: (Ie = new Ci.Quaternion,
- function(e) {
- Ie.setFromEuler(this),
- this.setFromQuaternion(Ie, e)
- }
- ),
- equals: function(e) {
- return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
- },
- fromArray: function(e) {
- return this._x = e[0],
- this._y = e[1],
- this._z = e[2],
- void 0 !== e[3] && (this._order = e[3]),
- this.onChangeCallback(),
- this
- },
- toArray: function(e, t) {
- return void 0 === e && (e = []),
- void 0 === t && (t = 0),
- e[t] = this._x,
- e[t + 1] = this._y,
- e[t + 2] = this._z,
- e[t + 3] = this._order,
- e
- },
- toVector3: function(e) {
- return e ? e.set(this._x, this._y, this._z) : new Ci.Vector3(this._x,this._y,this._z)
- },
- onChange: function(e) {
- return this.onChangeCallback = e,
- this
- },
- onChangeCallback: function() {}
- },
- Ci.Line3 = function(e, t) {
- this.start = void 0 !== e ? e : new Ci.Vector3,
- this.end = void 0 !== t ? t : new Ci.Vector3
- }
- ,
- Ci.Line3.prototype = {
- constructor: Ci.Line3,
- set: function(e, t) {
- return this.start.copy(e),
- this.end.copy(t),
- this
- },
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- return this.start.copy(e.start),
- this.end.copy(e.end),
- this
- },
- center: function(e) {
- return (e || new Ci.Vector3).addVectors(this.start, this.end).multiplyScalar(.5)
- },
- delta: function(e) {
- return (e || new Ci.Vector3).subVectors(this.end, this.start)
- },
- distanceSq: function() {
- return this.start.distanceToSquared(this.end)
- },
- distance: function() {
- return this.start.distanceTo(this.end)
- },
- at: function(e, t) {
- var i = t || new Ci.Vector3;
- return this.delta(i).multiplyScalar(e).add(this.start)
- },
- closestPointToPointParameter: (Ae = new Ci.Vector3,
- Ce = new Ci.Vector3,
- function(e, t) {
- Ae.subVectors(e, this.start),
- Ce.subVectors(this.end, this.start);
- var i = Ce.dot(Ce)
- , n = Ce.dot(Ae) / i;
- return t && (n = Ci.Math.clamp(n, 0, 1)),
- n
- }
- ),
- closestPointToPoint: function(e, t, i) {
- var n = this.closestPointToPointParameter(e, t)
- , r = i || new Ci.Vector3;
- return this.delta(r).multiplyScalar(n).add(this.start)
- },
- applyMatrix4: function(e) {
- return this.start.applyMatrix4(e),
- this.end.applyMatrix4(e),
- this
- },
- equals: function(e) {
- return e.start.equals(this.start) && e.end.equals(this.end)
- }
- },
- Ci.Box2 = function(e, t) {
- this.min = void 0 !== e ? e : new Ci.Vector2(1 / 0,1 / 0),
- this.max = void 0 !== t ? t : new Ci.Vector2(-1 / 0,-1 / 0)
- }
- ,
- Ci.Box2.prototype = {
- constructor: Ci.Box2,
- set: function(e, t) {
- return this.min.copy(e),
- this.max.copy(t),
- this
- },
- setFromPoints: function(e) {
- this.makeEmpty();
- for (var t = 0, i = e.length; t < i; t++)
- this.expandByPoint(e[t]);
- return this
- },
- setFromCenterAndSize: (ye = new Ci.Vector2,
- function(e, t) {
- var i = ye.copy(t).multiplyScalar(.5);
- return this.min.copy(e).sub(i),
- this.max.copy(e).add(i),
- this
- }
- ),
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- return this.min.copy(e.min),
- this.max.copy(e.max),
- this
- },
- makeEmpty: function() {
- return this.min.x = this.min.y = 1 / 0,
- this.max.x = this.max.y = -1 / 0,
- this
- },
- isEmpty: function() {
- return this.max.x < this.min.x || this.max.y < this.min.y
- },
- center: function(e) {
- return (e || new Ci.Vector2).addVectors(this.min, this.max).multiplyScalar(.5)
- },
- size: function(e) {
- return (e || new Ci.Vector2).subVectors(this.max, this.min)
- },
- expandByPoint: function(e) {
- return this.min.min(e),
- this.max.max(e),
- this
- },
- expandByVector: function(e) {
- return this.min.sub(e),
- this.max.add(e),
- this
- },
- expandByScalar: function(e) {
- return this.min.addScalar(-e),
- this.max.addScalar(e),
- this
- },
- containsPoint: function(e) {
- return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
- },
- containsBox: function(e) {
- 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
- },
- getParameter: function(e, t) {
- 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))
- },
- intersectsBox: function(e) {
- 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)
- },
- clampPoint: function(e, t) {
- return (t || new Ci.Vector2).copy(e).clamp(this.min, this.max)
- },
- distanceToPoint: (ve = new Ci.Vector2,
- function(e) {
- return ve.copy(e).clamp(this.min, this.max).sub(e).length()
- }
- ),
- intersect: function(e) {
- return this.min.max(e.min),
- this.max.min(e.max),
- this
- },
- union: function(e) {
- return this.min.min(e.min),
- this.max.max(e.max),
- this
- },
- translate: function(e) {
- return this.min.add(e),
- this.max.add(e),
- this
- },
- equals: function(e) {
- return e.min.equals(this.min) && e.max.equals(this.max)
- }
- },
- Ci.Box3 = function(e, t) {
- this.min = void 0 !== e ? e : new Ci.Vector3(1 / 0,1 / 0,1 / 0),
- this.max = void 0 !== t ? t : new Ci.Vector3(-1 / 0,-1 / 0,-1 / 0)
- }
- ,
- Ci.Box3.prototype = {
- constructor: Ci.Box3,
- set: function(e, t) {
- return this.min.copy(e),
- this.max.copy(t),
- this
- },
- setFromArray: function(e) {
- this.makeEmpty();
- 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) {
- var c = e[s]
- , h = e[s + 1]
- , u = e[s + 2];
- c < t && (t = c),
- h < i && (i = h),
- u < n && (n = u),
- r < c && (r = c),
- o < h && (o = h),
- a < u && (a = u)
- }
- this.min.set(t, i, n),
- this.max.set(r, o, a)
- },
- setFromPoints: function(e) {
- this.makeEmpty();
- for (var t = 0, i = e.length; t < i; t++)
- this.expandByPoint(e[t]);
- return this
- },
- setFromCenterAndSize: (me = new Ci.Vector3,
- function(e, t) {
- var i = me.copy(t).multiplyScalar(.5);
- return this.min.copy(e).sub(i),
- this.max.copy(e).add(i),
- this
- }
- ),
- setFromObject: function(e) {
- void 0 === ge && (ge = new Ci.Box3);
- var i = this;
- return this.makeEmpty(),
- e.updateMatrixWorld(!0),
- e.traverse(function(e) {
- var t = e.geometry;
- void 0 !== t && (null === t.boundingBox && t.computeBoundingBox(),
- !1 === t.boundingBox.isEmpty() && (ge.copy(t.boundingBox),
- ge.applyMatrix4(e.matrixWorld),
- i.union(ge)))
- }),
- this
- },
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- return this.min.copy(e.min),
- this.max.copy(e.max),
- this
- },
- makeEmpty: function() {
- return this.min.x = this.min.y = this.min.z = 1 / 0,
- this.max.x = this.max.y = this.max.z = -1 / 0,
- this
- },
- isEmpty: function() {
- return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
- },
- center: function(e) {
- return (e || new Ci.Vector3).addVectors(this.min, this.max).multiplyScalar(.5)
- },
- size: function(e) {
- return (e || new Ci.Vector3).subVectors(this.max, this.min)
- },
- expandByPoint: function(e) {
- return this.min.min(e),
- this.max.max(e),
- this
- },
- expandByVector: function(e) {
- return this.min.sub(e),
- this.max.add(e),
- this
- },
- expandByScalar: function(e) {
- return this.min.addScalar(-e),
- this.max.addScalar(e),
- this
- },
- containsPoint: function(e) {
- 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)
- },
- containsBox: function(e) {
- 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
- },
- getParameter: function(e, t) {
- 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))
- },
- intersectsBox: function(e) {
- 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)
- },
- intersectsSphere: function(e) {
- return void 0 === fe && (fe = new Ci.Vector3),
- this.clampPoint(e.center, fe),
- fe.distanceToSquared(e.center) <= e.radius * e.radius
- },
- intersectsPlane: function(e) {
- var t, i;
- return i = 0 < e.normal.x ? (t = e.normal.x * this.min.x,
- e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
- e.normal.x * this.min.x),
- 0 < e.normal.y ? (t += e.normal.y * this.min.y,
- i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
- i += e.normal.y * this.min.y),
- 0 < e.normal.z ? (t += e.normal.z * this.min.z,
- i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
- i += e.normal.z * this.min.z),
- t <= e.constant && i >= e.constant
- },
- clampPoint: function(e, t) {
- return (t || new Ci.Vector3).copy(e).clamp(this.min, this.max)
- },
- distanceToPoint: (pe = new Ci.Vector3,
- function(e) {
- return pe.copy(e).clamp(this.min, this.max).sub(e).length()
- }
- ),
- getBoundingSphere: (de = new Ci.Vector3,
- function(e) {
- var t = e || new Ci.Sphere;
- return t.center = this.center(),
- t.radius = .5 * this.size(de).length(),
- t
- }
- ),
- intersect: function(e) {
- return this.min.max(e.min),
- this.max.min(e.max),
- this
- },
- union: function(e) {
- return this.min.min(e.min),
- this.max.max(e.max),
- this
- },
- 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],
- function(e) {
- return ue[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e),
- ue[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e),
- ue[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e),
- ue[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e),
- ue[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e),
- ue[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e),
- ue[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e),
- ue[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e),
- this.makeEmpty(),
- this.setFromPoints(ue),
- this
- }
- ),
- translate: function(e) {
- return this.min.add(e),
- this.max.add(e),
- this
- },
- equals: function(e) {
- return e.min.equals(this.min) && e.max.equals(this.max)
- }
- },
- Ci.Matrix3 = function() {
- this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
- 0 < arguments.length && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
- }
- ,
- Ci.Matrix3.prototype = {
- constructor: Ci.Matrix3,
- set: function(e, t, i, n, r, o, a, s, l) {
- var c = this.elements;
- return c[0] = e,
- c[1] = n,
- c[2] = a,
- c[3] = t,
- c[4] = r,
- c[5] = s,
- c[6] = i,
- c[7] = o,
- c[8] = l,
- this
- },
- identity: function() {
- return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
- this
- },
- clone: function() {
- return (new this.constructor).fromArray(this.elements)
- },
- copy: function(e) {
- var t = e.elements;
- return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
- this
- },
- setFromMatrix4: function(e) {
- var t = e.elements;
- return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
- this
- },
- applyToVector3Array: function(e, t, i) {
- void 0 === he && (he = new Ci.Vector3),
- void 0 === t && (t = 0),
- void 0 === i && (i = e.length);
- for (var n = 0, r = t; n < i; n += 3,
- r += 3)
- he.fromArray(e, r),
- he.applyMatrix3(this),
- he.toArray(e, r);
- return e
- },
- applyToBuffer: function(e, t, i) {
- void 0 === ce && (ce = new Ci.Vector3),
- void 0 === t && (t = 0),
- void 0 === i && (i = e.length / e.itemSize);
- for (var n = 0, r = t; n < i; n++,
- r++)
- ce.x = e.getX(r),
- ce.y = e.getY(r),
- ce.z = e.getZ(r),
- ce.applyMatrix3(this),
- e.setXYZ(ce.x, ce.y, ce.z);
- return e
- },
- multiplyScalar: function(e) {
- var t = this.elements;
- return t[0] *= e,
- t[3] *= e,
- t[6] *= e,
- t[1] *= e,
- t[4] *= e,
- t[7] *= e,
- t[2] *= e,
- t[5] *= e,
- t[8] *= e,
- this
- },
- determinant: function() {
- var e = this.elements
- , t = e[0]
- , i = e[1]
- , n = e[2]
- , r = e[3]
- , o = e[4]
- , a = e[5]
- , s = e[6]
- , l = e[7]
- , c = e[8];
- return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
- },
- getInverse: function(e, t) {
- e instanceof Ci.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
- var i = e.elements
- , n = this.elements
- , r = i[0]
- , o = i[1]
- , a = i[2]
- , s = i[3]
- , l = i[4]
- , c = i[5]
- , h = i[6]
- , u = i[7]
- , d = i[8]
- , p = d * l - c * u
- , f = c * h - d * s
- , g = u * s - l * h
- , m = r * p + o * f + a * g;
- if (0 != m)
- return n[0] = p,
- n[1] = a * u - d * o,
- n[2] = c * o - a * l,
- n[3] = f,
- n[4] = d * r - a * h,
- n[5] = a * s - c * r,
- n[6] = g,
- n[7] = o * h - u * r,
- n[8] = l * r - o * s,
- this.multiplyScalar(1 / m);
- var v = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
- if (t)
- throw new Error(v);
- return console.warn(v),
- this.identity()
- },
- transpose: function() {
- var e, t = this.elements;
- return e = t[1],
- t[1] = t[3],
- t[3] = e,
- e = t[2],
- t[2] = t[6],
- t[6] = e,
- e = t[5],
- t[5] = t[7],
- t[7] = e,
- this
- },
- flattenToArrayOffset: function(e, t) {
- var i = this.elements;
- return e[t] = i[0],
- e[t + 1] = i[1],
- e[t + 2] = i[2],
- e[t + 3] = i[3],
- e[t + 4] = i[4],
- e[t + 5] = i[5],
- e[t + 6] = i[6],
- e[t + 7] = i[7],
- e[t + 8] = i[8],
- e
- },
- getNormalMatrix: function(e) {
- return this.setFromMatrix4(e).getInverse(this).transpose()
- },
- transposeIntoArray: function(e) {
- var t = this.elements;
- return e[0] = t[0],
- e[1] = t[3],
- e[2] = t[6],
- e[3] = t[1],
- e[4] = t[4],
- e[5] = t[7],
- e[6] = t[2],
- e[7] = t[5],
- e[8] = t[8],
- this
- },
- fromArray: function(e) {
- return this.elements.set(e),
- this
- },
- toArray: function() {
- var e = this.elements;
- return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
- }
- },
- Ci.Matrix4 = function() {
- this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
- 0 < arguments.length && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
- }
- ,
- Ci.Matrix4.prototype = {
- constructor: Ci.Matrix4,
- set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
- var m = this.elements;
- return m[0] = e,
- m[4] = t,
- m[8] = i,
- m[12] = n,
- m[1] = r,
- m[5] = o,
- m[9] = a,
- m[13] = s,
- m[2] = l,
- m[6] = c,
- m[10] = h,
- m[14] = u,
- m[3] = d,
- m[7] = p,
- m[11] = f,
- m[15] = g,
- this
- },
- identity: function() {
- return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
- this
- },
- clone: function() {
- return (new Ci.Matrix4).fromArray(this.elements)
- },
- copy: function(e) {
- return this.elements.set(e.elements),
- this
- },
- copyPosition: function(e) {
- var t = this.elements
- , i = e.elements;
- return t[12] = i[12],
- t[13] = i[13],
- t[14] = i[14],
- this
- },
- extractBasis: function(e, t, i) {
- return e.setFromMatrixColumn(this, 0),
- t.setFromMatrixColumn(this, 1),
- i.setFromMatrixColumn(this, 2),
- this
- },
- makeBasis: function(e, t, i) {
- 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),
- this
- },
- extractRotation: function(e) {
- void 0 === le && (le = new Ci.Vector3);
- var t = this.elements
- , i = e.elements
- , n = 1 / le.setFromMatrixColumn(e, 0).length()
- , r = 1 / le.setFromMatrixColumn(e, 1).length()
- , o = 1 / le.setFromMatrixColumn(e, 2).length();
- return t[0] = i[0] * n,
- t[1] = i[1] * n,
- t[2] = i[2] * n,
- t[4] = i[4] * r,
- t[5] = i[5] * r,
- t[6] = i[6] * r,
- t[8] = i[8] * o,
- t[9] = i[9] * o,
- t[10] = i[10] * o,
- this
- },
- makeRotationFromEuler: function(e) {
- e instanceof Ci.Euler == 0 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
- var t = this.elements
- , i = e.x
- , n = e.y
- , r = e.z
- , o = Math.cos(i)
- , a = Math.sin(i)
- , s = Math.cos(n)
- , l = Math.sin(n)
- , c = Math.cos(r)
- , h = Math.sin(r);
- if ("XYZ" === e.order) {
- var u = o * c
- , d = o * h
- , p = a * c
- , f = a * h;
- t[0] = s * c,
- t[4] = -s * h,
- t[8] = l,
- t[1] = d + p * l,
- t[5] = u - f * l,
- t[9] = -a * s,
- t[2] = f - u * l,
- t[6] = p + d * l,
- t[10] = o * s
- } else if ("YXZ" === e.order) {
- var g = s * c
- , m = s * h
- , v = l * c
- , y = l * h;
- t[0] = g + y * a,
- t[4] = v * a - m,
- t[8] = o * l,
- t[1] = o * h,
- t[5] = o * c,
- t[9] = -a,
- t[2] = m * a - v,
- t[6] = y + g * a,
- t[10] = o * s
- } else if ("ZXY" === e.order) {
- g = s * c,
- m = s * h,
- v = l * c,
- y = l * h;
- t[0] = g - y * a,
- t[4] = -o * h,
- t[8] = v + m * a,
- t[1] = m + v * a,
- t[5] = o * c,
- t[9] = y - g * a,
- t[2] = -o * l,
- t[6] = a,
- t[10] = o * s
- } else if ("ZYX" === e.order) {
- u = o * c,
- d = o * h,
- p = a * c,
- f = a * h;
- t[0] = s * c,
- t[4] = p * l - d,
- t[8] = u * l + f,
- t[1] = s * h,
- t[5] = f * l + u,
- t[9] = d * l - p,
- t[2] = -l,
- t[6] = a * s,
- t[10] = o * s
- } else if ("YZX" === e.order) {
- var A = o * s
- , C = o * l
- , I = a * s
- , E = a * l;
- t[0] = s * c,
- t[4] = E - A * h,
- t[8] = I * h + C,
- t[1] = h,
- t[5] = o * c,
- t[9] = -a * c,
- t[2] = -l * c,
- t[6] = C * h + I,
- t[10] = A - E * h
- } else if ("XZY" === e.order) {
- A = o * s,
- C = o * l,
- I = a * s,
- E = a * l;
- t[0] = s * c,
- t[4] = -h,
- t[8] = l * c,
- t[1] = A * h + E,
- t[5] = o * c,
- t[9] = C * h - I,
- t[2] = I * h - C,
- t[6] = a * c,
- t[10] = E * h + A
- }
- return t[3] = 0,
- t[7] = 0,
- t[11] = 0,
- t[12] = 0,
- t[13] = 0,
- t[14] = 0,
- t[15] = 1,
- this
- },
- makeRotationFromQuaternion: function(e) {
- var t = this.elements
- , i = e.x
- , n = e.y
- , r = e.z
- , o = e.w
- , a = i + i
- , s = n + n
- , l = r + r
- , c = i * a
- , h = i * s
- , u = i * l
- , d = n * s
- , p = n * l
- , f = r * l
- , g = o * a
- , m = o * s
- , v = o * l;
- return t[0] = 1 - (d + f),
- t[4] = h - v,
- t[8] = u + m,
- t[1] = h + v,
- t[5] = 1 - (c + f),
- t[9] = p - g,
- t[2] = u - m,
- t[6] = p + g,
- t[10] = 1 - (c + d),
- t[3] = 0,
- t[7] = 0,
- t[11] = 0,
- t[12] = 0,
- t[13] = 0,
- t[14] = 0,
- t[15] = 1,
- this
- },
- lookAt: function(e, t, i) {
- void 0 === oe && (oe = new Ci.Vector3),
- void 0 === ae && (ae = new Ci.Vector3),
- void 0 === se && (se = new Ci.Vector3);
- var n = this.elements;
- return se.subVectors(e, t).normalize(),
- 0 === se.lengthSq() && (se.z = 1),
- oe.crossVectors(i, se).normalize(),
- 0 === oe.lengthSq() && (se.x += 1e-4,
- oe.crossVectors(i, se).normalize()),
- ae.crossVectors(se, oe),
- n[0] = oe.x,
- n[4] = ae.x,
- n[8] = se.x,
- n[1] = oe.y,
- n[5] = ae.y,
- n[9] = se.y,
- n[2] = oe.z,
- n[6] = ae.z,
- n[10] = se.z,
- this
- },
- multiply: function(e, t) {
- return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
- this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
- },
- multiplyMatrices: function(e, t) {
- var i = e.elements
- , n = t.elements
- , r = this.elements
- , o = i[0]
- , a = i[4]
- , s = i[8]
- , l = i[12]
- , c = i[1]
- , h = i[5]
- , u = i[9]
- , d = i[13]
- , p = i[2]
- , f = i[6]
- , g = i[10]
- , m = i[14]
- , v = i[3]
- , y = i[7]
- , A = i[11]
- , C = i[15]
- , I = n[0]
- , E = n[4]
- , _ = n[8]
- , b = n[12]
- , w = n[1]
- , T = n[5]
- , x = n[9]
- , S = n[13]
- , M = n[2]
- , R = n[6]
- , P = n[10]
- , O = n[14]
- , L = n[3]
- , D = n[7]
- , N = n[11]
- , F = n[15];
- return r[0] = o * I + a * w + s * M + l * L,
- r[4] = o * E + a * T + s * R + l * D,
- r[8] = o * _ + a * x + s * P + l * N,
- r[12] = o * b + a * S + s * O + l * F,
- r[1] = c * I + h * w + u * M + d * L,
- r[5] = c * E + h * T + u * R + d * D,
- r[9] = c * _ + h * x + u * P + d * N,
- r[13] = c * b + h * S + u * O + d * F,
- r[2] = p * I + f * w + g * M + m * L,
- r[6] = p * E + f * T + g * R + m * D,
- r[10] = p * _ + f * x + g * P + m * N,
- r[14] = p * b + f * S + g * O + m * F,
- r[3] = v * I + y * w + A * M + C * L,
- r[7] = v * E + y * T + A * R + C * D,
- r[11] = v * _ + y * x + A * P + C * N,
- r[15] = v * b + y * S + A * O + C * F,
- this
- },
- multiplyToArray: function(e, t, i) {
- var n = this.elements;
- return this.multiplyMatrices(e, t),
- i[0] = n[0],
- i[1] = n[1],
- i[2] = n[2],
- i[3] = n[3],
- i[4] = n[4],
- i[5] = n[5],
- i[6] = n[6],
- i[7] = n[7],
- i[8] = n[8],
- i[9] = n[9],
- i[10] = n[10],
- i[11] = n[11],
- i[12] = n[12],
- i[13] = n[13],
- i[14] = n[14],
- i[15] = n[15],
- this
- },
- multiplyScalar: function(e) {
- var t = this.elements;
- return t[0] *= e,
- t[4] *= e,
- t[8] *= e,
- t[12] *= e,
- t[1] *= e,
- t[5] *= e,
- t[9] *= e,
- t[13] *= e,
- t[2] *= e,
- t[6] *= e,
- t[10] *= e,
- t[14] *= e,
- t[3] *= e,
- t[7] *= e,
- t[11] *= e,
- t[15] *= e,
- this
- },
- applyToVector3Array: function(e, t, i) {
- void 0 === re && (re = new Ci.Vector3),
- void 0 === t && (t = 0),
- void 0 === i && (i = e.length);
- for (var n = 0, r = t; n < i; n += 3,
- r += 3)
- re.fromArray(e, r),
- re.applyMatrix4(this),
- re.toArray(e, r);
- return e
- },
- applyToBuffer: function(e, t, i) {
- void 0 === ne && (ne = new Ci.Vector3),
- void 0 === t && (t = 0),
- void 0 === i && (i = e.length / e.itemSize);
- for (var n = 0, r = t; n < i; n++,
- r++)
- ne.x = e.getX(r),
- ne.y = e.getY(r),
- ne.z = e.getZ(r),
- ne.applyMatrix4(this),
- e.setXYZ(ne.x, ne.y, ne.z);
- return e
- },
- determinant: function() {
- var e = this.elements
- , t = e[0]
- , i = e[4]
- , n = e[8]
- , r = e[12]
- , o = e[1]
- , a = e[5]
- , s = e[9]
- , l = e[13]
- , c = e[2]
- , h = e[6]
- , u = e[10]
- , d = e[14];
- 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)
- },
- transpose: function() {
- var e, t = this.elements;
- return e = t[1],
- t[1] = t[4],
- t[4] = e,
- e = t[2],
- t[2] = t[8],
- t[8] = e,
- e = t[6],
- t[6] = t[9],
- t[9] = e,
- e = t[3],
- t[3] = t[12],
- t[12] = e,
- e = t[7],
- t[7] = t[13],
- t[13] = e,
- e = t[11],
- t[11] = t[14],
- t[14] = e,
- this
- },
- flattenToArrayOffset: function(e, t) {
- var i = this.elements;
- return e[t] = i[0],
- e[t + 1] = i[1],
- e[t + 2] = i[2],
- e[t + 3] = i[3],
- e[t + 4] = i[4],
- e[t + 5] = i[5],
- e[t + 6] = i[6],
- e[t + 7] = i[7],
- e[t + 8] = i[8],
- e[t + 9] = i[9],
- e[t + 10] = i[10],
- e[t + 11] = i[11],
- e[t + 12] = i[12],
- e[t + 13] = i[13],
- e[t + 14] = i[14],
- e[t + 15] = i[15],
- e
- },
- getPosition: function() {
- return void 0 === ie && (ie = new Ci.Vector3),
- console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
- ie.setFromMatrixColumn(this, 3)
- },
- setPosition: function(e) {
- var t = this.elements;
- return t[12] = e.x,
- t[13] = e.y,
- t[14] = e.z,
- this
- },
- getInverse: function(e, t) {
- var i = this.elements
- , n = e.elements
- , r = n[0]
- , o = n[1]
- , a = n[2]
- , s = n[3]
- , l = n[4]
- , c = n[5]
- , h = n[6]
- , u = n[7]
- , d = n[8]
- , p = n[9]
- , f = n[10]
- , g = n[11]
- , m = n[12]
- , v = n[13]
- , y = n[14]
- , A = n[15]
- , C = p * y * u - v * f * u + v * h * g - c * y * g - p * h * A + c * f * A
- , I = m * f * u - d * y * u - m * h * g + l * y * g + d * h * A - l * f * A
- , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * A + l * p * A
- , _ = m * p * h - d * v * h - m * c * f + l * v * f + d * c * y - l * p * y
- , b = r * C + o * I + a * E + s * _;
- if (0 != b)
- return i[0] = C,
- i[1] = v * f * s - p * y * s - v * a * g + o * y * g + p * a * A - o * f * A,
- i[2] = c * y * s - v * h * s + v * a * u - o * y * u - c * a * A + o * h * A,
- i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
- i[4] = I,
- i[5] = d * y * s - m * f * s + m * a * g - r * y * g - d * a * A + r * f * A,
- i[6] = m * h * s - l * y * s - m * a * u + r * y * u + l * a * A - r * h * A,
- i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
- i[8] = E,
- i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * A - r * p * A,
- i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * A + r * c * A,
- i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
- i[12] = _,
- i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * y + r * p * y,
- i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * y - r * c * y,
- i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
- this.multiplyScalar(1 / b);
- var w = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
- if (t)
- throw new Error(w);
- return console.warn(w),
- this.identity()
- },
- scale: function(e) {
- var t = this.elements
- , i = e.x
- , n = e.y
- , r = e.z;
- return t[0] *= i,
- t[4] *= n,
- t[8] *= r,
- t[1] *= i,
- t[5] *= n,
- t[9] *= r,
- t[2] *= i,
- t[6] *= n,
- t[10] *= r,
- t[3] *= i,
- t[7] *= n,
- t[11] *= r,
- this
- },
- getMaxScaleOnAxis: function() {
- var e = this.elements
- , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
- , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
- , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
- return Math.sqrt(Math.max(t, i, n))
- },
- makeTranslation: function(e, t, i) {
- return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
- this
- },
- makeRotationX: function(e) {
- var t = Math.cos(e)
- , i = Math.sin(e);
- return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
- this
- },
- makeRotationY: function(e) {
- var t = Math.cos(e)
- , i = Math.sin(e);
- return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
- this
- },
- makeRotationZ: function(e) {
- var t = Math.cos(e)
- , i = Math.sin(e);
- return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
- this
- },
- makeRotationAxis: function(e, t) {
- var i = Math.cos(t)
- , n = Math.sin(t)
- , r = 1 - i
- , o = e.x
- , a = e.y
- , s = e.z
- , l = r * o
- , c = r * a;
- 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),
- this
- },
- makeScale: function(e, t, i) {
- return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
- this
- },
- compose: function(e, t, i) {
- return this.makeRotationFromQuaternion(t),
- this.scale(i),
- this.setPosition(e),
- this
- },
- decompose: function(e, t, i) {
- void 0 === ee && (ee = new Ci.Vector3),
- void 0 === te && (te = new Ci.Matrix4);
- var n = this.elements
- , r = ee.set(n[0], n[1], n[2]).length()
- , o = ee.set(n[4], n[5], n[6]).length()
- , a = ee.set(n[8], n[9], n[10]).length();
- this.determinant() < 0 && (r = -r),
- e.x = n[12],
- e.y = n[13],
- e.z = n[14],
- te.elements.set(this.elements);
- var s = 1 / r
- , l = 1 / o
- , c = 1 / a;
- return te.elements[0] *= s,
- te.elements[1] *= s,
- te.elements[2] *= s,
- te.elements[4] *= l,
- te.elements[5] *= l,
- te.elements[6] *= l,
- te.elements[8] *= c,
- te.elements[9] *= c,
- te.elements[10] *= c,
- t.setFromRotationMatrix(te),
- i.x = r,
- i.y = o,
- i.z = a,
- this
- },
- makeFrustum: function(e, t, i, n, r, o) {
- var a = this.elements
- , s = 2 * r / (t - e)
- , l = 2 * r / (n - i)
- , c = (t + e) / (t - e)
- , h = (n + i) / (n - i)
- , u = -(o + r) / (o - r)
- , d = -2 * o * r / (o - r);
- return a[0] = s,
- a[4] = 0,
- a[8] = c,
- a[12] = 0,
- a[1] = 0,
- a[5] = l,
- a[9] = h,
- a[13] = 0,
- a[2] = 0,
- a[6] = 0,
- a[10] = u,
- a[14] = d,
- a[3] = 0,
- a[7] = 0,
- a[11] = -1,
- a[15] = 0,
- this
- },
- makePerspective: function(e, t, i, n) {
- var r = i * Math.tan(Ci.Math.degToRad(.5 * e))
- , o = -r
- , a = o * t
- , s = r * t;
- return this.makeFrustum(a, s, o, r, i, n)
- },
- makeOrthographic: function(e, t, i, n, r, o) {
- var a = this.elements
- , s = 1 / (t - e)
- , l = 1 / (i - n)
- , c = 1 / (o - r)
- , h = (t + e) * s
- , u = (i + n) * l
- , d = (o + r) * c;
- return a[0] = 2 * s,
- a[4] = 0,
- a[8] = 0,
- a[12] = -h,
- a[1] = 0,
- a[5] = 2 * l,
- a[9] = 0,
- a[13] = -u,
- a[2] = 0,
- a[6] = 0,
- a[10] = -2 * c,
- a[14] = -d,
- a[3] = 0,
- a[7] = 0,
- a[11] = 0,
- a[15] = 1,
- this
- },
- equals: function(e) {
- for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
- if (t[n] !== i[n])
- return !1;
- return !0
- },
- fromArray: function(e) {
- return this.elements.set(e),
- this
- },
- toArray: function() {
- var e = this.elements;
- 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]]
- }
- },
- Ci.Ray = function(e, t) {
- this.origin = void 0 !== e ? e : new Ci.Vector3,
- this.direction = void 0 !== t ? t : new Ci.Vector3
- }
- ,
- Ci.Ray.prototype = {
- constructor: Ci.Ray,
- set: function(e, t) {
- return this.origin.copy(e),
- this.direction.copy(t),
- this
- },
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- return this.origin.copy(e.origin),
- this.direction.copy(e.direction),
- this
- },
- at: function(e, t) {
- return (t || new Ci.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)
- },
- lookAt: function(e) {
- this.direction.copy(e).sub(this.origin).normalize()
- },
- recast: ($ = new Ci.Vector3,
- function(e) {
- return this.origin.copy(this.at(e, $)),
- this
- }
- ),
- closestPointToPoint: function(e, t) {
- var i = t || new Ci.Vector3;
- i.subVectors(e, this.origin);
- var n = i.dot(this.direction);
- return n < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(n).add(this.origin)
- },
- distanceToPoint: function(e) {
- return Math.sqrt(this.distanceSqToPoint(e))
- },
- distanceSqToPoint: (J = new Ci.Vector3,
- function(e) {
- var t = J.subVectors(e, this.origin).dot(this.direction);
- return t < 0 ? this.origin.distanceToSquared(e) : (J.copy(this.direction).multiplyScalar(t).add(this.origin),
- J.distanceToSquared(e))
- }
- ),
- distanceSqToSegment: (Z = new Ci.Vector3,
- K = new Ci.Vector3,
- Q = new Ci.Vector3,
- function(e, t, i, n) {
- Z.copy(e).add(t).multiplyScalar(.5),
- K.copy(t).sub(e).normalize(),
- Q.copy(this.origin).sub(Z);
- 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);
- if (0 < p)
- if (o = c * h - u,
- s = l * p,
- 0 <= (r = c * u - h))
- if (-s <= o)
- if (o <= s) {
- var f = 1 / p;
- a = (r *= f) * (r + c * (o *= f) + 2 * h) + o * (c * r + o + 2 * u) + d
- } else
- o = l,
- a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
- else
- o = -l,
- a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
- else
- 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,
- (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;
- else
- o = 0 < c ? -l : l,
- a = -(r = Math.max(0, -(c * o + h))) * r + o * (o + 2 * u) + d;
- return i && i.copy(this.direction).multiplyScalar(r).add(this.origin),
- n && n.copy(K).multiplyScalar(o).add(Z),
- a
- }
- ),
- intersectSphere: (X = new Ci.Vector3,
- function(e, t) {
- X.subVectors(e.center, this.origin);
- var i = X.dot(this.direction)
- , n = X.dot(X) - i * i
- , r = e.radius * e.radius;
- if (r < n)
- return null;
- var o = Math.sqrt(r - n)
- , a = i - o
- , s = i + o;
- return a < 0 && s < 0 ? null : a < 0 ? this.at(s, t) : this.at(a, t)
- }
- ),
- intersectsSphere: function(e) {
- return this.distanceToPoint(e.center) <= e.radius
- },
- distanceToPlane: function(e) {
- var t = e.normal.dot(this.direction);
- if (0 === t)
- return 0 === e.distanceToPoint(this.origin) ? 0 : null;
- var i = -(this.origin.dot(e.normal) + e.constant) / t;
- return 0 <= i ? i : null
- },
- intersectPlane: function(e, t) {
- var i = this.distanceToPlane(e);
- return null === i ? null : this.at(i, t)
- },
- intersectsPlane: function(e) {
- var t = e.distanceToPoint(this.origin);
- return 0 === t || e.normal.dot(this.direction) * t < 0
- },
- intersectBox: function(e, t) {
- 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;
- return n = 0 <= l ? (i = (e.min.x - u.x) * l,
- (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
- (e.min.x - u.x) * l),
- (o = 0 <= c ? (r = (e.min.y - u.y) * c,
- (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
- (e.min.y - u.y) * c)) < i || n < r ? null : ((i < r || i != i) && (i = r),
- (o < n || n != n) && (n = o),
- (s = 0 <= h ? (a = (e.min.z - u.z) * h,
- (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
- (e.min.z - u.z) * h)) < i || n < a ? null : ((i < a || i != i) && (i = a),
- (s < n || n != n) && (n = s),
- n < 0 ? null : this.at(0 <= i ? i : n, t)))
- },
- intersectsBox: (q = new Ci.Vector3,
- function(e) {
- return null !== this.intersectBox(e, q)
- }
- ),
- intersectTriangle: (G = new Ci.Vector3,
- W = new Ci.Vector3,
- j = new Ci.Vector3,
- Y = new Ci.Vector3,
- function(e, t, i, n, r) {
- W.subVectors(t, e),
- j.subVectors(i, e),
- Y.crossVectors(W, j);
- var o, a = this.direction.dot(Y);
- if (0 < a) {
- if (n)
- return null;
- o = 1
- } else {
- if (!(a < 0))
- return null;
- o = -1,
- a = -a
- }
- G.subVectors(this.origin, e);
- var s = o * this.direction.dot(j.crossVectors(G, j));
- if (s < 0)
- return null;
- var l = o * this.direction.dot(W.cross(G));
- if (l < 0)
- return null;
- if (a < s + l)
- return null;
- var c = -o * G.dot(Y);
- return c < 0 ? null : this.at(c / a, r)
- }
- ),
- applyMatrix4: function(e) {
- return this.direction.add(this.origin).applyMatrix4(e),
- this.origin.applyMatrix4(e),
- this.direction.sub(this.origin),
- this.direction.normalize(),
- this
- },
- equals: function(e) {
- return e.origin.equals(this.origin) && e.direction.equals(this.direction)
- }
- },
- Ci.Sphere = function(e, t) {
- this.center = void 0 !== e ? e : new Ci.Vector3,
- this.radius = void 0 !== t ? t : 0
- }
- ,
- Ci.Sphere.prototype = {
- constructor: Ci.Sphere,
- set: function(e, t) {
- return this.center.copy(e),
- this.radius = t,
- this
- },
- setFromPoints: (z = new Ci.Box3,
- function(e, t) {
- var i = this.center;
- void 0 !== t ? i.copy(t) : z.setFromPoints(e).center(i);
- for (var n = 0, r = 0, o = e.length; r < o; r++)
- n = Math.max(n, i.distanceToSquared(e[r]));
- return this.radius = Math.sqrt(n),
- this
- }
- ),
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- return this.center.copy(e.center),
- this.radius = e.radius,
- this
- },
- empty: function() {
- return this.radius <= 0
- },
- containsPoint: function(e) {
- return e.distanceToSquared(this.center) <= this.radius * this.radius
- },
- distanceToPoint: function(e) {
- return e.distanceTo(this.center) - this.radius
- },
- intersectsSphere: function(e) {
- var t = this.radius + e.radius;
- return e.center.distanceToSquared(this.center) <= t * t
- },
- intersectsBox: function(e) {
- return e.intersectsSphere(this)
- },
- intersectsPlane: function(e) {
- return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
- },
- clampPoint: function(e, t) {
- var i = this.center.distanceToSquared(e)
- , n = t || new Ci.Vector3;
- return n.copy(e),
- i > this.radius * this.radius && (n.sub(this.center).normalize(),
- n.multiplyScalar(this.radius).add(this.center)),
- n
- },
- getBoundingBox: function(e) {
- var t = e || new Ci.Box3;
- return t.set(this.center, this.center),
- t.expandByScalar(this.radius),
- t
- },
- applyMatrix4: function(e) {
- return this.center.applyMatrix4(e),
- this.radius = this.radius * e.getMaxScaleOnAxis(),
- this
- },
- translate: function(e) {
- return this.center.add(e),
- this
- },
- equals: function(e) {
- return e.center.equals(this.center) && e.radius === this.radius
- }
- },
- Ci.Frustum = function(e, t, i, n, r, o) {
- 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]
- }
- ,
- Ci.Frustum.prototype = {
- constructor: Ci.Frustum,
- set: function(e, t, i, n, r, o) {
- var a = this.planes;
- return a[0].copy(e),
- a[1].copy(t),
- a[2].copy(i),
- a[3].copy(n),
- a[4].copy(r),
- a[5].copy(o),
- this
- },
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- for (var t = this.planes, i = 0; i < 6; i++)
- t[i].copy(e.planes[i]);
- return this
- },
- setFromMatrix: function(e) {
- var t = this.planes
- , i = e.elements
- , n = i[0]
- , r = i[1]
- , o = i[2]
- , a = i[3]
- , s = i[4]
- , l = i[5]
- , c = i[6]
- , h = i[7]
- , u = i[8]
- , d = i[9]
- , p = i[10]
- , f = i[11]
- , g = i[12]
- , m = i[13]
- , v = i[14]
- , y = i[15];
- return t[0].setComponents(a - n, h - s, f - u, y - g).normalize(),
- t[1].setComponents(a + n, h + s, f + u, y + g).normalize(),
- t[2].setComponents(a + r, h + l, f + d, y + m).normalize(),
- t[3].setComponents(a - r, h - l, f - d, y - m).normalize(),
- t[4].setComponents(a - o, h - c, f - p, y - v).normalize(),
- t[5].setComponents(a + o, h + c, f + p, y + v).normalize(),
- this
- },
- intersectsObject: (H = new Ci.Sphere,
- function(e) {
- var t = e.geometry;
- return null === t.boundingSphere && t.computeBoundingSphere(),
- H.copy(t.boundingSphere),
- H.applyMatrix4(e.matrixWorld),
- this.intersectsSphere(H)
- }
- ),
- intersectsSphere: function(e) {
- for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
- if (t[r].distanceToPoint(i) < n)
- return !1
- }
- return !0
- },
- intersectsBox: (k = new Ci.Vector3,
- U = new Ci.Vector3,
- function(e) {
- for (var t = this.planes, i = 0; i < 6; i++) {
- var n = t[i];
- k.x = 0 < n.normal.x ? e.min.x : e.max.x,
- U.x = 0 < n.normal.x ? e.max.x : e.min.x,
- k.y = 0 < n.normal.y ? e.min.y : e.max.y,
- U.y = 0 < n.normal.y ? e.max.y : e.min.y,
- k.z = 0 < n.normal.z ? e.min.z : e.max.z,
- U.z = 0 < n.normal.z ? e.max.z : e.min.z;
- var r = n.distanceToPoint(k)
- , o = n.distanceToPoint(U);
- if (r < 0 && o < 0)
- return !1
- }
- return !0
- }
- ),
- containsPoint: function(e) {
- for (var t = this.planes, i = 0; i < 6; i++)
- if (t[i].distanceToPoint(e) < 0)
- return !1;
- return !0
- }
- },
- Ci.Plane = function(e, t) {
- this.normal = void 0 !== e ? e : new Ci.Vector3(1,0,0),
- this.constant = void 0 !== t ? t : 0
- }
- ,
- Ci.Plane.prototype = {
- constructor: Ci.Plane,
- set: function(e, t) {
- return this.normal.copy(e),
- this.constant = t,
- this
- },
- setComponents: function(e, t, i, n) {
- return this.normal.set(e, t, i),
- this.constant = n,
- this
- },
- setFromNormalAndCoplanarPoint: function(e, t) {
- return this.normal.copy(e),
- this.constant = -t.dot(this.normal),
- this
- },
- setFromCoplanarPoints: (B = new Ci.Vector3,
- V = new Ci.Vector3,
- function(e, t, i) {
- var n = B.subVectors(i, t).cross(V.subVectors(e, t)).normalize();
- return this.setFromNormalAndCoplanarPoint(n, e),
- this
- }
- ),
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- return this.normal.copy(e.normal),
- this.constant = e.constant,
- this
- },
- normalize: function() {
- var e = 1 / this.normal.length();
- return this.normal.multiplyScalar(e),
- this.constant *= e,
- this
- },
- negate: function() {
- return this.constant *= -1,
- this.normal.negate(),
- this
- },
- distanceToPoint: function(e) {
- return this.normal.dot(e) + this.constant
- },
- distanceToSphere: function(e) {
- return this.distanceToPoint(e.center) - e.radius
- },
- projectPoint: function(e, t) {
- return this.orthoPoint(e, t).sub(e).negate()
- },
- orthoPoint: function(e, t) {
- var i = this.distanceToPoint(e);
- return (t || new Ci.Vector3).copy(this.normal).multiplyScalar(i)
- },
- intersectLine: (F = new Ci.Vector3,
- function(e, t) {
- var i = t || new Ci.Vector3
- , n = e.delta(F)
- , r = this.normal.dot(n);
- if (0 !== r) {
- var o = -(e.start.dot(this.normal) + this.constant) / r;
- if (!(o < 0 || 1 < o))
- return i.copy(n).multiplyScalar(o).add(e.start)
- } else if (0 === this.distanceToPoint(e.start))
- return i.copy(e.start)
- }
- ),
- intersectsLine: function(e) {
- var t = this.distanceToPoint(e.start)
- , i = this.distanceToPoint(e.end);
- return t < 0 && 0 < i || i < 0 && 0 < t
- },
- intersectsBox: function(e) {
- return e.intersectsPlane(this)
- },
- intersectsSphere: function(e) {
- return e.intersectsPlane(this)
- },
- coplanarPoint: function(e) {
- return (e || new Ci.Vector3).copy(this.normal).multiplyScalar(-this.constant)
- },
- applyMatrix4: (L = new Ci.Vector3,
- D = new Ci.Vector3,
- N = new Ci.Matrix3,
- function(e, t) {
- var i = t || N.getNormalMatrix(e)
- , n = L.copy(this.normal).applyMatrix3(i)
- , r = this.coplanarPoint(D);
- return r.applyMatrix4(e),
- this.setFromNormalAndCoplanarPoint(n, r),
- this
- }
- ),
- translate: function(e) {
- return this.constant = this.constant - e.dot(this.normal),
- this
- },
- equals: function(e) {
- return e.normal.equals(this.normal) && e.constant === this.constant
- }
- },
- Ci.Spherical = function(e, t, i) {
- return this.radius = void 0 !== e ? e : 1,
- this.phi = void 0 !== t ? t : 0,
- this.theta = void 0 !== i ? i : 0,
- this
- }
- ,
- Ci.Spherical.prototype = {
- constructor: Ci.Spherical,
- set: function(e, t, i) {
- this.radius = e,
- this.phi = t,
- this.theta = i
- },
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- return this.radius.copy(e.radius),
- this.phi.copy(e.phi),
- this.theta.copy(e.theta),
- this
- },
- makeSafe: function() {
- this.phi = Math.max(1e-6, Math.min(Math.PI - 1e-6, this.phi))
- },
- setFromVector3: function(e) {
- return this.radius = e.length(),
- 0 === this.radius ? (this.theta = 0,
- this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
- this.phi = Math.acos(Ci.Math.clamp(e.y / this.radius, -1, 1))),
- this
- }
- },
- Ci.Math = {
- generateUUID: (R = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),
- P = new Array(36),
- O = 0,
- function() {
- for (var e = 0; e < 36; e++)
- 8 === e || 13 === e || 18 === e || 23 === e ? P[e] = "-" : 14 === e ? P[e] = "4" : (O <= 2 && (O = 33554432 + 16777216 * Math.random() | 0),
- M = 15 & O,
- O >>= 4,
- P[e] = R[19 === e ? 3 & M | 8 : M]);
- return P.join("")
- }
- ),
- clamp: function(e, t, i) {
- return Math.max(t, Math.min(i, e))
- },
- euclideanModulo: function(e, t) {
- return (e % t + t) % t
- },
- mapLinear: function(e, t, i, n, r) {
- return n + (e - t) * (r - n) / (i - t)
- },
- smoothstep: function(e, t, i) {
- return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * (3 - 2 * e)
- },
- smootherstep: function(e, t, i) {
- return e <= t ? 0 : i <= e ? 1 : (e = (e - t) / (i - t)) * e * e * (e * (6 * e - 15) + 10)
- },
- random16: function() {
- return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
- Math.random()
- },
- randInt: function(e, t) {
- return e + Math.floor(Math.random() * (t - e + 1))
- },
- randFloat: function(e, t) {
- return e + Math.random() * (t - e)
- },
- randFloatSpread: function(e) {
- return e * (.5 - Math.random())
- },
- degToRad: (S = Math.PI / 180,
- function(e) {
- return e * S
- }
- ),
- radToDeg: (x = 180 / Math.PI,
- function(e) {
- return e * x
- }
- ),
- isPowerOfTwo: function(e) {
- return 0 == (e & e - 1) && 0 !== e
- },
- nearestPowerOfTwo: function(e) {
- return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
- },
- nextPowerOfTwo: function(e) {
- return e--,
- e |= e >> 1,
- e |= e >> 2,
- e |= e >> 4,
- e |= e >> 8,
- e |= e >> 16,
- ++e
- }
- },
- Ci.Spline = function(e) {
- function t(e, t, i, n, r, o, a) {
- var s = .5 * (i - e)
- , l = .5 * (n - t);
- return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
- }
- this.points = e;
- var i, n, r, o, a, s, l, c, h, u = [], d = {
- x: 0,
- y: 0,
- z: 0
- };
- this.initFromArray = function(e) {
- this.points = [];
- for (var t = 0; t < e.length; t++)
- this.points[t] = {
- x: e[t][0],
- y: e[t][1],
- z: e[t][2]
- }
- }
- ,
- this.getPoint = function(e) {
- return i = (this.points.length - 1) * e,
- n = Math.floor(i),
- r = i - n,
- u[0] = 0 === n ? n : n - 1,
- u[1] = n,
- u[2] = n > this.points.length - 2 ? this.points.length - 1 : n + 1,
- u[3] = n > this.points.length - 3 ? this.points.length - 1 : n + 2,
- s = this.points[u[0]],
- l = this.points[u[1]],
- c = this.points[u[2]],
- h = this.points[u[3]],
- a = r * (o = r * r),
- d.x = t(s.x, l.x, c.x, h.x, r, o, a),
- d.y = t(s.y, l.y, c.y, h.y, r, o, a),
- d.z = t(s.z, l.z, c.z, h.z, r, o, a),
- d
- }
- ,
- this.getControlPointsArray = function() {
- var e, t, i = this.points.length, n = [];
- for (e = 0; e < i; e++)
- t = this.points[e],
- n[e] = [t.x, t.y, t.z];
- return n
- }
- ,
- this.getLength = function(e) {
- var t, i, n, r, o = 0, a = 0, s = 0, l = new Ci.Vector3, c = new Ci.Vector3, h = [], u = 0;
- for (h[0] = 0,
- e = e || 100,
- n = this.points.length * e,
- l.copy(this.points[0]),
- t = 1; t < n; t++)
- i = t / n,
- r = this.getPoint(i),
- c.copy(r),
- u += c.distanceTo(l),
- l.copy(r),
- o = (this.points.length - 1) * i,
- (a = Math.floor(o)) !== s && (h[a] = u,
- s = a);
- return h[h.length] = u,
- {
- chunks: h,
- total: u
- }
- }
- ,
- this.reparametrizeByArcLength = function(e) {
- var t, i, n, r, o, a, s, l, c = [], h = new Ci.Vector3, u = this.getLength();
- for (c.push(h.copy(this.points[0]).clone()),
- t = 1; t < this.points.length; t++) {
- for (a = u.chunks[t] - u.chunks[t - 1],
- s = Math.ceil(e * a / u.total),
- r = (t - 1) / (this.points.length - 1),
- o = t / (this.points.length - 1),
- i = 1; i < s - 1; i++)
- n = r + i * (1 / s) * (o - r),
- l = this.getPoint(n),
- c.push(h.copy(l).clone());
- c.push(h.copy(this.points[t]).clone())
- }
- this.points = c
- }
- }
- ,
- Ci.Triangle = function(e, t, i) {
- this.a = void 0 !== e ? e : new Ci.Vector3,
- this.b = void 0 !== t ? t : new Ci.Vector3,
- this.c = void 0 !== i ? i : new Ci.Vector3
- }
- ,
- Ci.Triangle.normal = (T = new Ci.Vector3,
- function(e, t, i, n) {
- var r = n || new Ci.Vector3;
- r.subVectors(i, t),
- T.subVectors(e, t),
- r.cross(T);
- var o = r.lengthSq();
- return 0 < o ? r.multiplyScalar(1 / Math.sqrt(o)) : r.set(0, 0, 0)
- }
- ),
- Ci.Triangle.barycoordFromPoint = (_ = new Ci.Vector3,
- b = new Ci.Vector3,
- w = new Ci.Vector3,
- function(e, t, i, n, r) {
- _.subVectors(n, t),
- b.subVectors(i, t),
- w.subVectors(e, t);
- var o = _.dot(_)
- , a = _.dot(b)
- , s = _.dot(w)
- , l = b.dot(b)
- , c = b.dot(w)
- , h = o * l - a * a
- , u = r || new Ci.Vector3;
- if (0 == h)
- return u.set(-2, -1, -1);
- var d = 1 / h
- , p = (l * s - a * c) * d
- , f = (o * c - a * s) * d;
- return u.set(1 - p - f, f, p)
- }
- ),
- Ci.Triangle.containsPoint = (E = new Ci.Vector3,
- function(e, t, i, n) {
- var r = Ci.Triangle.barycoordFromPoint(e, t, i, n, E);
- return 0 <= r.x && 0 <= r.y && r.x + r.y <= 1
- }
- ),
- Ci.Triangle.prototype = {
- constructor: Ci.Triangle,
- set: function(e, t, i) {
- return this.a.copy(e),
- this.b.copy(t),
- this.c.copy(i),
- this
- },
- setFromPointsAndIndices: function(e, t, i, n) {
- return this.a.copy(e[t]),
- this.b.copy(e[i]),
- this.c.copy(e[n]),
- this
- },
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- return this.a.copy(e.a),
- this.b.copy(e.b),
- this.c.copy(e.c),
- this
- },
- area: (C = new Ci.Vector3,
- I = new Ci.Vector3,
- function() {
- return C.subVectors(this.c, this.b),
- I.subVectors(this.a, this.b),
- .5 * C.cross(I).length()
- }
- ),
- midpoint: function(e) {
- return (e || new Ci.Vector3).addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
- },
- normal: function(e) {
- return Ci.Triangle.normal(this.a, this.b, this.c, e)
- },
- plane: function(e) {
- return (e || new Ci.Plane).setFromCoplanarPoints(this.a, this.b, this.c)
- },
- barycoordFromPoint: function(e, t) {
- return Ci.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
- },
- containsPoint: function(e) {
- return Ci.Triangle.containsPoint(e, this.a, this.b, this.c)
- },
- equals: function(e) {
- return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
- }
- },
- Ci.Interpolant = function(e, t, i, n) {
- this.parameterPositions = e,
- this._cachedIndex = 0,
- this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
- this.sampleValues = t,
- this.valueSize = i
- }
- ,
- Ci.Interpolant.prototype = {
- constructor: Ci.Interpolant,
- evaluate: function(e) {
- var t = this.parameterPositions
- , i = this._cachedIndex
- , n = t[i]
- , r = t[i - 1];
- e: {
- t: {
- var o;
- i: {
- n: if (!(e < n)) {
- for (var a = i + 2; ; ) {
- if (void 0 === n) {
- if (e < r)
- break n;
- return i = t.length,
- this._cachedIndex = i,
- this.afterEnd_(i - 1, e, r)
- }
- if (i === a)
- break;
- if (r = n,
- e < (n = t[++i]))
- break t
- }
- o = t.length;
- break i
- }
- if (r <= e)
- break e;
- var s = t[1];
- e < s && (i = 2,
- r = s);
- for (a = i - 2; ; ) {
- if (void 0 === r)
- return this._cachedIndex = 0,
- this.beforeStart_(0, e, n);
- if (i === a)
- break;
- if (n = r,
- (r = t[--i - 1]) <= e)
- break t
- }
- o = i,
- i = 0
- }
- for (; i < o; ) {
- var l = i + o >>> 1;
- e < t[l] ? o = l : i = 1 + l
- }
- if (n = t[i],
- void 0 === (r = t[i - 1]))
- return this._cachedIndex = 0,
- this.beforeStart_(0, e, n);
- if (void 0 === n)
- return i = t.length,
- this._cachedIndex = i,
- this.afterEnd_(i - 1, r, e)
- }
- this._cachedIndex = i,
- this.intervalChanged_(i, r, n)
- }
- return this.interpolate_(i, r, e, n)
- },
- settings: null,
- DefaultSettings_: {},
- getSettings_: function() {
- return this.settings || this.DefaultSettings_
- },
- copySampleValue_: function(e) {
- for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
- t[o] = i[r + o];
- return t
- },
- interpolate_: function(e, t, i, n) {
- throw new Error("call to abstract method")
- },
- intervalChanged_: function(e, t, i) {}
- },
- Object.assign(Ci.Interpolant.prototype, {
- beforeStart_: Ci.Interpolant.prototype.copySampleValue_,
- afterEnd_: Ci.Interpolant.prototype.copySampleValue_
- }),
- Ci.CubicInterpolant = function(e, t, i, n) {
- Ci.Interpolant.call(this, e, t, i, n),
- this._weightPrev = -0,
- this._offsetPrev = -0,
- this._weightNext = -0,
- this._offsetNext = -0
- }
- ,
- Ci.CubicInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
- constructor: Ci.CubicInterpolant,
- DefaultSettings_: {
- endingStart: Ci.ZeroCurvatureEnding,
- endingEnd: Ci.ZeroCurvatureEnding
- },
- intervalChanged_: function(e, t, i) {
- var n = this.parameterPositions
- , r = e - 2
- , o = e + 1
- , a = n[r]
- , s = n[o];
- if (void 0 === a)
- switch (this.getSettings_().endingStart) {
- case Ci.ZeroSlopeEnding:
- r = e,
- a = 2 * t - i;
- break;
- case Ci.WrapAroundEnding:
- a = t + n[r = n.length - 2] - n[r + 1];
- break;
- default:
- r = e,
- a = i
- }
- if (void 0 === s)
- switch (this.getSettings_().endingEnd) {
- case Ci.ZeroSlopeEnding:
- o = e,
- s = 2 * i - t;
- break;
- case Ci.WrapAroundEnding:
- s = i + n[o = 1] - n[0];
- break;
- default:
- o = e - 1,
- s = t
- }
- var l = .5 * (i - t)
- , c = this.valueSize;
- this._weightPrev = l / (t - a),
- this._weightNext = l / (s - i),
- this._offsetPrev = r * c,
- this._offsetNext = o * c
- },
- interpolate_: function(e, t, i, n) {
- 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)
- r[C] = m * o[c + C] + v * o[l + C] + y * o[s + C] + A * o[h + C];
- return r
- }
- }),
- Ci.DiscreteInterpolant = function(e, t, i, n) {
- Ci.Interpolant.call(this, e, t, i, n)
- }
- ,
- Ci.DiscreteInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
- constructor: Ci.DiscreteInterpolant,
- interpolate_: function(e, t, i, n) {
- return this.copySampleValue_(e - 1)
- }
- }),
- Ci.LinearInterpolant = function(e, t, i, n) {
- Ci.Interpolant.call(this, e, t, i, n)
- }
- ,
- Ci.LinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
- constructor: Ci.LinearInterpolant,
- interpolate_: function(e, t, i, n) {
- 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)
- r[u] = o[l + u] * h + o[s + u] * c;
- return r
- }
- }),
- Ci.QuaternionLinearInterpolant = function(e, t, i, n) {
- Ci.Interpolant.call(this, e, t, i, n)
- }
- ,
- Ci.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(Ci.Interpolant.prototype), {
- constructor: Ci.QuaternionLinearInterpolant,
- interpolate_: function(e, t, i, n) {
- 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)
- Ci.Quaternion.slerpFlat(r, 0, o, s - a, o, s, l);
- return r
- }
- }),
- Ci.Clock = function(e) {
- this.autoStart = void 0 === e || e,
- this.startTime = 0,
- this.oldTime = 0,
- this.elapsedTime = 0,
- this.running = !1
- }
- ,
- Ci.Clock.prototype = {
- constructor: Ci.Clock,
- start: function() {
- this.startTime = performance.now(),
- this.oldTime = this.startTime,
- this.running = !0
- },
- stop: function() {
- this.getElapsedTime(),
- this.running = !1
- },
- getElapsedTime: function() {
- return this.getDelta(),
- this.elapsedTime
- },
- getDelta: function() {
- var e = 0;
- if (this.autoStart && !this.running && this.start(),
- this.running) {
- var t = performance.now();
- e = .001 * (t - this.oldTime),
- this.oldTime = t,
- this.elapsedTime += e
- }
- return e
- }
- },
- Ci.EventDispatcher = function() {}
- ,
- Ci.EventDispatcher.prototype = {
- constructor: Ci.EventDispatcher,
- apply: function(e) {
- e.addEventListener = Ci.EventDispatcher.prototype.addEventListener,
- e.hasEventListener = Ci.EventDispatcher.prototype.hasEventListener,
- e.removeEventListener = Ci.EventDispatcher.prototype.removeEventListener,
- e.dispatchEvent = Ci.EventDispatcher.prototype.dispatchEvent
- },
- addEventListener: function(e, t) {
- void 0 === this._listeners && (this._listeners = {});
- var i = this._listeners;
- void 0 === i[e] && (i[e] = []),
- -1 === i[e].indexOf(t) && i[e].push(t)
- },
- hasEventListener: function(e, t) {
- if (void 0 === this._listeners)
- return !1;
- var i = this._listeners;
- return void 0 !== i[e] && -1 !== i[e].indexOf(t)
- },
- removeEventListener: function(e, t) {
- if (void 0 !== this._listeners) {
- var i = this._listeners[e];
- if (void 0 !== i) {
- var n = i.indexOf(t);
- -1 !== n && i.splice(n, 1)
- }
- }
- },
- dispatchEvent: function(e) {
- if (void 0 !== this._listeners) {
- var t = this._listeners[e.type];
- if (void 0 !== t) {
- e.target = this;
- for (var i = [], n = t.length, r = 0; r < n; r++)
- i[r] = t[r];
- for (r = 0; r < n; r++)
- i[r].call(this, e)
- }
- }
- }
- },
- Ci.Layers = function() {
- this.mask = 1
- }
- ,
- Ci.Layers.prototype = {
- constructor: Ci.Layers,
- set: function(e) {
- this.mask = 1 << e
- },
- enable: function(e) {
- this.mask |= 1 << e
- },
- toggle: function(e) {
- this.mask ^= 1 << e
- },
- disable: function(e) {
- this.mask &= ~(1 << e)
- },
- test: function(e) {
- return 0 != (this.mask & e.mask)
- }
- },
- (A = Ci).Raycaster = function(e, t, i, n) {
- this.ray = new A.Ray(e,t),
- this.near = i || 0,
- this.far = n || 1 / 0,
- this.params = {
- Mesh: {},
- Line: {},
- LOD: {},
- Points: {
- threshold: 1
- },
- Sprite: {}
- },
- Object.defineProperties(this.params, {
- PointCloud: {
- get: function() {
- return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
- this.Points
- }
- }
- })
- }
- ,
- A.Raycaster.prototype = {
- constructor: A.Raycaster,
- linePrecision: 1,
- set: function(e, t) {
- this.ray.set(e, t)
- },
- setFromCamera: function(e, t) {
- t instanceof A.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld),
- 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),
- this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
- },
- intersectObject: function(e, t) {
- var i = [];
- return Ei(e, this, i, t),
- i.sort(Ii),
- i
- },
- intersectObjects: function(e, t) {
- var i = [];
- if (!1 === Array.isArray(e))
- return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
- i;
- for (var n = 0, r = e.length; n < r; n++)
- Ei(e[n], this, i, t);
- return i.sort(Ii),
- i
- }
- },
- Ci.Object3D = function() {
- Object.defineProperty(this, "id", {
- value: Ci.Object3DIdCount++
- }),
- this.uuid = Ci.Math.generateUUID(),
- this.name = "",
- this.type = "Object3D",
- this.parent = null,
- this.children = [],
- this.up = Ci.Object3D.DefaultUp.clone();
- var e = new Ci.Vector3
- , t = new Ci.Euler
- , i = new Ci.Quaternion
- , n = new Ci.Vector3(1,1,1);
- t.onChange(function() {
- i.setFromEuler(t, !1)
- }),
- i.onChange(function() {
- t.setFromQuaternion(i, void 0, !1)
- }),
- Object.defineProperties(this, {
- position: {
- enumerable: !0,
- value: e
- },
- rotation: {
- enumerable: !0,
- value: t
- },
- quaternion: {
- enumerable: !0,
- value: i
- },
- scale: {
- enumerable: !0,
- value: n
- },
- modelViewMatrix: {
- value: new Ci.Matrix4
- },
- normalMatrix: {
- value: new Ci.Matrix3
- }
- }),
- this.rotationAutoUpdate = !0,
- this.matrix = new Ci.Matrix4,
- this.matrixWorld = new Ci.Matrix4,
- this.matrixAutoUpdate = Ci.Object3D.DefaultMatrixAutoUpdate,
- this.matrixWorldNeedsUpdate = !1,
- this.layers = new Ci.Layers,
- this.visible = !0,
- this.castShadow = !1,
- this.receiveShadow = !1,
- this.frustumCulled = !0,
- this.renderOrder = 0,
- this.userData = {}
- }
- ,
- Ci.Object3D.DefaultUp = new Ci.Vector3(0,1,0),
- Ci.Object3D.DefaultMatrixAutoUpdate = !0,
- Ci.Object3D.prototype = {
- constructor: Ci.Object3D,
- applyMatrix: function(e) {
- this.matrix.multiplyMatrices(e, this.matrix),
- this.matrix.decompose(this.position, this.quaternion, this.scale)
- },
- setRotationFromAxisAngle: function(e, t) {
- this.quaternion.setFromAxisAngle(e, t)
- },
- setRotationFromEuler: function(e) {
- this.quaternion.setFromEuler(e, !0)
- },
- setRotationFromMatrix: function(e) {
- this.quaternion.setFromRotationMatrix(e)
- },
- setRotationFromQuaternion: function(e) {
- this.quaternion.copy(e)
- },
- rotateOnAxis: (y = new Ci.Quaternion,
- function(e, t) {
- return y.setFromAxisAngle(e, t),
- this.quaternion.multiply(y),
- this
- }
- ),
- rotateX: (v = new Ci.Vector3(1,0,0),
- function(e) {
- return this.rotateOnAxis(v, e)
- }
- ),
- rotateY: (m = new Ci.Vector3(0,1,0),
- function(e) {
- return this.rotateOnAxis(m, e)
- }
- ),
- rotateZ: (g = new Ci.Vector3(0,0,1),
- function(e) {
- return this.rotateOnAxis(g, e)
- }
- ),
- translateOnAxis: (f = new Ci.Vector3,
- function(e, t) {
- return f.copy(e).applyQuaternion(this.quaternion),
- this.position.add(f.multiplyScalar(t)),
- this
- }
- ),
- translateX: (p = new Ci.Vector3(1,0,0),
- function(e) {
- return this.translateOnAxis(p, e)
- }
- ),
- translateY: (d = new Ci.Vector3(0,1,0),
- function(e) {
- return this.translateOnAxis(d, e)
- }
- ),
- translateZ: (u = new Ci.Vector3(0,0,1),
- function(e) {
- return this.translateOnAxis(u, e)
- }
- ),
- localToWorld: function(e) {
- return e.applyMatrix4(this.matrixWorld)
- },
- worldToLocal: (h = new Ci.Matrix4,
- function(e) {
- return e.applyMatrix4(h.getInverse(this.matrixWorld))
- }
- ),
- lookAt: (c = new Ci.Matrix4,
- function(e) {
- c.lookAt(e, this.position, this.up),
- this.quaternion.setFromRotationMatrix(c)
- }
- ),
- add: function(e) {
- if (1 < arguments.length) {
- for (var t = 0; t < arguments.length; t++)
- this.add(arguments[t]);
- return this
- }
- 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),
- e.parent = this,
- e.dispatchEvent({
- type: "added"
- }),
- this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
- this
- },
- remove: function(e) {
- if (1 < arguments.length)
- for (var t = 0; t < arguments.length; t++)
- this.remove(arguments[t]);
- var i = this.children.indexOf(e);
- -1 !== i && (e.parent = null,
- e.dispatchEvent({
- type: "removed"
- }),
- this.children.splice(i, 1))
- },
- getObjectById: function(e) {
- return this.getObjectByProperty("id", e)
- },
- getObjectByName: function(e) {
- return this.getObjectByProperty("name", e)
- },
- getObjectByProperty: function(e, t) {
- if (this[e] === t)
- return this;
- for (var i = 0, n = this.children.length; i < n; i++) {
- var r = this.children[i].getObjectByProperty(e, t);
- if (void 0 !== r)
- return r
- }
- },
- getWorldPosition: function(e) {
- var t = e || new Ci.Vector3;
- return this.updateMatrixWorld(!0),
- t.setFromMatrixPosition(this.matrixWorld)
- },
- getWorldQuaternion: (s = new Ci.Vector3,
- l = new Ci.Vector3,
- function(e) {
- var t = e || new Ci.Quaternion;
- return this.updateMatrixWorld(!0),
- this.matrixWorld.decompose(s, t, l),
- t
- }
- ),
- getWorldRotation: (a = new Ci.Quaternion,
- function(e) {
- var t = e || new Ci.Euler;
- return this.getWorldQuaternion(a),
- t.setFromQuaternion(a, this.rotation.order, !1)
- }
- ),
- getWorldScale: (r = new Ci.Vector3,
- o = new Ci.Quaternion,
- function(e) {
- var t = e || new Ci.Vector3;
- return this.updateMatrixWorld(!0),
- this.matrixWorld.decompose(r, o, t),
- t
- }
- ),
- getWorldDirection: (n = new Ci.Quaternion,
- function(e) {
- var t = e || new Ci.Vector3;
- return this.getWorldQuaternion(n),
- t.set(0, 0, 1).applyQuaternion(n)
- }
- ),
- raycast: function() {},
- traverse: function(e) {
- e(this);
- for (var t = this.children, i = 0, n = t.length; i < n; i++)
- t[i].traverse(e)
- },
- traverseVisible: function(e) {
- if (!1 !== this.visible) {
- e(this);
- for (var t = this.children, i = 0, n = t.length; i < n; i++)
- t[i].traverseVisible(e)
- }
- },
- traverseAncestors: function(e) {
- var t = this.parent;
- null !== t && (e(t),
- t.traverseAncestors(e))
- },
- updateMatrix: function() {
- this.matrix.compose(this.position, this.quaternion, this.scale),
- this.matrixWorldNeedsUpdate = !0
- },
- updateMatrixWorld: function(e) {
- !0 === this.matrixAutoUpdate && this.updateMatrix(),
- !0 !== this.matrixWorldNeedsUpdate && !0 !== e || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
- e = !(this.matrixWorldNeedsUpdate = !1));
- for (var t = 0, i = this.children.length; t < i; t++)
- this.children[t].updateMatrixWorld(e)
- },
- toJSON: function(e) {
- function t(e) {
- var t = [];
- for (var i in e) {
- var n = e[i];
- delete n.metadata,
- t.push(n)
- }
- return t
- }
- var i = void 0 === e
- , n = {};
- i && (e = {
- geometries: {},
- materials: {},
- textures: {},
- images: {}
- },
- n.metadata = {
- version: 4.4,
- type: "Object",
- generator: "Object3D.toJSON"
- });
- var r = {};
- if (r.uuid = this.uuid,
- r.type = this.type,
- "" !== this.name && (r.name = this.name),
- "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
- !0 === this.castShadow && (r.castShadow = !0),
- !0 === this.receiveShadow && (r.receiveShadow = !0),
- !1 === this.visible && (r.visible = !1),
- r.matrix = this.matrix.toArray(),
- void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
- r.geometry = this.geometry.uuid),
- void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
- r.material = this.material.uuid),
- 0 < this.children.length) {
- r.children = [];
- for (var o = 0; o < this.children.length; o++)
- r.children.push(this.children[o].toJSON(e).object)
- }
- if (i) {
- var a = t(e.geometries)
- , s = t(e.materials)
- , l = t(e.textures)
- , c = t(e.images);
- 0 < a.length && (n.geometries = a),
- 0 < s.length && (n.materials = s),
- 0 < l.length && (n.textures = l),
- 0 < c.length && (n.images = c)
- }
- return n.object = r,
- n
- },
- clone: function(e) {
- return (new this.constructor).copy(this, e)
- },
- copy: function(e, t) {
- if (void 0 === t && (t = !0),
- this.name = e.name,
- this.up.copy(e.up),
- this.position.copy(e.position),
- this.quaternion.copy(e.quaternion),
- this.scale.copy(e.scale),
- this.rotationAutoUpdate = e.rotationAutoUpdate,
- this.matrix.copy(e.matrix),
- this.matrixWorld.copy(e.matrixWorld),
- this.matrixAutoUpdate = e.matrixAutoUpdate,
- this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
- this.visible = e.visible,
- this.castShadow = e.castShadow,
- this.receiveShadow = e.receiveShadow,
- this.frustumCulled = e.frustumCulled,
- this.renderOrder = e.renderOrder,
- this.userData = JSON.parse(JSON.stringify(e.userData)),
- !0 === t)
- for (var i = 0; i < e.children.length; i++) {
- var n = e.children[i];
- this.add(n.clone())
- }
- return this
- }
- },
- Ci.EventDispatcher.prototype.apply(Ci.Object3D.prototype),
- Ci.Object3DIdCount = 0,
- Ci.Face3 = function(e, t, i, n, r, o) {
- this.a = e,
- this.b = t,
- this.c = i,
- this.normal = n instanceof Ci.Vector3 ? n : new Ci.Vector3,
- this.vertexNormals = Array.isArray(n) ? n : [],
- this.color = r instanceof Ci.Color ? r : new Ci.Color,
- this.vertexColors = Array.isArray(r) ? r : [],
- this.materialIndex = void 0 !== o ? o : 0
- }
- ,
- Ci.Face3.prototype = {
- constructor: Ci.Face3,
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- this.a = e.a,
- this.b = e.b,
- this.c = e.c,
- this.normal.copy(e.normal),
- this.color.copy(e.color),
- this.materialIndex = e.materialIndex;
- for (var t = 0, i = e.vertexNormals.length; t < i; t++)
- this.vertexNormals[t] = e.vertexNormals[t].clone();
- for (t = 0,
- i = e.vertexColors.length; t < i; t++)
- this.vertexColors[t] = e.vertexColors[t].clone();
- return this
- }
- },
- Ci.BufferAttribute = function(e, t) {
- this.uuid = Ci.Math.generateUUID(),
- this.array = e,
- this.itemSize = t,
- this.dynamic = !1,
- this.updateRange = {
- offset: 0,
- count: -1
- },
- this.version = 0
- }
- ,
- Ci.BufferAttribute.prototype = {
- constructor: Ci.BufferAttribute,
- get count() {
- return this.array.length / this.itemSize
- },
- set needsUpdate(e) {
- !0 === e && this.version++
- },
- setDynamic: function(e) {
- return this.dynamic = e,
- this
- },
- copy: function(e) {
- return this.array = new e.array.constructor(e.array),
- this.itemSize = e.itemSize,
- this.dynamic = e.dynamic,
- this
- },
- copyAt: function(e, t, i) {
- e *= this.itemSize,
- i *= t.itemSize;
- for (var n = 0, r = this.itemSize; n < r; n++)
- this.array[e + n] = t.array[i + n];
- return this
- },
- copyArray: function(e) {
- return this.array.set(e),
- this
- },
- copyColorsArray: function(e) {
- for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
- var o = e[n];
- void 0 === o && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", n),
- o = new Ci.Color),
- t[i++] = o.r,
- t[i++] = o.g,
- t[i++] = o.b
- }
- return this
- },
- copyIndicesArray: function(e) {
- for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
- var o = e[n];
- t[i++] = o.a,
- t[i++] = o.b,
- t[i++] = o.c
- }
- return this
- },
- copyVector2sArray: function(e) {
- for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
- var o = e[n];
- void 0 === o && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", n),
- o = new Ci.Vector2),
- t[i++] = o.x,
- t[i++] = o.y
- }
- return this
- },
- copyVector3sArray: function(e) {
- for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
- var o = e[n];
- void 0 === o && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", n),
- o = new Ci.Vector3),
- t[i++] = o.x,
- t[i++] = o.y,
- t[i++] = o.z
- }
- return this
- },
- copyVector4sArray: function(e) {
- for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
- var o = e[n];
- void 0 === o && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", n),
- o = new Ci.Vector4),
- t[i++] = o.x,
- t[i++] = o.y,
- t[i++] = o.z,
- t[i++] = o.w
- }
- return this
- },
- set: function(e, t) {
- return void 0 === t && (t = 0),
- this.array.set(e, t),
- this
- },
- getX: function(e) {
- return this.array[e * this.itemSize]
- },
- setX: function(e, t) {
- return this.array[e * this.itemSize] = t,
- this
- },
- getY: function(e) {
- return this.array[e * this.itemSize + 1]
- },
- setY: function(e, t) {
- return this.array[e * this.itemSize + 1] = t,
- this
- },
- getZ: function(e) {
- return this.array[e * this.itemSize + 2]
- },
- setZ: function(e, t) {
- return this.array[e * this.itemSize + 2] = t,
- this
- },
- getW: function(e) {
- return this.array[e * this.itemSize + 3]
- },
- setW: function(e, t) {
- return this.array[e * this.itemSize + 3] = t,
- this
- },
- setXY: function(e, t, i) {
- return e *= this.itemSize,
- this.array[e + 0] = t,
- this.array[e + 1] = i,
- this
- },
- setXYZ: function(e, t, i, n) {
- return e *= this.itemSize,
- this.array[e + 0] = t,
- this.array[e + 1] = i,
- this.array[e + 2] = n,
- this
- },
- setXYZW: function(e, t, i, n, r) {
- return e *= this.itemSize,
- this.array[e + 0] = t,
- this.array[e + 1] = i,
- this.array[e + 2] = n,
- this.array[e + 3] = r,
- this
- },
- clone: function() {
- return (new this.constructor).copy(this)
- }
- },
- Ci.Int8Attribute = function(e, t) {
- return new Ci.BufferAttribute(new Int8Array(e),t)
- }
- ,
- Ci.Uint8Attribute = function(e, t) {
- return new Ci.BufferAttribute(new Uint8Array(e),t)
- }
- ,
- Ci.Uint8ClampedAttribute = function(e, t) {
- return new Ci.BufferAttribute(new Uint8ClampedArray(e),t)
- }
- ,
- Ci.Int16Attribute = function(e, t) {
- return new Ci.BufferAttribute(new Int16Array(e),t)
- }
- ,
- Ci.Uint16Attribute = function(e, t) {
- return new Ci.BufferAttribute(new Uint16Array(e),t)
- }
- ,
- Ci.Int32Attribute = function(e, t) {
- return new Ci.BufferAttribute(new Int32Array(e),t)
- }
- ,
- Ci.Uint32Attribute = function(e, t) {
- return new Ci.BufferAttribute(new Uint32Array(e),t)
- }
- ,
- Ci.Float32Attribute = function(e, t) {
- return new Ci.BufferAttribute(new Float32Array(e),t)
- }
- ,
- Ci.Float64Attribute = function(e, t) {
- return new Ci.BufferAttribute(new Float64Array(e),t)
- }
- ,
- Ci.DynamicBufferAttribute = function(e, t) {
- return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
- new Ci.BufferAttribute(e,t).setDynamic(!0)
- }
- ,
- Ci.InstancedBufferAttribute = function(e, t, i) {
- Ci.BufferAttribute.call(this, e, t),
- this.meshPerAttribute = i || 1
- }
- ,
- Ci.InstancedBufferAttribute.prototype = Object.create(Ci.BufferAttribute.prototype),
- Ci.InstancedBufferAttribute.prototype.constructor = Ci.InstancedBufferAttribute,
- Ci.InstancedBufferAttribute.prototype.copy = function(e) {
- return Ci.BufferAttribute.prototype.copy.call(this, e),
- this.meshPerAttribute = e.meshPerAttribute,
- this
- }
- ,
- Ci.InterleavedBuffer = function(e, t) {
- this.uuid = Ci.Math.generateUUID(),
- this.array = e,
- this.stride = t,
- this.dynamic = !1,
- this.updateRange = {
- offset: 0,
- count: -1
- },
- this.version = 0
- }
- ,
- Ci.InterleavedBuffer.prototype = {
- constructor: Ci.InterleavedBuffer,
- get length() {
- return this.array.length
- },
- get count() {
- return this.array.length / this.stride
- },
- set needsUpdate(e) {
- !0 === e && this.version++
- },
- setDynamic: function(e) {
- return this.dynamic = e,
- this
- },
- copy: function(e) {
- return this.array = new e.array.constructor(e.array),
- this.stride = e.stride,
- this.dynamic = e.dynamic,
- this
- },
- copyAt: function(e, t, i) {
- e *= this.stride,
- i *= t.stride;
- for (var n = 0, r = this.stride; n < r; n++)
- this.array[e + n] = t.array[i + n];
- return this
- },
- set: function(e, t) {
- return void 0 === t && (t = 0),
- this.array.set(e, t),
- this
- },
- clone: function() {
- return (new this.constructor).copy(this)
- }
- },
- Ci.InstancedInterleavedBuffer = function(e, t, i) {
- Ci.InterleavedBuffer.call(this, e, t),
- this.meshPerAttribute = i || 1
- }
- ,
- Ci.InstancedInterleavedBuffer.prototype = Object.create(Ci.InterleavedBuffer.prototype),
- Ci.InstancedInterleavedBuffer.prototype.constructor = Ci.InstancedInterleavedBuffer,
- Ci.InstancedInterleavedBuffer.prototype.copy = function(e) {
- return Ci.InterleavedBuffer.prototype.copy.call(this, e),
- this.meshPerAttribute = e.meshPerAttribute,
- this
- }
- ,
- Ci.InterleavedBufferAttribute = function(e, t, i) {
- this.uuid = Ci.Math.generateUUID(),
- this.data = e,
- this.itemSize = t,
- this.offset = i
- }
- ,
- Ci.InterleavedBufferAttribute.prototype = {
- constructor: Ci.InterleavedBufferAttribute,
- get length() {
- return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
- this.array.length
- },
- get count() {
- return this.data.count
- },
- setX: function(e, t) {
- return this.data.array[e * this.data.stride + this.offset] = t,
- this
- },
- setY: function(e, t) {
- return this.data.array[e * this.data.stride + this.offset + 1] = t,
- this
- },
- setZ: function(e, t) {
- return this.data.array[e * this.data.stride + this.offset + 2] = t,
- this
- },
- setW: function(e, t) {
- return this.data.array[e * this.data.stride + this.offset + 3] = t,
- this
- },
- getX: function(e) {
- return this.data.array[e * this.data.stride + this.offset]
- },
- getY: function(e) {
- return this.data.array[e * this.data.stride + this.offset + 1]
- },
- getZ: function(e) {
- return this.data.array[e * this.data.stride + this.offset + 2]
- },
- getW: function(e) {
- return this.data.array[e * this.data.stride + this.offset + 3]
- },
- setXY: function(e, t, i) {
- return e = e * this.data.stride + this.offset,
- this.data.array[e + 0] = t,
- this.data.array[e + 1] = i,
- this
- },
- setXYZ: function(e, t, i, n) {
- return e = e * this.data.stride + this.offset,
- this.data.array[e + 0] = t,
- this.data.array[e + 1] = i,
- this.data.array[e + 2] = n,
- this
- },
- setXYZW: function(e, t, i, n, r) {
- return e = e * this.data.stride + this.offset,
- this.data.array[e + 0] = t,
- this.data.array[e + 1] = i,
- this.data.array[e + 2] = n,
- this.data.array[e + 3] = r,
- this
- }
- },
- Ci.Geometry = function() {
- Object.defineProperty(this, "id", {
- value: Ci.GeometryIdCount++
- }),
- this.uuid = Ci.Math.generateUUID(),
- this.name = "",
- this.type = "Geometry",
- this.vertices = [],
- this.colors = [],
- this.faces = [],
- this.faceVertexUvs = [[]],
- this.morphTargets = [],
- this.morphNormals = [],
- this.skinWeights = [],
- this.skinIndices = [],
- this.lineDistances = [],
- this.boundingBox = null,
- this.boundingSphere = null,
- this.verticesNeedUpdate = !1,
- this.elementsNeedUpdate = !1,
- this.uvsNeedUpdate = !1,
- this.normalsNeedUpdate = !1,
- this.colorsNeedUpdate = !1,
- this.lineDistancesNeedUpdate = !1,
- this.groupsNeedUpdate = !1
- }
- ,
- Ci.Geometry.prototype = {
- constructor: Ci.Geometry,
- applyMatrix: function(e) {
- for (var t = (new Ci.Matrix3).getNormalMatrix(e), i = 0, n = this.vertices.length; i < n; i++) {
- this.vertices[i].applyMatrix4(e)
- }
- for (i = 0,
- n = this.faces.length; i < n; i++) {
- var r = this.faces[i];
- r.normal.applyMatrix3(t).normalize();
- for (var o = 0, a = r.vertexNormals.length; o < a; o++)
- r.vertexNormals[o].applyMatrix3(t).normalize()
- }
- return null !== this.boundingBox && this.computeBoundingBox(),
- null !== this.boundingSphere && this.computeBoundingSphere(),
- this.verticesNeedUpdate = !0,
- this.normalsNeedUpdate = !0,
- this
- },
- rotateX: function(e) {
- return void 0 === mt && (mt = new Ci.Matrix4),
- mt.makeRotationX(e),
- this.applyMatrix(mt),
- this
- },
- rotateY: function(e) {
- return void 0 === gt && (gt = new Ci.Matrix4),
- gt.makeRotationY(e),
- this.applyMatrix(gt),
- this
- },
- rotateZ: function(e) {
- return void 0 === ft && (ft = new Ci.Matrix4),
- ft.makeRotationZ(e),
- this.applyMatrix(ft),
- this
- },
- translate: function(e, t, i) {
- return void 0 === pt && (pt = new Ci.Matrix4),
- pt.makeTranslation(e, t, i),
- this.applyMatrix(pt),
- this
- },
- scale: function(e, t, i) {
- return void 0 === dt && (dt = new Ci.Matrix4),
- dt.makeScale(e, t, i),
- this.applyMatrix(dt),
- this
- },
- lookAt: function(e) {
- void 0 === ut && (ut = new Ci.Object3D),
- ut.lookAt(e),
- ut.updateMatrix(),
- this.applyMatrix(ut.matrix)
- },
- fromBufferGeometry: function(e) {
- function t(e, t, i, n) {
- var r = void 0 !== l ? [d[e].clone(), d[t].clone(), d[i].clone()] : []
- , o = void 0 !== c ? [s.colors[e].clone(), s.colors[t].clone(), s.colors[i].clone()] : []
- , a = new Ci.Face3(e,t,i,r,o,n);
- s.faces.push(a),
- void 0 !== h && s.faceVertexUvs[0].push([p[e].clone(), p[t].clone(), p[i].clone()]),
- void 0 !== u && s.faceVertexUvs[1].push([f[e].clone(), f[t].clone(), f[i].clone()])
- }
- var s = this
- , i = null !== e.index ? e.index.array : void 0
- , n = e.attributes
- , r = n.position.array
- , l = void 0 !== n.normal ? n.normal.array : void 0
- , c = void 0 !== n.color ? n.color.array : void 0
- , h = void 0 !== n.uv ? n.uv.array : void 0
- , u = void 0 !== n.uv2 ? n.uv2.array : void 0;
- void 0 !== u && (this.faceVertexUvs[1] = []);
- for (var d = [], p = [], f = [], o = 0, a = 0; o < r.length; o += 3,
- a += 2)
- s.vertices.push(new Ci.Vector3(r[o],r[o + 1],r[o + 2])),
- void 0 !== l && d.push(new Ci.Vector3(l[o],l[o + 1],l[o + 2])),
- void 0 !== c && s.colors.push(new Ci.Color(c[o],c[o + 1],c[o + 2])),
- void 0 !== h && p.push(new Ci.Vector2(h[a],h[a + 1])),
- void 0 !== u && f.push(new Ci.Vector2(u[a],u[a + 1]));
- if (void 0 !== i) {
- var g = e.groups;
- if (0 < g.length)
- for (o = 0; o < g.length; o++)
- for (var m = g[o], v = m.start, y = (a = v,
- v + m.count); a < y; a += 3)
- t(i[a], i[a + 1], i[a + 2], m.materialIndex);
- else
- for (o = 0; o < i.length; o += 3)
- t(i[o], i[o + 1], i[o + 2])
- } else
- for (o = 0; o < r.length / 3; o += 3)
- t(o, o + 1, o + 2);
- return this.computeFaceNormals(),
- null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
- null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
- this
- },
- center: function() {
- this.computeBoundingBox();
- var e = this.boundingBox.center().negate();
- return this.translate(e.x, e.y, e.z),
- e
- },
- normalize: function() {
- this.computeBoundingSphere();
- var e = this.boundingSphere.center
- , t = this.boundingSphere.radius
- , i = 0 === t ? 1 : 1 / t
- , n = new Ci.Matrix4;
- 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),
- this.applyMatrix(n),
- this
- },
- computeFaceNormals: function() {
- for (var e = new Ci.Vector3, t = new Ci.Vector3, i = 0, n = this.faces.length; i < n; i++) {
- var r = this.faces[i]
- , o = this.vertices[r.a]
- , a = this.vertices[r.b]
- , s = this.vertices[r.c];
- e.subVectors(s, a),
- t.subVectors(o, a),
- e.cross(t),
- e.normalize(),
- r.normal.copy(e)
- }
- },
- computeVertexNormals: function(e) {
- var t, i, n, r, o, a;
- for (void 0 === e && (e = !0),
- a = new Array(this.vertices.length),
- t = 0,
- i = this.vertices.length; t < i; t++)
- a[t] = new Ci.Vector3;
- if (e) {
- var s, l, c, h = new Ci.Vector3, u = new Ci.Vector3;
- for (n = 0,
- r = this.faces.length; n < r; n++)
- o = this.faces[n],
- s = this.vertices[o.a],
- l = this.vertices[o.b],
- c = this.vertices[o.c],
- h.subVectors(c, l),
- u.subVectors(s, l),
- h.cross(u),
- a[o.a].add(h),
- a[o.b].add(h),
- a[o.c].add(h)
- } else
- for (n = 0,
- r = this.faces.length; n < r; n++)
- a[(o = this.faces[n]).a].add(o.normal),
- a[o.b].add(o.normal),
- a[o.c].add(o.normal);
- for (t = 0,
- i = this.vertices.length; t < i; t++)
- a[t].normalize();
- for (n = 0,
- r = this.faces.length; n < r; n++) {
- var d = (o = this.faces[n]).vertexNormals;
- 3 === d.length ? (d[0].copy(a[o.a]),
- d[1].copy(a[o.b]),
- d[2].copy(a[o.c])) : (d[0] = a[o.a].clone(),
- d[1] = a[o.b].clone(),
- d[2] = a[o.c].clone())
- }
- 0 < this.faces.length && (this.normalsNeedUpdate = !0)
- },
- computeMorphNormals: function() {
- var e, t, i, n, r;
- for (i = 0,
- n = this.faces.length; i < n; i++)
- for ((r = this.faces[i]).__originalFaceNormal ? r.__originalFaceNormal.copy(r.normal) : r.__originalFaceNormal = r.normal.clone(),
- r.__originalVertexNormals || (r.__originalVertexNormals = []),
- e = 0,
- t = r.vertexNormals.length; e < t; e++)
- r.__originalVertexNormals[e] ? r.__originalVertexNormals[e].copy(r.vertexNormals[e]) : r.__originalVertexNormals[e] = r.vertexNormals[e].clone();
- var o = new Ci.Geometry;
- for (o.faces = this.faces,
- e = 0,
- t = this.morphTargets.length; e < t; e++) {
- if (!this.morphNormals[e]) {
- this.morphNormals[e] = {},
- this.morphNormals[e].faceNormals = [],
- this.morphNormals[e].vertexNormals = [];
- var a = this.morphNormals[e].faceNormals
- , s = this.morphNormals[e].vertexNormals;
- for (i = 0,
- n = this.faces.length; i < n; i++)
- l = new Ci.Vector3,
- c = {
- a: new Ci.Vector3,
- b: new Ci.Vector3,
- c: new Ci.Vector3
- },
- a.push(l),
- s.push(c)
- }
- var l, c, h = this.morphNormals[e];
- for (o.vertices = this.morphTargets[e].vertices,
- o.computeFaceNormals(),
- o.computeVertexNormals(),
- i = 0,
- n = this.faces.length; i < n; i++)
- r = this.faces[i],
- l = h.faceNormals[i],
- c = h.vertexNormals[i],
- l.copy(r.normal),
- c.a.copy(r.vertexNormals[0]),
- c.b.copy(r.vertexNormals[1]),
- c.c.copy(r.vertexNormals[2])
- }
- for (i = 0,
- n = this.faces.length; i < n; i++)
- (r = this.faces[i]).normal = r.__originalFaceNormal,
- r.vertexNormals = r.__originalVertexNormals
- },
- computeTangents: function() {
- console.warn("THREE.Geometry: .computeTangents() has been removed.")
- },
- computeLineDistances: function() {
- for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
- 0 < i && (e += t[i].distanceTo(t[i - 1])),
- this.lineDistances[i] = e
- },
- computeBoundingBox: function() {
- null === this.boundingBox && (this.boundingBox = new Ci.Box3),
- this.boundingBox.setFromPoints(this.vertices)
- },
- computeBoundingSphere: function() {
- null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere),
- this.boundingSphere.setFromPoints(this.vertices)
- },
- merge: function(e, t, i) {
- if (e instanceof Ci.Geometry != 0) {
- 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];
- void 0 === i && (i = 0),
- void 0 !== t && (n = (new Ci.Matrix3).getNormalMatrix(t));
- for (var u = 0, d = a.length; u < d; u++) {
- var p = a[u].clone();
- void 0 !== t && p.applyMatrix4(t),
- o.push(p)
- }
- for (u = 0,
- d = l.length; u < d; u++) {
- var f, g, m, v = l[u], y = v.vertexNormals, A = v.vertexColors;
- (f = new Ci.Face3(v.a + r,v.b + r,v.c + r)).normal.copy(v.normal),
- void 0 !== n && f.normal.applyMatrix3(n).normalize();
- for (var C = 0, I = y.length; C < I; C++)
- g = y[C].clone(),
- void 0 !== n && g.applyMatrix3(n).normalize(),
- f.vertexNormals.push(g);
- f.color.copy(v.color);
- for (C = 0,
- I = A.length; C < I; C++)
- m = A[C],
- f.vertexColors.push(m.clone());
- f.materialIndex = v.materialIndex + i,
- s.push(f)
- }
- for (u = 0,
- d = h.length; u < d; u++) {
- var E = h[u]
- , _ = [];
- if (void 0 !== E) {
- for (C = 0,
- I = E.length; C < I; C++)
- _.push(E[C].clone());
- c.push(_)
- }
- }
- } else
- console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e)
- },
- mergeMesh: function(e) {
- return e instanceof Ci.Mesh == 0 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
- void this.merge(e.geometry, e.matrix))
- },
- mergeVertices: function() {
- var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = Math.pow(10, 4);
- for (i = 0,
- n = this.vertices.length; i < n; i++)
- e = this.vertices[i],
- void 0 === l[t = Math.round(e.x * u) + "_" + Math.round(e.y * u) + "_" + Math.round(e.z * u)] ? (l[t] = i,
- c.push(this.vertices[i]),
- h[i] = c.length - 1) : h[i] = h[l[t]];
- var d = [];
- for (i = 0,
- n = this.faces.length; i < n; i++) {
- (r = this.faces[i]).a = h[r.a],
- r.b = h[r.b],
- r.c = h[r.c],
- o = [r.a, r.b, r.c];
- for (var p = 0; p < 3; p++)
- if (o[p] === o[(p + 1) % 3]) {
- p,
- d.push(i);
- break
- }
- }
- for (i = d.length - 1; 0 <= i; i--) {
- var f = d[i];
- for (this.faces.splice(f, 1),
- a = 0,
- s = this.faceVertexUvs.length; a < s; a++)
- this.faceVertexUvs[a].splice(f, 1)
- }
- var g = this.vertices.length - c.length;
- return this.vertices = c,
- g
- },
- sortFacesByMaterialIndex: function() {
- for (var e = this.faces, t = e.length, i = 0; i < t; i++)
- e[i]._id = i;
- e.sort(function(e, t) {
- return e.materialIndex - t.materialIndex
- });
- var n, r, o = this.faceVertexUvs[0], a = this.faceVertexUvs[1];
- o && o.length === t && (n = []),
- a && a.length === t && (r = []);
- for (i = 0; i < t; i++) {
- var s = e[i]._id;
- n && n.push(o[s]),
- r && r.push(a[s])
- }
- n && (this.faceVertexUvs[0] = n),
- r && (this.faceVertexUvs[1] = r)
- },
- toJSON: function() {
- function e(e, t, i) {
- return i ? e | 1 << t : e & ~(1 << t)
- }
- function t(e) {
- var t = e.x.toString() + e.y.toString() + e.z.toString();
- return void 0 !== d[t] || (d[t] = u.length / 3,
- u.push(e.x, e.y, e.z)),
- d[t]
- }
- function i(e) {
- var t = e.r.toString() + e.g.toString() + e.b.toString();
- return void 0 !== f[t] || (f[t] = p.length,
- p.push(e.getHex())),
- f[t]
- }
- function n(e) {
- var t = e.x.toString() + e.y.toString();
- return void 0 !== m[t] || (m[t] = g.length / 2,
- g.push(e.x, e.y)),
- m[t]
- }
- var r = {
- metadata: {
- version: 4.4,
- type: "Geometry",
- generator: "Geometry.toJSON"
- }
- };
- if (r.uuid = this.uuid,
- r.type = this.type,
- "" !== this.name && (r.name = this.name),
- void 0 !== this.parameters) {
- var o = this.parameters;
- for (var a in o)
- void 0 !== o[a] && (r[a] = o[a]);
- return r
- }
- for (var s = [], l = 0; l < this.vertices.length; l++) {
- var c = this.vertices[l];
- s.push(c.x, c.y, c.z)
- }
- var h = []
- , u = []
- , d = {}
- , p = []
- , f = {}
- , g = []
- , m = {};
- for (l = 0; l < this.faces.length; l++) {
- var v = this.faces[l]
- , y = void 0 !== this.faceVertexUvs[0][l]
- , A = 0 < v.normal.length()
- , C = 0 < v.vertexNormals.length
- , I = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
- , E = 0 < v.vertexColors.length
- , _ = 0;
- 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),
- h.push(_),
- h.push(v.a, v.b, v.c),
- h.push(v.materialIndex),
- y) {
- var b = this.faceVertexUvs[0][l];
- h.push(n(b[0]), n(b[1]), n(b[2]))
- }
- if (A && h.push(t(v.normal)),
- C) {
- var w = v.vertexNormals;
- h.push(t(w[0]), t(w[1]), t(w[2]))
- }
- if (I && h.push(i(v.color)),
- E) {
- var T = v.vertexColors;
- h.push(i(T[0]), i(T[1]), i(T[2]))
- }
- }
- return r.data = {},
- r.data.vertices = s,
- r.data.normals = u,
- 0 < p.length && (r.data.colors = p),
- 0 < g.length && (r.data.uvs = [g]),
- r.data.faces = h,
- r
- },
- clone: function() {
- return (new Ci.Geometry).copy(this)
- },
- copy: function(e) {
- this.vertices = [],
- this.faces = [],
- this.faceVertexUvs = [[]];
- for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
- this.vertices.push(t[i].clone());
- var r = e.faces;
- for (i = 0,
- n = r.length; i < n; i++)
- this.faces.push(r[i].clone());
- for (i = 0,
- n = e.faceVertexUvs.length; i < n; i++) {
- var o = e.faceVertexUvs[i];
- void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
- for (var a = 0, s = o.length; a < s; a++) {
- for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
- var d = l[h];
- c.push(d.clone())
- }
- this.faceVertexUvs[i].push(c)
- }
- }
- return this
- },
- dispose: function() {
- this.dispatchEvent({
- type: "dispose"
- })
- }
- },
- Ci.EventDispatcher.prototype.apply(Ci.Geometry.prototype),
- Ci.GeometryIdCount = 0,
- Ci.DirectGeometry = function() {
- Object.defineProperty(this, "id", {
- value: Ci.GeometryIdCount++
- }),
- this.uuid = Ci.Math.generateUUID(),
- this.name = "",
- this.type = "DirectGeometry",
- this.indices = [],
- this.vertices = [],
- this.normals = [],
- this.colors = [],
- this.uvs = [],
- this.uvs2 = [],
- this.groups = [],
- this.morphTargets = {},
- this.skinWeights = [],
- this.skinIndices = [],
- this.boundingBox = null,
- this.boundingSphere = null,
- this.verticesNeedUpdate = !1,
- this.normalsNeedUpdate = !1,
- this.colorsNeedUpdate = !1,
- this.uvsNeedUpdate = !1,
- this.groupsNeedUpdate = !1
- }
- ,
- Ci.DirectGeometry.prototype = {
- constructor: Ci.DirectGeometry,
- computeBoundingBox: Ci.Geometry.prototype.computeBoundingBox,
- computeBoundingSphere: Ci.Geometry.prototype.computeBoundingSphere,
- computeFaceNormals: function() {
- console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
- },
- computeVertexNormals: function() {
- console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
- },
- computeGroups: function(e) {
- for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
- var a = r[o];
- a.materialIndex !== i && (i = a.materialIndex,
- void 0 !== t && (t.count = 3 * o - t.start,
- n.push(t)),
- t = {
- start: 3 * o,
- materialIndex: i
- })
- }
- void 0 !== t && (t.count = 3 * o - t.start,
- n.push(t)),
- this.groups = n
- },
- fromGeometry: function(e) {
- 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;
- if (0 < l) {
- t = [];
- for (var c = 0; c < l; c++)
- t[c] = [];
- this.morphTargets.position = t
- }
- var h, u = e.morphNormals, d = u.length;
- if (0 < d) {
- h = [];
- for (c = 0; c < d; c++)
- h[c] = [];
- this.morphTargets.normal = h
- }
- var p = e.skinIndices
- , f = e.skinWeights
- , g = p.length === n.length
- , m = f.length === n.length;
- for (c = 0; c < i.length; c++) {
- var v = i[c];
- this.vertices.push(n[v.a], n[v.b], n[v.c]);
- var y = v.vertexNormals;
- if (3 === y.length)
- this.normals.push(y[0], y[1], y[2]);
- else {
- var A = v.normal;
- this.normals.push(A, A, A)
- }
- var C, I = v.vertexColors;
- if (3 === I.length)
- this.colors.push(I[0], I[1], I[2]);
- else {
- var E = v.color;
- this.colors.push(E, E, E)
- }
- if (!0 === o)
- void 0 !== (C = r[0][c]) ? this.uvs.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", c),
- this.uvs.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
- if (!0 === a)
- void 0 !== (C = r[1][c]) ? this.uvs2.push(C[0], C[1], C[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", c),
- this.uvs2.push(new Ci.Vector2, new Ci.Vector2, new Ci.Vector2));
- for (var _ = 0; _ < l; _++) {
- var b = s[_].vertices;
- t[_].push(b[v.a], b[v.b], b[v.c])
- }
- for (_ = 0; _ < d; _++) {
- var w = u[_].vertexNormals[c];
- h[_].push(w.a, w.b, w.c)
- }
- g && this.skinIndices.push(p[v.a], p[v.b], p[v.c]),
- m && this.skinWeights.push(f[v.a], f[v.b], f[v.c])
- }
- return this.computeGroups(e),
- this.verticesNeedUpdate = e.verticesNeedUpdate,
- this.normalsNeedUpdate = e.normalsNeedUpdate,
- this.colorsNeedUpdate = e.colorsNeedUpdate,
- this.uvsNeedUpdate = e.uvsNeedUpdate,
- this.groupsNeedUpdate = e.groupsNeedUpdate,
- this
- },
- dispose: function() {
- this.dispatchEvent({
- type: "dispose"
- })
- }
- },
- Ci.EventDispatcher.prototype.apply(Ci.DirectGeometry.prototype),
- Ci.BufferGeometry = function() {
- Object.defineProperty(this, "id", {
- value: Ci.GeometryIdCount++
- }),
- this.uuid = Ci.Math.generateUUID(),
- this.name = "",
- this.type = "BufferGeometry",
- this.index = null,
- this.attributes = {},
- this.morphAttributes = {},
- this.groups = [],
- this.boundingBox = null,
- this.boundingSphere = null,
- this.drawRange = {
- start: 0,
- count: 1 / 0
- }
- }
- ,
- Ci.BufferGeometry.prototype = {
- constructor: Ci.BufferGeometry,
- getIndex: function() {
- return this.index
- },
- setIndex: function(e) {
- this.index = e
- },
- addAttribute: function(e, t) {
- return t instanceof Ci.BufferAttribute == 0 && t instanceof Ci.InterleavedBufferAttribute == 0 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
- void this.addAttribute(e, new Ci.BufferAttribute(t,arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
- void this.setIndex(t)) : (this.attributes[e] = t,
- this)
- },
- getAttribute: function(e) {
- return this.attributes[e]
- },
- removeAttribute: function(e) {
- return delete this.attributes[e],
- this
- },
- addGroup: function(e, t, i) {
- this.groups.push({
- start: e,
- count: t,
- materialIndex: void 0 !== i ? i : 0
- })
- },
- clearGroups: function() {
- this.groups = []
- },
- setDrawRange: function(e, t) {
- this.drawRange.start = e,
- this.drawRange.count = t
- },
- applyMatrix: function(e) {
- var t = this.attributes.position;
- void 0 !== t && (e.applyToVector3Array(t.array),
- t.needsUpdate = !0);
- var i = this.attributes.normal;
- void 0 !== i && ((new Ci.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),
- i.needsUpdate = !0);
- return null !== this.boundingBox && this.computeBoundingBox(),
- null !== this.boundingSphere && this.computeBoundingSphere(),
- this
- },
- rotateX: function(e) {
- return void 0 === ht && (ht = new Ci.Matrix4),
- ht.makeRotationX(e),
- this.applyMatrix(ht),
- this
- },
- rotateY: function(e) {
- return void 0 === ct && (ct = new Ci.Matrix4),
- ct.makeRotationY(e),
- this.applyMatrix(ct),
- this
- },
- rotateZ: function(e) {
- return void 0 === lt && (lt = new Ci.Matrix4),
- lt.makeRotationZ(e),
- this.applyMatrix(lt),
- this
- },
- translate: function(e, t, i) {
- return void 0 === st && (st = new Ci.Matrix4),
- st.makeTranslation(e, t, i),
- this.applyMatrix(st),
- this
- },
- scale: function(e, t, i) {
- return void 0 === at && (at = new Ci.Matrix4),
- at.makeScale(e, t, i),
- this.applyMatrix(at),
- this
- },
- lookAt: function(e) {
- void 0 === ot && (ot = new Ci.Object3D),
- ot.lookAt(e),
- ot.updateMatrix(),
- this.applyMatrix(ot.matrix)
- },
- center: function() {
- this.computeBoundingBox();
- var e = this.boundingBox.center().negate();
- return this.translate(e.x, e.y, e.z),
- e
- },
- setFromObject: function(e) {
- var t = e.geometry;
- if (e instanceof Ci.Points || e instanceof Ci.Line) {
- var i = new Ci.Float32Attribute(3 * t.vertices.length,3)
- , n = new Ci.Float32Attribute(3 * t.colors.length,3);
- if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
- this.addAttribute("color", n.copyColorsArray(t.colors)),
- t.lineDistances && t.lineDistances.length === t.vertices.length) {
- var r = new Ci.Float32Attribute(t.lineDistances.length,1);
- this.addAttribute("lineDistance", r.copyArray(t.lineDistances))
- }
- null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
- null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
- } else
- e instanceof Ci.Mesh && t instanceof Ci.Geometry && this.fromGeometry(t);
- return this
- },
- updateFromObject: function(e) {
- var t, i = e.geometry;
- if (e instanceof Ci.Mesh) {
- var n = i.__directGeometry;
- if (void 0 === n)
- return this.fromGeometry(i);
- n.verticesNeedUpdate = i.verticesNeedUpdate,
- n.normalsNeedUpdate = i.normalsNeedUpdate,
- n.colorsNeedUpdate = i.colorsNeedUpdate,
- n.uvsNeedUpdate = i.uvsNeedUpdate,
- n.groupsNeedUpdate = i.groupsNeedUpdate,
- i.verticesNeedUpdate = !1,
- i.normalsNeedUpdate = !1,
- i.colorsNeedUpdate = !1,
- i.uvsNeedUpdate = !1,
- i.groupsNeedUpdate = !1,
- i = n
- }
- !0 === i.verticesNeedUpdate && (void 0 !== (t = this.attributes.position) && (t.copyVector3sArray(i.vertices),
- t.needsUpdate = !0),
- i.verticesNeedUpdate = !1);
- !0 === i.normalsNeedUpdate && (void 0 !== (t = this.attributes.normal) && (t.copyVector3sArray(i.normals),
- t.needsUpdate = !0),
- i.normalsNeedUpdate = !1);
- !0 === i.colorsNeedUpdate && (void 0 !== (t = this.attributes.color) && (t.copyColorsArray(i.colors),
- t.needsUpdate = !0),
- i.colorsNeedUpdate = !1);
- i.uvsNeedUpdate && (void 0 !== (t = this.attributes.uv) && (t.copyVector2sArray(i.uvs),
- t.needsUpdate = !0),
- i.uvsNeedUpdate = !1);
- i.lineDistancesNeedUpdate && (void 0 !== (t = this.attributes.lineDistance) && (t.copyArray(i.lineDistances),
- t.needsUpdate = !0),
- i.lineDistancesNeedUpdate = !1);
- return i.groupsNeedUpdate && (i.computeGroups(e.geometry),
- this.groups = i.groups,
- i.groupsNeedUpdate = !1),
- this
- },
- fromGeometry: function(e) {
- return e.__directGeometry = (new Ci.DirectGeometry).fromGeometry(e),
- this.fromDirectGeometry(e.__directGeometry)
- },
- fromDirectGeometry: function(e) {
- var t = new Float32Array(3 * e.vertices.length);
- if (this.addAttribute("position", new Ci.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
- 0 < e.normals.length) {
- var i = new Float32Array(3 * e.normals.length);
- this.addAttribute("normal", new Ci.BufferAttribute(i,3).copyVector3sArray(e.normals))
- }
- if (0 < e.colors.length) {
- var n = new Float32Array(3 * e.colors.length);
- this.addAttribute("color", new Ci.BufferAttribute(n,3).copyColorsArray(e.colors))
- }
- if (0 < e.uvs.length) {
- var r = new Float32Array(2 * e.uvs.length);
- this.addAttribute("uv", new Ci.BufferAttribute(r,2).copyVector2sArray(e.uvs))
- }
- if (0 < e.uvs2.length) {
- var o = new Float32Array(2 * e.uvs2.length);
- this.addAttribute("uv2", new Ci.BufferAttribute(o,2).copyVector2sArray(e.uvs2))
- }
- if (0 < e.indices.length) {
- var a = new (65535 < e.vertices.length ? Uint32Array : Uint16Array)(3 * e.indices.length);
- this.setIndex(new Ci.BufferAttribute(a,1).copyIndicesArray(e.indices))
- }
- for (var s in this.groups = e.groups,
- e.morphTargets) {
- for (var l = [], c = e.morphTargets[s], h = 0, u = c.length; h < u; h++) {
- var d = c[h]
- , p = new Ci.Float32Attribute(3 * d.length,3);
- l.push(p.copyVector3sArray(d))
- }
- this.morphAttributes[s] = l
- }
- if (0 < e.skinIndices.length) {
- var f = new Ci.Float32Attribute(4 * e.skinIndices.length,4);
- this.addAttribute("skinIndex", f.copyVector4sArray(e.skinIndices))
- }
- if (0 < e.skinWeights.length) {
- var g = new Ci.Float32Attribute(4 * e.skinWeights.length,4);
- this.addAttribute("skinWeight", g.copyVector4sArray(e.skinWeights))
- }
- return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
- null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
- this
- },
- computeBoundingBox: (new Ci.Vector3,
- function() {
- null === this.boundingBox && (this.boundingBox = new Ci.Box3);
- var e = this.attributes.position.array;
- e && this.boundingBox.setFromArray(e),
- void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
- this.boundingBox.max.set(0, 0, 0)),
- (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)
- }
- ),
- computeBoundingSphere: (nt = new Ci.Box3,
- rt = new Ci.Vector3,
- function() {
- null === this.boundingSphere && (this.boundingSphere = new Ci.Sphere);
- var e = this.attributes.position.array;
- if (e) {
- var t = this.boundingSphere.center;
- nt.setFromArray(e),
- nt.center(t);
- for (var i = 0, n = 0, r = e.length; n < r; n += 3)
- rt.fromArray(e, n),
- i = Math.max(i, t.distanceToSquared(rt));
- this.boundingSphere.radius = Math.sqrt(i),
- isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
- }
- }
- ),
- computeFaceNormals: function() {},
- computeVertexNormals: function() {
- var e = this.index
- , t = this.attributes
- , i = this.groups;
- if (t.position) {
- var n = t.position.array;
- if (void 0 === t.normal)
- this.addAttribute("normal", new Ci.BufferAttribute(new Float32Array(n.length),3));
- else
- for (var r = t.normal.array, o = 0, a = r.length; o < a; o++)
- r[o] = 0;
- 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;
- if (e) {
- var m = e.array;
- 0 === i.length && this.addGroup(0, m.length);
- for (var v = 0, y = i.length; v < y; ++v) {
- var A = i[v]
- , C = A.start;
- for (o = C,
- a = C + A.count; o < a; o += 3)
- s = 3 * m[o + 0],
- l = 3 * m[o + 1],
- c = 3 * m[o + 2],
- u.fromArray(n, s),
- d.fromArray(n, l),
- p.fromArray(n, c),
- f.subVectors(p, d),
- g.subVectors(u, d),
- f.cross(g),
- h[s] += f.x,
- h[1 + s] += f.y,
- h[2 + s] += f.z,
- h[l] += f.x,
- h[1 + l] += f.y,
- h[2 + l] += f.z,
- h[c] += f.x,
- h[1 + c] += f.y,
- h[2 + c] += f.z
- }
- } else
- for (o = 0,
- a = n.length; o < a; o += 9)
- u.fromArray(n, o),
- d.fromArray(n, o + 3),
- p.fromArray(n, o + 6),
- f.subVectors(p, d),
- g.subVectors(u, d),
- f.cross(g),
- h[o] = f.x,
- h[o + 1] = f.y,
- h[o + 2] = f.z,
- h[o + 3] = f.x,
- h[o + 4] = f.y,
- h[o + 5] = f.z,
- h[o + 6] = f.x,
- h[o + 7] = f.y,
- h[o + 8] = f.z;
- this.normalizeNormals(),
- t.normal.needsUpdate = !0
- }
- },
- merge: function(e, t) {
- if (e instanceof Ci.BufferGeometry != 0) {
- void 0 === t && (t = 0);
- var i = this.attributes;
- for (var n in i)
- if (void 0 !== e.attributes[n])
- for (var r = i[n].array, o = e.attributes[n], a = o.array, s = 0, l = o.itemSize * t; s < a.length; s++,
- l++)
- r[l] = a[s];
- return this
- }
- console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e)
- },
- normalizeNormals: function() {
- for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
- e = r[o],
- t = r[o + 1],
- i = r[o + 2],
- n = 1 / Math.sqrt(e * e + t * t + i * i),
- r[o] *= n,
- r[o + 1] *= n,
- r[o + 2] *= n
- },
- toNonIndexed: function() {
- if (null === this.index)
- return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
- this;
- var e = new Ci.BufferGeometry
- , t = this.index.array
- , i = this.attributes;
- for (var n in i) {
- 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++) {
- l = t[h] * a;
- for (var d = 0; d < a; d++)
- s[c++] = o[l++]
- }
- e.addAttribute(n, new Ci.BufferAttribute(s,a))
- }
- return e
- },
- toJSON: function() {
- var e = {
- metadata: {
- version: 4.4,
- type: "BufferGeometry",
- generator: "BufferGeometry.toJSON"
- }
- };
- if (e.uuid = this.uuid,
- e.type = this.type,
- "" !== this.name && (e.name = this.name),
- void 0 !== this.parameters) {
- var t = this.parameters;
- for (var i in t)
- void 0 !== t[i] && (e[i] = t[i]);
- return e
- }
- e.data = {
- attributes: {}
- };
- var n = this.index;
- if (null !== n) {
- var r = Array.prototype.slice.call(n.array);
- e.data.index = {
- type: n.array.constructor.name,
- array: r
- }
- }
- var o = this.attributes;
- for (var i in o) {
- var a = o[i];
- r = Array.prototype.slice.call(a.array);
- e.data.attributes[i] = {
- itemSize: a.itemSize,
- type: a.array.constructor.name,
- array: r
- }
- }
- var s = this.groups;
- 0 < s.length && (e.data.groups = JSON.parse(JSON.stringify(s)));
- var l = this.boundingSphere;
- return null !== l && (e.data.boundingSphere = {
- center: l.center.toArray(),
- radius: l.radius
- }),
- e
- },
- clone: function() {
- return (new Ci.BufferGeometry).copy(this)
- },
- copy: function(e) {
- var t = e.index;
- null !== t && this.setIndex(t.clone());
- var i = e.attributes;
- for (var n in i) {
- var r = i[n];
- this.addAttribute(n, r.clone())
- }
- for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
- var l = o[a];
- this.addGroup(l.start, l.count)
- }
- return this
- },
- dispose: function() {
- this.dispatchEvent({
- type: "dispose"
- })
- }
- },
- Ci.EventDispatcher.prototype.apply(Ci.BufferGeometry.prototype),
- Ci.BufferGeometry.MaxIndex = 65535,
- Ci.InstancedBufferGeometry = function() {
- Ci.BufferGeometry.call(this),
- this.type = "InstancedBufferGeometry",
- this.maxInstancedCount = void 0
- }
- ,
- Ci.InstancedBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
- Ci.InstancedBufferGeometry.prototype.constructor = Ci.InstancedBufferGeometry,
- Ci.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
- this.groups.push({
- start: e,
- count: t,
- instances: i
- })
- }
- ,
- Ci.InstancedBufferGeometry.prototype.copy = function(e) {
- var t = e.index;
- null !== t && this.setIndex(t.clone());
- var i = e.attributes;
- for (var n in i) {
- var r = i[n];
- this.addAttribute(n, r.clone())
- }
- for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
- var l = o[a];
- this.addGroup(l.start, l.count, l.instances)
- }
- return this
- }
- ,
- Ci.EventDispatcher.prototype.apply(Ci.InstancedBufferGeometry.prototype),
- Ci.Uniform = function(e, t) {
- this.type = e,
- this.value = t,
- this.dynamic = !1
- }
- ,
- Ci.Uniform.prototype = {
- constructor: Ci.Uniform,
- onUpdate: function(e) {
- return this.dynamic = !0,
- this.onUpdateCallback = e,
- this
- }
- },
- Ci.AnimationClip = function(e, t, i) {
- this.name = e || Ci.Math.generateUUID(),
- this.tracks = i,
- this.duration = void 0 !== t ? t : -1,
- this.duration < 0 && this.resetDuration(),
- this.trim(),
- this.optimize()
- }
- ,
- Ci.AnimationClip.prototype = {
- constructor: Ci.AnimationClip,
- resetDuration: function() {
- for (var e = 0, t = 0, i = this.tracks.length; t !== i; ++t) {
- var n = this.tracks[t];
- e = Math.max(e, n.times[n.times.length - 1])
- }
- this.duration = e
- },
- trim: function() {
- for (var e = 0; e < this.tracks.length; e++)
- this.tracks[e].trim(0, this.duration);
- return this
- },
- optimize: function() {
- for (var e = 0; e < this.tracks.length; e++)
- this.tracks[e].optimize();
- return this
- }
- },
- Object.assign(Ci.AnimationClip, {
- parse: function(e) {
- for (var t = [], i = e.tracks, n = 1 / (e.fps || 1), r = 0, o = i.length; r !== o; ++r)
- t.push(Ci.KeyframeTrack.parse(i[r]).scale(n));
- return new Ci.AnimationClip(e.name,e.duration,t)
- },
- toJSON: function(e) {
- for (var t = [], i = e.tracks, n = {
- name: e.name,
- duration: e.duration,
- tracks: t
- }, r = 0, o = i.length; r !== o; ++r)
- t.push(Ci.KeyframeTrack.toJSON(i[r]));
- return n
- },
- CreateFromMorphTargetSequence: function(e, t, i) {
- for (var n = t.length, r = [], o = 0; o < n; o++) {
- var a = []
- , s = [];
- a.push((o + n - 1) % n, o, (o + 1) % n),
- s.push(0, 1, 0);
- var l = Ci.AnimationUtils.getKeyframeOrder(a);
- a = Ci.AnimationUtils.sortedArray(a, 1, l),
- s = Ci.AnimationUtils.sortedArray(s, 1, l),
- 0 === a[0] && (a.push(n),
- s.push(s[0])),
- r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluences[" + t[o].name + "]",a,s).scale(1 / i))
- }
- return new Ci.AnimationClip(e,-1,r)
- },
- findByName: function(e, t) {
- for (var i = 0; i < e.length; i++)
- if (e[i].name === t)
- return e[i];
- return null
- },
- CreateClipsFromMorphTargetSequences: function(e, t) {
- for (var i = {}, n = /^([\w-]*?)([\d]+)$/, r = 0, o = e.length; r < o; r++) {
- var a = e[r]
- , s = a.name.match(n);
- if (s && 1 < s.length) {
- var l = i[h = s[1]];
- l || (i[h] = l = []),
- l.push(a)
- }
- }
- var c = [];
- for (var h in i)
- c.push(Ci.AnimationClip.CreateFromMorphTargetSequence(h, i[h], t));
- return c
- },
- parseAnimation: function(e, t, i) {
- if (!e)
- return console.error(" no animation in JSONLoader data"),
- null;
- function n(e, t, i, n, r) {
- if (0 !== i.length) {
- var o = []
- , a = [];
- Ci.AnimationUtils.flattenJSON(i, o, a, n),
- 0 !== o.length && r.push(new e(t,o,a))
- }
- }
- for (var r = [], o = e.name || "default", a = e.length || -1, s = e.fps || 30, l = e.hierarchy || [], c = 0; c < l.length; c++) {
- var h = l[c].keys;
- if (h && 0 != h.length)
- if (h[0].morphTargets) {
- for (var u = {}, d = 0; d < h.length; d++)
- if (h[d].morphTargets)
- for (var p = 0; p < h[d].morphTargets.length; p++)
- u[h[d].morphTargets[p]] = -1;
- for (var f in u) {
- var g = []
- , m = [];
- for (p = 0; p !== h[d].morphTargets.length; ++p) {
- var v = h[d];
- g.push(v.time),
- m.push(v.morphTarget === f ? 1 : 0)
- }
- r.push(new Ci.NumberKeyframeTrack(".morphTargetInfluence[" + f + "]",g,m))
- }
- a = u.length * (s || 1)
- } else {
- var y = ".bones[" + t[c].name + "]";
- n(Ci.VectorKeyframeTrack, y + ".position", h, "pos", r),
- n(Ci.QuaternionKeyframeTrack, y + ".quaternion", h, "rot", r),
- n(Ci.VectorKeyframeTrack, y + ".scale", h, "scl", r)
- }
- }
- return 0 === r.length ? null : new Ci.AnimationClip(o,a,r)
- }
- }),
- Ci.AnimationMixer = function(e) {
- this._root = e,
- this._initMemoryManager(),
- this._accuIndex = 0,
- this.time = 0,
- this.timeScale = 1
- }
- ,
- Ci.AnimationMixer.prototype = {
- constructor: Ci.AnimationMixer,
- clipAction: function(e, t) {
- var i, n = (t || this._root).uuid, r = "string" == typeof e ? e : e.name, o = e !== r ? e : null, a = this._actionsByClip[r];
- if (void 0 !== a) {
- var s = a.actionByRoot[n];
- if (void 0 !== s)
- return s;
- if (o = (i = a.knownActions[0])._clip,
- e !== r && e !== o)
- throw new Error("Different clips with the same name detected!")
- }
- if (null === o)
- return null;
- var l = new Ci.AnimationMixer._Action(this,o,t);
- return this._bindAction(l, i),
- this._addInactiveAction(l, r, n),
- l
- },
- existingAction: function(e, t) {
- var i = (t || this._root).uuid
- , n = "string" == typeof e ? e : e.name
- , r = this._actionsByClip[n];
- return void 0 !== r && r.actionByRoot[i] || null
- },
- stopAllAction: function() {
- var e = this._actions
- , t = this._nActiveActions
- , i = this._bindings
- , n = this._nActiveBindings;
- this._nActiveActions = 0;
- for (var r = this._nActiveBindings = 0; r !== t; ++r)
- e[r].reset();
- for (r = 0; r !== n; ++r)
- i[r].useCount = 0;
- return this
- },
- update: function(e) {
- e *= this.timeScale;
- 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) {
- var s = t[a];
- s.enabled && s._update(n, e, r, o)
- }
- var l = this._bindings
- , c = this._nActiveBindings;
- for (a = 0; a !== c; ++a)
- l[a].apply(o);
- return this
- },
- getRoot: function() {
- return this._root
- },
- uncacheClip: function(e) {
- var t = this._actions
- , i = e.name
- , n = this._actionsByClip
- , r = n[i];
- if (void 0 !== r) {
- for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
- var l = o[a];
- this._deactivateAction(l);
- var c = l._cacheIndex
- , h = t[t.length - 1];
- l._cacheIndex = null,
- l._byClipCacheIndex = null,
- t[h._cacheIndex = c] = h,
- t.pop(),
- this._removeInactiveBindingsForAction(l)
- }
- delete n[i]
- }
- },
- uncacheRoot: function(e) {
- var t = e.uuid
- , i = this._actionsByClip;
- for (var n in i) {
- var r = i[n].actionByRoot[t];
- void 0 !== r && (this._deactivateAction(r),
- this._removeInactiveAction(r))
- }
- var o = this._bindingsByRootAndName[t];
- if (void 0 !== o)
- for (var a in o) {
- var s = o[a];
- s.restoreOriginalState(),
- this._removeInactiveBinding(s)
- }
- },
- uncacheAction: function(e, t) {
- var i = this.existingAction(e, t);
- null !== i && (this._deactivateAction(i),
- this._removeInactiveAction(i))
- }
- },
- Ci.EventDispatcher.prototype.apply(Ci.AnimationMixer.prototype),
- Ci.AnimationMixer._Action = function(e, t, i) {
- this._mixer = e,
- this._clip = t,
- this._localRoot = i || null;
- for (var n = t.tracks, r = n.length, o = new Array(r), a = {
- endingStart: Ci.ZeroCurvatureEnding,
- endingEnd: Ci.ZeroCurvatureEnding
- }, s = 0; s !== r; ++s) {
- var l = n[s].createInterpolant(null);
- (o[s] = l).settings = a
- }
- this._interpolantSettings = a,
- this._interpolants = o,
- this._propertyBindings = new Array(r),
- this._cacheIndex = null,
- this._byClipCacheIndex = null,
- this._timeScaleInterpolant = null,
- this._weightInterpolant = null,
- this.loop = Ci.LoopRepeat,
- this._loopCount = -1,
- this._startTime = null,
- this.time = 0,
- this.timeScale = 1,
- this._effectiveTimeScale = 1,
- this.weight = 1,
- this._effectiveWeight = 1,
- this.repetitions = 1 / 0,
- this.paused = !1,
- this.enabled = !0,
- this.clampWhenFinished = !1,
- this.zeroSlopeAtStart = !0,
- this.zeroSlopeAtEnd = !0
- }
- ,
- Ci.AnimationMixer._Action.prototype = {
- constructor: Ci.AnimationMixer._Action,
- play: function() {
- return this._mixer._activateAction(this),
- this
- },
- stop: function() {
- return this._mixer._deactivateAction(this),
- this.reset()
- },
- reset: function() {
- return this.paused = !1,
- this.enabled = !0,
- this.time = 0,
- this._loopCount = -1,
- this._startTime = null,
- this.stopFading().stopWarping()
- },
- isRunning: function() {
- return this._startTime,
- this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
- },
- isScheduled: function() {
- return this._mixer._isActiveAction(this)
- },
- startAt: function(e) {
- return this._startTime = e,
- this
- },
- setLoop: function(e, t) {
- return this.loop = e,
- this.repetitions = t,
- this
- },
- setEffectiveWeight: function(e) {
- return this.weight = e,
- this._effectiveWeight = this.enabled ? e : 0,
- this.stopFading()
- },
- getEffectiveWeight: function() {
- return this._effectiveWeight
- },
- fadeIn: function(e) {
- return this._scheduleFading(e, 0, 1)
- },
- fadeOut: function(e) {
- return this._scheduleFading(e, 1, 0)
- },
- crossFadeFrom: function(e, t, i) {
- if (this._mixer,
- e.fadeOut(t),
- this.fadeIn(t),
- i) {
- var n = this._clip.duration
- , r = e._clip.duration
- , o = r / n
- , a = n / r;
- e.warp(1, o, t),
- this.warp(a, 1, t)
- }
- return this
- },
- crossFadeTo: function(e, t, i) {
- return e.crossFadeFrom(this, t, i)
- },
- stopFading: function() {
- var e = this._weightInterpolant;
- return null !== e && (this._weightInterpolant = null,
- this._mixer._takeBackControlInterpolant(e)),
- this
- },
- setEffectiveTimeScale: function(e) {
- return this.timeScale = e,
- this._effectiveTimeScale = this.paused ? 0 : e,
- this.stopWarping()
- },
- getEffectiveTimeScale: function() {
- return this._effectiveTimeScale
- },
- setDuration: function(e) {
- return this.timeScale = this._clip.duration / e,
- this.stopWarping()
- },
- syncWith: function(e) {
- return this.time = e.time,
- this.timeScale = e.timeScale,
- this.stopWarping()
- },
- halt: function(e) {
- return this.warp(this._currentTimeScale, 0, e)
- },
- warp: function(e, t, i) {
- var n = this._mixer
- , r = n.time
- , o = this._timeScaleInterpolant
- , a = this.timeScale;
- null === o && (o = n._lendControlInterpolant(),
- this._timeScaleInterpolant = o);
- var s = o.parameterPositions
- , l = o.sampleValues;
- return s[0] = r,
- s[1] = r + i,
- l[0] = e / a,
- l[1] = t / a,
- this
- },
- stopWarping: function() {
- var e = this._timeScaleInterpolant;
- return null !== e && (this._timeScaleInterpolant = null,
- this._mixer._takeBackControlInterpolant(e)),
- this
- },
- getMixer: function() {
- return this._mixer
- },
- getClip: function() {
- return this._clip
- },
- getRoot: function() {
- return this._localRoot || this._mixer._root
- },
- _update: function(e, t, i, n) {
- var r = this._startTime;
- if (null !== r) {
- var o = (e - r) * i;
- if (o < 0 || 0 === i)
- return;
- this._startTime = null,
- t = i * o
- }
- t *= this._updateTimeScale(e);
- var a = this._updateTime(t)
- , s = this._updateWeight(e);
- if (0 < s)
- for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
- l[h].evaluate(a),
- c[h].accumulate(n, s)
- },
- _updateWeight: function(e) {
- var t = 0;
- if (this.enabled) {
- t = this.weight;
- var i = this._weightInterpolant;
- if (null !== i) {
- var n = i.evaluate(e)[0];
- t *= n,
- e > i.parameterPositions[1] && (this.stopFading(),
- 0 === n && (this.enabled = !1))
- }
- }
- return this._effectiveWeight = t
- },
- _updateTimeScale: function(e) {
- var t = 0;
- if (!this.paused) {
- t = this.timeScale;
- var i = this._timeScaleInterpolant;
- if (null !== i)
- t *= i.evaluate(e)[0],
- e > i.parameterPositions[1] && (this.stopWarping(),
- 0 === t ? this.pause = !0 : this.timeScale = t)
- }
- return this._effectiveTimeScale = t
- },
- _updateTime: function(e) {
- var t = this.time + e;
- if (0 === e)
- return t;
- var i = this._clip.duration
- , n = this.loop
- , r = this._loopCount
- , o = !1;
- switch (n) {
- case Ci.LoopOnce:
- if (-1 === r && (this.loopCount = 0,
- this._setEndings(!0, !0, !1)),
- i <= t)
- t = i;
- else {
- if (!(t < 0))
- break;
- t = 0
- }
- this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
- this._mixer.dispatchEvent({
- type: "finished",
- action: this,
- direction: e < 0 ? -1 : 1
- });
- break;
- case Ci.LoopPingPong:
- o = !0;
- case Ci.LoopRepeat:
- if (-1 === r && (0 < e ? (r = 0,
- this._setEndings(!0, 0 === this.repetitions, o)) : this._setEndings(0 === this.repetitions, !0, o)),
- i <= t || t < 0) {
- var a = Math.floor(t / i);
- t -= i * a,
- r += Math.abs(a);
- var s = this.repetitions - r;
- if (s < 0) {
- this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
- t = 0 < e ? i : 0,
- this._mixer.dispatchEvent({
- type: "finished",
- action: this,
- direction: 0 < e ? 1 : -1
- });
- break
- }
- if (0 == s) {
- var l = e < 0;
- this._setEndings(l, !l, o)
- } else
- this._setEndings(!1, !1, o);
- this._loopCount = r,
- this._mixer.dispatchEvent({
- type: "loop",
- action: this,
- loopDelta: a
- })
- }
- if (n === Ci.LoopPingPong && 1 == (1 & r))
- return i - (this.time = t)
- }
- return this.time = t
- },
- _setEndings: function(e, t, i) {
- var n = this._interpolantSettings;
- i ? (n.endingStart = Ci.ZeroSlopeEnding,
- n.endingEnd = Ci.ZeroSlopeEnding) : (n.endingStart = e ? this.zeroSlopeAtStart ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding,
- n.endingEnd = t ? this.zeroSlopeAtEnd ? Ci.ZeroSlopeEnding : Ci.ZeroCurvatureEnding : Ci.WrapAroundEnding)
- },
- _scheduleFading: function(e, t, i) {
- var n = this._mixer
- , r = n.time
- , o = this._weightInterpolant;
- null === o && (o = n._lendControlInterpolant(),
- this._weightInterpolant = o);
- var a = o.parameterPositions
- , s = o.sampleValues;
- return a[0] = r,
- s[0] = t,
- a[1] = r + e,
- s[1] = i,
- this
- }
- },
- Object.assign(Ci.AnimationMixer.prototype, {
- _bindAction: function(e, t) {
- var i = e._localRoot || this._root
- , n = e._clip.tracks
- , r = n.length
- , o = e._propertyBindings
- , a = e._interpolants
- , s = i.uuid
- , l = this._bindingsByRootAndName
- , c = l[s];
- void 0 === c && (c = {},
- l[s] = c);
- for (var h = 0; h !== r; ++h) {
- var u = n[h]
- , d = u.name
- , p = c[d];
- if (void 0 !== p)
- o[h] = p;
- else {
- if (void 0 !== (p = o[h])) {
- null === p._cacheIndex && (++p.referenceCount,
- this._addInactiveBinding(p, s, d));
- continue
- }
- var f = t && t._propertyBindings[h].binding.parsedPath;
- ++(p = new Ci.PropertyMixer(Ci.PropertyBinding.create(i, d, f),u.ValueTypeName,u.getValueSize())).referenceCount,
- this._addInactiveBinding(p, s, d),
- o[h] = p
- }
- a[h].resultBuffer = p.buffer
- }
- },
- _activateAction: function(e) {
- if (!this._isActiveAction(e)) {
- if (null === e._cacheIndex) {
- var t = (e._localRoot || this._root).uuid
- , i = e._clip.name
- , n = this._actionsByClip[i];
- this._bindAction(e, n && n.knownActions[0]),
- this._addInactiveAction(e, i, t)
- }
- for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
- var s = r[o];
- 0 == s.useCount++ && (this._lendBinding(s),
- s.saveOriginalState())
- }
- this._lendAction(e)
- }
- },
- _deactivateAction: function(e) {
- if (this._isActiveAction(e)) {
- for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
- var r = t[i];
- 0 == --r.useCount && (r.restoreOriginalState(),
- this._takeBackBinding(r))
- }
- this._takeBackAction(e)
- }
- },
- _initMemoryManager: function() {
- this._actions = [],
- this._nActiveActions = 0,
- this._actionsByClip = {},
- this._bindings = [],
- this._nActiveBindings = 0,
- this._bindingsByRootAndName = {},
- this._controlInterpolants = [],
- this._nActiveControlInterpolants = 0;
- var e = this;
- this.stats = {
- actions: {
- get total() {
- return e._actions.length
- },
- get inUse() {
- return e._nActiveActions
- }
- },
- bindings: {
- get total() {
- return e._bindings.length
- },
- get inUse() {
- return e._nActiveBindings
- }
- },
- controlInterpolants: {
- get total() {
- return e._controlInterpolants.length
- },
- get inUse() {
- return e._nActiveControlInterpolants
- }
- }
- }
- },
- _isActiveAction: function(e) {
- var t = e._cacheIndex;
- return null !== t && t < this._nActiveActions
- },
- _addInactiveAction: function(e, t, i) {
- var n = this._actions
- , r = this._actionsByClip
- , o = r[t];
- if (void 0 === o)
- o = {
- knownActions: [e],
- actionByRoot: {}
- },
- e._byClipCacheIndex = 0,
- r[t] = o;
- else {
- var a = o.knownActions;
- e._byClipCacheIndex = a.length,
- a.push(e)
- }
- e._cacheIndex = n.length,
- n.push(e),
- o.actionByRoot[i] = e
- },
- _removeInactiveAction: function(e) {
- var t = this._actions
- , i = t[t.length - 1]
- , n = e._cacheIndex;
- t[i._cacheIndex = n] = i,
- t.pop(),
- e._cacheIndex = null;
- var r = e._clip.name
- , o = this._actionsByClip
- , a = o[r]
- , s = a.knownActions
- , l = s[s.length - 1]
- , c = e._byClipCacheIndex;
- s[l._byClipCacheIndex = c] = l,
- s.pop(),
- e._byClipCacheIndex = null,
- delete a.actionByRoot[(t._localRoot || this._root).uuid],
- 0 === s.length && delete o[r],
- this._removeInactiveBindingsForAction(e)
- },
- _removeInactiveBindingsForAction: function(e) {
- for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
- var r = t[i];
- 0 == --r.referenceCount && this._removeInactiveBinding(r)
- }
- },
- _lendAction: function(e) {
- var t = this._actions
- , i = e._cacheIndex
- , n = this._nActiveActions++
- , r = t[n];
- t[e._cacheIndex = n] = e,
- t[r._cacheIndex = i] = r
- },
- _takeBackAction: function(e) {
- var t = this._actions
- , i = e._cacheIndex
- , n = --this._nActiveActions
- , r = t[n];
- t[e._cacheIndex = n] = e,
- t[r._cacheIndex = i] = r
- },
- _addInactiveBinding: function(e, t, i) {
- var n = this._bindingsByRootAndName
- , r = n[t]
- , o = this._bindings;
- void 0 === r && (r = {},
- n[t] = r),
- (r[i] = e)._cacheIndex = o.length,
- o.push(e)
- },
- _removeInactiveBinding: function(e) {
- var t = this._bindings
- , i = e.binding
- , n = i.rootNode.uuid
- , r = i.path
- , o = this._bindingsByRootAndName
- , a = o[n]
- , s = t[t.length - 1]
- , l = e._cacheIndex;
- t[s._cacheIndex = l] = s,
- t.pop(),
- delete a[r];
- e: {
- for (var c in a)
- break e;
- delete o[n]
- }
- },
- _lendBinding: function(e) {
- var t = this._bindings
- , i = e._cacheIndex
- , n = this._nActiveBindings++
- , r = t[n];
- t[e._cacheIndex = n] = e,
- t[r._cacheIndex = i] = r
- },
- _takeBackBinding: function(e) {
- var t = this._bindings
- , i = e._cacheIndex
- , n = --this._nActiveBindings
- , r = t[n];
- t[e._cacheIndex = n] = e,
- t[r._cacheIndex = i] = r
- },
- _lendControlInterpolant: function() {
- var e = this._controlInterpolants
- , t = this._nActiveControlInterpolants++
- , i = e[t];
- return void 0 === i && (e[(i = new Ci.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex = t] = i),
- i
- },
- _takeBackControlInterpolant: function(e) {
- var t = this._controlInterpolants
- , i = e.__cacheIndex
- , n = --this._nActiveControlInterpolants
- , r = t[n];
- t[e.__cacheIndex = n] = e,
- t[r.__cacheIndex = i] = r
- },
- _controlInterpolantsResultBuffer: new Float32Array(1)
- }),
- Ci.AnimationObjectGroup = function(e) {
- this.uuid = Ci.Math.generateUUID(),
- this._objects = Array.prototype.slice.call(arguments),
- this.nCachedObjects_ = 0;
- var t = {};
- this._indicesByUUID = t;
- for (var i = 0, n = arguments.length; i !== n; ++i)
- t[arguments[i].uuid] = i;
- this._paths = [],
- this._parsedPaths = [],
- this._bindings = [],
- this._bindingsIndicesByPath = {};
- var r = this;
- this.stats = {
- objects: {
- get total() {
- return r._objects.length
- },
- get inUse() {
- return this.total - r.nCachedObjects_
- }
- },
- get bindingsPerObject() {
- return r._bindings.length
- }
- }
- }
- ,
- Ci.AnimationObjectGroup.prototype = {
- constructor: Ci.AnimationObjectGroup,
- add: function(e) {
- 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) {
- var u = arguments[c]
- , d = u.uuid
- , p = r[d];
- if (void 0 === p) {
- p = i++,
- r[d] = p,
- t.push(u);
- for (var f = 0, g = l; f !== g; ++f)
- s[f].push(new Ci.PropertyBinding(u,o[f],a[f]))
- } else if (p < n) {
- var m = t[p]
- , v = --n
- , y = t[v];
- t[r[y.uuid] = p] = y,
- t[r[d] = v] = u;
- for (f = 0,
- g = l; f !== g; ++f) {
- var A = s[f]
- , C = A[v]
- , I = A[p];
- A[p] = C,
- void 0 === I && (I = new Ci.PropertyBinding(u,o[f],a[f])),
- A[v] = I
- }
- } else
- t[p] !== m && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
- }
- this.nCachedObjects_ = n
- },
- remove: function(e) {
- for (var t = this._objects, i = (t.length,
- this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
- var l = arguments[a]
- , c = l.uuid
- , h = n[c];
- if (void 0 !== h && i <= h) {
- var u = i++
- , d = t[u];
- t[n[d.uuid] = h] = d,
- t[n[c] = u] = l;
- for (var p = 0, f = o; p !== f; ++p) {
- var g = r[p]
- , m = g[u]
- , v = g[h];
- g[h] = m,
- g[u] = v
- }
- }
- }
- this.nCachedObjects_ = i
- },
- uncache: function(e) {
- 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) {
- var c = arguments[s].uuid
- , h = r[c];
- if (void 0 !== h)
- if (delete r[c],
- h < n) {
- var u = --n
- , d = t[u]
- , p = t[y = --i];
- t[r[d.uuid] = h] = d,
- t[r[p.uuid] = u] = p,
- t.pop();
- for (var f = 0, g = a; f !== g; ++f) {
- var m = (A = o[f])[u]
- , v = A[y];
- A[h] = m,
- A[u] = v,
- A.pop()
- }
- } else {
- var y;
- t[r[(p = t[y = --i]).uuid] = h] = p,
- t.pop();
- for (f = 0,
- g = a; f !== g; ++f) {
- var A;
- (A = o[f])[h] = A[y],
- A.pop()
- }
- }
- }
- this.nCachedObjects_ = n
- },
- subscribe_: function(e, t) {
- var i = this._bindingsIndicesByPath
- , n = i[e]
- , r = this._bindings;
- if (void 0 !== n)
- return r[n];
- var o = this._paths
- , a = this._parsedPaths
- , s = this._objects
- , l = s.length
- , c = this.nCachedObjects_
- , h = new Array(l);
- n = r.length,
- i[e] = n,
- o.push(e),
- a.push(t),
- r.push(h);
- for (var u = c, d = s.length; u !== d; ++u) {
- var p = s[u];
- h[u] = new Ci.PropertyBinding(p,e,t)
- }
- return h
- },
- unsubscribe_: function(e) {
- var t = this._bindingsIndicesByPath
- , i = t[e];
- if (void 0 !== i) {
- var n = this._paths
- , r = this._parsedPaths
- , o = this._bindings
- , a = o.length - 1
- , s = o[a];
- o[t[e[a]] = i] = s,
- o.pop(),
- r[i] = r[a],
- r.pop(),
- n[i] = n[a],
- n.pop()
- }
- }
- },
- Ci.AnimationUtils = {
- arraySlice: function(e, t, i) {
- return Ci.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
- },
- convertArray: function(e, t, i) {
- return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
- },
- isTypedArray: function(e) {
- return ArrayBuffer.isView(e) && !(e instanceof DataView)
- },
- getKeyframeOrder: function(i) {
- for (var e = i.length, t = new Array(e), n = 0; n !== e; ++n)
- t[n] = n;
- return t.sort(function(e, t) {
- return i[e] - i[t]
- }),
- t
- },
- sortedArray: function(e, t, i) {
- for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
- for (var s = i[o] * t, l = 0; l !== t; ++l)
- r[a++] = e[s + l];
- return r
- },
- flattenJSON: function(e, t, i, n) {
- for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
- o = e[r++];
- if (void 0 !== o) {
- var a = o[n];
- if (void 0 !== a)
- if (Array.isArray(a))
- for (; void 0 !== (a = o[n]) && (t.push(o.time),
- i.push.apply(i, a)),
- void 0 !== (o = e[r++]); )
- ;
- else if (void 0 !== a.toArray)
- for (; void 0 !== (a = o[n]) && (t.push(o.time),
- a.toArray(i, i.length)),
- void 0 !== (o = e[r++]); )
- ;
- else
- for (; void 0 !== (a = o[n]) && (t.push(o.time),
- i.push(a)),
- void 0 !== (o = e[r++]); )
- ;
- }
- }
- },
- Ci.KeyframeTrack = function(e, t, i, n) {
- if (void 0 === e)
- throw new Error("track name is undefined");
- if (void 0 === t || 0 === t.length)
- throw new Error("no keyframes in track named " + e);
- this.name = e,
- this.times = Ci.AnimationUtils.convertArray(t, this.TimeBufferType),
- this.values = Ci.AnimationUtils.convertArray(i, this.ValueBufferType),
- this.setInterpolation(n || this.DefaultInterpolation),
- this.validate(),
- this.optimize()
- }
- ,
- Ci.KeyframeTrack.prototype = {
- constructor: Ci.KeyframeTrack,
- TimeBufferType: Float32Array,
- ValueBufferType: Float32Array,
- DefaultInterpolation: Ci.InterpolateLinear,
- InterpolantFactoryMethodDiscrete: function(e) {
- return new Ci.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
- },
- InterpolantFactoryMethodLinear: function(e) {
- return new Ci.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
- },
- InterpolantFactoryMethodSmooth: function(e) {
- return new Ci.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
- },
- setInterpolation: function(e) {
- var t = void 0;
- switch (e) {
- case Ci.InterpolateDiscrete:
- t = this.InterpolantFactoryMethodDiscrete;
- break;
- case Ci.InterpolateLinear:
- t = this.InterpolantFactoryMethodLinear;
- break;
- case Ci.InterpolateSmooth:
- t = this.InterpolantFactoryMethodSmooth
- }
- if (void 0 !== t)
- this.createInterpolant = t;
- else {
- var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
- if (void 0 === this.createInterpolant) {
- if (e === this.DefaultInterpolation)
- throw new Error(i);
- this.setInterpolation(this.DefaultInterpolation)
- }
- console.warn(i)
- }
- },
- getInterpolation: function() {
- switch (this.createInterpolant) {
- case this.InterpolantFactoryMethodDiscrete:
- return Ci.InterpolateDiscrete;
- case this.InterpolantFactoryMethodLinear:
- return Ci.InterpolateLinear;
- case this.InterpolantFactoryMethodSmooth:
- return Ci.InterpolateSmooth
- }
- },
- getValueSize: function() {
- return this.values.length / this.times.length
- },
- shift: function(e) {
- if (0 !== e)
- for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
- t[i] += e;
- return this
- },
- scale: function(e) {
- if (1 !== e)
- for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
- t[i] *= e;
- return this
- },
- trim: function(e, t) {
- for (var i = this.times, n = i.length, r = 0, o = n - 1; r !== n && i[r] < e; )
- ++r;
- for (; -1 !== o && i[o] > t; )
- --o;
- if (++o,
- 0 !== r || o !== n) {
- o <= r && (r = (o = Math.max(o, 1)) - 1);
- var a = this.getValueSize();
- this.times = Ci.AnimationUtils.arraySlice(i, r, o),
- this.values = Ci.AnimationUtils.arraySlice(this.values, r * a, o * a)
- }
- return this
- },
- validate: function() {
- var e = !0
- , t = this.getValueSize();
- t - Math.floor(t) != 0 && (console.error("invalid value size in track", this),
- e = !1);
- var i = this.times
- , n = this.values
- , r = i.length;
- 0 === r && (console.error("track is empty", this),
- e = !1);
- for (var o = null, a = 0; a !== r; a++) {
- var s = i[a];
- if ("number" == typeof s && isNaN(s)) {
- console.error("time is not a valid number", this, a, s),
- e = !1;
- break
- }
- if (null !== o && s < o) {
- console.error("out of order keys", this, a, s, o),
- e = !1;
- break
- }
- o = s
- }
- if (void 0 !== n && Ci.AnimationUtils.isTypedArray(n)) {
- a = 0;
- for (var l = n.length; a !== l; ++a) {
- var c = n[a];
- if (isNaN(c)) {
- console.error("value is not a valid number", this, a, c),
- e = !1;
- break
- }
- }
- }
- return e
- },
- optimize: function() {
- for (var e = this.times, t = this.values, i = this.getValueSize(), n = 1, r = 1, o = e.length - 1; r <= o; ++r) {
- var a = !1
- , s = e[r];
- if (s !== e[r + 1] && (1 !== r || s !== s[0]))
- for (var l = r * i, c = l - i, h = l + i, u = 0; u !== i; ++u) {
- var d = t[l + u];
- if (d !== t[c + u] || d !== t[h + u]) {
- a = !0;
- break
- }
- }
- if (a) {
- if (r !== n) {
- e[n] = e[r];
- var p = r * i
- , f = n * i;
- for (u = 0; u !== i; ++u)
- t[f + u] = t[p + u]
- }
- ++n
- }
- }
- return n !== e.length && (this.times = Ci.AnimationUtils.arraySlice(e, 0, n),
- this.values = Ci.AnimationUtils.arraySlice(t, 0, n * i)),
- this
- }
- },
- Object.assign(Ci.KeyframeTrack, {
- parse: function(e) {
- if (void 0 === e.type)
- throw new Error("track type undefined, can not parse");
- var t = Ci.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
- if (void 0 === e.times) {
- console.warn("legacy JSON format detected, converting");
- var i = []
- , n = [];
- Ci.AnimationUtils.flattenJSON(e.keys, i, n, "value"),
- e.times = i,
- e.values = n
- }
- return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
- },
- toJSON: function(e) {
- var t, i = e.constructor;
- if (void 0 !== i.toJSON)
- t = i.toJSON(e);
- else {
- t = {
- name: e.name,
- times: Ci.AnimationUtils.convertArray(e.times, Array),
- values: Ci.AnimationUtils.convertArray(e.values, Array)
- };
- var n = e.getInterpolation();
- n !== e.DefaultInterpolation && (t.interpolation = n)
- }
- return t.type = e.ValueTypeName,
- t
- },
- _getTrackTypeForValueTypeName: function(e) {
- switch (e.toLowerCase()) {
- case "scalar":
- case "double":
- case "float":
- case "number":
- case "integer":
- return Ci.NumberKeyframeTrack;
- case "vector":
- case "vector2":
- case "vector3":
- case "vector4":
- return Ci.VectorKeyframeTrack;
- case "color":
- return Ci.ColorKeyframeTrack;
- case "quaternion":
- return Ci.QuaternionKeyframeTrack;
- case "bool":
- case "boolean":
- return Ci.BooleanKeyframeTrack;
- case "string":
- return Ci.StringKeyframeTrack
- }
- throw new Error("Unsupported typeName: " + e)
- }
- }),
- Ci.PropertyBinding = function(e, t, i) {
- this.path = t,
- this.parsedPath = i || Ci.PropertyBinding.parseTrackName(t),
- this.node = Ci.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
- this.rootNode = e
- }
- ,
- Ci.PropertyBinding.prototype = {
- constructor: Ci.PropertyBinding,
- getValue: function(e, t) {
- this.bind(),
- this.getValue(e, t)
- },
- setValue: function(e, t) {
- this.bind(),
- this.setValue(e, t)
- },
- bind: function() {
- var e = this.node
- , t = this.parsedPath
- , i = t.objectName
- , n = t.propertyName
- , r = t.propertyIndex;
- if (e || (e = Ci.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
- this.node = e),
- this.getValue = this._getValue_unavailable,
- this.setValue = this._setValue_unavailable,
- e) {
- if (i) {
- var o = t.objectIndex;
- switch (i) {
- case "materials":
- if (!e.material)
- return void console.error(" can not bind to material as node does not have a material", this);
- if (!e.material.materials)
- return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
- e = e.material.materials;
- break;
- case "bones":
- if (!e.skeleton)
- return void console.error(" can not bind to bones as node does not have a skeleton", this);
- e = e.skeleton.bones;
- for (var a = 0; a < e.length; a++)
- if (e[a].name === o) {
- o = a;
- break
- }
- break;
- default:
- if (void 0 === e[i])
- return void console.error(" can not bind to objectName of node, undefined", this);
- e = e[i]
- }
- if (void 0 !== o) {
- if (void 0 === e[o])
- return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
- e = e[o]
- }
- }
- var s = e[n];
- if (s) {
- var l = this.Versioning.None;
- void 0 !== e.needsUpdate ? (l = this.Versioning.NeedsUpdate,
- this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (l = this.Versioning.MatrixWorldNeedsUpdate,
- this.targetObject = e);
- var c = this.BindingType.Direct;
- if (void 0 !== r) {
- if ("morphTargetInfluences" === n) {
- if (!e.geometry)
- return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
- if (!e.geometry.morphTargets)
- return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
- for (a = 0; a < this.node.geometry.morphTargets.length; a++)
- if (e.geometry.morphTargets[a].name === r) {
- r = a;
- break
- }
- }
- c = this.BindingType.ArrayElement,
- this.resolvedProperty = s,
- this.propertyIndex = r
- } else
- void 0 !== s.fromArray && void 0 !== s.toArray ? (c = this.BindingType.HasFromToArray,
- this.resolvedProperty = s) : void 0 !== s.length ? (c = this.BindingType.EntireArray,
- this.resolvedProperty = s) : this.propertyName = n;
- this.getValue = this.GetterByBindingType[c],
- this.setValue = this.SetterByBindingTypeAndVersioning[c][l]
- } else {
- var h = t.nodeName;
- console.error(" trying to update property for track: " + h + "." + n + " but it wasn't found.", e)
- }
- } else
- console.error(" trying to update node for track: " + this.path + " but it wasn't found.")
- },
- unbind: function() {
- this.node = null,
- this.getValue = this._getValue_unbound,
- this.setValue = this._setValue_unbound
- }
- },
- Object.assign(Ci.PropertyBinding.prototype, {
- _getValue_unavailable: function() {},
- _setValue_unavailable: function() {},
- _getValue_unbound: Ci.PropertyBinding.prototype.getValue,
- _setValue_unbound: Ci.PropertyBinding.prototype.setValue,
- BindingType: {
- Direct: 0,
- EntireArray: 1,
- ArrayElement: 2,
- HasFromToArray: 3
- },
- Versioning: {
- None: 0,
- NeedsUpdate: 1,
- MatrixWorldNeedsUpdate: 2
- },
- GetterByBindingType: [function(e, t) {
- e[t] = this.node[this.propertyName]
- }
- , function(e, t) {
- for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
- e[t++] = i[n]
- }
- , function(e, t) {
- e[t] = this.resolvedProperty[this.propertyIndex]
- }
- , function(e, t) {
- this.resolvedProperty.toArray(e, t)
- }
- ],
- SetterByBindingTypeAndVersioning: [[function(e, t) {
- this.node[this.propertyName] = e[t]
- }
- , function(e, t) {
- this.node[this.propertyName] = e[t],
- this.targetObject.needsUpdate = !0
- }
- , function(e, t) {
- this.node[this.propertyName] = e[t],
- this.targetObject.matrixWorldNeedsUpdate = !0
- }
- ], [function(e, t) {
- for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
- i[n] = e[t++]
- }
- , function(e, t) {
- for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
- i[n] = e[t++];
- this.targetObject.needsUpdate = !0
- }
- , function(e, t) {
- for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
- i[n] = e[t++];
- this.targetObject.matrixWorldNeedsUpdate = !0
- }
- ], [function(e, t) {
- this.resolvedProperty[this.propertyIndex] = e[t]
- }
- , function(e, t) {
- this.resolvedProperty[this.propertyIndex] = e[t],
- this.targetObject.needsUpdate = !0
- }
- , function(e, t) {
- this.resolvedProperty[this.propertyIndex] = e[t],
- this.targetObject.matrixWorldNeedsUpdate = !0
- }
- ], [function(e, t) {
- this.resolvedProperty.fromArray(e, t)
- }
- , function(e, t) {
- this.resolvedProperty.fromArray(e, t),
- this.targetObject.needsUpdate = !0
- }
- , function(e, t) {
- this.resolvedProperty.fromArray(e, t),
- this.targetObject.matrixWorldNeedsUpdate = !0
- }
- ]]
- }),
- Ci.PropertyBinding.Composite = function(e, t, i) {
- var n = i || Ci.PropertyBinding.parseTrackName(t);
- this._targetGroup = e,
- this._bindings = e.subscribe_(t, n)
- }
- ,
- Ci.PropertyBinding.Composite.prototype = {
- constructor: Ci.PropertyBinding.Composite,
- getValue: function(e, t) {
- this.bind();
- var i = this._targetGroup.nCachedObjects_
- , n = this._bindings[i];
- void 0 !== n && n.getValue(e, t)
- },
- setValue: function(e, t) {
- for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
- i[n].setValue(e, t)
- },
- bind: function() {
- for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
- e[t].bind()
- },
- unbind: function() {
- for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
- e[t].unbind()
- }
- },
- Ci.PropertyBinding.create = function(e, t, i) {
- return e instanceof Ci.AnimationObjectGroup ? new Ci.PropertyBinding.Composite(e,t,i) : new Ci.PropertyBinding(e,t,i)
- }
- ,
- Ci.PropertyBinding.parseTrackName = function(e) {
- var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
- , i = t.exec(e);
- if (!i)
- throw new Error("cannot parse trackName at all: " + e);
- i.index === t.lastIndex && t.lastIndex++;
- var n = {
- nodeName: i[3],
- objectName: i[5],
- objectIndex: i[7],
- propertyName: i[9],
- propertyIndex: i[11]
- };
- if (null === n.propertyName || 0 === n.propertyName.length)
- throw new Error("can not parse propertyName from trackName: " + e);
- return n
- }
- ,
- Ci.PropertyBinding.findNode = function(e, r) {
- if (!r || "" === r || "root" === r || "." === r || -1 === r || r === e.name || r === e.uuid)
- return e;
- if (e.skeleton) {
- var t = function(e) {
- for (var t = 0; t < e.bones.length; t++) {
- var i = e.bones[t];
- if (i.name === r)
- return i
- }
- return null
- }(e.skeleton);
- if (t)
- return t
- }
- if (e.children) {
- var o = function(e) {
- for (var t = 0; t < e.length; t++) {
- var i = e[t];
- if (i.name === r || i.uuid === r)
- return i;
- var n = o(i.children);
- if (n)
- return n
- }
- return null
- }
- , i = o(e.children);
- if (i)
- return i
- }
- return null
- }
- ,
- Ci.PropertyMixer = function(e, t, i) {
- this.binding = e,
- this.valueSize = i;
- var n, r = Float64Array;
- switch (t) {
- case "quaternion":
- n = this._slerp;
- break;
- case "string":
- case "bool":
- r = Array,
- n = this._select;
- break;
- default:
- n = this._lerp
- }
- this.buffer = new r(4 * i),
- this._mixBufferRegion = n,
- this.cumulativeWeight = 0,
- this.useCount = 0,
- this.referenceCount = 0
- }
- ,
- Ci.PropertyMixer.prototype = {
- constructor: Ci.PropertyMixer,
- accumulate: function(e, t) {
- var i = this.buffer
- , n = this.valueSize
- , r = e * n + n
- , o = this.cumulativeWeight;
- if (0 === o) {
- for (var a = 0; a !== n; ++a)
- i[r + a] = i[a];
- o = t
- } else {
- var s = t / (o += t);
- this._mixBufferRegion(i, r, 0, s, n)
- }
- this.cumulativeWeight = o
- },
- apply: function(e) {
- var t = this.valueSize
- , i = this.buffer
- , n = e * t + t
- , r = this.cumulativeWeight
- , o = this.binding;
- if (this.cumulativeWeight = 0,
- r < 1) {
- var a = 3 * t;
- this._mixBufferRegion(i, n, a, 1 - r, t)
- }
- for (var s = t, l = t + t; s !== l; ++s)
- if (i[s] !== i[s + t]) {
- o.setValue(i, n);
- break
- }
- },
- saveOriginalState: function() {
- var e = this.binding
- , t = this.buffer
- , i = this.valueSize
- , n = 3 * i;
- e.getValue(t, n);
- for (var r = i, o = n; r !== o; ++r)
- t[r] = t[n + r % i];
- this.cumulativeWeight = 0
- },
- restoreOriginalState: function() {
- var e = 3 * this.valueSize;
- this.binding.setValue(this.buffer, e)
- },
- _select: function(e, t, i, n, r) {
- if (.5 <= n)
- for (var o = 0; o !== r; ++o)
- e[t + o] = e[i + o]
- },
- _slerp: function(e, t, i, n, r) {
- Ci.Quaternion.slerpFlat(e, t, e, t, e, i, n)
- },
- _lerp: function(e, t, i, n, r) {
- for (var o = 1 - n, a = 0; a !== r; ++a) {
- var s = t + a;
- e[s] = e[s] * o + e[i + a] * n
- }
- }
- },
- Ci.BooleanKeyframeTrack = function(e, t, i) {
- Ci.KeyframeTrack.call(this, e, t, i)
- }
- ,
- Ci.BooleanKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
- constructor: Ci.BooleanKeyframeTrack,
- ValueTypeName: "bool",
- ValueBufferType: Array,
- DefaultInterpolation: Ci.IntepolateDiscrete,
- InterpolantFactoryMethodLinear: void 0,
- InterpolantFactoryMethodSmooth: void 0
- }),
- Ci.NumberKeyframeTrack = function(e, t, i, n) {
- Ci.KeyframeTrack.call(this, e, t, i, n)
- }
- ,
- Ci.NumberKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
- constructor: Ci.NumberKeyframeTrack,
- ValueTypeName: "number"
- }),
- Ci.QuaternionKeyframeTrack = function(e, t, i, n) {
- Ci.KeyframeTrack.call(this, e, t, i, n)
- }
- ,
- Ci.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
- constructor: Ci.QuaternionKeyframeTrack,
- ValueTypeName: "quaternion",
- DefaultInterpolation: Ci.InterpolateLinear,
- InterpolantFactoryMethodLinear: function(e) {
- return new Ci.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
- },
- InterpolantFactoryMethodSmooth: void 0
- }),
- Ci.StringKeyframeTrack = function(e, t, i, n) {
- Ci.KeyframeTrack.call(this, e, t, i, n)
- }
- ,
- Ci.StringKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
- constructor: Ci.StringKeyframeTrack,
- ValueTypeName: "string",
- ValueBufferType: Array,
- DefaultInterpolation: Ci.IntepolateDiscrete,
- InterpolantFactoryMethodLinear: void 0,
- InterpolantFactoryMethodSmooth: void 0
- }),
- Ci.VectorKeyframeTrack = function(e, t, i, n) {
- Ci.KeyframeTrack.call(this, e, t, i, n)
- }
- ,
- Ci.VectorKeyframeTrack.prototype = Object.assign(Object.create(Ci.KeyframeTrack.prototype), {
- constructor: Ci.VectorKeyframeTrack,
- ValueTypeName: "vector"
- }),
- Ci.Audio = function(e) {
- Ci.Object3D.call(this),
- this.type = "Audio",
- this.context = e.context,
- this.source = this.context.createBufferSource(),
- this.source.onended = this.onEnded.bind(this),
- this.gain = this.context.createGain(),
- this.gain.connect(e.getInput()),
- this.autoplay = !1,
- this.startTime = 0,
- this.playbackRate = 1,
- this.isPlaying = !1,
- this.hasPlaybackControl = !0,
- this.sourceType = "empty",
- this.filter = null
- }
- ,
- Ci.Audio.prototype = Object.create(Ci.Object3D.prototype),
- Ci.Audio.prototype.constructor = Ci.Audio,
- Ci.Audio.prototype.getOutput = function() {
- return this.gain
- }
- ,
- Ci.Audio.prototype.load = function(e) {
- var t = new Ci.AudioBuffer(this.context);
- return t.load(e),
- this.setBuffer(t),
- this
- }
- ,
- Ci.Audio.prototype.setNodeSource = function(e) {
- return this.hasPlaybackControl = !1,
- this.sourceType = "audioNode",
- this.source = e,
- this.connect(),
- this
- }
- ,
- Ci.Audio.prototype.setBuffer = function(e) {
- var t = this;
- return e.onReady(function(e) {
- t.source.buffer = e,
- t.sourceType = "buffer",
- t.autoplay && t.play()
- }),
- this
- }
- ,
- Ci.Audio.prototype.play = function() {
- if (!0 !== this.isPlaying)
- if (!1 !== this.hasPlaybackControl) {
- var e = this.context.createBufferSource();
- e.buffer = this.source.buffer,
- e.loop = this.source.loop,
- e.onended = this.source.onended,
- e.start(0, this.startTime),
- e.playbackRate.value = this.playbackRate,
- this.isPlaying = !0,
- this.source = e,
- this.connect()
- } else
- console.warn("THREE.Audio: this Audio has no playback control.");
- else
- console.warn("THREE.Audio: Audio is already playing.")
- }
- ,
- Ci.Audio.prototype.pause = function() {
- return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
- void (this.startTime = this.context.currentTime))
- }
- ,
- Ci.Audio.prototype.stop = function() {
- return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
- void (this.startTime = 0))
- }
- ,
- Ci.Audio.prototype.connect = function() {
- null !== this.filter ? (this.source.connect(this.filter),
- this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
- }
- ,
- Ci.Audio.prototype.disconnect = function() {
- null !== this.filter ? (this.source.disconnect(this.filter),
- this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
- }
- ,
- Ci.Audio.prototype.getFilter = function() {
- return this.filter
- }
- ,
- Ci.Audio.prototype.setFilter = function(e) {
- void 0 === e && (e = null),
- !0 === this.isPlaying ? (this.disconnect(),
- this.filter = e,
- this.connect()) : this.filter = e
- }
- ,
- Ci.Audio.prototype.setPlaybackRate = function(e) {
- return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
- void (!0 === this.isPlaying && (this.source.playbackRate.value = this.playbackRate)))
- }
- ,
- Ci.Audio.prototype.getPlaybackRate = function() {
- return this.playbackRate
- }
- ,
- Ci.Audio.prototype.onEnded = function() {
- this.isPlaying = !1
- }
- ,
- Ci.Audio.prototype.setLoop = function(e) {
- return !1 === this.hasPlaybackControl ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
- }
- ,
- Ci.Audio.prototype.getLoop = function() {
- return !1 === this.hasPlaybackControl ? (console.warn("THREE.Audio: this Audio has no playback control."),
- !1) : this.source.loop
- }
- ,
- Ci.Audio.prototype.setVolume = function(e) {
- this.gain.gain.value = e
- }
- ,
- Ci.Audio.prototype.getVolume = function() {
- return this.gain.gain.value
- }
- ,
- Ci.AudioAnalyser = function(e, t) {
- this.analyser = e.context.createAnalyser(),
- this.analyser.fftSize = void 0 !== t ? t : 2048,
- this.data = new Uint8Array(this.analyser.frequencyBinCount),
- e.getOutput().connect(this.analyser)
- }
- ,
- Ci.AudioAnalyser.prototype = {
- constructor: Ci.AudioAnalyser,
- getData: function() {
- return this.analyser.getByteFrequencyData(this.data),
- this.data
- }
- },
- Ci.AudioBuffer = function(e) {
- this.context = e,
- this.ready = !1,
- this.readyCallbacks = []
- }
- ,
- Ci.AudioBuffer.prototype.load = function(e) {
- var i = this
- , t = new XMLHttpRequest;
- return t.open("GET", e, !0),
- t.responseType = "arraybuffer",
- t.onload = function(e) {
- i.context.decodeAudioData(this.response, function(e) {
- i.buffer = e,
- i.ready = !0;
- for (var t = 0; t < i.readyCallbacks.length; t++)
- i.readyCallbacks[t](i.buffer);
- i.readyCallbacks = []
- })
- }
- ,
- t.send(),
- this
- }
- ,
- Ci.AudioBuffer.prototype.onReady = function(e) {
- this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
- }
- ,
- Ci.PositionalAudio = function(e) {
- Ci.Audio.call(this, e),
- this.panner = this.context.createPanner(),
- this.panner.connect(this.gain)
- }
- ,
- Ci.PositionalAudio.prototype = Object.create(Ci.Audio.prototype),
- Ci.PositionalAudio.prototype.constructor = Ci.PositionalAudio,
- Ci.PositionalAudio.prototype.getOutput = function() {
- return this.panner
- }
- ,
- Ci.PositionalAudio.prototype.setRefDistance = function(e) {
- this.panner.refDistance = e
- }
- ,
- Ci.PositionalAudio.prototype.getRefDistance = function() {
- return this.panner.refDistance
- }
- ,
- Ci.PositionalAudio.prototype.setRolloffFactor = function(e) {
- this.panner.rolloffFactor = e
- }
- ,
- Ci.PositionalAudio.prototype.getRolloffFactor = function() {
- return this.panner.rolloffFactor
- }
- ,
- Ci.PositionalAudio.prototype.setDistanceModel = function(e) {
- this.panner.distanceModel = e
- }
- ,
- Ci.PositionalAudio.prototype.getDistanceModel = function() {
- return this.panner.distanceModel
- }
- ,
- Ci.PositionalAudio.prototype.setMaxDistance = function(e) {
- this.panner.maxDistance = e
- }
- ,
- Ci.PositionalAudio.prototype.getMaxDistance = function() {
- return this.panner.maxDistance
- }
- ,
- Ci.PositionalAudio.prototype.updateMatrixWorld = (it = new Ci.Vector3,
- function(e) {
- Ci.Object3D.prototype.updateMatrixWorld.call(this, e),
- it.setFromMatrixPosition(this.matrixWorld),
- this.panner.setPosition(it.x, it.y, it.z)
- }
- ),
- Ci.AudioListener = function() {
- Ci.Object3D.call(this),
- this.type = "AudioListener",
- this.context = new (window.AudioContext || window.webkitAudioContext),
- this.gain = this.context.createGain(),
- this.gain.connect(this.context.destination),
- this.filter = null
- }
- ,
- Ci.AudioListener.prototype = Object.create(Ci.Object3D.prototype),
- Ci.AudioListener.prototype.constructor = Ci.AudioListener,
- Ci.AudioListener.prototype.getInput = function() {
- return this.gain
- }
- ,
- Ci.AudioListener.prototype.removeFilter = function() {
- null !== this.filter && (this.gain.disconnect(this.filter),
- this.filter.disconnect(this.context.destination),
- this.gain.connect(this.context.destination),
- this.filter = null)
- }
- ,
- Ci.AudioListener.prototype.setFilter = function(e) {
- null !== this.filter ? (this.gain.disconnect(this.filter),
- this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
- this.filter = e,
- this.gain.connect(this.filter),
- this.filter.connect(this.context.destination)
- }
- ,
- Ci.AudioListener.prototype.getFilter = function() {
- return this.filter
- }
- ,
- Ci.AudioListener.prototype.setMasterVolume = function(e) {
- this.gain.gain.value = e
- }
- ,
- Ci.AudioListener.prototype.getMasterVolume = function() {
- return this.gain.gain.value
- }
- ,
- Ci.AudioListener.prototype.updateMatrixWorld = (Je = new Ci.Vector3,
- $e = new Ci.Quaternion,
- et = new Ci.Vector3,
- tt = new Ci.Vector3,
- function(e) {
- Ci.Object3D.prototype.updateMatrixWorld.call(this, e);
- var t = this.context.listener
- , i = this.up;
- this.matrixWorld.decompose(Je, $e, et),
- tt.set(0, 0, -1).applyQuaternion($e),
- t.setPosition(Je.x, Je.y, Je.z),
- t.setOrientation(tt.x, tt.y, tt.z, i.x, i.y, i.z)
- }
- ),
- Ci.Camera = function() {
- Ci.Object3D.call(this),
- this.type = "Camera",
- this.matrixWorldInverse = new Ci.Matrix4,
- this.projectionMatrix = new Ci.Matrix4
- }
- ,
- Ci.Camera.prototype = Object.create(Ci.Object3D.prototype),
- Ci.Camera.prototype.constructor = Ci.Camera,
- Ci.Camera.prototype.getWorldDirection = (Qe = new Ci.Quaternion,
- function(e) {
- var t = e || new Ci.Vector3;
- return this.getWorldQuaternion(Qe),
- t.set(0, 0, -1).applyQuaternion(Qe)
- }
- ),
- Ci.Camera.prototype.lookAt = (Ke = new Ci.Matrix4,
- function(e) {
- Ke.lookAt(this.position, e, this.up),
- this.quaternion.setFromRotationMatrix(Ke)
- }
- ),
- Ci.Camera.prototype.clone = function() {
- return (new this.constructor).copy(this)
- }
- ,
- Ci.Camera.prototype.copy = function(e) {
- return Ci.Object3D.prototype.copy.call(this, e),
- this.matrixWorldInverse.copy(e.matrixWorldInverse),
- this.projectionMatrix.copy(e.projectionMatrix),
- this
- }
- ,
- Ci.CubeCamera = function(e, t, i) {
- Ci.Object3D.call(this),
- this.type = "CubeCamera";
- var r = new Ci.PerspectiveCamera(90,1,e,t);
- r.up.set(0, -1, 0),
- r.lookAt(new Ci.Vector3(1,0,0)),
- this.add(r);
- var o = new Ci.PerspectiveCamera(90,1,e,t);
- o.up.set(0, -1, 0),
- o.lookAt(new Ci.Vector3(-1,0,0)),
- this.add(o);
- var a = new Ci.PerspectiveCamera(90,1,e,t);
- a.up.set(0, 0, 1),
- a.lookAt(new Ci.Vector3(0,1,0)),
- this.add(a);
- var s = new Ci.PerspectiveCamera(90,1,e,t);
- s.up.set(0, 0, -1),
- s.lookAt(new Ci.Vector3(0,-1,0)),
- this.add(s);
- var l = new Ci.PerspectiveCamera(90,1,e,t);
- l.up.set(0, -1, 0),
- l.lookAt(new Ci.Vector3(0,0,1)),
- this.add(l);
- var c = new Ci.PerspectiveCamera(90,1,e,t);
- c.up.set(0, -1, 0),
- c.lookAt(new Ci.Vector3(0,0,-1)),
- this.add(c);
- var n = {
- format: Ci.RGBFormat,
- magFilter: Ci.LinearFilter,
- minFilter: Ci.LinearFilter
- };
- this.renderTarget = new Ci.WebGLRenderTargetCube(i,i,n),
- this.updateCubeMap = function(e, t) {
- null === this.parent && this.updateMatrixWorld();
- var i = this.renderTarget
- , n = i.texture.generateMipmaps;
- i.texture.generateMipmaps = !1,
- i.activeCubeFace = 0,
- e.render(t, r, i),
- i.activeCubeFace = 1,
- e.render(t, o, i),
- i.activeCubeFace = 2,
- e.render(t, a, i),
- i.activeCubeFace = 3,
- e.render(t, s, i),
- i.activeCubeFace = 4,
- e.render(t, l, i),
- i.texture.generateMipmaps = n,
- i.activeCubeFace = 5,
- e.render(t, c, i),
- e.setRenderTarget(null)
- }
- }
- ,
- Ci.CubeCamera.prototype = Object.create(Ci.Object3D.prototype),
- Ci.CubeCamera.prototype.constructor = Ci.CubeCamera,
- Ci.OrthographicCamera = function(e, t, i, n, r, o) {
- Ci.Camera.call(this),
- this.type = "OrthographicCamera",
- this.zoom = 1,
- this.left = e,
- this.right = t,
- this.top = i,
- this.bottom = n,
- this.near = void 0 !== r ? r : .1,
- this.far = void 0 !== o ? o : 2e3,
- this.updateProjectionMatrix()
- }
- ,
- Ci.OrthographicCamera.prototype = Object.create(Ci.Camera.prototype),
- Ci.OrthographicCamera.prototype.constructor = Ci.OrthographicCamera,
- Ci.OrthographicCamera.prototype.updateProjectionMatrix = function() {
- var e = (this.right - this.left) / (2 * this.zoom)
- , t = (this.top - this.bottom) / (2 * this.zoom)
- , i = (this.right + this.left) / 2
- , n = (this.top + this.bottom) / 2;
- this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
- }
- ,
- Ci.OrthographicCamera.prototype.copy = function(e) {
- return Ci.Camera.prototype.copy.call(this, e),
- this.left = e.left,
- this.right = e.right,
- this.top = e.top,
- this.bottom = e.bottom,
- this.near = e.near,
- this.far = e.far,
- this.zoom = e.zoom,
- this
- }
- ,
- Ci.OrthographicCamera.prototype.toJSON = function(e) {
- var t = Ci.Object3D.prototype.toJSON.call(this, e);
- return t.object.zoom = this.zoom,
- t.object.left = this.left,
- t.object.right = this.right,
- t.object.top = this.top,
- t.object.bottom = this.bottom,
- t.object.near = this.near,
- t.object.far = this.far,
- t
- }
- ,
- Ci.PerspectiveCamera = function(e, t, i, n) {
- Ci.Camera.call(this),
- this.type = "PerspectiveCamera",
- this.focalLength = 10,
- this.zoom = 1,
- this.fov = void 0 !== e ? e : 50,
- this.aspect = void 0 !== t ? t : 1,
- this.near = void 0 !== i ? i : .1,
- this.far = void 0 !== n ? n : 2e3,
- this.updateProjectionMatrix()
- }
- ,
- Ci.PerspectiveCamera.prototype = Object.create(Ci.Camera.prototype),
- Ci.PerspectiveCamera.prototype.constructor = Ci.PerspectiveCamera,
- Ci.PerspectiveCamera.prototype.setLens = function(e, t) {
- void 0 === t && (t = 24),
- this.fov = 2 * Ci.Math.radToDeg(Math.atan(t / (2 * e))),
- this.updateProjectionMatrix()
- }
- ,
- Ci.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
- this.fullWidth = e,
- this.fullHeight = t,
- this.x = i,
- this.y = n,
- this.width = r,
- this.height = o,
- this.updateProjectionMatrix()
- }
- ,
- Ci.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
- var e = Ci.Math.radToDeg(2 * Math.atan(Math.tan(.5 * Ci.Math.degToRad(this.fov)) / this.zoom));
- if (this.fullWidth) {
- var t = this.fullWidth / this.fullHeight
- , i = Math.tan(Ci.Math.degToRad(.5 * e)) * this.near
- , n = -i
- , r = t * n
- , o = t * i
- , a = Math.abs(o - r)
- , s = Math.abs(i - n);
- 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)
- } else
- this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
- }
- ,
- Ci.PerspectiveCamera.prototype.copy = function(e) {
- return Ci.Camera.prototype.copy.call(this, e),
- this.focalLength = e.focalLength,
- this.zoom = e.zoom,
- this.fov = e.fov,
- this.aspect = e.aspect,
- this.near = e.near,
- this.far = e.far,
- this
- }
- ,
- Ci.PerspectiveCamera.prototype.toJSON = function(e) {
- var t = Ci.Object3D.prototype.toJSON.call(this, e);
- return t.object.focalLength = this.focalLength,
- t.object.zoom = this.zoom,
- t.object.fov = this.fov,
- t.object.aspect = this.aspect,
- t.object.near = this.near,
- t.object.far = this.far,
- t
- }
- ,
- Ci.StereoCamera = function() {
- this.type = "StereoCamera",
- this.aspect = 1,
- this.cameraL = new Ci.PerspectiveCamera,
- this.cameraL.layers.enable(1),
- this.cameraL.matrixAutoUpdate = !1,
- this.cameraR = new Ci.PerspectiveCamera,
- this.cameraR.layers.enable(2),
- this.cameraR.matrixAutoUpdate = !1
- }
- ,
- Ci.StereoCamera.prototype = {
- constructor: Ci.StereoCamera,
- update: (Xe = new Ci.Matrix4,
- Ze = new Ci.Matrix4,
- function(e) {
- if (Ge !== e.focalLength || We !== e.fov || je !== e.aspect * this.aspect || Ye !== e.near || qe !== e.far) {
- Ge = e.focalLength,
- We = e.fov,
- je = e.aspect * this.aspect,
- Ye = e.near,
- qe = e.far;
- var t, i, n = e.projectionMatrix.clone(), r = .032 * Ye / Ge, o = Ye * Math.tan(Ci.Math.degToRad(.5 * We));
- Ze.elements[12] = -.032,
- Xe.elements[12] = .032,
- t = -o * je + r,
- i = o * je + r,
- n.elements[0] = 2 * Ye / (i - t),
- n.elements[8] = (i + t) / (i - t),
- this.cameraL.projectionMatrix.copy(n),
- t = -o * je - r,
- i = o * je - r,
- n.elements[0] = 2 * Ye / (i - t),
- n.elements[8] = (i + t) / (i - t),
- this.cameraR.projectionMatrix.copy(n)
- }
- this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ze),
- this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Xe)
- }
- )
- },
- Ci.Light = function(e, t) {
- Ci.Object3D.call(this),
- this.type = "Light",
- this.color = new Ci.Color(e),
- this.intensity = void 0 !== t ? t : 1,
- this.receiveShadow = void 0
- }
- ,
- Ci.Light.prototype = Object.create(Ci.Object3D.prototype),
- Ci.Light.prototype.constructor = Ci.Light,
- Ci.Light.prototype.copy = function(e) {
- return Ci.Object3D.prototype.copy.call(this, e),
- this.color.copy(e.color),
- this.intensity = e.intensity,
- this
- }
- ,
- Ci.Light.prototype.toJSON = function(e) {
- var t = Ci.Object3D.prototype.toJSON.call(this, e);
- return t.object.color = this.color.getHex(),
- t.object.intensity = this.intensity,
- void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
- void 0 !== this.distance && (t.object.distance = this.distance),
- void 0 !== this.angle && (t.object.angle = this.angle),
- void 0 !== this.decay && (t.object.decay = this.decay),
- void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
- t
- }
- ,
- Ci.LightShadow = function(e) {
- this.camera = e,
- this.bias = 0,
- this.radius = 1,
- this.mapSize = new Ci.Vector2(512,512),
- this.map = null,
- this.matrix = new Ci.Matrix4
- }
- ,
- Ci.LightShadow.prototype = {
- constructor: Ci.LightShadow,
- copy: function(e) {
- return this.camera = e.camera.clone(),
- this.bias = e.bias,
- this.radius = e.radius,
- this.mapSize.copy(e.mapSize),
- this
- },
- clone: function() {
- return (new this.constructor).copy(this)
- }
- },
- Ci.AmbientLight = function(e, t) {
- Ci.Light.call(this, e, t),
- this.type = "AmbientLight",
- this.castShadow = void 0
- }
- ,
- Ci.AmbientLight.prototype = Object.create(Ci.Light.prototype),
- Ci.AmbientLight.prototype.constructor = Ci.AmbientLight,
- Ci.DirectionalLight = function(e, t) {
- Ci.Light.call(this, e, t),
- this.type = "DirectionalLight",
- this.position.set(0, 1, 0),
- this.updateMatrix(),
- this.target = new Ci.Object3D,
- this.shadow = new Ci.LightShadow(new Ci.OrthographicCamera(-5,5,5,-5,.5,500))
- }
- ,
- Ci.DirectionalLight.prototype = Object.create(Ci.Light.prototype),
- Ci.DirectionalLight.prototype.constructor = Ci.DirectionalLight,
- Ci.DirectionalLight.prototype.copy = function(e) {
- return Ci.Light.prototype.copy.call(this, e),
- this.target = e.target.clone(),
- this.shadow = e.shadow.clone(),
- this
- }
- ,
- Ci.HemisphereLight = function(e, t, i) {
- Ci.Light.call(this, e, i),
- this.type = "HemisphereLight",
- this.castShadow = void 0,
- this.position.set(0, 1, 0),
- this.updateMatrix(),
- this.groundColor = new Ci.Color(t)
- }
- ,
- Ci.HemisphereLight.prototype = Object.create(Ci.Light.prototype),
- Ci.HemisphereLight.prototype.constructor = Ci.HemisphereLight,
- Ci.HemisphereLight.prototype.copy = function(e) {
- return Ci.Light.prototype.copy.call(this, e),
- this.groundColor.copy(e.groundColor),
- this
- }
- ,
- Ci.PointLight = function(e, t, i, n) {
- Ci.Light.call(this, e, t),
- this.type = "PointLight",
- this.distance = void 0 !== i ? i : 0,
- this.decay = void 0 !== n ? n : 1,
- this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(90,1,.5,500))
- }
- ,
- Ci.PointLight.prototype = Object.create(Ci.Light.prototype),
- Ci.PointLight.prototype.constructor = Ci.PointLight,
- Object.defineProperty(Ci.PointLight.prototype, "power", {
- get: function() {
- return 4 * this.intensity * Math.PI
- },
- set: function(e) {
- this.intensity = e / (4 * Math.PI)
- }
- }),
- Ci.PointLight.prototype.copy = function(e) {
- return Ci.Light.prototype.copy.call(this, e),
- this.distance = e.distance,
- this.decay = e.decay,
- this.shadow = e.shadow.clone(),
- this
- }
- ,
- Ci.SpotLight = function(e, t, i, n, r, o) {
- Ci.Light.call(this, e, t),
- this.type = "SpotLight",
- this.position.set(0, 1, 0),
- this.updateMatrix(),
- this.target = new Ci.Object3D,
- this.distance = void 0 !== i ? i : 0,
- this.angle = void 0 !== n ? n : Math.PI / 3,
- this.penumbra = void 0 !== r ? r : 0,
- this.decay = void 0 !== o ? o : 1,
- this.shadow = new Ci.LightShadow(new Ci.PerspectiveCamera(50,1,.5,500))
- }
- ,
- Ci.SpotLight.prototype = Object.create(Ci.Light.prototype),
- Ci.SpotLight.prototype.constructor = Ci.SpotLight,
- Object.defineProperty(Ci.SpotLight.prototype, "power", {
- get: function() {
- return this.intensity * Math.PI
- },
- set: function(e) {
- this.intensity = e / Math.PI
- }
- }),
- Ci.SpotLight.prototype.copy = function(e) {
- return Ci.Light.prototype.copy.call(this, e),
- this.distance = e.distance,
- this.angle = e.angle,
- this.penumbra = e.penumbra,
- this.decay = e.decay,
- this.target = e.target.clone(),
- this.shadow = e.shadow.clone(),
- this
- }
- ,
- Ci.Cache = {
- enabled: !1,
- files: {},
- add: function(e, t) {
- !1 !== this.enabled && (this.files[e] = t)
- },
- get: function(e) {
- if (!1 !== this.enabled)
- return this.files[e]
- },
- remove: function(e) {
- delete this.files[e]
- },
- clear: function() {
- this.files = {}
- }
- },
- Ci.Loader = function() {
- this.onLoadStart = function() {}
- ,
- this.onLoadProgress = function() {}
- ,
- this.onLoadComplete = function() {}
- }
- ,
- Ci.Loader.prototype = {
- constructor: Ci.Loader,
- crossOrigin: void 0,
- extractUrlBase: function(e) {
- var t = e.split("/");
- return 1 === t.length ? "./" : (t.pop(),
- t.join("/") + "/")
- },
- initMaterials: function(e, t, i) {
- for (var n = [], r = 0; r < e.length; ++r)
- n[r] = this.createMaterial(e[r], t, i);
- return n
- },
- createMaterial: function(e, c, h) {
- function t(e, t, i, n, r) {
- var o, a = c + e, s = Ci.Loader.Handlers.get(a);
- o = null !== s ? s.load(a) : (He.setCrossOrigin(h),
- He.load(a)),
- void 0 !== t && (o.repeat.fromArray(t),
- 1 !== t[0] && (o.wrapS = Ci.RepeatWrapping),
- 1 !== t[1] && (o.wrapT = Ci.RepeatWrapping)),
- void 0 !== i && o.offset.fromArray(i),
- void 0 !== n && ("repeat" === n[0] && (o.wrapS = Ci.RepeatWrapping),
- "mirror" === n[0] && (o.wrapS = Ci.MirroredRepeatWrapping),
- "repeat" === n[1] && (o.wrapT = Ci.RepeatWrapping),
- "mirror" === n[1] && (o.wrapT = Ci.MirroredRepeatWrapping)),
- void 0 !== r && (o.anisotropy = r);
- var l = Ci.Math.generateUUID();
- return u[l] = o,
- l
- }
- void 0 === Ue && (Ue = new Ci.Color),
- void 0 === He && (He = new Ci.TextureLoader),
- void 0 === ze && (ze = new Ci.MaterialLoader);
- var u = {}
- , i = {
- uuid: Ci.Math.generateUUID(),
- type: "MeshLambertMaterial"
- };
- for (var n in e) {
- var r = e[n];
- switch (n) {
- case "DbgColor":
- case "DbgIndex":
- case "opticalDensity":
- case "illumination":
- break;
- case "DbgName":
- i.name = r;
- break;
- case "blending":
- i.blending = Ci[r];
- break;
- case "colorAmbient":
- case "mapAmbient":
- console.warn("THREE.Loader.createMaterial:", n, "is no longer supported.");
- break;
- case "colorDiffuse":
- i.color = Ue.fromArray(r).getHex();
- break;
- case "colorSpecular":
- i.specular = Ue.fromArray(r).getHex();
- break;
- case "colorEmissive":
- i.emissive = Ue.fromArray(r).getHex();
- break;
- case "specularCoef":
- i.shininess = r;
- break;
- case "shading":
- "basic" === r.toLowerCase() && (i.type = "MeshBasicMaterial"),
- "phong" === r.toLowerCase() && (i.type = "MeshPhongMaterial");
- break;
- case "mapDiffuse":
- i.map = t(r, e.mapDiffuseRepeat, e.mapDiffuseOffset, e.mapDiffuseWrap, e.mapDiffuseAnisotropy);
- break;
- case "mapDiffuseRepeat":
- case "mapDiffuseOffset":
- case "mapDiffuseWrap":
- case "mapDiffuseAnisotropy":
- break;
- case "mapLight":
- i.lightMap = t(r, e.mapLightRepeat, e.mapLightOffset, e.mapLightWrap, e.mapLightAnisotropy);
- break;
- case "mapLightRepeat":
- case "mapLightOffset":
- case "mapLightWrap":
- case "mapLightAnisotropy":
- break;
- case "mapAO":
- i.aoMap = t(r, e.mapAORepeat, e.mapAOOffset, e.mapAOWrap, e.mapAOAnisotropy);
- break;
- case "mapAORepeat":
- case "mapAOOffset":
- case "mapAOWrap":
- case "mapAOAnisotropy":
- break;
- case "mapBump":
- i.bumpMap = t(r, e.mapBumpRepeat, e.mapBumpOffset, e.mapBumpWrap, e.mapBumpAnisotropy);
- break;
- case "mapBumpScale":
- i.bumpScale = r;
- break;
- case "mapBumpRepeat":
- case "mapBumpOffset":
- case "mapBumpWrap":
- case "mapBumpAnisotropy":
- break;
- case "mapNormal":
- i.normalMap = t(r, e.mapNormalRepeat, e.mapNormalOffset, e.mapNormalWrap, e.mapNormalAnisotropy);
- break;
- case "mapNormalFactor":
- i.normalScale = [r, r];
- break;
- case "mapNormalRepeat":
- case "mapNormalOffset":
- case "mapNormalWrap":
- case "mapNormalAnisotropy":
- break;
- case "mapSpecular":
- i.specularMap = t(r, e.mapSpecularRepeat, e.mapSpecularOffset, e.mapSpecularWrap, e.mapSpecularAnisotropy);
- break;
- case "mapSpecularRepeat":
- case "mapSpecularOffset":
- case "mapSpecularWrap":
- case "mapSpecularAnisotropy":
- break;
- case "mapAlpha":
- i.alphaMap = t(r, e.mapAlphaRepeat, e.mapAlphaOffset, e.mapAlphaWrap, e.mapAlphaAnisotropy);
- break;
- case "mapAlphaRepeat":
- case "mapAlphaOffset":
- case "mapAlphaWrap":
- case "mapAlphaAnisotropy":
- break;
- case "flipSided":
- i.side = Ci.BackSide;
- break;
- case "doubleSided":
- i.side = Ci.DoubleSide;
- break;
- case "transparency":
- console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
- i.opacity = r;
- break;
- case "depthTest":
- case "depthWrite":
- case "colorWrite":
- case "opacity":
- case "reflectivity":
- case "transparent":
- case "visible":
- case "wireframe":
- i[n] = r;
- break;
- case "vertexColors":
- !0 === r && (i.vertexColors = Ci.VertexColors),
- "face" === r && (i.vertexColors = Ci.FaceColors);
- break;
- default:
- console.error("THREE.Loader.createMaterial: Unsupported", n, r)
- }
- }
- return "MeshBasicMaterial" === i.type && delete i.emissive,
- "MeshPhongMaterial" !== i.type && delete i.specular,
- i.opacity < 1 && (i.transparent = !0),
- ze.setTextures(u),
- ze.parse(i)
- }
- },
- Ci.Loader.Handlers = {
- handlers: [],
- add: function(e, t) {
- this.handlers.push(e, t)
- },
- get: function(e) {
- for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
- var r = t[i]
- , o = t[i + 1];
- if (r.test(e))
- return o
- }
- return null
- }
- },
- Ci.XHRLoader = function(e) {
- this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
- }
- ,
- Ci.XHRLoader.prototype = {
- constructor: Ci.XHRLoader,
- load: function(i, n, t, r) {
- void 0 !== this.path && (i = this.path + i);
- var o = this
- , e = Ci.Cache.get(i);
- if (void 0 !== e)
- return n && setTimeout(function() {
- n(e)
- }, 0),
- e;
- var a = new XMLHttpRequest;
- return a.overrideMimeType("text/plain"),
- a.open("GET", i, !0),
- a.addEventListener("load", function(e) {
- var t = e.target.response;
- Ci.Cache.add(i, t),
- 200 === this.status ? (n && n(t),
- o.manager.itemEnd(i)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
- n && n(t),
- o.manager.itemEnd(i)) : (r && r(e),
- o.manager.itemError(i))
- }, !1),
- void 0 !== t && a.addEventListener("progress", function(e) {
- t(e)
- }, !1),
- a.addEventListener("error", function(e) {
- r && r(e),
- o.manager.itemError(i)
- }, !1),
- void 0 !== this.responseType && (a.responseType = this.responseType),
- void 0 !== this.withCredentials && (a.withCredentials = this.withCredentials),
- a.send(null),
- o.manager.itemStart(i),
- a
- },
- setPath: function(e) {
- this.path = e
- },
- setResponseType: function(e) {
- this.responseType = e
- },
- setWithCredentials: function(e) {
- this.withCredentials = e
- }
- },
- Ci.FontLoader = function(e) {
- this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
- }
- ,
- Ci.FontLoader.prototype = {
- constructor: Ci.FontLoader,
- load: function(e, t, i, n) {
- new Ci.XHRLoader(this.manager).load(e, function(e) {
- t(new Ci.Font(JSON.parse(e.substring(65, e.length - 2))))
- }, i, n)
- }
- },
- Ci.ImageLoader = function(e) {
- this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
- }
- ,
- Ci.ImageLoader.prototype = {
- constructor: Ci.ImageLoader,
- load: function(t, i, n, r) {
- void 0 !== this.path && (t = this.path + t);
- var o = this
- , e = Ci.Cache.get(t);
- if (void 0 !== e)
- return o.manager.itemStart(t),
- i ? setTimeout(function() {
- i(e),
- o.manager.itemEnd(t)
- }, 0) : o.manager.itemEnd(t),
- e;
- var a = document.createElement("img");
- return a.addEventListener("load", function(e) {
- Ci.Cache.add(t, this),
- i && i(this),
- o.manager.itemEnd(t)
- }, !1),
- void 0 !== n && a.addEventListener("progress", function(e) {
- n(e)
- }, !1),
- a.addEventListener("error", function(e) {
- r && r(e),
- o.manager.itemError(t)
- }, !1),
- void 0 !== this.crossOrigin && (a.crossOrigin = this.crossOrigin),
- o.manager.itemStart(t),
- a.src = t,
- a
- },
- setCrossOrigin: function(e) {
- this.crossOrigin = e
- },
- setPath: function(e) {
- this.path = e
- }
- },
- Ci.JSONLoader = function(e) {
- "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
- e = void 0),
- this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
- this.withCredentials = !1
- }
- ,
- Ci.JSONLoader.prototype = {
- constructor: Ci.JSONLoader,
- get statusDomElement() {
- return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
- console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
- this._statusDomElement
- },
- load: function(o, a, e, t) {
- var s = this
- , l = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : Ci.Loader.prototype.extractUrlBase(o)
- , i = new Ci.XHRLoader(this.manager);
- i.setWithCredentials(this.withCredentials),
- i.load(o, function(e) {
- var t = JSON.parse(e)
- , i = t.metadata;
- if (void 0 !== i) {
- var n = i.type;
- if (void 0 !== n) {
- if ("object" === n.toLowerCase())
- return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.ObjectLoader instead.");
- if ("scene" === n.toLowerCase())
- return void console.error("THREE.JSONLoader: " + o + " should be loaded with THREE.SceneLoader instead.")
- }
- }
- var r = s.parse(t, l);
- a(r.geometry, r.materials)
- }, e, t)
- },
- setTexturePath: function(e) {
- this.texturePath = e
- },
- parse: function(D, e) {
- var N = new Ci.Geometry
- , t = void 0 !== D.scale ? 1 / D.scale : 1;
- if (function(e) {
- function t(e, t) {
- return e & 1 << t
- }
- 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;
- if (void 0 !== D.uvs) {
- for (i = 0; i < D.uvs.length; i++)
- D.uvs[i].length && L++;
- for (i = 0; i < L; i++)
- N.faceVertexUvs[i] = []
- }
- for (o = 0,
- a = R.length; o < a; )
- (A = new Ci.Vector3).x = R[o++] * e,
- A.y = R[o++] * e,
- A.z = R[o++] * e,
- N.vertices.push(A);
- for (o = 0,
- a = M.length; o < a; )
- if (d = t(u = M[o++], 0),
- p = t(u, 1),
- f = t(u, 3),
- g = t(u, 4),
- m = t(u, 5),
- v = t(u, 6),
- y = t(u, 7),
- d) {
- if ((I = new Ci.Face3).a = M[o],
- I.b = M[o + 1],
- I.c = M[o + 3],
- (E = new Ci.Face3).a = M[o + 1],
- E.b = M[o + 2],
- E.c = M[o + 3],
- o += 4,
- p && (h = M[o++],
- I.materialIndex = h,
- E.materialIndex = h),
- r = N.faces.length,
- f)
- for (i = 0; i < L; i++)
- for (w = D.uvs[i],
- N.faceVertexUvs[i][r] = [],
- N.faceVertexUvs[i][r + 1] = [],
- n = 0; n < 4; n++)
- x = w[2 * (c = M[o++])],
- S = w[2 * c + 1],
- T = new Ci.Vector2(x,S),
- 2 !== n && N.faceVertexUvs[i][r].push(T),
- 0 !== n && N.faceVertexUvs[i][r + 1].push(T);
- if (g && (l = 3 * M[o++],
- I.normal.set(P[l++], P[l++], P[l]),
- E.normal.copy(I.normal)),
- m)
- for (i = 0; i < 4; i++)
- l = 3 * M[o++],
- b = new Ci.Vector3(P[l++],P[l++],P[l]),
- 2 !== i && I.vertexNormals.push(b),
- 0 !== i && E.vertexNormals.push(b);
- if (v && (_ = O[s = M[o++]],
- I.color.setHex(_),
- E.color.setHex(_)),
- y)
- for (i = 0; i < 4; i++)
- _ = O[s = M[o++]],
- 2 !== i && I.vertexColors.push(new Ci.Color(_)),
- 0 !== i && E.vertexColors.push(new Ci.Color(_));
- N.faces.push(I),
- N.faces.push(E)
- } else {
- if ((C = new Ci.Face3).a = M[o++],
- C.b = M[o++],
- C.c = M[o++],
- p && (h = M[o++],
- C.materialIndex = h),
- r = N.faces.length,
- f)
- for (i = 0; i < L; i++)
- for (w = D.uvs[i],
- N.faceVertexUvs[i][r] = [],
- n = 0; n < 3; n++)
- x = w[2 * (c = M[o++])],
- S = w[2 * c + 1],
- T = new Ci.Vector2(x,S),
- N.faceVertexUvs[i][r].push(T);
- if (g && (l = 3 * M[o++],
- C.normal.set(P[l++], P[l++], P[l])),
- m)
- for (i = 0; i < 3; i++)
- l = 3 * M[o++],
- b = new Ci.Vector3(P[l++],P[l++],P[l]),
- C.vertexNormals.push(b);
- if (v && (s = M[o++],
- C.color.setHex(O[s])),
- y)
- for (i = 0; i < 3; i++)
- s = M[o++],
- C.vertexColors.push(new Ci.Color(O[s]));
- N.faces.push(C)
- }
- }(t),
- function() {
- var e = void 0 !== D.influencesPerVertex ? D.influencesPerVertex : 2;
- if (D.skinWeights)
- for (var t = 0, i = D.skinWeights.length; t < i; t += e) {
- var n = D.skinWeights[t]
- , r = 1 < e ? D.skinWeights[t + 1] : 0
- , o = 2 < e ? D.skinWeights[t + 2] : 0
- , a = 3 < e ? D.skinWeights[t + 3] : 0;
- N.skinWeights.push(new Ci.Vector4(n,r,o,a))
- }
- if (D.skinIndices)
- for (t = 0,
- i = D.skinIndices.length; t < i; t += e) {
- var s = D.skinIndices[t]
- , l = 1 < e ? D.skinIndices[t + 1] : 0
- , c = 2 < e ? D.skinIndices[t + 2] : 0
- , h = 3 < e ? D.skinIndices[t + 3] : 0;
- N.skinIndices.push(new Ci.Vector4(s,l,c,h))
- }
- N.bones = D.bones,
- 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.")
- }(),
- function(e) {
- if (void 0 !== D.morphTargets)
- for (var t = 0, i = D.morphTargets.length; t < i; t++) {
- N.morphTargets[t] = {},
- N.morphTargets[t].name = D.morphTargets[t].name,
- N.morphTargets[t].vertices = [];
- for (var n = N.morphTargets[t].vertices, r = D.morphTargets[t].vertices, o = 0, a = r.length; o < a; o += 3) {
- var s = new Ci.Vector3;
- s.x = r[o] * e,
- s.y = r[o + 1] * e,
- s.z = r[o + 2] * e,
- n.push(s)
- }
- }
- if (void 0 !== D.morphColors && 0 < D.morphColors.length) {
- console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
- var l = N.faces
- , c = D.morphColors[0].colors;
- for (t = 0,
- i = l.length; t < i; t++)
- l[t].color.fromArray(c, 3 * t)
- }
- }(t),
- function() {
- var e = []
- , t = [];
- void 0 !== D.animation && t.push(D.animation),
- void 0 !== D.animations && (D.animations.length ? t = t.concat(D.animations) : t.push(D.animations));
- for (var i = 0; i < t.length; i++) {
- var n = Ci.AnimationClip.parseAnimation(t[i], N.bones);
- n && e.push(n)
- }
- if (N.morphTargets) {
- var r = Ci.AnimationClip.CreateClipsFromMorphTargetSequences(N.morphTargets, 10);
- e = e.concat(r)
- }
- 0 < e.length && (N.animations = e)
- }(),
- N.computeFaceNormals(),
- N.computeBoundingSphere(),
- void 0 === D.materials || 0 === D.materials.length)
- return {
- geometry: N
- };
- var i = Ci.Loader.prototype.initMaterials(D.materials, e, this.crossOrigin);
- return {
- geometry: N,
- materials: i
- }
- }
- },
- Ci.LoadingManager = function(e, t, i) {
- var n = this
- , r = !1
- , o = 0
- , a = 0;
- this.onStart = void 0,
- this.onLoad = e,
- this.onProgress = t,
- this.onError = i,
- this.itemStart = function(e) {
- a++,
- !1 === r && void 0 !== n.onStart && n.onStart(e, o, a),
- r = !0
- }
- ,
- this.itemEnd = function(e) {
- o++,
- void 0 !== n.onProgress && n.onProgress(e, o, a),
- o === a && (r = !1,
- void 0 !== n.onLoad && n.onLoad())
- }
- ,
- this.itemError = function(e) {
- void 0 !== n.onError && n.onError(e)
- }
- }
- ,
- Ci.DefaultLoadingManager = new Ci.LoadingManager,
- Ci.BufferGeometryLoader = function(e) {
- this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
- }
- ,
- Ci.BufferGeometryLoader.prototype = {
- constructor: Ci.BufferGeometryLoader,
- load: function(e, t, i, n) {
- var r = this;
- new Ci.XHRLoader(r.manager).load(e, function(e) {
- t(r.parse(JSON.parse(e)))
- }, i, n)
- },
- parse: function(e) {
- var t = new Ci.BufferGeometry
- , i = e.data.index
- , n = {
- Int8Array: Int8Array,
- Uint8Array: Uint8Array,
- Uint8ClampedArray: Uint8ClampedArray,
- Int16Array: Int16Array,
- Uint16Array: Uint16Array,
- Int32Array: Int32Array,
- Uint32Array: Uint32Array,
- Float32Array: Float32Array,
- Float64Array: Float64Array
- };
- if (void 0 !== i) {
- var r = new n[i.type](i.array);
- t.setIndex(new Ci.BufferAttribute(r,1))
- }
- var o = e.data.attributes;
- for (var a in o) {
- var s = o[a];
- r = new n[s.type](s.array);
- t.addAttribute(a, new Ci.BufferAttribute(r,s.itemSize))
- }
- var l = e.data.groups || e.data.drawcalls || e.data.offsets;
- if (void 0 !== l)
- for (var c = 0, h = l.length; c !== h; ++c) {
- var u = l[c];
- t.addGroup(u.start, u.count, u.materialIndex)
- }
- var d = e.data.boundingSphere;
- if (void 0 !== d) {
- var p = new Ci.Vector3;
- void 0 !== d.center && p.fromArray(d.center),
- t.boundingSphere = new Ci.Sphere(p,d.radius)
- }
- return t
- }
- },
- Ci.MaterialLoader = function(e) {
- this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
- this.textures = {}
- }
- ,
- Ci.MaterialLoader.prototype = {
- constructor: Ci.MaterialLoader,
- load: function(e, t, i, n) {
- var r = this;
- new Ci.XHRLoader(r.manager).load(e, function(e) {
- t(r.parse(JSON.parse(e)))
- }, i, n)
- },
- setTextures: function(e) {
- this.textures = e
- },
- getTexture: function(e) {
- var t = this.textures;
- return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
- t[e]
- },
- parse: function(e) {
- var t = new Ci[e.type];
- if (void 0 !== e.uuid && (t.uuid = e.uuid),
- void 0 !== e.name && (t.name = e.name),
- void 0 !== e.color && t.color.setHex(e.color),
- void 0 !== e.roughness && (t.roughness = e.roughness),
- void 0 !== e.metalness && (t.metalness = e.metalness),
- void 0 !== e.emissive && t.emissive.setHex(e.emissive),
- void 0 !== e.specular && t.specular.setHex(e.specular),
- void 0 !== e.shininess && (t.shininess = e.shininess),
- void 0 !== e.uniforms && (t.uniforms = e.uniforms),
- void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
- void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
- void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
- void 0 !== e.shading && (t.shading = e.shading),
- void 0 !== e.blending && (t.blending = e.blending),
- void 0 !== e.side && (t.side = e.side),
- void 0 !== e.opacity && (t.opacity = e.opacity),
- void 0 !== e.transparent && (t.transparent = e.transparent),
- void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
- void 0 !== e.depthTest && (t.depthTest = e.depthTest),
- void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
- void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
- void 0 !== e.wireframe && (t.wireframe = e.wireframe),
- void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
- void 0 !== e.size && (t.size = e.size),
- void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
- void 0 !== e.map && (t.map = this.getTexture(e.map)),
- void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
- t.transparent = !0),
- void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
- void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
- void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
- void 0 !== e.normalScale) {
- var i = e.normalScale;
- !1 === Array.isArray(i) && (i = [i, i]),
- t.normalScale = (new Ci.Vector2).fromArray(i)
- }
- if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
- void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
- void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
- void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
- void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
- void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
- void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
- void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
- void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
- t.combine = Ci.MultiplyOperation),
- e.reflectivity && (t.reflectivity = e.reflectivity),
- void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
- void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
- void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
- void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
- void 0 !== e.materials)
- for (var n = 0, r = e.materials.length; n < r; n++)
- t.materials.push(this.parse(e.materials[n]));
- return t
- }
- },
- Ci.ObjectLoader = function(e) {
- this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
- this.texturePath = ""
- }
- ,
- Ci.ObjectLoader.prototype = {
- constructor: Ci.ObjectLoader,
- load: function(e, t, i, n) {
- "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
- var r = this;
- new Ci.XHRLoader(r.manager).load(e, function(e) {
- r.parse(JSON.parse(e), t)
- }, i, n)
- },
- setTexturePath: function(e) {
- this.texturePath = e
- },
- setCrossOrigin: function(e) {
- this.crossOrigin = e
- },
- parse: function(e, t) {
- var i = this.parseGeometries(e.geometries)
- , n = this.parseImages(e.images, function() {
- void 0 !== t && t(a)
- })
- , r = this.parseTextures(e.textures, n)
- , o = this.parseMaterials(e.materials, r)
- , a = this.parseObject(e.object, i, o);
- return e.animations && (a.animations = this.parseAnimations(e.animations)),
- void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
- a
- },
- parseGeometries: function(e) {
- var t = {};
- if (void 0 !== e)
- for (var i = new Ci.JSONLoader, n = new Ci.BufferGeometryLoader, r = 0, o = e.length; r < o; r++) {
- var a, s = e[r];
- switch (s.type) {
- case "PlaneGeometry":
- case "PlaneBufferGeometry":
- a = new Ci[s.type](s.width,s.height,s.widthSegments,s.heightSegments);
- break;
- case "BoxGeometry":
- case "BoxBufferGeometry":
- case "CubeGeometry":
- a = new Ci[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);
- break;
- case "CircleGeometry":
- case "CircleBufferGeometry":
- a = new Ci[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);
- break;
- case "CylinderGeometry":
- case "CylinderBufferGeometry":
- a = new Ci[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);
- break;
- case "SphereGeometry":
- case "SphereBufferGeometry":
- a = new Ci[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);
- break;
- case "DodecahedronGeometry":
- a = new Ci.DodecahedronGeometry(s.radius,s.detail);
- break;
- case "IcosahedronGeometry":
- a = new Ci.IcosahedronGeometry(s.radius,s.detail);
- break;
- case "OctahedronGeometry":
- a = new Ci.OctahedronGeometry(s.radius,s.detail);
- break;
- case "TetrahedronGeometry":
- a = new Ci.TetrahedronGeometry(s.radius,s.detail);
- break;
- case "RingGeometry":
- case "RingBufferGeometry":
- a = new Ci[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);
- break;
- case "TorusGeometry":
- case "TorusBufferGeometry":
- a = new Ci[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);
- break;
- case "TorusKnotGeometry":
- case "TorusKnotBufferGeometry":
- a = new Ci[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);
- break;
- case "LatheGeometry":
- a = new Ci.LatheGeometry(s.points,s.segments,s.phiStart,s.phiLength);
- break;
- case "BufferGeometry":
- a = n.parse(s);
- break;
- case "Geometry":
- a = i.parse(s.data, this.texturePath).geometry;
- break;
- default:
- console.warn('THREE.ObjectLoader: Unsupported geometry type "' + s.type + '"');
- continue
- }
- a.uuid = s.uuid,
- void 0 !== s.name && (a.name = s.name),
- t[s.uuid] = a
- }
- return t
- },
- parseMaterials: function(e, t) {
- var i = {};
- if (void 0 !== e) {
- var n = new Ci.MaterialLoader;
- n.setTextures(t);
- for (var r = 0, o = e.length; r < o; r++) {
- var a = n.parse(e[r]);
- i[a.uuid] = a
- }
- }
- return i
- },
- parseAnimations: function(e) {
- for (var t = [], i = 0; i < e.length; i++) {
- var n = Ci.AnimationClip.parse(e[i]);
- t.push(n)
- }
- return t
- },
- parseImages: function(e, t) {
- function i(e) {
- return n.manager.itemStart(e),
- a.load(e, function() {
- n.manager.itemEnd(e)
- })
- }
- var n = this
- , r = {};
- if (void 0 !== e && 0 < e.length) {
- var o = new Ci.LoadingManager(t)
- , a = new Ci.ImageLoader(o);
- a.setCrossOrigin(this.crossOrigin);
- for (var s = 0, l = e.length; s < l; s++) {
- var c = e[s]
- , h = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url) ? c.url : n.texturePath + c.url;
- r[c.uuid] = i(h)
- }
- }
- return r
- },
- parseTextures: function(e, t) {
- function i(e) {
- return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
- Ci[e])
- }
- var n = {};
- if (void 0 !== e)
- for (var r = 0, o = e.length; r < o; r++) {
- var a = e[r];
- void 0 === a.image && console.warn('THREE.ObjectLoader: No "image" specified for', a.uuid),
- void 0 === t[a.image] && console.warn("THREE.ObjectLoader: Undefined image", a.image);
- var s = new Ci.Texture(t[a.image]);
- s.needsUpdate = !0,
- s.uuid = a.uuid,
- void 0 !== a.name && (s.name = a.name),
- void 0 !== a.mapping && (s.mapping = i(a.mapping)),
- void 0 !== a.offset && (s.offset = new Ci.Vector2(a.offset[0],a.offset[1])),
- void 0 !== a.repeat && (s.repeat = new Ci.Vector2(a.repeat[0],a.repeat[1])),
- void 0 !== a.minFilter && (s.minFilter = i(a.minFilter)),
- void 0 !== a.magFilter && (s.magFilter = i(a.magFilter)),
- void 0 !== a.anisotropy && (s.anisotropy = a.anisotropy),
- Array.isArray(a.wrap) && (s.wrapS = i(a.wrap[0]),
- s.wrapT = i(a.wrap[1])),
- n[a.uuid] = s
- }
- return n
- },
- parseObject: (ke = new Ci.Matrix4,
- function(e, t, i) {
- function n(e) {
- return void 0 === t[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
- t[e]
- }
- function r(e) {
- if (void 0 !== e)
- return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
- i[e]
- }
- var o;
- switch (e.type) {
- case "Scene":
- o = new Ci.Scene;
- break;
- case "PerspectiveCamera":
- o = new Ci.PerspectiveCamera(e.fov,e.aspect,e.near,e.far);
- break;
- case "OrthographicCamera":
- o = new Ci.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);
- break;
- case "AmbientLight":
- o = new Ci.AmbientLight(e.color,e.intensity);
- break;
- case "DirectionalLight":
- o = new Ci.DirectionalLight(e.color,e.intensity);
- break;
- case "PointLight":
- o = new Ci.PointLight(e.color,e.intensity,e.distance,e.decay);
- break;
- case "SpotLight":
- o = new Ci.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);
- break;
- case "HemisphereLight":
- o = new Ci.HemisphereLight(e.color,e.groundColor,e.intensity);
- break;
- case "Mesh":
- var a = n(e.geometry)
- , s = r(e.material);
- o = a.bones && 0 < a.bones.length ? new Ci.SkinnedMesh(a,s) : new Ci.Mesh(a,s);
- break;
- case "LOD":
- o = new Ci.LOD;
- break;
- case "Line":
- o = new Ci.Line(n(e.geometry),r(e.material),e.mode);
- break;
- case "PointCloud":
- case "Points":
- o = new Ci.Points(n(e.geometry),r(e.material));
- break;
- case "Sprite":
- o = new Ci.Sprite(r(e.material));
- break;
- case "Group":
- o = new Ci.Group;
- break;
- default:
- o = new Ci.Object3D
- }
- if (o.uuid = e.uuid,
- void 0 !== e.name && (o.name = e.name),
- void 0 !== e.matrix ? (ke.fromArray(e.matrix),
- ke.decompose(o.position, o.quaternion, o.scale)) : (void 0 !== e.position && o.position.fromArray(e.position),
- void 0 !== e.rotation && o.rotation.fromArray(e.rotation),
- void 0 !== e.scale && o.scale.fromArray(e.scale)),
- void 0 !== e.castShadow && (o.castShadow = e.castShadow),
- void 0 !== e.receiveShadow && (o.receiveShadow = e.receiveShadow),
- void 0 !== e.visible && (o.visible = e.visible),
- void 0 !== e.userData && (o.userData = e.userData),
- void 0 !== e.children)
- for (var l in e.children)
- o.add(this.parseObject(e.children[l], t, i));
- if ("LOD" === e.type)
- for (var c = e.levels, h = 0; h < c.length; h++) {
- var u = c[h];
- void 0 !== (l = o.getObjectByProperty("uuid", u.object)) && o.addLevel(l, u.distance)
- }
- return o
- }
- )
- },
- Ci.TextureLoader = function(e) {
- this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
- }
- ,
- Ci.TextureLoader.prototype = {
- constructor: Ci.TextureLoader,
- load: function(e, t, i, n) {
- var r = new Ci.Texture
- , o = new Ci.ImageLoader(this.manager);
- return o.setCrossOrigin(this.crossOrigin),
- o.setPath(this.path),
- o.load(e, function(e) {
- r.image = e,
- r.needsUpdate = !0,
- void 0 !== t && t(r)
- }, i, n),
- r
- },
- setCrossOrigin: function(e) {
- this.crossOrigin = e
- },
- setPath: function(e) {
- this.path = e
- }
- },
- Ci.CubeTextureLoader = function(e) {
- this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager
- }
- ,
- Ci.CubeTextureLoader.prototype = {
- constructor: Ci.CubeTextureLoader,
- load: function(e, i, t, n) {
- function r(t) {
- a.load(e[t], function(e) {
- o.images[t] = e,
- 6 === ++s && (o.needsUpdate = !0,
- i && i(o))
- }, void 0, n)
- }
- var o = new Ci.CubeTexture
- , a = new Ci.ImageLoader(this.manager);
- a.setCrossOrigin(this.crossOrigin),
- a.setPath(this.path);
- for (var s = 0, l = 0; l < e.length; ++l)
- r(l);
- return o
- },
- setCrossOrigin: function(e) {
- this.crossOrigin = e
- },
- setPath: function(e) {
- this.path = e
- }
- },
- Ci.DataTextureLoader = Ci.BinaryTextureLoader = function(e) {
- this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
- this._parser = null
- }
- ,
- Ci.BinaryTextureLoader.prototype = {
- constructor: Ci.BinaryTextureLoader,
- load: function(e, i, t, n) {
- var r = this
- , o = new Ci.DataTexture
- , a = new Ci.XHRLoader(this.manager);
- return a.setResponseType("arraybuffer"),
- a.load(e, function(e) {
- var t = r._parser(e);
- t && (void 0 !== t.image ? o.image = t.image : void 0 !== t.data && (o.image.width = t.width,
- o.image.height = t.height,
- o.image.data = t.data),
- o.wrapS = void 0 !== t.wrapS ? t.wrapS : Ci.ClampToEdgeWrapping,
- o.wrapT = void 0 !== t.wrapT ? t.wrapT : Ci.ClampToEdgeWrapping,
- o.magFilter = void 0 !== t.magFilter ? t.magFilter : Ci.LinearFilter,
- o.minFilter = void 0 !== t.minFilter ? t.minFilter : Ci.LinearMipMapLinearFilter,
- o.anisotropy = void 0 !== t.anisotropy ? t.anisotropy : 1,
- void 0 !== t.format && (o.format = t.format),
- void 0 !== t.type && (o.type = t.type),
- void 0 !== t.mipmaps && (o.mipmaps = t.mipmaps),
- 1 === t.mipmapCount && (o.minFilter = Ci.LinearFilter),
- o.needsUpdate = !0,
- i && i(o, t))
- }, t, n),
- o
- }
- },
- Ci.CompressedTextureLoader = function(e) {
- this.manager = void 0 !== e ? e : Ci.DefaultLoadingManager,
- this._parser = null
- }
- ,
- Ci.CompressedTextureLoader.prototype = {
- constructor: Ci.CompressedTextureLoader,
- load: function(e, o, t, n) {
- function i(i) {
- r.load(e[i], function(e) {
- var t = a._parser(e, !0);
- s[i] = {
- width: t.width,
- height: t.height,
- format: t.format,
- mipmaps: t.mipmaps
- },
- 6 === (c += 1) && (1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
- l.format = t.format,
- l.needsUpdate = !0,
- o && o(l))
- }, t, n)
- }
- var a = this
- , s = []
- , l = new Ci.CompressedTexture;
- l.image = s;
- var r = new Ci.XHRLoader(this.manager);
- if (r.setPath(this.path),
- r.setResponseType("arraybuffer"),
- Array.isArray(e))
- for (var c = 0, h = 0, u = e.length; h < u; ++h)
- i(h);
- else
- r.load(e, function(e) {
- var t = a._parser(e, !0);
- if (t.isCubemap)
- for (var i = t.mipmaps.length / t.mipmapCount, n = 0; n < i; n++) {
- s[n] = {
- mipmaps: []
- };
- for (var r = 0; r < t.mipmapCount; r++)
- s[n].mipmaps.push(t.mipmaps[n * t.mipmapCount + r]),
- s[n].format = t.format,
- s[n].width = t.width,
- s[n].height = t.height
- }
- else
- l.image.width = t.width,
- l.image.height = t.height,
- l.mipmaps = t.mipmaps;
- 1 === t.mipmapCount && (l.minFilter = Ci.LinearFilter),
- l.format = t.format,
- l.needsUpdate = !0,
- o && o(l)
- }, t, n);
- return l
- },
- setPath: function(e) {
- this.path = e
- }
- },
- Ci.Material = function() {
- Object.defineProperty(this, "id", {
- value: Ci.MaterialIdCount++
- }),
- this.uuid = Ci.Math.generateUUID(),
- this.name = "",
- this.type = "Material",
- this.side = Ci.FrontSide,
- this.opacity = 1,
- this.transparent = !1,
- this.blending = Ci.NormalBlending,
- this.blendSrc = Ci.SrcAlphaFactor,
- this.blendDst = Ci.OneMinusSrcAlphaFactor,
- this.blendEquation = Ci.AddEquation,
- this.blendSrcAlpha = null,
- this.blendDstAlpha = null,
- this.blendEquationAlpha = null,
- this.depthFunc = Ci.LessEqualDepth,
- this.depthTest = !0,
- this.depthWrite = !0,
- this.colorWrite = !0,
- this.precision = null,
- this.polygonOffset = !1,
- this.polygonOffsetFactor = 0,
- this.polygonOffsetUnits = 0,
- this.alphaTest = 0,
- this.premultipliedAlpha = !1,
- this.overdraw = 0,
- this.visible = !0,
- this._needsUpdate = !0
- }
- ,
- Ci.Material.prototype = {
- constructor: Ci.Material,
- get needsUpdate() {
- return this._needsUpdate
- },
- set needsUpdate(e) {
- !0 === e && this.update(),
- this._needsUpdate = e
- },
- setValues: function(e) {
- if (void 0 !== e)
- for (var t in e) {
- var i = e[t];
- if (void 0 !== i) {
- var n = this[t];
- 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.")
- } else
- console.warn("THREE.Material: '" + t + "' parameter is undefined.")
- }
- },
- toJSON: function(e) {
- function t(e) {
- var t = [];
- for (var i in e) {
- var n = e[i];
- delete n.metadata,
- t.push(n)
- }
- return t
- }
- var i = void 0 === e;
- i && (e = {
- textures: {},
- images: {}
- });
- var n = {
- metadata: {
- version: 4.4,
- type: "Material",
- generator: "Material.toJSON"
- }
- };
- if (n.uuid = this.uuid,
- n.type = this.type,
- "" !== this.name && (n.name = this.name),
- this.color instanceof Ci.Color && (n.color = this.color.getHex()),
- .5 !== this.roughness && (n.roughness = this.roughness),
- .5 !== this.metalness && (n.metalness = this.metalness),
- this.emissive instanceof Ci.Color && (n.emissive = this.emissive.getHex()),
- this.specular instanceof Ci.Color && (n.specular = this.specular.getHex()),
- void 0 !== this.shininess && (n.shininess = this.shininess),
- this.map instanceof Ci.Texture && (n.map = this.map.toJSON(e).uuid),
- this.alphaMap instanceof Ci.Texture && (n.alphaMap = this.alphaMap.toJSON(e).uuid),
- this.lightMap instanceof Ci.Texture && (n.lightMap = this.lightMap.toJSON(e).uuid),
- this.bumpMap instanceof Ci.Texture && (n.bumpMap = this.bumpMap.toJSON(e).uuid,
- n.bumpScale = this.bumpScale),
- this.normalMap instanceof Ci.Texture && (n.normalMap = this.normalMap.toJSON(e).uuid,
- n.normalScale = this.normalScale.toArray()),
- this.displacementMap instanceof Ci.Texture && (n.displacementMap = this.displacementMap.toJSON(e).uuid,
- n.displacementScale = this.displacementScale,
- n.displacementBias = this.displacementBias),
- this.roughnessMap instanceof Ci.Texture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid),
- this.metalnessMap instanceof Ci.Texture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid),
- this.emissiveMap instanceof Ci.Texture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid),
- this.specularMap instanceof Ci.Texture && (n.specularMap = this.specularMap.toJSON(e).uuid),
- this.envMap instanceof Ci.Texture && (n.envMap = this.envMap.toJSON(e).uuid,
- n.reflectivity = this.reflectivity),
- void 0 !== this.size && (n.size = this.size),
- void 0 !== this.sizeAttenuation && (n.sizeAttenuation = this.sizeAttenuation),
- void 0 !== this.vertexColors && this.vertexColors !== Ci.NoColors && (n.vertexColors = this.vertexColors),
- void 0 !== this.shading && this.shading !== Ci.SmoothShading && (n.shading = this.shading),
- void 0 !== this.blending && this.blending !== Ci.NormalBlending && (n.blending = this.blending),
- void 0 !== this.side && this.side !== Ci.FrontSide && (n.side = this.side),
- this.opacity < 1 && (n.opacity = this.opacity),
- !0 === this.transparent && (n.transparent = this.transparent),
- 0 < this.alphaTest && (n.alphaTest = this.alphaTest),
- !0 === this.premultipliedAlpha && (n.premultipliedAlpha = this.premultipliedAlpha),
- !0 === this.wireframe && (n.wireframe = this.wireframe),
- 1 < this.wireframeLinewidth && (n.wireframeLinewidth = this.wireframeLinewidth),
- i) {
- var r = t(e.textures)
- , o = t(e.images);
- 0 < r.length && (n.textures = r),
- 0 < o.length && (n.images = o)
- }
- return n
- },
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- return this.name = e.name,
- this.side = e.side,
- this.opacity = e.opacity,
- this.transparent = e.transparent,
- this.blending = e.blending,
- this.blendSrc = e.blendSrc,
- this.blendDst = e.blendDst,
- this.blendEquation = e.blendEquation,
- this.blendSrcAlpha = e.blendSrcAlpha,
- this.blendDstAlpha = e.blendDstAlpha,
- this.blendEquationAlpha = e.blendEquationAlpha,
- this.depthFunc = e.depthFunc,
- this.depthTest = e.depthTest,
- this.depthWrite = e.depthWrite,
- this.colorWrite = e.colorWrite,
- this.precision = e.precision,
- this.polygonOffset = e.polygonOffset,
- this.polygonOffsetFactor = e.polygonOffsetFactor,
- this.polygonOffsetUnits = e.polygonOffsetUnits,
- this.alphaTest = e.alphaTest,
- this.premultipliedAlpha = e.premultipliedAlpha,
- this.overdraw = e.overdraw,
- this.visible = e.visible,
- this
- },
- update: function() {
- this.dispatchEvent({
- type: "update"
- })
- },
- dispose: function() {
- this.dispatchEvent({
- type: "dispose"
- })
- }
- },
- Ci.EventDispatcher.prototype.apply(Ci.Material.prototype),
- Ci.MaterialIdCount = 0,
- Ci.LineBasicMaterial = function(e) {
- Ci.Material.call(this),
- this.type = "LineBasicMaterial",
- this.color = new Ci.Color(16777215),
- this.linewidth = 1,
- this.linecap = "round",
- this.linejoin = "round",
- this.blending = Ci.NormalBlending,
- this.vertexColors = Ci.NoColors,
- this.fog = !0,
- this.setValues(e)
- }
- ,
- Ci.LineBasicMaterial.prototype = Object.create(Ci.Material.prototype),
- Ci.LineBasicMaterial.prototype.constructor = Ci.LineBasicMaterial,
- Ci.LineBasicMaterial.prototype.copy = function(e) {
- return Ci.Material.prototype.copy.call(this, e),
- this.color.copy(e.color),
- this.linewidth = e.linewidth,
- this.linecap = e.linecap,
- this.linejoin = e.linejoin,
- this.vertexColors = e.vertexColors,
- this.fog = e.fog,
- this
- }
- ,
- Ci.LineDashedMaterial = function(e) {
- Ci.Material.call(this),
- this.type = "LineDashedMaterial",
- this.color = new Ci.Color(16777215),
- this.linewidth = 1,
- this.scale = 1,
- this.dashSize = 3,
- this.gapSize = 1,
- this.blending = Ci.NormalBlending,
- this.vertexColors = Ci.NoColors,
- this.fog = !0,
- this.setValues(e)
- }
- ,
- Ci.LineDashedMaterial.prototype = Object.create(Ci.Material.prototype),
- Ci.LineDashedMaterial.prototype.constructor = Ci.LineDashedMaterial,
- Ci.LineDashedMaterial.prototype.copy = function(e) {
- return Ci.Material.prototype.copy.call(this, e),
- this.color.copy(e.color),
- this.linewidth = e.linewidth,
- this.scale = e.scale,
- this.dashSize = e.dashSize,
- this.gapSize = e.gapSize,
- this.vertexColors = e.vertexColors,
- this.fog = e.fog,
- this
- }
- ,
- Ci.MeshBasicMaterial = function(e) {
- Ci.Material.call(this),
- this.type = "MeshBasicMaterial",
- this.color = new Ci.Color(16777215),
- this.map = null,
- this.aoMap = null,
- this.aoMapIntensity = 1,
- this.specularMap = null,
- this.alphaMap = null,
- this.envMap = null,
- this.combine = Ci.MultiplyOperation,
- this.reflectivity = 1,
- this.refractionRatio = .98,
- this.fog = !0,
- this.shading = Ci.SmoothShading,
- this.blending = Ci.NormalBlending,
- this.wireframe = !1,
- this.wireframeLinewidth = 1,
- this.wireframeLinecap = "round",
- this.wireframeLinejoin = "round",
- this.vertexColors = Ci.NoColors,
- this.skinning = !1,
- this.morphTargets = !1,
- this.setValues(e)
- }
- ,
- Ci.MeshBasicMaterial.prototype = Object.create(Ci.Material.prototype),
- Ci.MeshBasicMaterial.prototype.constructor = Ci.MeshBasicMaterial,
- Ci.MeshBasicMaterial.prototype.copy = function(e) {
- return Ci.Material.prototype.copy.call(this, e),
- this.color.copy(e.color),
- this.map = e.map,
- this.aoMap = e.aoMap,
- this.aoMapIntensity = e.aoMapIntensity,
- this.specularMap = e.specularMap,
- this.alphaMap = e.alphaMap,
- this.envMap = e.envMap,
- this.combine = e.combine,
- this.reflectivity = e.reflectivity,
- this.refractionRatio = e.refractionRatio,
- this.fog = e.fog,
- this.shading = e.shading,
- this.wireframe = e.wireframe,
- this.wireframeLinewidth = e.wireframeLinewidth,
- this.wireframeLinecap = e.wireframeLinecap,
- this.wireframeLinejoin = e.wireframeLinejoin,
- this.vertexColors = e.vertexColors,
- this.skinning = e.skinning,
- this.morphTargets = e.morphTargets,
- this
- }
- ,
- Ci.MeshLambertMaterial = function(e) {
- Ci.Material.call(this),
- this.type = "MeshLambertMaterial",
- this.color = new Ci.Color(16777215),
- this.map = null,
- this.lightMap = null,
- this.lightMapIntensity = 1,
- this.aoMap = null,
- this.aoMapIntensity = 1,
- this.emissive = new Ci.Color(0),
- this.emissiveIntensity = 1,
- this.emissiveMap = null,
- this.specularMap = null,
- this.alphaMap = null,
- this.envMap = null,
- this.combine = Ci.MultiplyOperation,
- this.reflectivity = 1,
- this.refractionRatio = .98,
- this.fog = !0,
- this.blending = Ci.NormalBlending,
- this.wireframe = !1,
- this.wireframeLinewidth = 1,
- this.wireframeLinecap = "round",
- this.wireframeLinejoin = "round",
- this.vertexColors = Ci.NoColors,
- this.skinning = !1,
- this.morphTargets = !1,
- this.morphNormals = !1,
- this.setValues(e)
- }
- ,
- Ci.MeshLambertMaterial.prototype = Object.create(Ci.Material.prototype),
- Ci.MeshLambertMaterial.prototype.constructor = Ci.MeshLambertMaterial,
- Ci.MeshLambertMaterial.prototype.copy = function(e) {
- return Ci.Material.prototype.copy.call(this, e),
- this.color.copy(e.color),
- this.map = e.map,
- this.lightMap = e.lightMap,
- this.lightMapIntensity = e.lightMapIntensity,
- this.aoMap = e.aoMap,
- this.aoMapIntensity = e.aoMapIntensity,
- this.emissive.copy(e.emissive),
- this.emissiveMap = e.emissiveMap,
- this.emissiveIntensity = e.emissiveIntensity,
- this.specularMap = e.specularMap,
- this.alphaMap = e.alphaMap,
- this.envMap = e.envMap,
- this.combine = e.combine,
- this.reflectivity = e.reflectivity,
- this.refractionRatio = e.refractionRatio,
- this.fog = e.fog,
- this.wireframe = e.wireframe,
- this.wireframeLinewidth = e.wireframeLinewidth,
- this.wireframeLinecap = e.wireframeLinecap,
- this.wireframeLinejoin = e.wireframeLinejoin,
- this.vertexColors = e.vertexColors,
- this.skinning = e.skinning,
- this.morphTargets = e.morphTargets,
- this.morphNormals = e.morphNormals,
- this
- }
- ,
- Ci.MeshPhongMaterial = function(e) {
- Ci.Material.call(this),
- this.type = "MeshPhongMaterial",
- this.color = new Ci.Color(16777215),
- this.specular = new Ci.Color(1118481),
- this.shininess = 30,
- this.map = null,
- this.lightMap = null,
- this.lightMapIntensity = 1,
- this.aoMap = null,
- this.aoMapIntensity = 1,
- this.emissive = new Ci.Color(0),
- this.emissiveIntensity = 1,
- this.emissiveMap = null,
- this.bumpMap = null,
- this.bumpScale = 1,
- this.normalMap = null,
- this.normalScale = new Ci.Vector2(1,1),
- this.displacementMap = null,
- this.displacementScale = 1,
- this.displacementBias = 0,
- this.specularMap = null,
- this.alphaMap = null,
- this.envMap = null,
- this.combine = Ci.MultiplyOperation,
- this.reflectivity = 1,
- this.refractionRatio = .98,
- this.fog = !0,
- this.shading = Ci.SmoothShading,
- this.blending = Ci.NormalBlending,
- this.wireframe = !1,
- this.wireframeLinewidth = 1,
- this.wireframeLinecap = "round",
- this.wireframeLinejoin = "round",
- this.vertexColors = Ci.NoColors,
- this.skinning = !1,
- this.morphTargets = !1,
- this.morphNormals = !1,
- this.setValues(e)
- }
- ,
- Ci.MeshPhongMaterial.prototype = Object.create(Ci.Material.prototype),
- Ci.MeshPhongMaterial.prototype.constructor = Ci.MeshPhongMaterial,
- Ci.MeshPhongMaterial.prototype.copy = function(e) {
- return Ci.Material.prototype.copy.call(this, e),
- this.color.copy(e.color),
- this.specular.copy(e.specular),
- this.shininess = e.shininess,
- this.map = e.map,
- this.lightMap = e.lightMap,
- this.lightMapIntensity = e.lightMapIntensity,
- this.aoMap = e.aoMap,
- this.aoMapIntensity = e.aoMapIntensity,
- this.emissive.copy(e.emissive),
- this.emissiveMap = e.emissiveMap,
- this.emissiveIntensity = e.emissiveIntensity,
- this.bumpMap = e.bumpMap,
- this.bumpScale = e.bumpScale,
- this.normalMap = e.normalMap,
- this.normalScale.copy(e.normalScale),
- this.displacementMap = e.displacementMap,
- this.displacementScale = e.displacementScale,
- this.displacementBias = e.displacementBias,
- this.specularMap = e.specularMap,
- this.alphaMap = e.alphaMap,
- this.envMap = e.envMap,
- this.combine = e.combine,
- this.reflectivity = e.reflectivity,
- this.refractionRatio = e.refractionRatio,
- this.fog = e.fog,
- this.shading = e.shading,
- this.wireframe = e.wireframe,
- this.wireframeLinewidth = e.wireframeLinewidth,
- this.wireframeLinecap = e.wireframeLinecap,
- this.wireframeLinejoin = e.wireframeLinejoin,
- this.vertexColors = e.vertexColors,
- this.skinning = e.skinning,
- this.morphTargets = e.morphTargets,
- this.morphNormals = e.morphNormals,
- this
- }
- ,
- Ci.MeshStandardMaterial = function(e) {
- Ci.Material.call(this),
- this.type = "MeshStandardMaterial",
- this.color = new Ci.Color(16777215),
- this.roughness = .5,
- this.metalness = .5,
- this.map = null,
- this.lightMap = null,
- this.lightMapIntensity = 1,
- this.aoMap = null,
- this.aoMapIntensity = 1,
- this.emissive = new Ci.Color(0),
- this.emissiveIntensity = 1,
- this.emissiveMap = null,
- this.bumpMap = null,
- this.bumpScale = 1,
- this.normalMap = null,
- this.normalScale = new Ci.Vector2(1,1),
- this.displacementMap = null,
- this.displacementScale = 1,
- this.displacementBias = 0,
- this.roughnessMap = null,
- this.metalnessMap = null,
- this.alphaMap = null,
- this.envMap = null,
- this.envMapIntensity = 1,
- this.refractionRatio = .98,
- this.fog = !0,
- this.shading = Ci.SmoothShading,
- this.blending = Ci.NormalBlending,
- this.wireframe = !1,
- this.wireframeLinewidth = 1,
- this.wireframeLinecap = "round",
- this.wireframeLinejoin = "round",
- this.vertexColors = Ci.NoColors,
- this.skinning = !1,
- this.morphTargets = !1,
- this.morphNormals = !1,
- this.setValues(e)
- }
- ,
- Ci.MeshStandardMaterial.prototype = Object.create(Ci.Material.prototype),
- Ci.MeshStandardMaterial.prototype.constructor = Ci.MeshStandardMaterial,
- Ci.MeshStandardMaterial.prototype.copy = function(e) {
- return Ci.Material.prototype.copy.call(this, e),
- this.color.copy(e.color),
- this.roughness = e.roughness,
- this.metalness = e.metalness,
- this.map = e.map,
- this.lightMap = e.lightMap,
- this.lightMapIntensity = e.lightMapIntensity,
- this.aoMap = e.aoMap,
- this.aoMapIntensity = e.aoMapIntensity,
- this.emissive.copy(e.emissive),
- this.emissiveMap = e.emissiveMap,
- this.emissiveIntensity = e.emissiveIntensity,
- this.bumpMap = e.bumpMap,
- this.bumpScale = e.bumpScale,
- this.normalMap = e.normalMap,
- this.normalScale.copy(e.normalScale),
- this.displacementMap = e.displacementMap,
- this.displacementScale = e.displacementScale,
- this.displacementBias = e.displacementBias,
- this.roughnessMap = e.roughnessMap,
- this.metalnessMap = e.metalnessMap,
- this.alphaMap = e.alphaMap,
- this.envMap = e.envMap,
- this.envMapIntensity = e.envMapIntensity,
- this.refractionRatio = e.refractionRatio,
- this.fog = e.fog,
- this.shading = e.shading,
- this.wireframe = e.wireframe,
- this.wireframeLinewidth = e.wireframeLinewidth,
- this.wireframeLinecap = e.wireframeLinecap,
- this.wireframeLinejoin = e.wireframeLinejoin,
- this.vertexColors = e.vertexColors,
- this.skinning = e.skinning,
- this.morphTargets = e.morphTargets,
- this.morphNormals = e.morphNormals,
- this
- }
- ,
- Ci.MeshDepthMaterial = function(e) {
- Ci.Material.call(this),
- this.type = "MeshDepthMaterial",
- this.morphTargets = !1,
- this.wireframe = !1,
- this.wireframeLinewidth = 1,
- this.setValues(e)
- }
- ,
- Ci.MeshDepthMaterial.prototype = Object.create(Ci.Material.prototype),
- Ci.MeshDepthMaterial.prototype.constructor = Ci.MeshDepthMaterial,
- Ci.MeshDepthMaterial.prototype.copy = function(e) {
- return Ci.Material.prototype.copy.call(this, e),
- this.wireframe = e.wireframe,
- this.wireframeLinewidth = e.wireframeLinewidth,
- this
- }
- ,
- Ci.MeshNormalMaterial = function(e) {
- Ci.Material.call(this, e),
- this.type = "MeshNormalMaterial",
- this.wireframe = !1,
- this.wireframeLinewidth = 1,
- this.morphTargets = !1,
- this.setValues(e)
- }
- ,
- Ci.MeshNormalMaterial.prototype = Object.create(Ci.Material.prototype),
- Ci.MeshNormalMaterial.prototype.constructor = Ci.MeshNormalMaterial,
- Ci.MeshNormalMaterial.prototype.copy = function(e) {
- return Ci.Material.prototype.copy.call(this, e),
- this.wireframe = e.wireframe,
- this.wireframeLinewidth = e.wireframeLinewidth,
- this
- }
- ,
- Ci.MultiMaterial = function(e) {
- this.uuid = Ci.Math.generateUUID(),
- this.type = "MultiMaterial",
- this.materials = e instanceof Array ? e : [],
- this.visible = !0
- }
- ,
- Ci.MultiMaterial.prototype = {
- constructor: Ci.MultiMaterial,
- toJSON: function(e) {
- for (var t = {
- metadata: {
- version: 4.2,
- type: "material",
- generator: "MaterialExporter"
- },
- uuid: this.uuid,
- type: this.type,
- materials: []
- }, i = this.materials, n = 0, r = i.length; n < r; n++) {
- var o = i[n].toJSON(e);
- delete o.metadata,
- t.materials.push(o)
- }
- return t.visible = this.visible,
- t
- },
- clone: function() {
- for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
- e.materials.push(this.materials[t].clone());
- return e.visible = this.visible,
- e
- }
- },
- Ci.PointsMaterial = function(e) {
- Ci.Material.call(this),
- this.type = "PointsMaterial",
- this.color = new Ci.Color(16777215),
- this.map = null,
- this.size = 1,
- this.sizeAttenuation = !0,
- this.blending = Ci.NormalBlending,
- this.vertexColors = Ci.NoColors,
- this.fog = !0,
- this.setValues(e)
- }
- ,
- Ci.PointsMaterial.prototype = Object.create(Ci.Material.prototype),
- Ci.PointsMaterial.prototype.constructor = Ci.PointsMaterial,
- Ci.PointsMaterial.prototype.copy = function(e) {
- return Ci.Material.prototype.copy.call(this, e),
- this.color.copy(e.color),
- this.map = e.map,
- this.size = e.size,
- this.sizeAttenuation = e.sizeAttenuation,
- this.vertexColors = e.vertexColors,
- this.fog = e.fog,
- this
- }
- ,
- Ci.ShaderMaterial = function(e) {
- Ci.Material.call(this),
- this.type = "ShaderMaterial",
- this.defines = {},
- this.uniforms = {},
- this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
- this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
- this.shading = Ci.SmoothShading,
- this.linewidth = 1,
- this.wireframe = !1,
- this.wireframeLinewidth = 1,
- this.fog = !1,
- this.lights = !1,
- this.vertexColors = Ci.NoColors,
- this.skinning = !1,
- this.morphTargets = !1,
- this.morphNormals = !1,
- this.extensions = {
- derivatives: !1,
- fragDepth: !1,
- drawBuffers: !1,
- shaderTextureLOD: !1
- },
- this.defaultAttributeValues = {
- color: [1, 1, 1],
- uv: [0, 0],
- uv2: [0, 0]
- },
- (this.index0AttributeName = void 0) !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
- this.setValues(e))
- }
- ,
- Ci.ShaderMaterial.prototype = Object.create(Ci.Material.prototype),
- Ci.ShaderMaterial.prototype.constructor = Ci.ShaderMaterial,
- Ci.ShaderMaterial.prototype.copy = function(e) {
- return Ci.Material.prototype.copy.call(this, e),
- this.fragmentShader = e.fragmentShader,
- this.vertexShader = e.vertexShader,
- this.uniforms = Ci.UniformsUtils.clone(e.uniforms),
- this.defines = e.defines,
- this.shading = e.shading,
- this.wireframe = e.wireframe,
- this.wireframeLinewidth = e.wireframeLinewidth,
- this.fog = e.fog,
- this.lights = e.lights,
- this.vertexColors = e.vertexColors,
- this.skinning = e.skinning,
- this.morphTargets = e.morphTargets,
- this.morphNormals = e.morphNormals,
- this.extensions = e.extensions,
- this
- }
- ,
- Ci.ShaderMaterial.prototype.toJSON = function(e) {
- var t = Ci.Material.prototype.toJSON.call(this, e);
- return t.uniforms = this.uniforms,
- t.vertexShader = this.vertexShader,
- t.fragmentShader = this.fragmentShader,
- t
- }
- ,
- Ci.RawShaderMaterial = function(e) {
- Ci.ShaderMaterial.call(this, e),
- this.type = "RawShaderMaterial"
- }
- ,
- Ci.RawShaderMaterial.prototype = Object.create(Ci.ShaderMaterial.prototype),
- Ci.RawShaderMaterial.prototype.constructor = Ci.RawShaderMaterial,
- Ci.SpriteMaterial = function(e) {
- Ci.Material.call(this),
- this.type = "SpriteMaterial",
- this.color = new Ci.Color(16777215),
- this.map = null,
- this.rotation = 0,
- this.fog = !1,
- this.setValues(e)
- }
- ,
- Ci.SpriteMaterial.prototype = Object.create(Ci.Material.prototype),
- Ci.SpriteMaterial.prototype.constructor = Ci.SpriteMaterial,
- Ci.SpriteMaterial.prototype.copy = function(e) {
- return Ci.Material.prototype.copy.call(this, e),
- this.color.copy(e.color),
- this.map = e.map,
- this.rotation = e.rotation,
- this.fog = e.fog,
- this
- }
- ,
- Ci.Texture = function(e, t, i, n, r, o, a, s, l) {
- Object.defineProperty(this, "id", {
- value: Ci.TextureIdCount++
- }),
- this.uuid = Ci.Math.generateUUID(),
- this.name = "",
- this.sourceFile = "",
- this.image = void 0 !== e ? e : Ci.Texture.DEFAULT_IMAGE,
- this.mipmaps = [],
- this.mapping = void 0 !== t ? t : Ci.Texture.DEFAULT_MAPPING,
- this.wrapS = void 0 !== i ? i : Ci.ClampToEdgeWrapping,
- this.wrapT = void 0 !== n ? n : Ci.ClampToEdgeWrapping,
- this.magFilter = void 0 !== r ? r : Ci.LinearFilter,
- this.minFilter = void 0 !== o ? o : Ci.LinearMipMapLinearFilter,
- this.anisotropy = void 0 !== l ? l : 1,
- this.format = void 0 !== a ? a : Ci.RGBAFormat,
- this.type = void 0 !== s ? s : Ci.UnsignedByteType,
- this.offset = new Ci.Vector2(0,0),
- this.repeat = new Ci.Vector2(1,1),
- this.generateMipmaps = !0,
- this.premultiplyAlpha = !1,
- this.flipY = !0,
- this.unpackAlignment = 4,
- this.encoding = Ci.LinearEncoding,
- this.version = 0,
- this.onUpdate = null
- }
- ,
- Ci.Texture.DEFAULT_IMAGE = void 0,
- Ci.Texture.DEFAULT_MAPPING = Ci.UVMapping,
- Ci.Texture.prototype = {
- constructor: Ci.Texture,
- set needsUpdate(e) {
- !0 === e && this.version++
- },
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- return this.image = e.image,
- this.mipmaps = e.mipmaps.slice(0),
- this.mapping = e.mapping,
- this.wrapS = e.wrapS,
- this.wrapT = e.wrapT,
- this.magFilter = e.magFilter,
- this.minFilter = e.minFilter,
- this.anisotropy = e.anisotropy,
- this.format = e.format,
- this.type = e.type,
- this.offset.copy(e.offset),
- this.repeat.copy(e.repeat),
- this.generateMipmaps = e.generateMipmaps,
- this.premultiplyAlpha = e.premultiplyAlpha,
- this.flipY = e.flipY,
- this.unpackAlignment = e.unpackAlignment,
- this.encoding = e.encoding,
- this
- },
- toJSON: function(e) {
- if (void 0 !== e.textures[this.uuid])
- return e.textures[this.uuid];
- var t, i, n = {
- metadata: {
- version: 4.4,
- type: "Texture",
- generator: "Texture.toJSON"
- },
- uuid: this.uuid,
- name: this.name,
- mapping: this.mapping,
- repeat: [this.repeat.x, this.repeat.y],
- offset: [this.offset.x, this.offset.y],
- wrap: [this.wrapS, this.wrapT],
- minFilter: this.minFilter,
- magFilter: this.magFilter,
- anisotropy: this.anisotropy
- };
- if (void 0 !== this.image) {
- var r = this.image;
- void 0 === r.uuid && (r.uuid = Ci.Math.generateUUID()),
- void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
- uuid: r.uuid,
- url: (t = r,
- void 0 !== t.toDataURL ? i = t : ((i = document.createElement("canvas")).width = t.width,
- i.height = t.height,
- i.getContext("2d").drawImage(t, 0, 0, t.width, t.height)),
- 2048 < i.width || 2048 < i.height ? i.toDataURL("image/jpeg", .6) : i.toDataURL("image/png"))
- }),
- n.image = r.uuid
- }
- return e.textures[this.uuid] = n
- },
- dispose: function() {
- this.dispatchEvent({
- type: "dispose"
- })
- },
- transformUv: function(e) {
- if (this.mapping === Ci.UVMapping) {
- if (e.multiply(this.repeat),
- e.add(this.offset),
- e.x < 0 || 1 < e.x)
- switch (this.wrapS) {
- case Ci.RepeatWrapping:
- e.x = e.x - Math.floor(e.x);
- break;
- case Ci.ClampToEdgeWrapping:
- e.x = e.x < 0 ? 0 : 1;
- break;
- case Ci.MirroredRepeatWrapping:
- 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
- }
- if (e.y < 0 || 1 < e.y)
- switch (this.wrapT) {
- case Ci.RepeatWrapping:
- e.y = e.y - Math.floor(e.y);
- break;
- case Ci.ClampToEdgeWrapping:
- e.y = e.y < 0 ? 0 : 1;
- break;
- case Ci.MirroredRepeatWrapping:
- 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
- }
- this.flipY && (e.y = 1 - e.y)
- }
- }
- },
- Ci.EventDispatcher.prototype.apply(Ci.Texture.prototype),
- Ci.TextureIdCount = 0,
- Ci.CanvasTexture = function(e, t, i, n, r, o, a, s, l) {
- Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
- this.needsUpdate = !0
- }
- ,
- Ci.CanvasTexture.prototype = Object.create(Ci.Texture.prototype),
- Ci.CanvasTexture.prototype.constructor = Ci.CanvasTexture,
- Ci.CubeTexture = function(e, t, i, n, r, o, a, s, l) {
- e = void 0 !== e ? e : [],
- t = void 0 !== t ? t : Ci.CubeReflectionMapping,
- Ci.Texture.call(this, e, t, i, n, r, o, a, s, l),
- this.flipY = !1
- }
- ,
- Ci.CubeTexture.prototype = Object.create(Ci.Texture.prototype),
- Ci.CubeTexture.prototype.constructor = Ci.CubeTexture,
- Object.defineProperty(Ci.CubeTexture.prototype, "images", {
- get: function() {
- return this.image
- },
- set: function(e) {
- this.image = e
- }
- }),
- Ci.CompressedTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
- Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
- this.image = {
- width: t,
- height: i
- },
- this.mipmaps = e,
- this.flipY = !1,
- this.generateMipmaps = !1
- }
- ,
- Ci.CompressedTexture.prototype = Object.create(Ci.Texture.prototype),
- Ci.CompressedTexture.prototype.constructor = Ci.CompressedTexture,
- Ci.DataTexture = function(e, t, i, n, r, o, a, s, l, c, h) {
- Ci.Texture.call(this, null, o, a, s, l, c, n, r, h),
- this.image = {
- data: e,
- width: t,
- height: i
- },
- this.magFilter = void 0 !== l ? l : Ci.NearestFilter,
- this.minFilter = void 0 !== c ? c : Ci.NearestFilter,
- this.flipY = !1,
- this.generateMipmaps = !1
- }
- ,
- Ci.DataTexture.prototype = Object.create(Ci.Texture.prototype),
- Ci.DataTexture.prototype.constructor = Ci.DataTexture,
- Ci.VideoTexture = function(t, e, i, n, r, o, a, s, l) {
- Ci.Texture.call(this, t, e, i, n, r, o, a, s, l),
- this.generateMipmaps = !1;
- var c = this;
- !function e() {
- requestAnimationFrame(e),
- t.readyState === t.HAVE_ENOUGH_DATA && (c.needsUpdate = !0)
- }()
- }
- ,
- Ci.VideoTexture.prototype = Object.create(Ci.Texture.prototype),
- Ci.VideoTexture.prototype.constructor = Ci.VideoTexture,
- Ci.Group = function() {
- Ci.Object3D.call(this),
- this.type = "Group"
- }
- ,
- Ci.Group.prototype = Object.create(Ci.Object3D.prototype),
- Ci.Group.prototype.constructor = Ci.Group,
- Ci.Points = function(e, t) {
- Ci.Object3D.call(this),
- this.type = "Points",
- this.geometry = void 0 !== e ? e : new Ci.Geometry,
- this.material = void 0 !== t ? t : new Ci.PointsMaterial({
- color: 16777215 * Math.random()
- })
- }
- ,
- Ci.Points.prototype = Object.create(Ci.Object3D.prototype),
- Ci.Points.prototype.constructor = Ci.Points,
- Ci.Points.prototype.raycast = (Wt = new Ci.Matrix4,
- jt = new Ci.Ray,
- Yt = new Ci.Sphere,
- function(o, a) {
- function e(e, t) {
- var i = jt.distanceSqToPoint(e);
- if (i < c) {
- var n = jt.closestPointToPoint(e);
- n.applyMatrix4(l);
- var r = o.ray.origin.distanceTo(n);
- if (r < o.near || r > o.far)
- return;
- a.push({
- distance: r,
- distanceToRay: Math.sqrt(i),
- point: n.clone(),
- index: t,
- face: null,
- object: s
- })
- }
- }
- var s = this
- , t = this.geometry
- , l = this.matrixWorld
- , i = o.params.Points.threshold;
- if (null === t.boundingSphere && t.computeBoundingSphere(),
- Yt.copy(t.boundingSphere),
- Yt.applyMatrix4(l),
- !1 !== o.ray.intersectsSphere(Yt)) {
- Wt.getInverse(l),
- jt.copy(o.ray).applyMatrix4(Wt);
- var n = i / ((this.scale.x + this.scale.y + this.scale.z) / 3)
- , c = n * n
- , r = new Ci.Vector3;
- if (t instanceof Ci.BufferGeometry) {
- var h = t.index
- , u = t.attributes.position.array;
- if (null !== h)
- for (var d = h.array, p = 0, f = d.length; p < f; p++) {
- var g = d[p];
- r.fromArray(u, 3 * g),
- e(r, g)
- }
- else {
- p = 0;
- for (var m = u.length / 3; p < m; p++)
- r.fromArray(u, 3 * p),
- e(r, p)
- }
- } else {
- var v = t.vertices;
- for (p = 0,
- m = v.length; p < m; p++)
- e(v[p], p)
- }
- }
- }
- ),
- Ci.Points.prototype.clone = function() {
- return new this.constructor(this.geometry,this.material).copy(this)
- }
- ,
- Ci.Line = function(e, t, i) {
- return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
- new Ci.LineSegments(e,t)) : (Ci.Object3D.call(this),
- this.type = "Line",
- this.geometry = void 0 !== e ? e : new Ci.Geometry,
- void (this.material = void 0 !== t ? t : new Ci.LineBasicMaterial({
- color: 16777215 * Math.random()
- })))
- }
- ,
- Ci.Line.prototype = Object.create(Ci.Object3D.prototype),
- Ci.Line.prototype.constructor = Ci.Line,
- Ci.Line.prototype.raycast = (Ht = new Ci.Matrix4,
- zt = new Ci.Ray,
- Gt = new Ci.Sphere,
- function(e, t) {
- var i = e.linePrecision
- , n = i * i
- , r = this.geometry
- , o = this.matrixWorld;
- if (null === r.boundingSphere && r.computeBoundingSphere(),
- Gt.copy(r.boundingSphere),
- Gt.applyMatrix4(o),
- !1 !== e.ray.intersectsSphere(Gt)) {
- Ht.getInverse(o),
- zt.copy(e.ray).applyMatrix4(Ht);
- var a = new Ci.Vector3
- , s = new Ci.Vector3
- , l = new Ci.Vector3
- , c = new Ci.Vector3
- , h = this instanceof Ci.LineSegments ? 2 : 1;
- if (r instanceof Ci.BufferGeometry) {
- var u = r.index
- , d = r.attributes.position.array;
- if (null !== u)
- for (var p = u.array, f = 0, g = p.length - 1; f < g; f += h) {
- var m = p[f]
- , v = p[f + 1];
- a.fromArray(d, 3 * m),
- s.fromArray(d, 3 * v),
- n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
- (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
- distance: C,
- point: l.clone().applyMatrix4(this.matrixWorld),
- index: f,
- face: null,
- faceIndex: null,
- object: this
- }))
- }
- else
- for (f = 0,
- g = d.length / 3 - 1; f < g; f += h)
- a.fromArray(d, 3 * f),
- s.fromArray(d, 3 * f + 3),
- n < zt.distanceSqToSegment(a, s, c, l) || (c.applyMatrix4(this.matrixWorld),
- (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
- distance: C,
- point: l.clone().applyMatrix4(this.matrixWorld),
- index: f,
- face: null,
- faceIndex: null,
- object: this
- }))
- } else if (r instanceof Ci.Geometry) {
- var y = r.vertices
- , A = y.length;
- for (f = 0; f < A - 1; f += h) {
- var C;
- n < zt.distanceSqToSegment(y[f], y[f + 1], c, l) || (c.applyMatrix4(this.matrixWorld),
- (C = e.ray.origin.distanceTo(c)) < e.near || C > e.far || t.push({
- distance: C,
- point: l.clone().applyMatrix4(this.matrixWorld),
- index: f,
- face: null,
- faceIndex: null,
- object: this
- }))
- }
- }
- }
- }
- ),
- Ci.Line.prototype.clone = function() {
- return new this.constructor(this.geometry,this.material).copy(this)
- }
- ,
- Ci.LineStrip = 0,
- Ci.LinePieces = 1,
- Ci.LineSegments = function(e, t) {
- Ci.Line.call(this, e, t),
- this.type = "LineSegments"
- }
- ,
- Ci.LineSegments.prototype = Object.create(Ci.Line.prototype),
- Ci.LineSegments.prototype.constructor = Ci.LineSegments,
- Ci.Mesh = function(e, t) {
- Ci.Object3D.call(this),
- this.type = "Mesh",
- this.geometry = void 0 !== e ? e : new Ci.Geometry,
- this.material = void 0 !== t ? t : new Ci.MeshBasicMaterial({
- color: 16777215 * Math.random()
- }),
- this.drawMode = Ci.TrianglesDrawMode,
- this.updateMorphTargets()
- }
- ,
- Ci.Mesh.prototype = Object.create(Ci.Object3D.prototype),
- Ci.Mesh.prototype.constructor = Ci.Mesh,
- Ci.Mesh.prototype.setDrawMode = function(e) {
- this.drawMode = e
- }
- ,
- Ci.Mesh.prototype.updateMorphTargets = function() {
- if (void 0 !== this.geometry.morphTargets && 0 < this.geometry.morphTargets.length) {
- this.morphTargetBase = -1,
- this.morphTargetInfluences = [],
- this.morphTargetDictionary = {};
- for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
- this.morphTargetInfluences.push(0),
- this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
- }
- }
- ,
- Ci.Mesh.prototype.getMorphTargetIndexByName = function(e) {
- return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
- 0)
- }
- ,
- Ci.Mesh.prototype.raycast = (Tt = new Ci.Matrix4,
- xt = new Ci.Ray,
- St = new Ci.Sphere,
- Mt = new Ci.Vector3,
- Rt = new Ci.Vector3,
- Pt = new Ci.Vector3,
- Ot = new Ci.Vector3,
- Lt = new Ci.Vector3,
- Dt = new Ci.Vector3,
- Nt = new Ci.Vector2,
- Ft = new Ci.Vector2,
- Bt = new Ci.Vector2,
- Vt = new Ci.Vector3,
- kt = new Ci.Vector3,
- Ut = new Ci.Vector3,
- function(e, t) {
- var i, n, r = this.geometry, o = this.material, a = this.matrixWorld;
- if (void 0 !== o && (null === r.boundingSphere && r.computeBoundingSphere(),
- St.copy(r.boundingSphere),
- St.applyMatrix4(a),
- !1 !== e.ray.intersectsSphere(St) && (Tt.getInverse(a),
- xt.copy(e.ray).applyMatrix4(Tt),
- null === r.boundingBox || !1 !== xt.intersectsBox(r.boundingBox))))
- if (r instanceof Ci.BufferGeometry) {
- var s, l, c, h = r.index, u = r.attributes, d = u.position.array;
- if (void 0 !== u.uv && (i = u.uv.array),
- null !== h)
- for (var p = h.array, f = 0, g = p.length; f < g; f += 3)
- s = p[f],
- l = p[f + 1],
- c = p[f + 2],
- (n = Ti(this, e, xt, d, i, s, l, c)) && (n.faceIndex = Math.floor(f / 3),
- t.push(n));
- else
- for (f = 0,
- g = d.length; f < g; f += 9)
- (n = Ti(this, e, xt, d, i, s = f / 3, l = s + 1, c = s + 2)) && (n.index = s,
- t.push(n))
- } else if (r instanceof Ci.Geometry) {
- var m, v, y, A = o instanceof Ci.MultiMaterial, C = 1 == A ? o.materials : null, I = r.vertices, E = r.faces, _ = r.faceVertexUvs[0];
- 0 < _.length && (i = _);
- for (var b = 0, w = E.length; b < w; b++) {
- var T = E[b]
- , x = 1 == A ? C[T.materialIndex] : o;
- if (void 0 !== x) {
- if (m = I[T.a],
- v = I[T.b],
- y = I[T.c],
- !0 === x.morphTargets) {
- var S = r.morphTargets
- , M = this.morphTargetInfluences;
- Mt.set(0, 0, 0),
- Rt.set(0, 0, 0),
- Pt.set(0, 0, 0);
- for (var R = 0, P = S.length; R < P; R++) {
- var O = M[R];
- if (0 !== O) {
- var L = S[R].vertices;
- Mt.addScaledVector(Ot.subVectors(L[T.a], m), O),
- Rt.addScaledVector(Lt.subVectors(L[T.b], v), O),
- Pt.addScaledVector(Dt.subVectors(L[T.c], y), O)
- }
- }
- Mt.add(m),
- Rt.add(v),
- Pt.add(y),
- m = Mt,
- v = Rt,
- y = Pt
- }
- if (n = wi(this, e, xt, m, v, y, kt)) {
- if (i) {
- var D = i[b];
- Nt.copy(D[0]),
- Ft.copy(D[1]),
- Bt.copy(D[2]),
- n.uv = bi(kt, m, v, y, Nt, Ft, Bt)
- }
- n.face = T,
- n.faceIndex = b,
- t.push(n)
- }
- }
- }
- }
- }
- ),
- Ci.Mesh.prototype.clone = function() {
- return new this.constructor(this.geometry,this.material).copy(this)
- }
- ,
- Ci.Bone = function(e) {
- Ci.Object3D.call(this),
- this.type = "Bone",
- this.skin = e
- }
- ,
- Ci.Bone.prototype = Object.create(Ci.Object3D.prototype),
- Ci.Bone.prototype.constructor = Ci.Bone,
- Ci.Bone.prototype.copy = function(e) {
- return Ci.Object3D.prototype.copy.call(this, e),
- this.skin = e.skin,
- this
- }
- ,
- Ci.Skeleton = function(e, t, i) {
- if (this.useVertexTexture = void 0 === i || i,
- this.identityMatrix = new Ci.Matrix4,
- e = e || [],
- this.bones = e.slice(0),
- this.useVertexTexture) {
- var n = Math.sqrt(4 * this.bones.length);
- n = Ci.Math.nextPowerOfTwo(Math.ceil(n)),
- n = Math.max(n, 4),
- this.boneTextureWidth = n,
- this.boneTextureHeight = n,
- this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
- this.boneTexture = new Ci.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,Ci.RGBAFormat,Ci.FloatType)
- } else
- this.boneMatrices = new Float32Array(16 * this.bones.length);
- if (void 0 === t)
- this.calculateInverses();
- else if (this.bones.length === t.length)
- this.boneInverses = t.slice(0);
- else {
- console.warn("THREE.Skeleton bonInverses is the wrong length."),
- this.boneInverses = [];
- for (var r = 0, o = this.bones.length; r < o; r++)
- this.boneInverses.push(new Ci.Matrix4)
- }
- }
- ,
- Ci.Skeleton.prototype.calculateInverses = function() {
- this.boneInverses = [];
- for (var e = 0, t = this.bones.length; e < t; e++) {
- var i = new Ci.Matrix4;
- this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
- this.boneInverses.push(i)
- }
- }
- ,
- Ci.Skeleton.prototype.pose = function() {
- for (var e, t = 0, i = this.bones.length; t < i; t++)
- (e = this.bones[t]) && e.matrixWorld.getInverse(this.boneInverses[t]);
- for (t = 0,
- i = this.bones.length; t < i; t++)
- (e = this.bones[t]) && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
- e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
- e.matrix.decompose(e.position, e.quaternion, e.scale))
- }
- ,
- Ci.Skeleton.prototype.update = (wt = new Ci.Matrix4,
- function() {
- for (var e = 0, t = this.bones.length; e < t; e++) {
- var i = this.bones[e] ? this.bones[e].matrixWorld : this.identityMatrix;
- wt.multiplyMatrices(i, this.boneInverses[e]),
- wt.flattenToArrayOffset(this.boneMatrices, 16 * e)
- }
- this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
- }
- ),
- Ci.Skeleton.prototype.clone = function() {
- return new Ci.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
- }
- ,
- Ci.SkinnedMesh = function(e, t, i) {
- Ci.Mesh.call(this, e, t),
- this.type = "SkinnedMesh",
- this.bindMode = "attached",
- this.bindMatrix = new Ci.Matrix4,
- this.bindMatrixInverse = new Ci.Matrix4;
- var n = [];
- if (this.geometry && void 0 !== this.geometry.bones) {
- for (var r, o, a = 0, s = this.geometry.bones.length; a < s; ++a)
- o = this.geometry.bones[a],
- r = new Ci.Bone(this),
- n.push(r),
- r.name = o.name,
- r.position.fromArray(o.pos),
- r.quaternion.fromArray(o.rotq),
- void 0 !== o.scl && r.scale.fromArray(o.scl);
- for (a = 0,
- s = this.geometry.bones.length; a < s; ++a)
- -1 !== (o = this.geometry.bones[a]).parent && null !== o.parent ? n[o.parent].add(n[a]) : this.add(n[a])
- }
- this.normalizeSkinWeights(),
- this.updateMatrixWorld(!0),
- this.bind(new Ci.Skeleton(n,void 0,i), this.matrixWorld)
- }
- ,
- Ci.SkinnedMesh.prototype = Object.create(Ci.Mesh.prototype),
- Ci.SkinnedMesh.prototype.constructor = Ci.SkinnedMesh,
- Ci.SkinnedMesh.prototype.bind = function(e, t) {
- this.skeleton = e,
- void 0 === t && (this.updateMatrixWorld(!0),
- this.skeleton.calculateInverses(),
- t = this.matrixWorld),
- this.bindMatrix.copy(t),
- this.bindMatrixInverse.getInverse(t)
- }
- ,
- Ci.SkinnedMesh.prototype.pose = function() {
- this.skeleton.pose()
- }
- ,
- Ci.SkinnedMesh.prototype.normalizeSkinWeights = function() {
- if (this.geometry instanceof Ci.Geometry)
- for (var e = 0; e < this.geometry.skinWeights.length; e++) {
- var t = this.geometry.skinWeights[e];
- (r = 1 / t.lengthManhattan()) !== 1 / 0 ? t.multiplyScalar(r) : t.set(1, 0, 0, 0)
- }
- else if (this.geometry instanceof Ci.BufferGeometry) {
- var i = new Ci.Vector4
- , n = this.geometry.attributes.skinWeight;
- for (e = 0; e < n.count; e++) {
- var r;
- i.x = n.getX(e),
- i.y = n.getY(e),
- i.z = n.getZ(e),
- i.w = n.getW(e),
- (r = 1 / i.lengthManhattan()) !== 1 / 0 ? i.multiplyScalar(r) : i.set(1, 0, 0, 0),
- n.setXYZW(e, i.x, i.y, i.z, i.w)
- }
- }
- }
- ,
- Ci.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
- Ci.Mesh.prototype.updateMatrixWorld.call(this, !0),
- "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
- }
- ,
- Ci.SkinnedMesh.prototype.clone = function() {
- return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
- }
- ,
- Ci.LOD = function() {
- Ci.Object3D.call(this),
- this.type = "LOD",
- Object.defineProperties(this, {
- levels: {
- enumerable: !0,
- value: []
- },
- objects: {
- get: function() {
- return console.warn("THREE.LOD: .objects has been renamed to .levels."),
- this.levels
- }
- }
- })
- }
- ,
- Ci.LOD.prototype = Object.create(Ci.Object3D.prototype),
- Ci.LOD.prototype.constructor = Ci.LOD,
- Ci.LOD.prototype.addLevel = function(e, t) {
- void 0 === t && (t = 0),
- t = Math.abs(t);
- for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
- ;
- i.splice(n, 0, {
- distance: t,
- object: e
- }),
- this.add(e)
- }
- ,
- Ci.LOD.prototype.getObjectForDistance = function(e) {
- for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
- ;
- return t[i - 1].object
- }
- ,
- Ci.LOD.prototype.raycast = (bt = new Ci.Vector3,
- function(e, t) {
- bt.setFromMatrixPosition(this.matrixWorld);
- var i = e.ray.origin.distanceTo(bt);
- this.getObjectForDistance(i).raycast(e, t)
- }
- ),
- Ci.LOD.prototype.update = (Et = new Ci.Vector3,
- _t = new Ci.Vector3,
- function(e) {
- var t = this.levels;
- if (1 < t.length) {
- Et.setFromMatrixPosition(e.matrixWorld),
- _t.setFromMatrixPosition(this.matrixWorld);
- var i = Et.distanceTo(_t);
- t[0].object.visible = !0;
- for (var n = 1, r = t.length; n < r && i >= t[n].distance; n++)
- t[n - 1].object.visible = !1,
- t[n].object.visible = !0;
- for (; n < r; n++)
- t[n].object.visible = !1
- }
- }
- ),
- Ci.LOD.prototype.copy = function(e) {
- Ci.Object3D.prototype.copy.call(this, e, !1);
- for (var t = e.levels, i = 0, n = t.length; i < n; i++) {
- var r = t[i];
- this.addLevel(r.object.clone(), r.distance)
- }
- return this
- }
- ,
- Ci.LOD.prototype.toJSON = function(e) {
- var t = Ci.Object3D.prototype.toJSON.call(this, e);
- t.object.levels = [];
- for (var i = this.levels, n = 0, r = i.length; n < r; n++) {
- var o = i[n];
- t.object.levels.push({
- object: o.object.uuid,
- distance: o.distance
- })
- }
- return t
- }
- ,
- Ci.Sprite = (yt = new Uint16Array([0, 1, 2, 0, 2, 3]),
- At = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0]),
- Ct = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
- (It = new Ci.BufferGeometry).setIndex(new Ci.BufferAttribute(yt,1)),
- It.addAttribute("position", new Ci.BufferAttribute(At,3)),
- It.addAttribute("uv", new Ci.BufferAttribute(Ct,2)),
- function(e) {
- Ci.Object3D.call(this),
- this.type = "Sprite",
- this.geometry = It,
- this.material = void 0 !== e ? e : new Ci.SpriteMaterial
- }
- ),
- Ci.Sprite.prototype = Object.create(Ci.Object3D.prototype),
- Ci.Sprite.prototype.constructor = Ci.Sprite,
- Ci.Sprite.prototype.raycast = (vt = new Ci.Vector3,
- function(e, t) {
- vt.setFromMatrixPosition(this.matrixWorld);
- var i = e.ray.distanceSqToPoint(vt);
- this.scale.x * this.scale.y < i || t.push({
- distance: Math.sqrt(i),
- point: this.position,
- face: null,
- object: this
- })
- }
- ),
- Ci.Sprite.prototype.clone = function() {
- return new this.constructor(this.material).copy(this)
- }
- ,
- Ci.Particle = Ci.Sprite,
- Ci.LensFlare = function(e, t, i, n, r) {
- Ci.Object3D.call(this),
- this.lensFlares = [],
- this.positionScreen = new Ci.Vector3,
- (this.customUpdateCallback = void 0) !== e && this.add(e, t, i, n, r)
- }
- ,
- Ci.LensFlare.prototype = Object.create(Ci.Object3D.prototype),
- Ci.LensFlare.prototype.constructor = Ci.LensFlare,
- Ci.LensFlare.prototype.add = function(e, t, i, n, r, o) {
- void 0 === t && (t = -1),
- void 0 === i && (i = 0),
- void 0 === o && (o = 1),
- void 0 === r && (r = new Ci.Color(16777215)),
- void 0 === n && (n = Ci.NormalBlending),
- i = Math.min(i, Math.max(0, i)),
- this.lensFlares.push({
- texture: e,
- size: t,
- distance: i,
- x: 0,
- y: 0,
- z: 0,
- scale: 1,
- rotation: 0,
- opacity: o,
- color: r,
- blending: n
- })
- }
- ,
- Ci.LensFlare.prototype.updateLensFlares = function() {
- var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
- for (e = 0; e < i; e++)
- (t = this.lensFlares[e]).x = this.positionScreen.x + n * t.distance,
- t.y = this.positionScreen.y + r * t.distance,
- t.wantedRotation = t.x * Math.PI * .25,
- t.rotation += .25 * (t.wantedRotation - t.rotation)
- }
- ,
- Ci.LensFlare.prototype.copy = function(e) {
- Ci.Object3D.prototype.copy.call(this, e),
- this.positionScreen.copy(e.positionScreen),
- this.customUpdateCallback = e.customUpdateCallback;
- for (var t = 0, i = e.lensFlares.length; t < i; t++)
- this.lensFlares.push(e.lensFlares[t]);
- return this
- }
- ,
- Ci.Scene = function() {
- Ci.Object3D.call(this),
- this.type = "Scene",
- this.fog = null,
- this.overrideMaterial = null,
- this.autoUpdate = !0
- }
- ,
- Ci.Scene.prototype = Object.create(Ci.Object3D.prototype),
- Ci.Scene.prototype.constructor = Ci.Scene,
- Ci.Scene.prototype.copy = function(e, t) {
- return Ci.Object3D.prototype.copy.call(this, e, t),
- null !== e.fog && (this.fog = e.fog.clone()),
- null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
- this.autoUpdate = e.autoUpdate,
- this.matrixAutoUpdate = e.matrixAutoUpdate,
- this
- }
- ,
- Ci.Fog = function(e, t, i) {
- this.name = "",
- this.color = new Ci.Color(e),
- this.near = void 0 !== t ? t : 1,
- this.far = void 0 !== i ? i : 1e3
- }
- ,
- Ci.Fog.prototype.clone = function() {
- return new Ci.Fog(this.color.getHex(),this.near,this.far)
- }
- ,
- Ci.FogExp2 = function(e, t) {
- this.name = "",
- this.color = new Ci.Color(e),
- this.density = void 0 !== t ? t : 25e-5
- }
- ,
- Ci.FogExp2.prototype.clone = function() {
- return new Ci.FogExp2(this.color.getHex(),this.density)
- }
- ,
- Ci.ShaderChunk = {},
- Ci.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
- Ci.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
- Ci.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
- 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",
- Ci.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
- Ci.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
- Ci.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
- 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",
- 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",
- Ci.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
- Ci.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
- Ci.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
- Ci.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
- 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",
- 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",
- Ci.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
- Ci.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
- Ci.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
- 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",
- Ci.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
- 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",
- Ci.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- Ci.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
- Ci.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
- 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",
- 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",
- Ci.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
- 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",
- Ci.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
- Ci.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
- 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",
- 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",
- 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",
- Ci.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
- 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",
- 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",
- 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",
- Ci.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
- Ci.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
- 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",
- Ci.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
- Ci.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
- Ci.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
- 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",
- 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",
- 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",
- 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",
- 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",
- Ci.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
- 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",
- Ci.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
- Ci.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- Ci.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
- Ci.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
- 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",
- Ci.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
- Ci.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
- Ci.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
- 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",
- 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",
- 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",
- 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",
- Ci.UniformsUtils = {
- merge: function(e) {
- for (var t = {}, i = 0; i < e.length; i++) {
- var n = this.clone(e[i]);
- for (var r in n)
- t[r] = n[r]
- }
- return t
- },
- clone: function(e) {
- var t = {};
- for (var i in e)
- for (var n in t[i] = {},
- e[i]) {
- var r = e[i][n];
- 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
- }
- return t
- }
- },
- Ci.UniformsLib = {
- common: {
- diffuse: {
- type: "c",
- value: new Ci.Color(15658734)
- },
- opacity: {
- type: "f",
- value: 1
- },
- map: {
- type: "t",
- value: null
- },
- offsetRepeat: {
- type: "v4",
- value: new Ci.Vector4(0,0,1,1)
- },
- specularMap: {
- type: "t",
- value: null
- },
- alphaMap: {
- type: "t",
- value: null
- },
- envMap: {
- type: "t",
- value: null
- },
- flipEnvMap: {
- type: "f",
- value: -1
- },
- reflectivity: {
- type: "f",
- value: 1
- },
- refractionRatio: {
- type: "f",
- value: .98
- }
- },
- aomap: {
- aoMap: {
- type: "t",
- value: null
- },
- aoMapIntensity: {
- type: "f",
- value: 1
- }
- },
- lightmap: {
- lightMap: {
- type: "t",
- value: null
- },
- lightMapIntensity: {
- type: "f",
- value: 1
- }
- },
- emissivemap: {
- emissiveMap: {
- type: "t",
- value: null
- }
- },
- bumpmap: {
- bumpMap: {
- type: "t",
- value: null
- },
- bumpScale: {
- type: "f",
- value: 1
- }
- },
- normalmap: {
- normalMap: {
- type: "t",
- value: null
- },
- normalScale: {
- type: "v2",
- value: new Ci.Vector2(1,1)
- }
- },
- displacementmap: {
- displacementMap: {
- type: "t",
- value: null
- },
- displacementScale: {
- type: "f",
- value: 1
- },
- displacementBias: {
- type: "f",
- value: 0
- }
- },
- roughnessmap: {
- roughnessMap: {
- type: "t",
- value: null
- }
- },
- metalnessmap: {
- metalnessMap: {
- type: "t",
- value: null
- }
- },
- fog: {
- fogDensity: {
- type: "f",
- value: 25e-5
- },
- fogNear: {
- type: "f",
- value: 1
- },
- fogFar: {
- type: "f",
- value: 2e3
- },
- fogColor: {
- type: "c",
- value: new Ci.Color(16777215)
- }
- },
- lights: {
- ambientLightColor: {
- type: "fv",
- value: []
- },
- directionalLights: {
- type: "sa",
- value: [],
- properties: {
- direction: {
- type: "v3"
- },
- color: {
- type: "c"
- },
- shadow: {
- type: "i"
- },
- shadowBias: {
- type: "f"
- },
- shadowRadius: {
- type: "f"
- },
- shadowMapSize: {
- type: "v2"
- }
- }
- },
- directionalShadowMap: {
- type: "tv",
- value: []
- },
- directionalShadowMatrix: {
- type: "m4v",
- value: []
- },
- spotLights: {
- type: "sa",
- value: [],
- properties: {
- color: {
- type: "c"
- },
- position: {
- type: "v3"
- },
- direction: {
- type: "v3"
- },
- distance: {
- type: "f"
- },
- coneCos: {
- type: "f"
- },
- penumbraCos: {
- type: "f"
- },
- decay: {
- type: "f"
- },
- shadow: {
- type: "i"
- },
- shadowBias: {
- type: "f"
- },
- shadowRadius: {
- type: "f"
- },
- shadowMapSize: {
- type: "v2"
- }
- }
- },
- spotShadowMap: {
- type: "tv",
- value: []
- },
- spotShadowMatrix: {
- type: "m4v",
- value: []
- },
- pointLights: {
- type: "sa",
- value: [],
- properties: {
- color: {
- type: "c"
- },
- position: {
- type: "v3"
- },
- decay: {
- type: "f"
- },
- distance: {
- type: "f"
- },
- shadow: {
- type: "i"
- },
- shadowBias: {
- type: "f"
- },
- shadowRadius: {
- type: "f"
- },
- shadowMapSize: {
- type: "v2"
- }
- }
- },
- pointShadowMap: {
- type: "tv",
- value: []
- },
- pointShadowMatrix: {
- type: "m4v",
- value: []
- },
- hemisphereLights: {
- type: "sa",
- value: [],
- properties: {
- direction: {
- type: "v3"
- },
- skyColor: {
- type: "c"
- },
- groundColor: {
- type: "c"
- }
- }
- }
- },
- points: {
- diffuse: {
- type: "c",
- value: new Ci.Color(15658734)
- },
- opacity: {
- type: "f",
- value: 1
- },
- size: {
- type: "f",
- value: 1
- },
- scale: {
- type: "f",
- value: 1
- },
- map: {
- type: "t",
- value: null
- },
- offsetRepeat: {
- type: "v4",
- value: new Ci.Vector4(0,0,1,1)
- }
- }
- },
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- 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",
- Ci.ShaderLib = {
- basic: {
- uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.fog]),
- vertexShader: Ci.ShaderChunk.meshbasic_vert,
- fragmentShader: Ci.ShaderChunk.meshbasic_frag
- },
- lambert: {
- uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.aomap, Ci.UniformsLib.lightmap, Ci.UniformsLib.emissivemap, Ci.UniformsLib.fog, Ci.UniformsLib.lights, {
- emissive: {
- type: "c",
- value: new Ci.Color(0)
- }
- }]),
- vertexShader: Ci.ShaderChunk.meshlambert_vert,
- fragmentShader: Ci.ShaderChunk.meshlambert_frag
- },
- phong: {
- 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, {
- emissive: {
- type: "c",
- value: new Ci.Color(0)
- },
- specular: {
- type: "c",
- value: new Ci.Color(1118481)
- },
- shininess: {
- type: "f",
- value: 30
- }
- }]),
- vertexShader: Ci.ShaderChunk.meshphong_vert,
- fragmentShader: Ci.ShaderChunk.meshphong_frag
- },
- standard: {
- 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, {
- emissive: {
- type: "c",
- value: new Ci.Color(0)
- },
- roughness: {
- type: "f",
- value: .5
- },
- metalness: {
- type: "f",
- value: 0
- },
- envMapIntensity: {
- type: "f",
- value: 1
- }
- }]),
- vertexShader: Ci.ShaderChunk.meshstandard_vert,
- fragmentShader: Ci.ShaderChunk.meshstandard_frag
- },
- points: {
- uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.points, Ci.UniformsLib.fog]),
- vertexShader: Ci.ShaderChunk.points_vert,
- fragmentShader: Ci.ShaderChunk.points_frag
- },
- dashed: {
- uniforms: Ci.UniformsUtils.merge([Ci.UniformsLib.common, Ci.UniformsLib.fog, {
- scale: {
- type: "f",
- value: 1
- },
- dashSize: {
- type: "f",
- value: 1
- },
- totalSize: {
- type: "f",
- value: 2
- }
- }]),
- vertexShader: Ci.ShaderChunk.linedashed_vert,
- fragmentShader: Ci.ShaderChunk.linedashed_frag
- },
- depth: {
- uniforms: {
- mNear: {
- type: "f",
- value: 1
- },
- mFar: {
- type: "f",
- value: 2e3
- },
- opacity: {
- type: "f",
- value: 1
- }
- },
- vertexShader: Ci.ShaderChunk.depth_vert,
- fragmentShader: Ci.ShaderChunk.depth_frag
- },
- normal: {
- uniforms: {
- opacity: {
- type: "f",
- value: 1
- }
- },
- vertexShader: Ci.ShaderChunk.normal_vert,
- fragmentShader: Ci.ShaderChunk.normal_frag
- },
- cube: {
- uniforms: {
- tCube: {
- type: "t",
- value: null
- },
- tFlip: {
- type: "f",
- value: -1
- }
- },
- vertexShader: Ci.ShaderChunk.cube_vert,
- fragmentShader: Ci.ShaderChunk.cube_frag
- },
- equirect: {
- uniforms: {
- tEquirect: {
- type: "t",
- value: null
- },
- tFlip: {
- type: "f",
- value: -1
- }
- },
- vertexShader: Ci.ShaderChunk.equirect_vert,
- fragmentShader: Ci.ShaderChunk.equirect_frag
- },
- depthRGBA: {
- uniforms: {},
- vertexShader: Ci.ShaderChunk.depthRGBA_vert,
- fragmentShader: Ci.ShaderChunk.depthRGBA_frag
- },
- distanceRGBA: {
- uniforms: {
- lightPos: {
- type: "v3",
- value: new Ci.Vector3(0,0,0)
- }
- },
- vertexShader: Ci.ShaderChunk.distanceRGBA_vert,
- fragmentShader: Ci.ShaderChunk.distanceRGBA_frag
- }
- },
- Ci.WebGLRenderer = function(e) {
- function S() {
- return null === Q ? he : 1
- }
- function i(e, t, i, n) {
- !0 === V && (e *= n,
- t *= n,
- i *= n),
- _e.clearColor(e, t, i, n)
- }
- function t() {
- _e.init(),
- _e.scissor(ie.copy(ue).multiplyScalar(he)),
- _e.viewport(re.copy(pe).multiplyScalar(he)),
- i(ae.r, ae.g, ae.b, se)
- }
- function n() {
- te = K = null,
- ee = "",
- $ = -1,
- _e.reset()
- }
- function r(e) {
- e.preventDefault(),
- n(),
- t(),
- be.clear()
- }
- function f(e) {
- var t = e.target;
- t.removeEventListener("dispose", f),
- function(e) {
- var t = be.get(e);
- if (e.image && t.__image__webglTextureCube)
- X.deleteTexture(t.__image__webglTextureCube);
- else {
- if (void 0 === t.__webglInit)
- return;
- X.deleteTexture(t.__webglTexture)
- }
- be.delete(e)
- }(t),
- ye.textures--
- }
- function a(e) {
- var t = e.target;
- t.removeEventListener("dispose", a),
- function(e) {
- var t = be.get(e)
- , i = be.get(e.texture);
- if (e && void 0 !== i.__webglTexture) {
- if (X.deleteTexture(i.__webglTexture),
- e instanceof Ci.WebGLRenderTargetCube)
- for (var n = 0; n < 6; n++)
- X.deleteFramebuffer(t.__webglFramebuffer[n]),
- X.deleteRenderbuffer(t.__webglDepthbuffer[n]);
- else
- X.deleteFramebuffer(t.__webglFramebuffer),
- X.deleteRenderbuffer(t.__webglDepthbuffer);
- be.delete(e.texture),
- be.delete(e)
- }
- }(t),
- ye.textures--
- }
- function v(e) {
- var t = e.target;
- t.removeEventListener("dispose", v),
- function(e) {
- y(e),
- be.delete(e)
- }(t)
- }
- function y(e) {
- var t = be.get(e).program;
- (e.program = void 0) !== t && Te.releaseProgram(t)
- }
- function M(e, t) {
- return Math.abs(t[0]) - Math.abs(e[0])
- }
- function s(e, t) {
- 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
- }
- function l(e, t) {
- 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
- }
- function d(e, t, i, n, r) {
- var o, a;
- a = i.transparent ? (o = G,
- ++W) : (o = H,
- ++z);
- var s = o[a];
- void 0 !== s ? (s.id = e.id,
- s.object = e,
- s.geometry = t,
- s.material = i,
- s.z = me.z,
- s.group = r) : (s = {
- id: e.id,
- object: e,
- geometry: t,
- material: i,
- z: me.z,
- group: r
- },
- o.push(s))
- }
- function c(e, t, i, n) {
- for (var r = 0, o = e.length; r < o; r++) {
- var a = e[r]
- , s = a.object
- , l = a.geometry
- , c = void 0 === n ? a.material : n
- , h = a.group;
- if (s.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, s.matrixWorld),
- s.normalMatrix.getNormalMatrix(s.modelViewMatrix),
- s instanceof Ci.ImmediateRenderObject) {
- R(c);
- var u = P(t, i, c, s);
- ee = "",
- s.render(function(e) {
- Z.renderBufferImmediate(e, u, c)
- })
- } else
- Z.renderBufferDirect(t, i, l, c, s, h)
- }
- }
- function R(e) {
- (function(e) {
- e.side !== Ci.DoubleSide ? _e.enable(X.CULL_FACE) : _e.disable(X.CULL_FACE),
- _e.setFlipSided(e.side === Ci.BackSide)
- }
- )(e),
- !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),
- _e.setDepthFunc(e.depthFunc),
- _e.setDepthTest(e.depthTest),
- _e.setDepthWrite(e.depthWrite),
- _e.setColorWrite(e.colorWrite),
- _e.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
- }
- function P(e, t, i, n) {
- oe = 0;
- var r = be.get(i);
- void 0 === r.program && (i.needsUpdate = !0),
- void 0 !== r.lightsHash && r.lightsHash !== ve.hash && (i.needsUpdate = !0),
- i.needsUpdate && (function(e, t, i) {
- var n = be.get(e)
- , r = Te.getParameters(e, ve, t, i)
- , o = Te.getProgramCode(e, r)
- , a = n.program
- , s = !0;
- if (void 0 === a)
- e.addEventListener("dispose", v);
- else if (a.code !== o)
- y(e);
- else {
- if (void 0 !== r.shaderID)
- return;
- s = !1
- }
- if (s) {
- if (r.shaderID) {
- var l = Ci.ShaderLib[r.shaderID];
- n.__webglShader = {
- name: e.type,
- uniforms: Ci.UniformsUtils.clone(l.uniforms),
- vertexShader: l.vertexShader,
- fragmentShader: l.fragmentShader
- }
- } else
- n.__webglShader = {
- name: e.type,
- uniforms: e.uniforms,
- vertexShader: e.vertexShader,
- fragmentShader: e.fragmentShader
- };
- e.__webglShader = n.__webglShader,
- a = Te.acquireProgram(e, r, o),
- n.program = a,
- e.program = a
- }
- var c = a.getAttributes();
- if (e.morphTargets)
- for (var h = e.numSupportedMorphTargets = 0; h < Z.maxMorphTargets; h++)
- 0 <= c["morphTarget" + h] && e.numSupportedMorphTargets++;
- if (e.morphNormals)
- for (h = e.numSupportedMorphNormals = 0; h < Z.maxMorphNormals; h++)
- 0 <= c["morphNormal" + h] && e.numSupportedMorphNormals++;
- n.uniformsList = [];
- var u = n.__webglShader.uniforms
- , d = n.program.getUniforms();
- for (var p in u) {
- var f = d[p];
- f && n.uniformsList.push([n.__webglShader.uniforms[p], f])
- }
- (e instanceof Ci.MeshPhongMaterial || e instanceof Ci.MeshLambertMaterial || e instanceof Ci.MeshStandardMaterial || e.lights) && (n.lightsHash = ve.hash,
- u.ambientLightColor.value = ve.ambient,
- u.directionalLights.value = ve.directional,
- u.spotLights.value = ve.spot,
- u.pointLights.value = ve.point,
- u.hemisphereLights.value = ve.hemi,
- u.directionalShadowMap.value = ve.directionalShadowMap,
- u.directionalShadowMatrix.value = ve.directionalShadowMatrix,
- u.spotShadowMap.value = ve.spotShadowMap,
- u.spotShadowMatrix.value = ve.spotShadowMatrix,
- u.pointShadowMap.value = ve.pointShadowMap,
- u.pointShadowMatrix.value = ve.pointShadowMatrix),
- n.hasDynamicUniforms = !1;
- for (var g = 0, m = n.uniformsList.length; g < m; g++) {
- if (!0 === n.uniformsList[g][0].dynamic) {
- n.hasDynamicUniforms = !0;
- break
- }
- }
- }(i, t, n),
- i.needsUpdate = !1);
- var o = !1
- , a = !1
- , s = !1
- , l = r.program
- , c = l.getUniforms()
- , h = r.__webglShader.uniforms;
- if (l.id !== K && (X.useProgram(l.program),
- K = l.id,
- s = a = o = !0),
- i.id !== $ && ($ = i.id,
- a = !0),
- !o && e === te || (X.uniformMatrix4fv(c.projectionMatrix, !1, e.projectionMatrix.elements),
- Ee.logarithmicDepthBuffer && X.uniform1f(c.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
- e !== te && (te = e,
- s = a = !0),
- (i instanceof Ci.ShaderMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial || i.envMap) && void 0 !== c.cameraPosition && (me.setFromMatrixPosition(e.matrixWorld),
- X.uniform3f(c.cameraPosition, me.x, me.y, me.z)),
- (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),
- void 0 !== c.toneMappingExposure && X.uniform1f(c.toneMappingExposure, Z.toneMappingExposure),
- void 0 !== c.toneMappingWhitePoint && X.uniform1f(c.toneMappingWhitePoint, Z.toneMappingWhitePoint)),
- i.skinning)
- if (n.bindMatrix && void 0 !== c.bindMatrix && X.uniformMatrix4fv(c.bindMatrix, !1, n.bindMatrix.elements),
- n.bindMatrixInverse && void 0 !== c.bindMatrixInverse && X.uniformMatrix4fv(c.bindMatrixInverse, !1, n.bindMatrixInverse.elements),
- Ee.floatVertexTextures && n.skeleton && n.skeleton.useVertexTexture) {
- if (void 0 !== c.boneTexture) {
- var u = A();
- X.uniform1i(c.boneTexture, u),
- Z.setTexture(n.skeleton.boneTexture, u)
- }
- void 0 !== c.boneTextureWidth && X.uniform1i(c.boneTextureWidth, n.skeleton.boneTextureWidth),
- void 0 !== c.boneTextureHeight && X.uniform1i(c.boneTextureHeight, n.skeleton.boneTextureHeight)
- } else
- n.skeleton && n.skeleton.boneMatrices && void 0 !== c.boneGlobalMatrices && X.uniformMatrix4fv(c.boneGlobalMatrices, !1, n.skeleton.boneMatrices);
- return a && ((i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshStandardMaterial || i.lights) && function(e, t) {
- e.ambientLightColor.needsUpdate = t,
- e.directionalLights.needsUpdate = t,
- e.pointLights.needsUpdate = t,
- e.spotLights.needsUpdate = t,
- e.hemisphereLights.needsUpdate = t
- }(h, s),
- t && i.fog && function(e, t) {
- e.fogColor.value = t.color,
- t instanceof Ci.Fog ? (e.fogNear.value = t.near,
- e.fogFar.value = t.far) : t instanceof Ci.FogExp2 && (e.fogDensity.value = t.density)
- }(h, t),
- (i instanceof Ci.MeshBasicMaterial || i instanceof Ci.MeshLambertMaterial || i instanceof Ci.MeshPhongMaterial || i instanceof Ci.MeshStandardMaterial) && function(e, t) {
- var i;
- if (e.opacity.value = t.opacity,
- e.diffuse.value = t.color,
- t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
- e.map.value = t.map,
- e.specularMap.value = t.specularMap,
- e.alphaMap.value = t.alphaMap,
- t.aoMap && (e.aoMap.value = t.aoMap,
- e.aoMapIntensity.value = t.aoMapIntensity),
- 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),
- void 0 !== i) {
- i instanceof Ci.WebGLRenderTarget && (i = i.texture);
- var n = i.offset
- , r = i.repeat;
- e.offsetRepeat.value.set(n.x, n.y, r.x, r.y)
- }
- e.envMap.value = t.envMap,
- e.flipEnvMap.value = t.envMap instanceof Ci.WebGLRenderTargetCube ? 1 : -1,
- e.reflectivity.value = t.reflectivity,
- e.refractionRatio.value = t.refractionRatio
- }(h, i),
- i instanceof Ci.LineBasicMaterial ? p(h, i) : i instanceof Ci.LineDashedMaterial ? (p(h, i),
- function(e, t) {
- e.dashSize.value = t.dashSize,
- e.totalSize.value = t.dashSize + t.gapSize,
- e.scale.value = t.scale
- }(h, i)) : i instanceof Ci.PointsMaterial ? function(e, t) {
- if (e.diffuse.value = t.color,
- e.opacity.value = t.opacity,
- e.size.value = t.size * he,
- e.scale.value = O.clientHeight / 2,
- e.map.value = t.map,
- null !== t.map) {
- var i = t.map.offset
- , n = t.map.repeat;
- e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
- }
- }(h, i) : i instanceof Ci.MeshLambertMaterial ? function(e, t) {
- t.lightMap && (e.lightMap.value = t.lightMap,
- e.lightMapIntensity.value = t.lightMapIntensity),
- t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
- }(h, i) : i instanceof Ci.MeshPhongMaterial ? function(e, t) {
- e.specular.value = t.specular,
- e.shininess.value = Math.max(t.shininess, 1e-4),
- t.lightMap && (e.lightMap.value = t.lightMap,
- e.lightMapIntensity.value = t.lightMapIntensity),
- t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
- t.bumpMap && (e.bumpMap.value = t.bumpMap,
- e.bumpScale.value = t.bumpScale),
- t.normalMap && (e.normalMap.value = t.normalMap,
- e.normalScale.value.copy(t.normalScale)),
- t.displacementMap && (e.displacementMap.value = t.displacementMap,
- e.displacementScale.value = t.displacementScale,
- e.displacementBias.value = t.displacementBias)
- }(h, i) : i instanceof Ci.MeshStandardMaterial ? function(e, t) {
- e.roughness.value = t.roughness,
- e.metalness.value = t.metalness,
- t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
- t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
- t.lightMap && (e.lightMap.value = t.lightMap,
- e.lightMapIntensity.value = t.lightMapIntensity),
- t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
- t.bumpMap && (e.bumpMap.value = t.bumpMap,
- e.bumpScale.value = t.bumpScale),
- t.normalMap && (e.normalMap.value = t.normalMap,
- e.normalScale.value.copy(t.normalScale)),
- t.displacementMap && (e.displacementMap.value = t.displacementMap,
- e.displacementScale.value = t.displacementScale,
- e.displacementBias.value = t.displacementBias),
- t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
- }(h, i) : i instanceof Ci.MeshDepthMaterial ? (h.mNear.value = e.near,
- h.mFar.value = e.far,
- h.opacity.value = i.opacity) : i instanceof Ci.MeshNormalMaterial && (h.opacity.value = i.opacity),
- g(r.uniformsList)),
- function(e, t) {
- X.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
- e.normalMatrix && X.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
- }(c, n),
- void 0 !== c.modelMatrix && X.uniformMatrix4fv(c.modelMatrix, !1, n.matrixWorld.elements),
- !0 === r.hasDynamicUniforms && function(e, t, i) {
- for (var n = [], r = 0, o = e.length; r < o; r++) {
- var a = e[r][0]
- , s = a.onUpdateCallback;
- void 0 !== s && (s.bind(a)(t, i),
- n.push(e[r]))
- }
- g(n)
- }(r.uniformsList, n, e),
- l
- }
- function p(e, t) {
- e.diffuse.value = t.color,
- e.opacity.value = t.opacity
- }
- function A() {
- var e = oe;
- return e >= Ee.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + Ee.maxTextures),
- oe += 1,
- e
- }
- function C(e, t, i, n) {
- var r, o;
- if ("1i" === t)
- X.uniform1i(i, n);
- else if ("1f" === t)
- X.uniform1f(i, n);
- else if ("2f" === t)
- X.uniform2f(i, n[0], n[1]);
- else if ("3f" === t)
- X.uniform3f(i, n[0], n[1], n[2]);
- else if ("4f" === t)
- X.uniform4f(i, n[0], n[1], n[2], n[3]);
- else if ("1iv" === t)
- X.uniform1iv(i, n);
- else if ("3iv" === t)
- X.uniform3iv(i, n);
- else if ("1fv" === t)
- X.uniform1fv(i, n);
- else if ("2fv" === t)
- X.uniform2fv(i, n);
- else if ("3fv" === t)
- X.uniform3fv(i, n);
- else if ("4fv" === t)
- X.uniform4fv(i, n);
- else if ("Matrix2fv" === t)
- X.uniformMatrix2fv(i, !1, n);
- else if ("Matrix3fv" === t)
- X.uniformMatrix3fv(i, !1, n);
- else if ("Matrix4fv" === t)
- X.uniformMatrix4fv(i, !1, n);
- else if ("i" === t)
- X.uniform1i(i, n);
- else if ("f" === t)
- X.uniform1f(i, n);
- else if ("v2" === t)
- X.uniform2f(i, n.x, n.y);
- else if ("v3" === t)
- X.uniform3f(i, n.x, n.y, n.z);
- else if ("v4" === t)
- X.uniform4f(i, n.x, n.y, n.z, n.w);
- else if ("c" === t)
- X.uniform3f(i, n.r, n.g, n.b);
- else if ("s" === t) {
- var a = e.properties;
- for (var s in a) {
- var l = a[s]
- , c = i[s]
- , h = n[s];
- C(l, l.type, c, h)
- }
- } else if ("sa" === t) {
- a = e.properties;
- for (var u = 0, d = n.length; u < d; u++)
- for (var s in a) {
- l = a[s],
- c = i[u][s],
- h = n[u][s];
- C(l, l.type, c, h)
- }
- } else if ("iv1" === t)
- X.uniform1iv(i, n);
- else if ("iv" === t)
- X.uniform3iv(i, n);
- else if ("fv1" === t)
- X.uniform1fv(i, n);
- else if ("fv" === t)
- X.uniform3fv(i, n);
- else if ("v2v" === t) {
- void 0 === e._array && (e._array = new Float32Array(2 * n.length));
- u = 0;
- for (var p = 0, f = n.length; u < f; u++,
- p += 2)
- e._array[p + 0] = n[u].x,
- e._array[p + 1] = n[u].y;
- X.uniform2fv(i, e._array)
- } else if ("v3v" === t) {
- void 0 === e._array && (e._array = new Float32Array(3 * n.length));
- u = 0;
- var g = 0;
- for (f = n.length; u < f; u++,
- g += 3)
- e._array[g + 0] = n[u].x,
- e._array[g + 1] = n[u].y,
- e._array[g + 2] = n[u].z;
- X.uniform3fv(i, e._array)
- } else if ("v4v" === t) {
- void 0 === e._array && (e._array = new Float32Array(4 * n.length));
- u = 0;
- var m = 0;
- for (f = n.length; u < f; u++,
- m += 4)
- e._array[m + 0] = n[u].x,
- e._array[m + 1] = n[u].y,
- e._array[m + 2] = n[u].z,
- e._array[m + 3] = n[u].w;
- X.uniform4fv(i, e._array)
- } else if ("m2" === t)
- X.uniformMatrix2fv(i, !1, n.elements);
- else if ("m3" === t)
- X.uniformMatrix3fv(i, !1, n.elements);
- else if ("m3v" === t) {
- void 0 === e._array && (e._array = new Float32Array(9 * n.length));
- for (u = 0,
- f = n.length; u < f; u++)
- n[u].flattenToArrayOffset(e._array, 9 * u);
- X.uniformMatrix3fv(i, !1, e._array)
- } else if ("m4" === t)
- X.uniformMatrix4fv(i, !1, n.elements);
- else if ("m4v" === t) {
- void 0 === e._array && (e._array = new Float32Array(16 * n.length));
- for (u = 0,
- f = n.length; u < f; u++)
- n[u].flattenToArrayOffset(e._array, 16 * u);
- X.uniformMatrix4fv(i, !1, e._array)
- } else if ("t" === t) {
- if (r = n,
- o = A(),
- X.uniform1i(i, o),
- !r)
- return;
- 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)
- } else if ("tv" === t) {
- void 0 === e._array && (e._array = []);
- for (u = 0,
- f = e.value.length; u < f; u++)
- e._array[u] = A();
- X.uniform1iv(i, e._array);
- for (u = 0,
- f = e.value.length; u < f; u++)
- r = e.value[u],
- o = e._array[u],
- 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))
- } else
- console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
- }
- function g(e) {
- for (var t = 0, i = e.length; t < i; t++) {
- var n = e[t][0];
- if (!1 !== n.needsUpdate)
- C(n, n.type, e[t][1], n.value)
- }
- }
- function m(e, t, i) {
- var n;
- if (i ? (X.texParameteri(e, X.TEXTURE_WRAP_S, x(t.wrapS)),
- X.texParameteri(e, X.TEXTURE_WRAP_T, x(t.wrapT)),
- X.texParameteri(e, X.TEXTURE_MAG_FILTER, x(t.magFilter)),
- X.texParameteri(e, X.TEXTURE_MIN_FILTER, x(t.minFilter))) : (X.texParameteri(e, X.TEXTURE_WRAP_S, X.CLAMP_TO_EDGE),
- X.texParameteri(e, X.TEXTURE_WRAP_T, X.CLAMP_TO_EDGE),
- 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),
- X.texParameteri(e, X.TEXTURE_MAG_FILTER, T(t.magFilter)),
- X.texParameteri(e, X.TEXTURE_MIN_FILTER, T(t.minFilter)),
- 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)),
- n = Ie.get("EXT_texture_filter_anisotropic")) {
- if (t.type === Ci.FloatType && null === Ie.get("OES_texture_float_linear"))
- return;
- if (t.type === Ci.HalfFloatType && null === Ie.get("OES_texture_half_float_linear"))
- return;
- (1 < t.anisotropy || be.get(t).__currentAnisotropy) && (X.texParameterf(e, n.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, Z.getMaxAnisotropy())),
- be.get(t).__currentAnisotropy = t.anisotropy)
- }
- }
- function o(e, t, i) {
- void 0 === e.__webglInit && (e.__webglInit = !0,
- t.addEventListener("dispose", f),
- e.__webglTexture = X.createTexture(),
- ye.textures++),
- _e.activeTexture(X.TEXTURE0 + i),
- _e.bindTexture(X.TEXTURE_2D, e.__webglTexture),
- X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, t.flipY),
- X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
- X.pixelStorei(X.UNPACK_ALIGNMENT, t.unpackAlignment);
- var n = I(t.image, Ee.maxTextureSize);
- !function(e) {
- return e.wrapS !== Ci.ClampToEdgeWrapping || e.wrapT !== Ci.ClampToEdgeWrapping || e.minFilter !== Ci.NearestFilter && e.minFilter !== Ci.LinearFilter
- }(t) || !1 !== E(n) || (n = function(e) {
- if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
- var t = document.createElement("canvas");
- return t.width = Ci.Math.nearestPowerOfTwo(e.width),
- t.height = Ci.Math.nearestPowerOfTwo(e.height),
- t.getContext("2d").drawImage(e, 0, 0, t.width, t.height),
- console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
- t
- }
- return e
- }(n));
- var r = E(n)
- , o = x(t.format)
- , a = x(t.type);
- m(X.TEXTURE_2D, t, r);
- var s, l = t.mipmaps;
- if (t instanceof Ci.DataTexture)
- if (0 < l.length && r) {
- for (var c = 0, h = l.length; c < h; c++)
- s = l[c],
- _e.texImage2D(X.TEXTURE_2D, c, o, s.width, s.height, 0, o, a, s.data);
- t.generateMipmaps = !1
- } else
- _e.texImage2D(X.TEXTURE_2D, 0, o, n.width, n.height, 0, o, a, n.data);
- else if (t instanceof Ci.CompressedTexture)
- for (c = 0,
- h = l.length; c < h; c++)
- s = l[c],
- 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);
- else if (0 < l.length && r) {
- for (c = 0,
- h = l.length; c < h; c++)
- s = l[c],
- _e.texImage2D(X.TEXTURE_2D, c, o, o, a, s);
- t.generateMipmaps = !1
- } else
- _e.texImage2D(X.TEXTURE_2D, 0, o, o, a, n);
- t.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
- e.__version = t.version,
- t.onUpdate && t.onUpdate(t)
- }
- function I(e, t) {
- if (e.width > t || e.height > t) {
- var i = t / Math.max(e.width, e.height)
- , n = document.createElement("canvas");
- return n.width = Math.floor(e.width * i),
- n.height = Math.floor(e.height * i),
- n.getContext("2d").drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
- console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
- n
- }
- return e
- }
- function E(e) {
- return Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height)
- }
- function _(e, t) {
- var i = be.get(e);
- if (6 === e.image.length)
- if (0 < e.version && i.__version !== e.version) {
- i.__image__webglTextureCube || (e.addEventListener("dispose", f),
- i.__image__webglTextureCube = X.createTexture(),
- ye.textures++),
- _e.activeTexture(X.TEXTURE0 + t),
- _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
- X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL, e.flipY);
- for (var n = e instanceof Ci.CompressedTexture, r = e.image[0]instanceof Ci.DataTexture, o = [], a = 0; a < 6; a++)
- !Z.autoScaleCubemaps || n || r ? o[a] = r ? e.image[a].image : e.image[a] : o[a] = I(e.image[a], Ee.maxCubemapSize);
- var s = E(o[0])
- , l = x(e.format)
- , c = x(e.type);
- m(X.TEXTURE_CUBE_MAP, e, s);
- for (a = 0; a < 6; a++)
- if (n)
- for (var h, u = o[a].mipmaps, d = 0, p = u.length; d < p; d++)
- h = u[d],
- 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);
- else
- 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]);
- e.generateMipmaps && s && X.generateMipmap(X.TEXTURE_CUBE_MAP),
- i.__version = e.version,
- e.onUpdate && e.onUpdate(e)
- } else
- _e.activeTexture(X.TEXTURE0 + t),
- _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
- }
- function b(e, t) {
- _e.activeTexture(X.TEXTURE0 + t),
- _e.bindTexture(X.TEXTURE_CUBE_MAP, be.get(e).__webglTexture)
- }
- function h(e, t, i, n) {
- var r = x(t.texture.format)
- , o = x(t.texture.type);
- _e.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
- X.bindFramebuffer(X.FRAMEBUFFER, e),
- X.framebufferTexture2D(X.FRAMEBUFFER, i, n, be.get(t.texture).__webglTexture, 0),
- X.bindFramebuffer(X.FRAMEBUFFER, null)
- }
- function u(e, t) {
- X.bindRenderbuffer(X.RENDERBUFFER, e),
- t.depthBuffer && !t.stencilBuffer ? (X.renderbufferStorage(X.RENDERBUFFER, X.DEPTH_COMPONENT16, t.width, t.height),
- 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),
- X.framebufferRenderbuffer(X.FRAMEBUFFER, X.DEPTH_STENCIL_ATTACHMENT, X.RENDERBUFFER, e)) : X.renderbufferStorage(X.RENDERBUFFER, X.RGBA4, t.width, t.height),
- X.bindRenderbuffer(X.RENDERBUFFER, null)
- }
- function w(e) {
- var t = be.get(e)
- , i = be.get(e.texture);
- e.addEventListener("dispose", a),
- i.__webglTexture = X.createTexture(),
- ye.textures++;
- var n = e instanceof Ci.WebGLRenderTargetCube
- , r = Ci.Math.isPowerOfTwo(e.width) && Ci.Math.isPowerOfTwo(e.height);
- if (n) {
- t.__webglFramebuffer = [];
- for (var o = 0; o < 6; o++)
- t.__webglFramebuffer[o] = X.createFramebuffer()
- } else
- t.__webglFramebuffer = X.createFramebuffer();
- if (n) {
- _e.bindTexture(X.TEXTURE_CUBE_MAP, i.__webglTexture),
- m(X.TEXTURE_CUBE_MAP, e.texture, r);
- for (o = 0; o < 6; o++)
- h(t.__webglFramebuffer[o], e, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + o);
- e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_CUBE_MAP),
- _e.bindTexture(X.TEXTURE_CUBE_MAP, null)
- } else
- _e.bindTexture(X.TEXTURE_2D, i.__webglTexture),
- m(X.TEXTURE_2D, e.texture, r),
- h(t.__webglFramebuffer, e, X.COLOR_ATTACHMENT0, X.TEXTURE_2D),
- e.texture.generateMipmaps && r && X.generateMipmap(X.TEXTURE_2D),
- _e.bindTexture(X.TEXTURE_2D, null);
- e.depthBuffer && function(e) {
- var t = be.get(e);
- if (e instanceof Ci.WebGLRenderTargetCube) {
- t.__webglDepthbuffer = [];
- for (var i = 0; i < 6; i++)
- X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer[i]),
- t.__webglDepthbuffer[i] = X.createRenderbuffer(),
- u(t.__webglDepthbuffer[i], e)
- } else
- X.bindFramebuffer(X.FRAMEBUFFER, t.__webglFramebuffer),
- t.__webglDepthbuffer = X.createRenderbuffer(),
- u(t.__webglDepthbuffer, e);
- X.bindFramebuffer(X.FRAMEBUFFER, null)
- }(e)
- }
- function T(e) {
- return e === Ci.NearestFilter || e === Ci.NearestMipMapNearestFilter || e === Ci.NearestMipMapLinearFilter ? X.NEAREST : X.LINEAR
- }
- function x(e) {
- var t;
- if (e === Ci.RepeatWrapping)
- return X.REPEAT;
- if (e === Ci.ClampToEdgeWrapping)
- return X.CLAMP_TO_EDGE;
- if (e === Ci.MirroredRepeatWrapping)
- return X.MIRRORED_REPEAT;
- if (e === Ci.NearestFilter)
- return X.NEAREST;
- if (e === Ci.NearestMipMapNearestFilter)
- return X.NEAREST_MIPMAP_NEAREST;
- if (e === Ci.NearestMipMapLinearFilter)
- return X.NEAREST_MIPMAP_LINEAR;
- if (e === Ci.LinearFilter)
- return X.LINEAR;
- if (e === Ci.LinearMipMapNearestFilter)
- return X.LINEAR_MIPMAP_NEAREST;
- if (e === Ci.LinearMipMapLinearFilter)
- return X.LINEAR_MIPMAP_LINEAR;
- if (e === Ci.UnsignedByteType)
- return X.UNSIGNED_BYTE;
- if (e === Ci.UnsignedShort4444Type)
- return X.UNSIGNED_SHORT_4_4_4_4;
- if (e === Ci.UnsignedShort5551Type)
- return X.UNSIGNED_SHORT_5_5_5_1;
- if (e === Ci.UnsignedShort565Type)
- return X.UNSIGNED_SHORT_5_6_5;
- if (e === Ci.ByteType)
- return X.BYTE;
- if (e === Ci.ShortType)
- return X.SHORT;
- if (e === Ci.UnsignedShortType)
- return X.UNSIGNED_SHORT;
- if (e === Ci.IntType)
- return X.INT;
- if (e === Ci.UnsignedIntType)
- return X.UNSIGNED_INT;
- if (e === Ci.FloatType)
- return X.FLOAT;
- if (null !== (t = Ie.get("OES_texture_half_float")) && e === Ci.HalfFloatType)
- return t.HALF_FLOAT_OES;
- if (e === Ci.AlphaFormat)
- return X.ALPHA;
- if (e === Ci.RGBFormat)
- return X.RGB;
- if (e === Ci.RGBAFormat)
- return X.RGBA;
- if (e === Ci.LuminanceFormat)
- return X.LUMINANCE;
- if (e === Ci.LuminanceAlphaFormat)
- return X.LUMINANCE_ALPHA;
- if (e === Ci.AddEquation)
- return X.FUNC_ADD;
- if (e === Ci.SubtractEquation)
- return X.FUNC_SUBTRACT;
- if (e === Ci.ReverseSubtractEquation)
- return X.FUNC_REVERSE_SUBTRACT;
- if (e === Ci.ZeroFactor)
- return X.ZERO;
- if (e === Ci.OneFactor)
- return X.ONE;
- if (e === Ci.SrcColorFactor)
- return X.SRC_COLOR;
- if (e === Ci.OneMinusSrcColorFactor)
- return X.ONE_MINUS_SRC_COLOR;
- if (e === Ci.SrcAlphaFactor)
- return X.SRC_ALPHA;
- if (e === Ci.OneMinusSrcAlphaFactor)
- return X.ONE_MINUS_SRC_ALPHA;
- if (e === Ci.DstAlphaFactor)
- return X.DST_ALPHA;
- if (e === Ci.OneMinusDstAlphaFactor)
- return X.ONE_MINUS_DST_ALPHA;
- if (e === Ci.DstColorFactor)
- return X.DST_COLOR;
- if (e === Ci.OneMinusDstColorFactor)
- return X.ONE_MINUS_DST_COLOR;
- if (e === Ci.SrcAlphaSaturateFactor)
- return X.SRC_ALPHA_SATURATE;
- if (null !== (t = Ie.get("WEBGL_compressed_texture_s3tc"))) {
- if (e === Ci.RGB_S3TC_DXT1_Format)
- return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
- if (e === Ci.RGBA_S3TC_DXT1_Format)
- return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
- if (e === Ci.RGBA_S3TC_DXT3_Format)
- return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
- if (e === Ci.RGBA_S3TC_DXT5_Format)
- return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
- }
- if (null !== (t = Ie.get("WEBGL_compressed_texture_pvrtc"))) {
- if (e === Ci.RGB_PVRTC_4BPPV1_Format)
- return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
- if (e === Ci.RGB_PVRTC_2BPPV1_Format)
- return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
- if (e === Ci.RGBA_PVRTC_4BPPV1_Format)
- return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
- if (e === Ci.RGBA_PVRTC_2BPPV1_Format)
- return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
- }
- if (null !== (t = Ie.get("WEBGL_compressed_texture_etc1")) && e === Ci.RGB_ETC1_Format)
- return t.COMPRESSED_RGB_ETC1_WEBGL;
- if (null !== (t = Ie.get("EXT_blend_minmax"))) {
- if (e === Ci.MinEquation)
- return t.MIN_EXT;
- if (e === Ci.MaxEquation)
- return t.MAX_EXT
- }
- return 0
- }
- console.log("THREE.WebGLRenderer", Ci.REVISION);
- var O = void 0 !== (e = e || {}).canvas ? e.canvas : document.createElement("canvas")
- , L = void 0 !== e.context ? e.context : null
- , D = void 0 !== e.alpha && e.alpha
- , N = void 0 === e.depth || e.depth
- , F = void 0 === e.stencil || e.stencil
- , B = void 0 !== e.antialias && e.antialias
- , V = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
- , k = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
- , U = []
- , H = []
- , z = -1
- , G = []
- , W = -1
- , j = new Float32Array(8)
- , Y = []
- , q = [];
- this.domElement = O,
- this.context = null,
- this.autoClear = !0,
- this.autoClearColor = !0,
- this.autoClearDepth = !0,
- this.autoClearStencil = !0,
- this.sortObjects = !0,
- this.gammaFactor = 2,
- this.gammaInput = !1,
- this.gammaOutput = !1,
- this.physicallyCorrectLights = !1,
- this.toneMapping = Ci.LinearToneMapping,
- this.toneMappingExposure = 1,
- this.toneMappingWhitePoint = 1,
- this.maxMorphTargets = 8,
- this.maxMorphNormals = 4,
- this.autoScaleCubemaps = !0;
- 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 = {
- hash: "",
- ambient: [0, 0, 0],
- directional: [],
- directionalShadowMap: [],
- directionalShadowMatrix: [],
- spot: [],
- spotShadowMap: [],
- spotShadowMatrix: [],
- point: [],
- pointShadowMap: [],
- pointShadowMatrix: [],
- hemi: [],
- shadows: [],
- shadowsPointLight: 0
- }, ye = {
- geometries: 0,
- textures: 0
- }, Ae = {
- calls: 0,
- vertices: 0,
- faces: 0,
- points: 0
- };
- this.info = {
- render: Ae,
- memory: ye,
- programs: null
- };
- try {
- var Ce = {
- alpha: D,
- depth: N,
- stencil: F,
- antialias: B,
- premultipliedAlpha: V,
- preserveDrawingBuffer: k
- };
- if (null === (X = L || O.getContext("webgl", Ce) || O.getContext("experimental-webgl", Ce)))
- throw null !== O.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
- void 0 === X.getShaderPrecisionFormat && (X.getShaderPrecisionFormat = function() {
- return {
- rangeMin: 1,
- rangeMax: 1,
- precision: 1
- }
- }
- ),
- O.addEventListener("webglcontextlost", r, !1)
- } catch (e) {
- console.error("THREE.WebGLRenderer: " + e)
- }
- var Ie = new Ci.WebGLExtensions(X);
- Ie.get("OES_texture_float"),
- Ie.get("OES_texture_float_linear"),
- Ie.get("OES_texture_half_float"),
- Ie.get("OES_texture_half_float_linear"),
- Ie.get("OES_standard_derivatives"),
- Ie.get("ANGLE_instanced_arrays"),
- Ie.get("OES_element_index_uint") && (Ci.BufferGeometry.MaxIndex = 4294967296);
- var Ee = new Ci.WebGLCapabilities(X,Ie,e)
- , _e = new Ci.WebGLState(X,Ie,x)
- , be = new Ci.WebGLProperties
- , we = new Ci.WebGLObjects(X,be,this.info)
- , Te = new Ci.WebGLPrograms(this,Ee)
- , xe = new Ci.WebGLLights;
- this.info.programs = Te.programs;
- var Se = new Ci.WebGLBufferRenderer(X,Ie,Ae)
- , Me = new Ci.WebGLIndexedBufferRenderer(X,Ie,Ae);
- t(),
- this.context = X,
- this.capabilities = Ee,
- this.extensions = Ie,
- this.properties = be,
- this.state = _e;
- var Re = new Ci.WebGLShadowMap(this,ve,we);
- this.shadowMap = Re;
- var Pe, Oe = new Ci.SpritePlugin(this,Y), Le = new Ci.LensFlarePlugin(this,q);
- this.getContext = function() {
- return X
- }
- ,
- this.getContextAttributes = function() {
- return X.getContextAttributes()
- }
- ,
- this.forceContextLoss = function() {
- Ie.get("WEBGL_lose_context").loseContext()
- }
- ,
- this.getMaxAnisotropy = function() {
- if (void 0 !== Pe)
- return Pe;
- var e = Ie.get("EXT_texture_filter_anisotropic");
- return Pe = null !== e ? X.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
- }
- ,
- this.getPrecision = function() {
- return Ee.precision
- }
- ,
- this.getPixelRatio = function() {
- return he
- }
- ,
- this.setPixelRatio = function(e) {
- void 0 !== e && (he = e,
- this.setSize(pe.z, pe.w, !1))
- }
- ,
- this.getSize = function() {
- return {
- width: le,
- height: ce
- }
- }
- ,
- this.setSize = function(e, t, i, n) {
- null != n && (he = n),
- le = e,
- ce = t,
- O.width = e * he,
- O.height = t * he,
- !1 !== i && (O.style.width = e + "px",
- O.style.height = t + "px"),
- this.setViewport(0, 0, e, t)
- }
- ,
- this.setViewport = function(e, t, i, n) {
- _e.viewport(pe.set(e, t, i, n))
- }
- ,
- this.setScissor = function(e, t, i, n) {
- _e.scissor(ue.set(e, t, i, n))
- }
- ,
- this.setScissorTest = function(e) {
- _e.setScissorTest(de = e)
- }
- ,
- this.getClearColor = function() {
- return ae
- }
- ,
- this.setClearColor = function(e, t) {
- ae.set(e),
- se = void 0 !== t ? t : 1,
- i(ae.r, ae.g, ae.b, se)
- }
- ,
- this.getClearAlpha = function() {
- return se
- }
- ,
- this.setClearAlpha = function(e) {
- se = e,
- i(ae.r, ae.g, ae.b, se)
- }
- ,
- this.clear = function(e, t, i) {
- var n = 0;
- void 0 !== e && !e || (n |= X.COLOR_BUFFER_BIT),
- void 0 !== t && !t || (n |= X.DEPTH_BUFFER_BIT),
- void 0 !== i && !i || (n |= X.STENCIL_BUFFER_BIT),
- X.clear(n)
- }
- ,
- this.clearColor = function() {
- this.clear(!0, !1, !1)
- }
- ,
- this.clearDepth = function() {
- this.clear(!1, !0, !1)
- }
- ,
- this.clearStencil = function() {
- this.clear(!1, !1, !0)
- }
- ,
- this.clearTarget = function(e, t, i, n) {
- this.setRenderTarget(e),
- this.clear(t, i, n)
- }
- ,
- this.resetGLState = n,
- this.dispose = function() {
- O.removeEventListener("webglcontextlost", r, !1)
- }
- ,
- this.renderBufferImmediate = function(e, t, i) {
- _e.initAttributes();
- var n = be.get(e);
- e.hasPositions && !n.position && (n.position = X.createBuffer()),
- e.hasNormals && !n.normal && (n.normal = X.createBuffer()),
- e.hasUvs && !n.uv && (n.uv = X.createBuffer()),
- e.hasColors && !n.color && (n.color = X.createBuffer());
- var r = t.getAttributes();
- if (e.hasPositions && (X.bindBuffer(X.ARRAY_BUFFER, n.position),
- X.bufferData(X.ARRAY_BUFFER, e.positionArray, X.DYNAMIC_DRAW),
- _e.enableAttribute(r.position),
- X.vertexAttribPointer(r.position, 3, X.FLOAT, !1, 0, 0)),
- e.hasNormals) {
- if (X.bindBuffer(X.ARRAY_BUFFER, n.normal),
- "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === Ci.FlatShading)
- for (var o = 0, a = 3 * e.count; o < a; o += 9) {
- var s = e.normalArray
- , l = (s[o + 0] + s[o + 3] + s[o + 6]) / 3
- , c = (s[o + 1] + s[o + 4] + s[o + 7]) / 3
- , h = (s[o + 2] + s[o + 5] + s[o + 8]) / 3;
- s[o + 0] = l,
- s[o + 1] = c,
- s[o + 2] = h,
- s[o + 3] = l,
- s[o + 4] = c,
- s[o + 5] = h,
- s[o + 6] = l,
- s[o + 7] = c,
- s[o + 8] = h
- }
- X.bufferData(X.ARRAY_BUFFER, e.normalArray, X.DYNAMIC_DRAW),
- _e.enableAttribute(r.normal),
- X.vertexAttribPointer(r.normal, 3, X.FLOAT, !1, 0, 0)
- }
- e.hasUvs && i.map && (X.bindBuffer(X.ARRAY_BUFFER, n.uv),
- X.bufferData(X.ARRAY_BUFFER, e.uvArray, X.DYNAMIC_DRAW),
- _e.enableAttribute(r.uv),
- X.vertexAttribPointer(r.uv, 2, X.FLOAT, !1, 0, 0)),
- e.hasColors && i.vertexColors !== Ci.NoColors && (X.bindBuffer(X.ARRAY_BUFFER, n.color),
- X.bufferData(X.ARRAY_BUFFER, e.colorArray, X.DYNAMIC_DRAW),
- _e.enableAttribute(r.color),
- X.vertexAttribPointer(r.color, 3, X.FLOAT, !1, 0, 0)),
- _e.disableUnusedAttributes(),
- X.drawArrays(X.TRIANGLES, 0, e.count),
- e.count = 0
- }
- ,
- this.renderBufferDirect = function(e, t, i, n, r, o) {
- R(n);
- var a = P(e, t, n, r)
- , s = !1
- , l = i.id + "_" + a.id + "_" + n.wireframe;
- l !== ee && (ee = l,
- s = !0);
- var c = r.morphTargetInfluences;
- if (void 0 !== c) {
- for (var h = [], u = 0, d = c.length; u < d; u++) {
- var p = c[u];
- h.push([p, u])
- }
- h.sort(M),
- 8 < h.length && (h.length = 8);
- var f = i.morphAttributes;
- for (u = 0,
- d = h.length; u < d; u++) {
- p = h[u];
- if (j[u] = p[0],
- 0 !== p[0]) {
- var g = p[1];
- !0 === n.morphTargets && f.position && i.addAttribute("morphTarget" + u, f.position[g]),
- !0 === n.morphNormals && f.normal && i.addAttribute("morphNormal" + u, f.normal[g])
- } else
- !0 === n.morphTargets && i.removeAttribute("morphTarget" + u),
- !0 === n.morphNormals && i.removeAttribute("morphNormal" + u)
- }
- var m = a.getUniforms();
- null !== m.morphTargetInfluences && X.uniform1fv(m.morphTargetInfluences, j),
- s = !0
- }
- g = i.index;
- var v, y = i.attributes.position;
- !0 === n.wireframe && (g = we.getWireframeAttribute(i)),
- null !== g ? (v = Me).setIndex(g) : v = Se,
- s && (function(e, t, i, n) {
- var r;
- if (i instanceof Ci.InstancedBufferGeometry && null === (r = Ie.get("ANGLE_instanced_arrays")))
- console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
- else {
- void 0 === n && (n = 0),
- _e.initAttributes();
- var o = i.attributes
- , a = t.getAttributes()
- , s = e.defaultAttributeValues;
- for (var l in a) {
- var c = a[l];
- if (0 <= c) {
- var h = o[l];
- if (void 0 !== h) {
- var u = h.itemSize
- , d = we.getAttributeBuffer(h);
- if (h instanceof Ci.InterleavedBufferAttribute) {
- var p = h.data
- , f = p.stride
- , g = h.offset;
- p instanceof Ci.InstancedInterleavedBuffer ? (_e.enableAttributeAndDivisor(c, p.meshPerAttribute, r),
- void 0 === i.maxInstancedCount && (i.maxInstancedCount = p.meshPerAttribute * p.count)) : _e.enableAttribute(c),
- X.bindBuffer(X.ARRAY_BUFFER, d),
- X.vertexAttribPointer(c, u, X.FLOAT, !1, f * p.array.BYTES_PER_ELEMENT, (n * f + g) * p.array.BYTES_PER_ELEMENT)
- } else
- h instanceof Ci.InstancedBufferAttribute ? (_e.enableAttributeAndDivisor(c, h.meshPerAttribute, r),
- void 0 === i.maxInstancedCount && (i.maxInstancedCount = h.meshPerAttribute * h.count)) : _e.enableAttribute(c),
- X.bindBuffer(X.ARRAY_BUFFER, d),
- X.vertexAttribPointer(c, u, X.FLOAT, !1, 0, n * u * 4)
- } else if (void 0 !== s) {
- var m = s[l];
- if (void 0 !== m)
- switch (m.length) {
- case 2:
- X.vertexAttrib2fv(c, m);
- break;
- case 3:
- X.vertexAttrib3fv(c, m);
- break;
- case 4:
- X.vertexAttrib4fv(c, m);
- break;
- default:
- X.vertexAttrib1fv(c, m)
- }
- }
- }
- }
- _e.disableUnusedAttributes()
- }
- }(n, a, i),
- null !== g && X.bindBuffer(X.ELEMENT_ARRAY_BUFFER, we.getAttributeBuffer(g)));
- var A = 1 / 0;
- null !== g ? A = g.count : void 0 !== y && (A = y.count);
- var C = i.drawRange.start
- , I = i.drawRange.count
- , E = null !== o ? o.start : 0
- , _ = null !== o ? o.count : 1 / 0
- , b = Math.max(0, C, E)
- , w = Math.min(0 + A, C + I, E + _) - 1
- , T = Math.max(0, w - b + 1);
- if (r instanceof Ci.Mesh)
- if (!0 === n.wireframe)
- _e.setLineWidth(n.wireframeLinewidth * S()),
- v.setMode(X.LINES);
- else
- switch (r.drawMode) {
- case Ci.TrianglesDrawMode:
- v.setMode(X.TRIANGLES);
- break;
- case Ci.TriangleStripDrawMode:
- v.setMode(X.TRIANGLE_STRIP);
- break;
- case Ci.TriangleFanDrawMode:
- v.setMode(X.TRIANGLE_FAN)
- }
- else if (r instanceof Ci.Line) {
- var x = n.linewidth;
- void 0 === x && (x = 1),
- _e.setLineWidth(x * S()),
- r instanceof Ci.LineSegments ? v.setMode(X.LINES) : v.setMode(X.LINE_STRIP)
- } else
- r instanceof Ci.Points && v.setMode(X.POINTS);
- i instanceof Ci.InstancedBufferGeometry ? 0 < i.maxInstancedCount && v.renderInstances(i, b, T) : v.render(b, T)
- }
- ,
- this.render = function(e, t, i, n) {
- if (t instanceof Ci.Camera != 0) {
- var r = e.fog;
- if (ee = "",
- $ = -1,
- !(te = null) === e.autoUpdate && e.updateMatrixWorld(),
- null === t.parent && t.updateMatrixWorld(),
- t.matrixWorldInverse.getInverse(t.matrixWorld),
- ge.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
- fe.setFromMatrix(ge),
- U.length = 0,
- W = z = -1,
- Y.length = 0,
- q.length = 0,
- function e(t, i) {
- if (!1 !== t.visible) {
- if (t.layers.test(i.layers))
- if (t instanceof Ci.Light)
- U.push(t);
- else if (t instanceof Ci.Sprite)
- !1 !== t.frustumCulled && !0 !== fe.intersectsObject(t) || Y.push(t);
- else if (t instanceof Ci.LensFlare)
- q.push(t);
- else if (t instanceof Ci.ImmediateRenderObject)
- !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
- me.applyProjection(ge)),
- d(t, null, t.material, me.z, null);
- else if ((t instanceof Ci.Mesh || t instanceof Ci.Line || t instanceof Ci.Points) && (t instanceof Ci.SkinnedMesh && t.skeleton.update(),
- !1 === t.frustumCulled || !0 === fe.intersectsObject(t))) {
- var n = t.material;
- if (!0 === n.visible) {
- !0 === Z.sortObjects && (me.setFromMatrixPosition(t.matrixWorld),
- me.applyProjection(ge));
- var r = we.update(t);
- if (n instanceof Ci.MultiMaterial)
- for (var o = r.groups, a = n.materials, s = 0, l = o.length; s < l; s++) {
- var c = o[s]
- , h = a[c.materialIndex];
- !0 === h.visible && d(t, r, h, me.z, c)
- }
- else
- d(t, r, n, me.z, null)
- }
- }
- var u = t.children;
- for (s = 0,
- l = u.length; s < l; s++)
- e(u[s], i)
- }
- }(e, t),
- H.length = z + 1,
- G.length = W + 1,
- !0 === Z.sortObjects && (H.sort(s),
- G.sort(l)),
- function(e, t) {
- 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;
- for (i = ve.shadowsPointLight = 0,
- n = e.length; i < n; i++)
- if (o = (r = e[i]).color,
- a = r.intensity,
- s = r.distance,
- r instanceof Ci.AmbientLight)
- l += o.r * a,
- c += o.g * a,
- h += o.b * a;
- else if (r instanceof Ci.DirectionalLight) {
- (v = xe.get(r)).color.copy(r.color).multiplyScalar(r.intensity),
- v.direction.setFromMatrixPosition(r.matrixWorld),
- me.setFromMatrixPosition(r.target.matrixWorld),
- v.direction.sub(me),
- v.direction.transformDirection(u),
- v.shadow = r.castShadow,
- r.castShadow && (v.shadowBias = r.shadow.bias,
- v.shadowRadius = r.shadow.radius,
- v.shadowMapSize = r.shadow.mapSize,
- ve.shadows[m++] = r),
- ve.directionalShadowMap[d] = r.shadow.map,
- ve.directionalShadowMatrix[d] = r.shadow.matrix,
- ve.directional[d++] = v
- } else if (r instanceof Ci.SpotLight) {
- (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
- v.position.applyMatrix4(u),
- v.color.copy(o).multiplyScalar(a),
- v.distance = s,
- v.direction.setFromMatrixPosition(r.matrixWorld),
- me.setFromMatrixPosition(r.target.matrixWorld),
- v.direction.sub(me),
- v.direction.transformDirection(u),
- v.coneCos = Math.cos(r.angle),
- v.penumbraCos = Math.cos(r.angle * (1 - r.penumbra)),
- v.decay = 0 === r.distance ? 0 : r.decay,
- v.shadow = r.castShadow,
- r.castShadow && (v.shadowBias = r.shadow.bias,
- v.shadowRadius = r.shadow.radius,
- v.shadowMapSize = r.shadow.mapSize,
- ve.shadows[m++] = r),
- ve.spotShadowMap[f] = r.shadow.map,
- ve.spotShadowMatrix[f] = r.shadow.matrix,
- ve.spot[f++] = v
- } else if (r instanceof Ci.PointLight) {
- (v = xe.get(r)).position.setFromMatrixPosition(r.matrixWorld),
- v.position.applyMatrix4(u),
- v.color.copy(r.color).multiplyScalar(r.intensity),
- v.distance = r.distance,
- v.decay = 0 === r.distance ? 0 : r.decay,
- v.shadow = r.castShadow,
- r.castShadow && (v.shadowBias = r.shadow.bias,
- v.shadowRadius = r.shadow.radius,
- v.shadowMapSize = r.shadow.mapSize,
- ve.shadows[m++] = r),
- ve.pointShadowMap[p] = r.shadow.map,
- void 0 === ve.pointShadowMatrix[p] && (ve.pointShadowMatrix[p] = new Ci.Matrix4),
- me.setFromMatrixPosition(r.matrixWorld).negate(),
- ve.pointShadowMatrix[p].identity().setPosition(me),
- ve.point[p++] = v
- } else if (r instanceof Ci.HemisphereLight) {
- var v;
- (v = xe.get(r)).direction.setFromMatrixPosition(r.matrixWorld),
- v.direction.transformDirection(u),
- v.direction.normalize(),
- v.skyColor.copy(r.color).multiplyScalar(a),
- v.groundColor.copy(r.groundColor).multiplyScalar(a),
- ve.hemi[g++] = v
- }
- ve.ambient[0] = l,
- ve.ambient[1] = c,
- ve.ambient[2] = h,
- ve.directional.length = d,
- ve.spot.length = f,
- ve.point.length = p,
- ve.hemi.length = g,
- ve.shadows.length = m,
- ve.hash = d + "," + p + "," + f + "," + g + "," + m
- }(U, t),
- Re.render(e, t),
- Ae.calls = 0,
- Ae.vertices = 0,
- Ae.faces = 0,
- void (Ae.points = 0) === i && (i = null),
- this.setRenderTarget(i),
- (this.autoClear || n) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
- e.overrideMaterial) {
- var o = e.overrideMaterial;
- c(H, t, r, o),
- c(G, t, r, o)
- } else
- _e.setBlending(Ci.NoBlending),
- c(H, t, r),
- c(G, t, r);
- if (Oe.render(e, t),
- Le.render(e, t, re),
- i) {
- var a = i.texture;
- a.generateMipmaps && E(i) && a.minFilter !== Ci.NearestFilter && a.minFilter !== Ci.LinearFilter && function(e) {
- var t = e instanceof Ci.WebGLRenderTargetCube ? X.TEXTURE_CUBE_MAP : X.TEXTURE_2D
- , i = be.get(e.texture).__webglTexture;
- _e.bindTexture(t, i),
- X.generateMipmap(t),
- _e.bindTexture(t, null)
- }(i)
- }
- _e.setDepthTest(!0),
- _e.setDepthWrite(!0),
- _e.setColorWrite(!0)
- } else
- console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")
- }
- ,
- this.setFaceCulling = function(e, t) {
- e === Ci.CullFaceNone ? _e.disable(X.CULL_FACE) : (t === Ci.FrontFaceDirectionCW ? X.frontFace(X.CW) : X.frontFace(X.CCW),
- e === Ci.CullFaceBack ? X.cullFace(X.BACK) : e === Ci.CullFaceFront ? X.cullFace(X.FRONT) : X.cullFace(X.FRONT_AND_BACK),
- _e.enable(X.CULL_FACE))
- }
- ,
- this.setTexture = function(e, t) {
- var i = be.get(e);
- if (0 < e.version && i.__version !== e.version) {
- var n = e.image;
- 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)
- }
- _e.activeTexture(X.TEXTURE0 + t),
- _e.bindTexture(X.TEXTURE_2D, i.__webglTexture)
- }
- ,
- this.getCurrentRenderTarget = function() {
- return Q
- }
- ,
- this.setRenderTarget = function(e) {
- (Q = e) && void 0 === be.get(e).__webglFramebuffer && w(e);
- var t, i = e instanceof Ci.WebGLRenderTargetCube;
- if (e) {
- var n = be.get(e);
- t = i ? n.__webglFramebuffer[e.activeCubeFace] : n.__webglFramebuffer,
- ie.copy(e.scissor),
- ne = e.scissorTest,
- re.copy(e.viewport)
- } else
- t = null,
- ie.copy(ue).multiplyScalar(he),
- ne = de,
- re.copy(pe).multiplyScalar(he);
- if (J !== t && (X.bindFramebuffer(X.FRAMEBUFFER, t),
- J = t),
- _e.scissor(ie),
- _e.setScissorTest(ne),
- _e.viewport(re),
- i) {
- var r = be.get(e.texture);
- X.framebufferTexture2D(X.FRAMEBUFFER, X.COLOR_ATTACHMENT0, X.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, r.__webglTexture, e.activeMipMapLevel)
- }
- }
- ,
- this.readRenderTargetPixels = function(e, t, i, n, r, o) {
- if (e instanceof Ci.WebGLRenderTarget != 0) {
- var a = be.get(e).__webglFramebuffer;
- if (a) {
- var s = !1;
- a !== J && (X.bindFramebuffer(X.FRAMEBUFFER, a),
- s = !0);
- try {
- var l = e.texture;
- if (l.format !== Ci.RGBAFormat && x(l.format) !== X.getParameter(X.IMPLEMENTATION_COLOR_READ_FORMAT))
- return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
- 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")))
- return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
- 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.")
- } finally {
- s && X.bindFramebuffer(X.FRAMEBUFFER, J)
- }
- }
- } else
- console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")
- }
- }
- ,
- Ci.WebGLRenderTarget = function(e, t, i) {
- this.uuid = Ci.Math.generateUUID(),
- this.width = e,
- this.height = t,
- this.scissor = new Ci.Vector4(0,0,e,t),
- this.scissorTest = !1,
- this.viewport = new Ci.Vector4(0,0,e,t),
- void 0 === (i = i || {}).minFilter && (i.minFilter = Ci.LinearFilter),
- this.texture = new Ci.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
- this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
- this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
- }
- ,
- Ci.WebGLRenderTarget.prototype = {
- constructor: Ci.WebGLRenderTarget,
- setSize: function(e, t) {
- this.width === e && this.height === t || (this.width = e,
- this.height = t,
- this.dispose()),
- this.viewport.set(0, 0, e, t),
- this.scissor.set(0, 0, e, t)
- },
- clone: function() {
- return (new this.constructor).copy(this)
- },
- copy: function(e) {
- return this.width = e.width,
- this.height = e.height,
- this.viewport.copy(e.viewport),
- this.texture = e.texture.clone(),
- this.depthBuffer = e.depthBuffer,
- this.stencilBuffer = e.stencilBuffer,
- this
- },
- dispose: function() {
- this.dispatchEvent({
- type: "dispose"
- })
- }
- },
- Ci.EventDispatcher.prototype.apply(Ci.WebGLRenderTarget.prototype),
- Ci.WebGLRenderTargetCube = function(e, t, i) {
- Ci.WebGLRenderTarget.call(this, e, t, i),
- this.activeCubeFace = 0,
- this.activeMipMapLevel = 0
- }
- ,
- Ci.WebGLRenderTargetCube.prototype = Object.create(Ci.WebGLRenderTarget.prototype),
- Ci.WebGLRenderTargetCube.prototype.constructor = Ci.WebGLRenderTargetCube,
- Ci.WebGLBufferRenderer = function(r, o, a) {
- var s;
- this.setMode = function(e) {
- s = e
- }
- ,
- this.render = function(e, t) {
- r.drawArrays(s, e, t),
- a.calls++,
- a.vertices += t,
- s === r.TRIANGLES && (a.faces += t / 3)
- }
- ,
- this.renderInstances = function(e) {
- var t = o.get("ANGLE_instanced_arrays");
- if (null !== t) {
- var i = e.attributes.position
- , n = 0;
- n = i instanceof Ci.InterleavedBufferAttribute ? i.data.count : i.count,
- t.drawArraysInstancedANGLE(s, 0, n, e.maxInstancedCount),
- a.calls++,
- a.vertices += n * e.maxInstancedCount,
- s === r.TRIANGLES && (a.faces += e.maxInstancedCount * n / 3)
- } else
- console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.")
- }
- }
- ,
- Ci.WebGLIndexedBufferRenderer = function(r, o, a) {
- var s, l, c;
- this.setMode = function(e) {
- s = e
- }
- ,
- this.setIndex = function(e) {
- c = e.array instanceof Uint32Array && o.get("OES_element_index_uint") ? (l = r.UNSIGNED_INT,
- 4) : (l = r.UNSIGNED_SHORT,
- 2)
- }
- ,
- this.render = function(e, t) {
- r.drawElements(s, t, l, e * c),
- a.calls++,
- a.vertices += t,
- s === r.TRIANGLES && (a.faces += t / 3)
- }
- ,
- this.renderInstances = function(e, t, i) {
- var n = o.get("ANGLE_instanced_arrays");
- 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),
- a.calls++,
- a.vertices += i * e.maxInstancedCount,
- void (s === r.TRIANGLES && (a.faces += e.maxInstancedCount * i / 3)))
- }
- }
- ,
- Ci.WebGLExtensions = function(i) {
- var n = {};
- this.get = function(e) {
- if (void 0 !== n[e])
- return n[e];
- var t;
- switch (e) {
- case "EXT_texture_filter_anisotropic":
- t = i.getExtension("EXT_texture_filter_anisotropic") || i.getExtension("MOZ_EXT_texture_filter_anisotropic") || i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
- break;
- case "WEBGL_compressed_texture_s3tc":
- t = i.getExtension("WEBGL_compressed_texture_s3tc") || i.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
- break;
- case "WEBGL_compressed_texture_pvrtc":
- t = i.getExtension("WEBGL_compressed_texture_pvrtc") || i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
- break;
- case "WEBGL_compressed_texture_etc1":
- t = i.getExtension("WEBGL_compressed_texture_etc1");
- break;
- default:
- t = i.getExtension(e)
- }
- return null === t && console.warn("THREE.WebGLRenderer: " + e + " extension not supported."),
- n[e] = t
- }
- }
- ,
- Ci.WebGLCapabilities = function(t, e, i) {
- function n(e) {
- if ("highp" === e) {
- if (0 < t.getShaderPrecisionFormat(t.VERTEX_SHADER, t.HIGH_FLOAT).precision && 0 < t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT).precision)
- return "highp";
- e = "mediump"
- }
- 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"
- }
- this.getMaxPrecision = n,
- this.precision = void 0 !== i.precision ? i.precision : "highp",
- this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
- this.maxTextures = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
- this.maxVertexTextures = t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
- this.maxTextureSize = t.getParameter(t.MAX_TEXTURE_SIZE),
- this.maxCubemapSize = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),
- this.maxAttributes = t.getParameter(t.MAX_VERTEX_ATTRIBS),
- this.maxVertexUniforms = t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),
- this.maxVaryings = t.getParameter(t.MAX_VARYING_VECTORS),
- this.maxFragmentUniforms = t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),
- this.vertexTextures = 0 < this.maxVertexTextures,
- this.floatFragmentTextures = !!e.get("OES_texture_float"),
- this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
- var r = n(this.precision);
- r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
- this.precision = r),
- this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!e.get("EXT_frag_depth"))
- }
- ,
- Ci.WebGLGeometries = function(i, o, a) {
- function s(e) {
- var t = e.target
- , i = c[t.id];
- null !== i.index && l(i.index),
- function(e) {
- for (var t in e)
- l(e[t])
- }(i.attributes),
- t.removeEventListener("dispose", s),
- delete c[t.id];
- var n = o.get(t);
- n.wireframe && l(n.wireframe),
- o.delete(t);
- var r = o.get(i);
- r.wireframe && l(r.wireframe),
- o.delete(i),
- a.memory.geometries--
- }
- function l(e) {
- var t = function(e) {
- return e instanceof Ci.InterleavedBufferAttribute ? o.get(e.data).__webglBuffer : o.get(e).__webglBuffer
- }(e);
- void 0 !== t && (i.deleteBuffer(t),
- function(e) {
- e instanceof Ci.InterleavedBufferAttribute ? o.delete(e.data) : o.delete(e)
- }(e))
- }
- var c = {};
- this.get = function(e) {
- var t, i = e.geometry;
- return void 0 !== c[i.id] ? c[i.id] : (i.addEventListener("dispose", s),
- i instanceof Ci.BufferGeometry ? t = i : i instanceof Ci.Geometry && (void 0 === i._bufferGeometry && (i._bufferGeometry = (new Ci.BufferGeometry).setFromObject(e)),
- t = i._bufferGeometry),
- c[i.id] = t,
- a.memory.geometries++,
- t)
- }
- }
- ,
- Ci.WebGLLights = function() {
- var i = {};
- this.get = function(e) {
- if (void 0 !== i[e.id])
- return i[e.id];
- var t;
- switch (e.type) {
- case "DirectionalLight":
- t = {
- direction: new Ci.Vector3,
- color: new Ci.Color,
- shadow: !1,
- shadowBias: 0,
- shadowRadius: 1,
- shadowMapSize: new Ci.Vector2
- };
- break;
- case "SpotLight":
- t = {
- position: new Ci.Vector3,
- direction: new Ci.Vector3,
- color: new Ci.Color,
- distance: 0,
- coneCos: 0,
- penumbraCos: 0,
- decay: 0,
- shadow: !1,
- shadowBias: 0,
- shadowRadius: 1,
- shadowMapSize: new Ci.Vector2
- };
- break;
- case "PointLight":
- t = {
- position: new Ci.Vector3,
- color: new Ci.Color,
- distance: 0,
- decay: 0,
- shadow: !1,
- shadowBias: 0,
- shadowRadius: 1,
- shadowMapSize: new Ci.Vector2
- };
- break;
- case "HemisphereLight":
- t = {
- direction: new Ci.Vector3,
- skyColor: new Ci.Color,
- groundColor: new Ci.Color
- }
- }
- return i[e.id] = t
- }
- }
- ,
- Ci.WebGLObjects = function(g, m, e) {
- function v(e, t) {
- var i = e instanceof Ci.InterleavedBufferAttribute ? e.data : e
- , n = m.get(i);
- void 0 === n.__webglBuffer ? function(e, t, i) {
- e.__webglBuffer = g.createBuffer(),
- g.bindBuffer(i, e.__webglBuffer);
- var n = t.dynamic ? g.DYNAMIC_DRAW : g.STATIC_DRAW;
- g.bufferData(i, t.array, n),
- e.version = t.version
- }(n, i, t) : n.version !== i.version && function(e, t, i) {
- g.bindBuffer(i, e.__webglBuffer),
- !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)),
- t.updateRange.count = 0),
- e.version = t.version
- }(n, i, t)
- }
- function y(e, t, i) {
- if (i < t) {
- var n = t;
- t = i,
- i = n
- }
- var r = e[t];
- return void 0 === r ? (e[t] = [i],
- !0) : -1 === r.indexOf(i) && (r.push(i),
- !0)
- }
- var c = new Ci.WebGLGeometries(g,m,e);
- this.getAttributeBuffer = function(e) {
- return e instanceof Ci.InterleavedBufferAttribute ? m.get(e.data).__webglBuffer : m.get(e).__webglBuffer
- }
- ,
- this.getWireframeAttribute = function(e) {
- var t = m.get(e);
- if (void 0 !== t.wireframe)
- return t.wireframe;
- var i, n = [], r = e.index, o = e.attributes, a = o.position;
- if (null !== r)
- for (var s = {}, l = 0, c = (i = r.array).length; l < c; l += 3) {
- var h = i[l + 0]
- , u = i[l + 1]
- , d = i[l + 2];
- y(s, h, u) && n.push(h, u),
- y(s, u, d) && n.push(u, d),
- y(s, d, h) && n.push(d, h)
- }
- else
- for (l = 0,
- c = (i = o.position.array).length / 3 - 1; l < c; l += 3) {
- h = l + 0,
- u = l + 1,
- d = l + 2;
- n.push(h, u, u, d, d, h)
- }
- var p = 65535 < a.count ? Uint32Array : Uint16Array
- , f = new Ci.BufferAttribute(new p(n),1);
- return v(f, g.ELEMENT_ARRAY_BUFFER),
- t.wireframe = f
- }
- ,
- this.update = function(e) {
- var t = c.get(e);
- e.geometry instanceof Ci.Geometry && t.updateFromObject(e);
- var i = t.index
- , n = t.attributes;
- for (var r in null !== i && v(i, g.ELEMENT_ARRAY_BUFFER),
- n)
- v(n[r], g.ARRAY_BUFFER);
- var o = t.morphAttributes;
- for (var r in o)
- for (var a = o[r], s = 0, l = a.length; s < l; s++)
- v(a[s], g.ARRAY_BUFFER);
- return t
- }
- }
- ,
- Ci.WebGLProgram = (Qt = 0,
- Jt = /^([\w\d_]+)\.([\w\d_]+)$/,
- $t = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
- ei = /^([\w\d_]+)\[0\]$/,
- function(e, t, i, n) {
- var r = e.context
- , o = i.extensions
- , a = i.defines
- , s = i.__webglShader.vertexShader
- , l = i.__webglShader.fragmentShader
- , c = "SHADOWMAP_TYPE_BASIC";
- n.shadowMapType === Ci.PCFShadowMap ? c = "SHADOWMAP_TYPE_PCF" : n.shadowMapType === Ci.PCFSoftShadowMap && (c = "SHADOWMAP_TYPE_PCF_SOFT");
- var h = "ENVMAP_TYPE_CUBE"
- , u = "ENVMAP_MODE_REFLECTION"
- , d = "ENVMAP_BLENDING_MULTIPLY";
- if (n.envMap) {
- switch (i.envMap.mapping) {
- case Ci.CubeReflectionMapping:
- case Ci.CubeRefractionMapping:
- h = "ENVMAP_TYPE_CUBE";
- break;
- case Ci.CubeUVReflectionMapping:
- case Ci.CubeUVRefractionMapping:
- h = "ENVMAP_TYPE_CUBE_UV";
- break;
- case Ci.EquirectangularReflectionMapping:
- case Ci.EquirectangularRefractionMapping:
- h = "ENVMAP_TYPE_EQUIREC";
- break;
- case Ci.SphericalReflectionMapping:
- h = "ENVMAP_TYPE_SPHERE"
- }
- switch (i.envMap.mapping) {
- case Ci.CubeRefractionMapping:
- case Ci.EquirectangularRefractionMapping:
- u = "ENVMAP_MODE_REFRACTION"
- }
- switch (i.combine) {
- case Ci.MultiplyOperation:
- d = "ENVMAP_BLENDING_MULTIPLY";
- break;
- case Ci.MixOperation:
- d = "ENVMAP_BLENDING_MIX";
- break;
- case Ci.AddOperation:
- d = "ENVMAP_BLENDING_ADD"
- }
- }
- var p, f, g = 0 < e.gammaFactor ? e.gammaFactor : 1, m = function(e, t, i) {
- 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")
- }(o, n, e.extensions), v = function(e) {
- var t = [];
- for (var i in e) {
- var n = e[i];
- !1 !== n && t.push("#define " + i + " " + n)
- }
- return t.join("\n")
- }(a), y = r.createProgram();
- 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"),
- [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) {
- var i;
- switch (t) {
- case Ci.LinearToneMapping:
- i = "Linear";
- break;
- case Ci.ReinhardToneMapping:
- i = "Reinhard";
- break;
- case Ci.Uncharted2ToneMapping:
- i = "Uncharted2";
- break;
- case Ci.CineonToneMapping:
- i = "OptimizedCineon";
- break;
- default:
- throw new Error("unsupported toneMapping: " + t)
- }
- return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
- }("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) {
- var i = Mi(t);
- return "vec4 " + e + "( vec4 value ) { return LinearTo" + i[0] + i[1] + "; }"
- }("linearToOutputTexel", n.outputEncoding) : "", "\n"].filter(Pi).join("\n")),
- s = Oi(s = Li(s), n),
- l = Oi(l = Li(l), n),
- i instanceof Ci.ShaderMaterial == 0 && (s = Di(s),
- l = Di(l));
- var A = p + s
- , C = f + l
- , I = Ci.WebGLShader(r, r.VERTEX_SHADER, A)
- , E = Ci.WebGLShader(r, r.FRAGMENT_SHADER, C);
- r.attachShader(y, I),
- r.attachShader(y, E),
- void 0 !== i.index0AttributeName ? r.bindAttribLocation(y, 0, i.index0AttributeName) : !0 === n.morphTargets && r.bindAttribLocation(y, 0, "position"),
- r.linkProgram(y);
- var _, b, w = r.getProgramInfoLog(y), T = r.getShaderInfoLog(I), x = r.getShaderInfoLog(E), S = !0, M = !0;
- return !1 === r.getProgramParameter(y, r.LINK_STATUS) ? (S = !1,
- 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),
- M && (this.diagnostics = {
- runnable: S,
- material: i,
- programLog: w,
- vertexShader: {
- log: T,
- prefix: p
- },
- fragmentShader: {
- log: x,
- prefix: f
- }
- }),
- r.deleteShader(I),
- r.deleteShader(E),
- this.getUniforms = function() {
- return void 0 === _ && (_ = function(e, t) {
- for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), r = 0; r < n; r++) {
- var o = e.getActiveUniform(t, r).name
- , a = e.getUniformLocation(t, o)
- , s = Jt.exec(o);
- if (s) {
- var l = s[1]
- , c = s[2]
- , h = i[l];
- (h = h || (i[l] = {}))[c] = a
- } else if (s = $t.exec(o)) {
- var u = s[1]
- , d = s[2]
- , p = s[3]
- , f = i[u]
- , g = (f = f || (i[u] = []))[d];
- (g = g || (f[d] = {}))[p] = a
- } else
- (s = ei.exec(o)) ? i[u = s[1]] = a : i[o] = a
- }
- return i
- }(r, y)),
- _
- }
- ,
- this.getAttributes = function() {
- return void 0 === b && (b = function(e, t) {
- for (var i = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), r = 0; r < n; r++) {
- var o = e.getActiveAttrib(t, r).name;
- i[o] = e.getAttribLocation(t, o)
- }
- return i
- }(r, y)),
- b
- }
- ,
- this.destroy = function() {
- r.deleteProgram(y),
- this.program = void 0
- }
- ,
- Object.defineProperties(this, {
- uniforms: {
- get: function() {
- return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
- this.getUniforms()
- }
- },
- attributes: {
- get: function() {
- return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
- this.getAttributes()
- }
- }
- }),
- this.id = Qt++,
- this.code = t,
- this.usedTimes = 1,
- this.program = y,
- this.vertexShader = I,
- this.fragmentShader = E,
- this
- }
- ),
- Ci.WebGLPrograms = function(s, l) {
- function c(e, t) {
- var i;
- return e ? e instanceof Ci.Texture ? i = e.encoding : e instanceof Ci.WebGLRenderTarget && (i = e.texture.encoding) : i = Ci.LinearEncoding,
- i === Ci.LinearEncoding && t && (i = Ci.GammaEncoding),
- i
- }
- var h = []
- , u = {
- MeshDepthMaterial: "depth",
- MeshNormalMaterial: "normal",
- MeshBasicMaterial: "basic",
- MeshLambertMaterial: "lambert",
- MeshPhongMaterial: "phong",
- MeshStandardMaterial: "standard",
- LineBasicMaterial: "basic",
- LineDashedMaterial: "dashed",
- PointsMaterial: "points"
- }
- , 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"];
- this.getParameters = function(e, t, i, n) {
- var r = u[e.type]
- , o = function(e) {
- if (l.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
- return 1024;
- var t = l.maxVertexUniforms
- , i = Math.floor((t - 20) / 4);
- 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)")),
- i
- }(n)
- , a = s.getPrecision();
- return null === e.precision || (a = l.getMaxPrecision(e.precision)) !== e.precision && console.warn("THREE.WebGLProgram.getParameters:", e.precision, "not supported, using", a, "instead."),
- {
- shaderID: r,
- precision: a,
- supportsVertexTextures: l.vertexTextures,
- outputEncoding: c(s.getCurrentRenderTarget(), s.gammaOutput),
- map: !!e.map,
- mapEncoding: c(e.map, s.gammaInput),
- envMap: !!e.envMap,
- envMapMode: e.envMap && e.envMap.mapping,
- envMapEncoding: c(e.envMap, s.gammaInput),
- envMapCubeUV: !!e.envMap && (e.envMap.mapping === Ci.CubeUVReflectionMapping || e.envMap.mapping === Ci.CubeUVRefractionMapping),
- lightMap: !!e.lightMap,
- aoMap: !!e.aoMap,
- emissiveMap: !!e.emissiveMap,
- emissiveMapEncoding: c(e.emissiveMap, s.gammaInput),
- bumpMap: !!e.bumpMap,
- normalMap: !!e.normalMap,
- displacementMap: !!e.displacementMap,
- roughnessMap: !!e.roughnessMap,
- metalnessMap: !!e.metalnessMap,
- specularMap: !!e.specularMap,
- alphaMap: !!e.alphaMap,
- combine: e.combine,
- vertexColors: e.vertexColors,
- fog: i,
- useFog: e.fog,
- fogExp: i instanceof Ci.FogExp2,
- flatShading: e.shading === Ci.FlatShading,
- sizeAttenuation: e.sizeAttenuation,
- logarithmicDepthBuffer: l.logarithmicDepthBuffer,
- skinning: e.skinning,
- maxBones: o,
- useVertexTexture: l.floatVertexTextures && n && n.skeleton && n.skeleton.useVertexTexture,
- morphTargets: e.morphTargets,
- morphNormals: e.morphNormals,
- maxMorphTargets: s.maxMorphTargets,
- maxMorphNormals: s.maxMorphNormals,
- numDirLights: t.directional.length,
- numPointLights: t.point.length,
- numSpotLights: t.spot.length,
- numHemiLights: t.hemi.length,
- pointLightShadows: t.shadowsPointLight,
- shadowMapEnabled: s.shadowMap.enabled && n.receiveShadow && 0 < t.shadows.length,
- shadowMapType: s.shadowMap.type,
- toneMapping: s.toneMapping,
- physicallyCorrectLights: s.physicallyCorrectLights,
- premultipliedAlpha: e.premultipliedAlpha,
- alphaTest: e.alphaTest,
- doubleSided: e.side === Ci.DoubleSide,
- flipSided: e.side === Ci.BackSide
- }
- }
- ,
- this.getProgramCode = function(e, t) {
- var i = [];
- if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
- i.push(e.vertexShader)),
- void 0 !== e.defines)
- for (var n in e.defines)
- i.push(n),
- i.push(e.defines[n]);
- for (var r = 0; r < a.length; r++) {
- var o = a[r];
- i.push(o),
- i.push(t[o])
- }
- return i.join()
- }
- ,
- this.acquireProgram = function(e, t, i) {
- for (var n, r = 0, o = h.length; r < o; r++) {
- var a = h[r];
- if (a.code === i) {
- ++(n = a).usedTimes;
- break
- }
- }
- return void 0 === n && (n = new Ci.WebGLProgram(s,i,e,t),
- h.push(n)),
- n
- }
- ,
- this.releaseProgram = function(e) {
- if (0 == --e.usedTimes) {
- var t = h.indexOf(e);
- h[t] = h[h.length - 1],
- h.pop(),
- e.destroy()
- }
- }
- ,
- this.programs = h
- }
- ,
- Ci.WebGLProperties = function() {
- var n = {};
- this.get = function(e) {
- var t = e.uuid
- , i = n[t];
- return void 0 === i && (i = {},
- n[t] = i),
- i
- }
- ,
- this.delete = function(e) {
- delete n[e.uuid]
- }
- ,
- this.clear = function() {
- n = {}
- }
- }
- ,
- Ci.WebGLShader = function(e, t, i) {
- var n = e.createShader(t);
- return e.shaderSource(n, i),
- e.compileShader(n),
- !1 === e.getShaderParameter(n, e.COMPILE_STATUS) && console.error("THREE.WebGLShader: Shader couldn't compile."),
- "" !== e.getShaderInfoLog(n) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", t === e.VERTEX_SHADER ? "vertex" : "fragment", e.getShaderInfoLog(n), function(e) {
- for (var t = e.split("\n"), i = 0; i < t.length; i++)
- t[i] = i + 1 + ": " + t[i];
- return t.join("\n")
- }(i)),
- n
- }
- ,
- Ci.WebGLShadowMap = function(P, O, L) {
- function D(e, t, i, n) {
- var r = e.geometry
- , o = null
- , a = p
- , s = e.customDepthMaterial;
- if (i && (a = f,
- s = e.customDistanceMaterial),
- s)
- o = s;
- else {
- var l = void 0 !== r.morphTargets && 0 < r.morphTargets.length && t.morphTargets
- , c = e instanceof Ci.SkinnedMesh && t.skinning
- , h = 0;
- l && (h |= u),
- c && (h |= d),
- o = a[h]
- }
- return o.visible = t.visible,
- o.wireframe = t.wireframe,
- o.wireframeLinewidth = t.wireframeLinewidth,
- i && void 0 !== o.uniforms.lightPos && o.uniforms.lightPos.value.copy(n),
- o
- }
- function N(e, t, i) {
- if (!1 !== e.visible) {
- 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)))
- !0 === e.material.visible && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
- G.push(e));
- for (var n = e.children, r = 0, o = n.length; r < o; r++)
- N(n[r], t, i)
- }
- }
- 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) {
- var a = 0 != (o & u)
- , s = 0 != (o & d)
- , l = new Ci.ShaderMaterial({
- uniforms: i,
- vertexShader: t.vertexShader,
- fragmentShader: t.fragmentShader,
- morphTargets: a,
- skinning: s
- });
- p[o] = l;
- var c = new Ci.ShaderMaterial({
- defines: {
- USE_SHADOWMAP: ""
- },
- uniforms: r,
- vertexShader: n.vertexShader,
- fragmentShader: n.fragmentShader,
- morphTargets: a,
- skinning: s
- });
- f[o] = c
- }
- var q = this;
- this.enabled = !1,
- this.autoUpdate = !0,
- this.needsUpdate = !1,
- this.type = Ci.PCFShadowMap,
- this.cullFace = Ci.CullFaceFront,
- this.render = function(e, t) {
- var i, n, r = O.shadows;
- if (0 !== r.length && !1 !== q.enabled && (!1 !== q.autoUpdate || !1 !== q.needsUpdate)) {
- B.clearColor(1, 1, 1, 1),
- B.disable(F.BLEND),
- B.enable(F.CULL_FACE),
- F.frontFace(F.CCW),
- F.cullFace(q.cullFace === Ci.CullFaceFront ? F.FRONT : F.BACK),
- B.setDepthTest(!0),
- B.setScissorTest(!1);
- for (var o = 0, a = r.length; o < a; o++) {
- var s = r[o]
- , l = s.shadow
- , c = l.camera;
- if (U.copy(l.mapSize),
- s instanceof Ci.PointLight) {
- i = 6,
- n = !0;
- var h = U.x
- , u = U.y;
- Y[0].set(2 * h, u, h, u),
- Y[1].set(0, u, h, u),
- Y[2].set(3 * h, u, h, u),
- Y[3].set(h, u, h, u),
- Y[4].set(3 * h, 0, h, u),
- Y[5].set(h, 0, h, u),
- U.x *= 4,
- U.y *= 2
- } else
- n = !(i = 1);
- if (null === l.map) {
- var d = {
- minFilter: Ci.NearestFilter,
- magFilter: Ci.NearestFilter,
- format: Ci.RGBAFormat
- };
- l.map = new Ci.WebGLRenderTarget(U.x,U.y,d),
- s instanceof Ci.SpotLight && (c.aspect = U.x / U.y),
- c.updateProjectionMatrix()
- }
- var p = l.map
- , f = l.matrix;
- z.setFromMatrixPosition(s.matrixWorld),
- c.position.copy(z),
- P.setRenderTarget(p),
- P.clear();
- for (var g = 0; g < i; g++) {
- if (n) {
- H.copy(c.position),
- H.add(W[g]),
- c.up.copy(j[g]),
- c.lookAt(H);
- var m = Y[g];
- B.viewport(m)
- } else
- H.setFromMatrixPosition(s.target.matrixWorld),
- c.lookAt(H);
- c.updateMatrixWorld(),
- c.matrixWorldInverse.getInverse(c.matrixWorld),
- f.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
- f.multiply(c.projectionMatrix),
- f.multiply(c.matrixWorldInverse),
- k.multiplyMatrices(c.projectionMatrix, c.matrixWorldInverse),
- V.setFromMatrix(k),
- G.length = 0,
- N(e, t, c);
- for (var v = 0, y = G.length; v < y; v++) {
- var A = G[v]
- , C = L.update(A)
- , I = A.material;
- if (I instanceof Ci.MultiMaterial)
- for (var E = C.groups, _ = I.materials, b = 0, w = E.length; b < w; b++) {
- var T = E[b]
- , x = _[T.materialIndex];
- if (!0 === x.visible) {
- var S = D(A, x, n, z);
- P.renderBufferDirect(c, null, C, S, A, T)
- }
- }
- else {
- S = D(A, I, n, z);
- P.renderBufferDirect(c, null, C, S, A, null)
- }
- }
- }
- }
- var M = P.getClearColor()
- , R = P.getClearAlpha();
- P.setClearColor(M, R),
- B.enable(F.BLEND),
- q.cullFace === Ci.CullFaceFront && F.cullFace(F.BACK),
- q.needsUpdate = !1
- }
- }
- }
- ,
- Ci.WebGLState = function(l, i, c) {
- var n = this
- , r = new Ci.Vector4
- , o = new Uint8Array(16)
- , a = new Uint8Array(16)
- , s = new Uint8Array(16)
- , t = {}
- , h = null
- , u = null
- , d = null
- , p = null
- , f = null
- , g = null
- , m = null
- , v = null
- , y = !1
- , A = null
- , C = null
- , I = null
- , E = null
- , _ = null
- , b = null
- , w = null
- , T = null
- , x = null
- , S = null
- , M = null
- , R = null
- , P = null
- , O = null
- , L = null
- , D = l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS)
- , N = void 0
- , F = {}
- , B = new Ci.Vector4
- , V = null
- , k = null
- , U = new Ci.Vector4
- , H = new Ci.Vector4
- , z = l.createTexture();
- l.bindTexture(l.TEXTURE_2D, z),
- l.texParameteri(l.TEXTURE_2D, l.TEXTURE_MIN_FILTER, l.LINEAR),
- l.texImage2D(l.TEXTURE_2D, 0, l.RGB, 1, 1, 0, l.RGB, l.UNSIGNED_BYTE, new Uint8Array(3)),
- this.init = function() {
- this.clearColor(0, 0, 0, 1),
- this.clearDepth(1),
- this.clearStencil(0),
- this.enable(l.DEPTH_TEST),
- l.depthFunc(l.LEQUAL),
- l.frontFace(l.CCW),
- l.cullFace(l.BACK),
- this.enable(l.CULL_FACE),
- this.enable(l.BLEND),
- l.blendEquation(l.FUNC_ADD),
- l.blendFunc(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA)
- }
- ,
- this.initAttributes = function() {
- for (var e = 0, t = o.length; e < t; e++)
- o[e] = 0
- }
- ,
- this.enableAttribute = function(e) {
- o[e] = 1,
- 0 === a[e] && (l.enableVertexAttribArray(e),
- a[e] = 1),
- 0 !== s[e] && (i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(e, 0),
- s[e] = 0)
- }
- ,
- this.enableAttributeAndDivisor = function(e, t, i) {
- o[e] = 1,
- 0 === a[e] && (l.enableVertexAttribArray(e),
- a[e] = 1),
- s[e] !== t && (i.vertexAttribDivisorANGLE(e, t),
- s[e] = t)
- }
- ,
- this.disableUnusedAttributes = function() {
- for (var e = 0, t = a.length; e < t; e++)
- a[e] !== o[e] && (l.disableVertexAttribArray(e),
- a[e] = 0)
- }
- ,
- this.enable = function(e) {
- !0 !== t[e] && (l.enable(e),
- t[e] = !0)
- }
- ,
- this.disable = function(e) {
- !1 !== t[e] && (l.disable(e),
- t[e] = !1)
- }
- ,
- this.getCompressedTextureFormats = function() {
- if (null === h && (h = [],
- i.get("WEBGL_compressed_texture_pvrtc") || i.get("WEBGL_compressed_texture_s3tc") || i.get("WEBGL_compressed_texture_etc1")))
- for (var e = l.getParameter(l.COMPRESSED_TEXTURE_FORMATS), t = 0; t < e.length; t++)
- h.push(e[t]);
- return h
- }
- ,
- this.setBlending = function(e, t, i, n, r, o, a, s) {
- e === Ci.NoBlending ? this.disable(l.BLEND) : this.enable(l.BLEND),
- e === u && s === y || (e === Ci.AdditiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
- l.blendFuncSeparate(l.ONE, l.ONE, l.ONE, l.ONE)) : (l.blendEquation(l.FUNC_ADD),
- l.blendFunc(l.SRC_ALPHA, l.ONE)) : e === Ci.SubtractiveBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
- l.blendFuncSeparate(l.ZERO, l.ZERO, l.ONE_MINUS_SRC_COLOR, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
- l.blendFunc(l.ZERO, l.ONE_MINUS_SRC_COLOR)) : e === Ci.MultiplyBlending ? s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
- l.blendFuncSeparate(l.ZERO, l.ZERO, l.SRC_COLOR, l.SRC_ALPHA)) : (l.blendEquation(l.FUNC_ADD),
- l.blendFunc(l.ZERO, l.SRC_COLOR)) : s ? (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
- l.blendFuncSeparate(l.ONE, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)) : (l.blendEquationSeparate(l.FUNC_ADD, l.FUNC_ADD),
- l.blendFuncSeparate(l.SRC_ALPHA, l.ONE_MINUS_SRC_ALPHA, l.ONE, l.ONE_MINUS_SRC_ALPHA)),
- u = e,
- y = s),
- e === Ci.CustomBlending ? (r = r || t,
- o = o || i,
- a = a || n,
- t === d && r === g || (l.blendEquationSeparate(c(t), c(r)),
- d = t,
- g = r),
- i === p && n === f && o === m && a === v || (l.blendFuncSeparate(c(i), c(n), c(o), c(a)),
- p = i,
- f = n,
- m = o,
- v = a)) : v = m = g = f = p = d = null
- }
- ,
- this.setDepthFunc = function(e) {
- if (A !== e) {
- if (e)
- switch (e) {
- case Ci.NeverDepth:
- l.depthFunc(l.NEVER);
- break;
- case Ci.AlwaysDepth:
- l.depthFunc(l.ALWAYS);
- break;
- case Ci.LessDepth:
- l.depthFunc(l.LESS);
- break;
- case Ci.LessEqualDepth:
- l.depthFunc(l.LEQUAL);
- break;
- case Ci.EqualDepth:
- l.depthFunc(l.EQUAL);
- break;
- case Ci.GreaterEqualDepth:
- l.depthFunc(l.GEQUAL);
- break;
- case Ci.GreaterDepth:
- l.depthFunc(l.GREATER);
- break;
- case Ci.NotEqualDepth:
- l.depthFunc(l.NOTEQUAL);
- break;
- default:
- l.depthFunc(l.LEQUAL)
- }
- else
- l.depthFunc(l.LEQUAL);
- A = e
- }
- }
- ,
- this.setDepthTest = function(e) {
- e ? this.enable(l.DEPTH_TEST) : this.disable(l.DEPTH_TEST)
- }
- ,
- this.setDepthWrite = function(e) {
- C !== e && (l.depthMask(e),
- C = e)
- }
- ,
- this.setColorWrite = function(e) {
- I !== e && (l.colorMask(e, e, e, e),
- I = e)
- }
- ,
- this.setStencilFunc = function(e, t, i) {
- _ === e && b === t && w === i || (l.stencilFunc(e, t, i),
- _ = e,
- b = t,
- w = i)
- }
- ,
- this.setStencilOp = function(e, t, i) {
- T === e && x === t && S === i || (l.stencilOp(e, t, i),
- T = e,
- x = t,
- S = i)
- }
- ,
- this.setStencilTest = function(e) {
- e ? this.enable(l.STENCIL_TEST) : this.disable(l.STENCIL_TEST)
- }
- ,
- this.setStencilWrite = function(e) {
- E !== e && (l.stencilMask(e),
- E = e)
- }
- ,
- this.setFlipSided = function(e) {
- M !== e && (e ? l.frontFace(l.CW) : l.frontFace(l.CCW),
- M = e)
- }
- ,
- this.setLineWidth = function(e) {
- e !== R && (l.lineWidth(e),
- R = e)
- }
- ,
- this.setPolygonOffset = function(e, t, i) {
- e ? this.enable(l.POLYGON_OFFSET_FILL) : this.disable(l.POLYGON_OFFSET_FILL),
- !e || P === t && O === i || (l.polygonOffset(t, i),
- P = t,
- O = i)
- }
- ,
- this.getScissorTest = function() {
- return L
- }
- ,
- this.setScissorTest = function(e) {
- (L = e) ? this.enable(l.SCISSOR_TEST) : this.disable(l.SCISSOR_TEST)
- }
- ,
- this.activeTexture = function(e) {
- void 0 === e && (e = l.TEXTURE0 + D - 1),
- N !== e && (l.activeTexture(e),
- N = e)
- }
- ,
- this.bindTexture = function(e, t) {
- void 0 === N && n.activeTexture();
- var i = F[N];
- void 0 === i && (i = {
- type: void 0,
- texture: void 0
- },
- F[N] = i),
- i.type === e && i.texture === t || (l.bindTexture(e, t || z),
- i.type = e,
- i.texture = t)
- }
- ,
- this.compressedTexImage2D = function() {
- try {
- l.compressedTexImage2D.apply(l, arguments)
- } catch (e) {
- console.error(e)
- }
- }
- ,
- this.texImage2D = function() {
- try {
- l.texImage2D.apply(l, arguments)
- } catch (e) {
- console.error(e)
- }
- }
- ,
- this.clearColor = function(e, t, i, n) {
- r.set(e, t, i, n),
- !1 === B.equals(r) && (l.clearColor(e, t, i, n),
- B.copy(r))
- }
- ,
- this.clearDepth = function(e) {
- V !== e && (l.clearDepth(e),
- V = e)
- }
- ,
- this.clearStencil = function(e) {
- k !== e && (l.clearStencil(e),
- k = e)
- }
- ,
- this.scissor = function(e) {
- !1 === U.equals(e) && (l.scissor(e.x, e.y, e.z, e.w),
- U.copy(e))
- }
- ,
- this.viewport = function(e) {
- !1 === H.equals(e) && (l.viewport(e.x, e.y, e.z, e.w),
- H.copy(e))
- }
- ,
- this.reset = function() {
- for (var e = 0; e < a.length; e++)
- 1 === a[e] && (l.disableVertexAttribArray(e),
- a[e] = 0);
- t = {},
- N = void 0,
- F = {},
- M = E = C = I = u = h = null
- }
- }
- ,
- Ci.LensFlarePlugin = function(v, y) {
- function A() {
- 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]);
- C = S.createBuffer(),
- I = S.createBuffer(),
- S.bindBuffer(S.ARRAY_BUFFER, C),
- S.bufferData(S.ARRAY_BUFFER, t, S.STATIC_DRAW),
- S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
- S.bufferData(S.ELEMENT_ARRAY_BUFFER, i, S.STATIC_DRAW),
- T = S.createTexture(),
- x = S.createTexture(),
- M.bindTexture(S.TEXTURE_2D, T),
- S.texImage2D(S.TEXTURE_2D, 0, S.RGB, 16, 16, 0, S.RGB, S.UNSIGNED_BYTE, null),
- S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
- S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
- S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
- S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
- M.bindTexture(S.TEXTURE_2D, x),
- S.texImage2D(S.TEXTURE_2D, 0, S.RGBA, 16, 16, 0, S.RGBA, S.UNSIGNED_BYTE, null),
- S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_S, S.CLAMP_TO_EDGE),
- S.texParameteri(S.TEXTURE_2D, S.TEXTURE_WRAP_T, S.CLAMP_TO_EDGE),
- S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MAG_FILTER, S.NEAREST),
- S.texParameteri(S.TEXTURE_2D, S.TEXTURE_MIN_FILTER, S.NEAREST),
- e = (w = 0 < S.getParameter(S.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) ? {
- 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"),
- 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")
- } : {
- 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"),
- 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")
- },
- E = function(e) {
- var t = S.createProgram()
- , i = S.createShader(S.FRAGMENT_SHADER)
- , n = S.createShader(S.VERTEX_SHADER)
- , r = "precision " + v.getPrecision() + " float;\n";
- return S.shaderSource(i, r + e.fragmentShader),
- S.shaderSource(n, r + e.vertexShader),
- S.compileShader(i),
- S.compileShader(n),
- S.attachShader(t, i),
- S.attachShader(t, n),
- S.linkProgram(t),
- t
- }(e),
- _ = {
- vertex: S.getAttribLocation(E, "position"),
- uv: S.getAttribLocation(E, "uv")
- },
- b = {
- renderType: S.getUniformLocation(E, "renderType"),
- map: S.getUniformLocation(E, "map"),
- occlusionMap: S.getUniformLocation(E, "occlusionMap"),
- opacity: S.getUniformLocation(E, "opacity"),
- color: S.getUniformLocation(E, "color"),
- scale: S.getUniformLocation(E, "scale"),
- rotation: S.getUniformLocation(E, "rotation"),
- screenPosition: S.getUniformLocation(E, "screenPosition")
- }
- }
- var C, I, E, _, b, w, T, x, S = v.context, M = v.state;
- this.render = function(e, t, i) {
- if (0 !== y.length) {
- var n = new Ci.Vector3
- , r = i.w / i.z
- , o = .5 * i.z
- , a = .5 * i.w
- , s = 16 / i.w
- , l = new Ci.Vector2(s * r,s)
- , c = new Ci.Vector3(1,1,0)
- , h = new Ci.Vector2(1,1);
- void 0 === E && A(),
- S.useProgram(E),
- M.initAttributes(),
- M.enableAttribute(_.vertex),
- M.enableAttribute(_.uv),
- M.disableUnusedAttributes(),
- S.uniform1i(b.occlusionMap, 0),
- S.uniform1i(b.map, 1),
- S.bindBuffer(S.ARRAY_BUFFER, C),
- S.vertexAttribPointer(_.vertex, 2, S.FLOAT, !1, 16, 0),
- S.vertexAttribPointer(_.uv, 2, S.FLOAT, !1, 16, 8),
- S.bindBuffer(S.ELEMENT_ARRAY_BUFFER, I),
- M.disable(S.CULL_FACE),
- M.setDepthWrite(!1);
- for (var u = 0, d = y.length; u < d; u++) {
- s = 16 / i.w,
- l.set(s * r, s);
- var p = y[u];
- if (n.set(p.matrixWorld.elements[12], p.matrixWorld.elements[13], p.matrixWorld.elements[14]),
- n.applyMatrix4(t.matrixWorldInverse),
- n.applyProjection(t.projectionMatrix),
- c.copy(n),
- h.x = c.x * o + o,
- h.y = c.y * a + a,
- w || 0 < h.x && h.x < i.z && 0 < h.y && h.y < i.w) {
- M.activeTexture(S.TEXTURE0),
- M.bindTexture(S.TEXTURE_2D, null),
- M.activeTexture(S.TEXTURE1),
- M.bindTexture(S.TEXTURE_2D, T),
- S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGB, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
- S.uniform1i(b.renderType, 0),
- S.uniform2f(b.scale, l.x, l.y),
- S.uniform3f(b.screenPosition, c.x, c.y, c.z),
- M.disable(S.BLEND),
- M.enable(S.DEPTH_TEST),
- S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
- M.activeTexture(S.TEXTURE0),
- M.bindTexture(S.TEXTURE_2D, x),
- S.copyTexImage2D(S.TEXTURE_2D, 0, S.RGBA, i.x + h.x - 8, i.y + h.y - 8, 16, 16, 0),
- S.uniform1i(b.renderType, 1),
- M.disable(S.DEPTH_TEST),
- M.activeTexture(S.TEXTURE1),
- M.bindTexture(S.TEXTURE_2D, T),
- S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0),
- p.positionScreen.copy(c),
- p.customUpdateCallback ? p.customUpdateCallback(p) : p.updateLensFlares(),
- S.uniform1i(b.renderType, 2),
- M.enable(S.BLEND);
- for (var f = 0, g = p.lensFlares.length; f < g; f++) {
- var m = p.lensFlares[f];
- .001 < m.opacity && .001 < m.scale && (c.x = m.x,
- c.y = m.y,
- c.z = m.z,
- s = m.size * m.scale / i.w,
- l.x = s * r,
- l.y = s,
- S.uniform3f(b.screenPosition, c.x, c.y, c.z),
- S.uniform2f(b.scale, l.x, l.y),
- S.uniform1f(b.rotation, m.rotation),
- S.uniform1f(b.opacity, m.opacity),
- S.uniform3f(b.color, m.color.r, m.color.g, m.color.b),
- M.setBlending(m.blending, m.blendEquation, m.blendSrc, m.blendDst),
- v.setTexture(m.texture, 1),
- S.drawElements(S.TRIANGLES, 6, S.UNSIGNED_SHORT, 0))
- }
- }
- }
- M.enable(S.CULL_FACE),
- M.enable(S.DEPTH_TEST),
- M.setDepthWrite(!0),
- v.resetGLState()
- }
- }
- }
- ,
- Ci.SpritePlugin = function(u, d) {
- function p() {
- var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
- , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
- g = I.createBuffer(),
- m = I.createBuffer(),
- I.bindBuffer(I.ARRAY_BUFFER, g),
- I.bufferData(I.ARRAY_BUFFER, e, I.STATIC_DRAW),
- I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
- I.bufferData(I.ELEMENT_ARRAY_BUFFER, t, I.STATIC_DRAW),
- v = function() {
- var e = I.createProgram()
- , t = I.createShader(I.VERTEX_SHADER)
- , i = I.createShader(I.FRAGMENT_SHADER);
- 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")),
- 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")),
- I.compileShader(t),
- I.compileShader(i),
- I.attachShader(e, t),
- I.attachShader(e, i),
- I.linkProgram(e),
- e
- }(),
- y = {
- position: I.getAttribLocation(v, "position"),
- uv: I.getAttribLocation(v, "uv")
- },
- A = {
- uvOffset: I.getUniformLocation(v, "uvOffset"),
- uvScale: I.getUniformLocation(v, "uvScale"),
- rotation: I.getUniformLocation(v, "rotation"),
- scale: I.getUniformLocation(v, "scale"),
- color: I.getUniformLocation(v, "color"),
- map: I.getUniformLocation(v, "map"),
- opacity: I.getUniformLocation(v, "opacity"),
- modelViewMatrix: I.getUniformLocation(v, "modelViewMatrix"),
- projectionMatrix: I.getUniformLocation(v, "projectionMatrix"),
- fogType: I.getUniformLocation(v, "fogType"),
- fogDensity: I.getUniformLocation(v, "fogDensity"),
- fogNear: I.getUniformLocation(v, "fogNear"),
- fogFar: I.getUniformLocation(v, "fogFar"),
- fogColor: I.getUniformLocation(v, "fogColor"),
- alphaTest: I.getUniformLocation(v, "alphaTest")
- };
- var i = document.createElement("canvas");
- i.width = 8,
- i.height = 8;
- var n = i.getContext("2d");
- n.fillStyle = "white",
- n.fillRect(0, 0, 8, 8),
- (C = new Ci.Texture(i)).needsUpdate = !0
- }
- function f(e, t) {
- return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
- }
- var g, m, v, y, A, C, I = u.context, E = u.state, _ = new Ci.Vector3, b = new Ci.Quaternion, w = new Ci.Vector3;
- this.render = function(e, t) {
- if (0 !== d.length) {
- void 0 === v && p(),
- I.useProgram(v),
- E.initAttributes(),
- E.enableAttribute(y.position),
- E.enableAttribute(y.uv),
- E.disableUnusedAttributes(),
- E.disable(I.CULL_FACE),
- E.enable(I.BLEND),
- I.bindBuffer(I.ARRAY_BUFFER, g),
- I.vertexAttribPointer(y.position, 2, I.FLOAT, !1, 16, 0),
- I.vertexAttribPointer(y.uv, 2, I.FLOAT, !1, 16, 8),
- I.bindBuffer(I.ELEMENT_ARRAY_BUFFER, m),
- I.uniformMatrix4fv(A.projectionMatrix, !1, t.projectionMatrix.elements),
- E.activeTexture(I.TEXTURE0),
- I.uniform1i(A.map, 0);
- var i = 0
- , n = 0
- , r = e.fog;
- r ? (I.uniform3f(A.fogColor, r.color.r, r.color.g, r.color.b),
- r instanceof Ci.Fog ? (I.uniform1f(A.fogNear, r.near),
- I.uniform1f(A.fogFar, r.far),
- I.uniform1i(A.fogType, 1),
- n = i = 1) : r instanceof Ci.FogExp2 && (I.uniform1f(A.fogDensity, r.density),
- I.uniform1i(A.fogType, 2),
- n = i = 2)) : (I.uniform1i(A.fogType, 0),
- n = i = 0);
- for (var o = 0, a = d.length; o < a; o++) {
- (l = d[o]).modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
- l.z = -l.modelViewMatrix.elements[14]
- }
- d.sort(f);
- var s = [];
- for (o = 0,
- a = d.length; o < a; o++) {
- var l, c = (l = d[o]).material;
- I.uniform1f(A.alphaTest, c.alphaTest),
- I.uniformMatrix4fv(A.modelViewMatrix, !1, l.modelViewMatrix.elements),
- l.matrixWorld.decompose(_, b, w),
- s[0] = w.x,
- s[1] = w.y;
- var h = 0;
- e.fog && c.fog && (h = n),
- i !== h && (I.uniform1i(A.fogType, h),
- i = h),
- null !== c.map ? (I.uniform2f(A.uvOffset, c.map.offset.x, c.map.offset.y),
- I.uniform2f(A.uvScale, c.map.repeat.x, c.map.repeat.y)) : (I.uniform2f(A.uvOffset, 0, 0),
- I.uniform2f(A.uvScale, 1, 1)),
- I.uniform1f(A.opacity, c.opacity),
- I.uniform3f(A.color, c.color.r, c.color.g, c.color.b),
- I.uniform1f(A.rotation, c.rotation),
- I.uniform2fv(A.scale, s),
- E.setBlending(c.blending, c.blendEquation, c.blendSrc, c.blendDst),
- E.setDepthTest(c.depthTest),
- E.setDepthWrite(c.depthWrite),
- c.map && c.map.image && c.map.image.width ? u.setTexture(c.map, 0) : u.setTexture(C, 0),
- I.drawElements(I.TRIANGLES, 6, I.UNSIGNED_SHORT, 0)
- }
- E.enable(I.CULL_FACE),
- u.resetGLState()
- }
- }
- }
- ,
- Object.defineProperties(Ci.Box2.prototype, {
- empty: {
- value: function() {
- return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
- this.isEmpty()
- }
- },
- isIntersectionBox: {
- value: function(e) {
- return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
- this.intersectsBox(e)
- }
- }
- }),
- Object.defineProperties(Ci.Box3.prototype, {
- empty: {
- value: function() {
- return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
- this.isEmpty()
- }
- },
- isIntersectionBox: {
- value: function(e) {
- return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
- this.intersectsBox(e)
- }
- },
- isIntersectionSphere: {
- value: function(e) {
- return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
- this.intersectsSphere(e)
- }
- }
- }),
- Object.defineProperties(Ci.Matrix3.prototype, {
- multiplyVector3: {
- value: function(e) {
- return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
- e.applyMatrix3(this)
- }
- },
- multiplyVector3Array: {
- value: function(e) {
- return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
- this.applyToVector3Array(e)
- }
- }
- }),
- Object.defineProperties(Ci.Matrix4.prototype, {
- extractPosition: {
- value: function(e) {
- return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
- this.copyPosition(e)
- }
- },
- setRotationFromQuaternion: {
- value: function(e) {
- return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
- this.makeRotationFromQuaternion(e)
- }
- },
- multiplyVector3: {
- value: function(e) {
- return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
- e.applyProjection(this)
- }
- },
- multiplyVector4: {
- value: function(e) {
- return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
- e.applyMatrix4(this)
- }
- },
- multiplyVector3Array: {
- value: function(e) {
- return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
- this.applyToVector3Array(e)
- }
- },
- rotateAxis: {
- value: function(e) {
- console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
- e.transformDirection(this)
- }
- },
- crossVector: {
- value: function(e) {
- return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
- e.applyMatrix4(this)
- }
- },
- translate: {
- value: function(e) {
- console.error("THREE.Matrix4: .translate() has been removed.")
- }
- },
- rotateX: {
- value: function(e) {
- console.error("THREE.Matrix4: .rotateX() has been removed.")
- }
- },
- rotateY: {
- value: function(e) {
- console.error("THREE.Matrix4: .rotateY() has been removed.")
- }
- },
- rotateZ: {
- value: function(e) {
- console.error("THREE.Matrix4: .rotateZ() has been removed.")
- }
- },
- rotateByAxis: {
- value: function(e, t) {
- console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
- }
- }
- }),
- Object.defineProperties(Ci.Plane.prototype, {
- isIntersectionLine: {
- value: function(e) {
- return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
- this.intersectsLine(e)
- }
- }
- }),
- Object.defineProperties(Ci.Quaternion.prototype, {
- multiplyVector3: {
- value: function(e) {
- return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
- e.applyQuaternion(this)
- }
- }
- }),
- Object.defineProperties(Ci.Ray.prototype, {
- isIntersectionBox: {
- value: function(e) {
- return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
- this.intersectsBox(e)
- }
- },
- isIntersectionPlane: {
- value: function(e) {
- return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
- this.intersectsPlane(e)
- }
- },
- isIntersectionSphere: {
- value: function(e) {
- return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
- this.intersectsSphere(e)
- }
- }
- }),
- Object.defineProperties(Ci.Vector3.prototype, {
- setEulerFromRotationMatrix: {
- value: function() {
- console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
- }
- },
- setEulerFromQuaternion: {
- value: function() {
- console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
- }
- },
- getPositionFromMatrix: {
- value: function(e) {
- return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
- this.setFromMatrixPosition(e)
- }
- },
- getScaleFromMatrix: {
- value: function(e) {
- return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
- this.setFromMatrixScale(e)
- }
- },
- getColumnFromMatrix: {
- value: function(e, t) {
- return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
- this.setFromMatrixColumn(e, t)
- }
- }
- }),
- Ci.Face4 = function(e, t, i, n, r, o, a) {
- return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
- new Ci.Face3(e,t,i,r,o,a)
- }
- ,
- Ci.Vertex = function(e, t, i) {
- return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
- new Ci.Vector3(e,t,i)
- }
- ,
- Object.defineProperties(Ci.Object3D.prototype, {
- eulerOrder: {
- get: function() {
- return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
- this.rotation.order
- },
- set: function(e) {
- console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
- this.rotation.order = e
- }
- },
- getChildByName: {
- value: function(e) {
- return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
- this.getObjectByName(e)
- }
- },
- renderDepth: {
- set: function(e) {
- console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
- }
- },
- translate: {
- value: function(e, t) {
- return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
- this.translateOnAxis(t, e)
- }
- },
- useQuaternion: {
- get: function() {
- console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
- },
- set: function(e) {
- console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
- }
- }
- }),
- Object.defineProperties(Ci, {
- PointCloud: {
- value: function(e, t) {
- return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
- new Ci.Points(e,t)
- }
- },
- ParticleSystem: {
- value: function(e, t) {
- return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
- new Ci.Points(e,t)
- }
- }
- }),
- Object.defineProperties(Ci.Light.prototype, {
- onlyShadow: {
- set: function(e) {
- console.warn("THREE.Light: .onlyShadow has been removed.")
- }
- },
- shadowCameraFov: {
- set: function(e) {
- console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
- this.shadow.camera.fov = e
- }
- },
- shadowCameraLeft: {
- set: function(e) {
- console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
- this.shadow.camera.left = e
- }
- },
- shadowCameraRight: {
- set: function(e) {
- console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
- this.shadow.camera.right = e
- }
- },
- shadowCameraTop: {
- set: function(e) {
- console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
- this.shadow.camera.top = e
- }
- },
- shadowCameraBottom: {
- set: function(e) {
- console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
- this.shadow.camera.bottom = e
- }
- },
- shadowCameraNear: {
- set: function(e) {
- console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
- this.shadow.camera.near = e
- }
- },
- shadowCameraFar: {
- set: function(e) {
- console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
- this.shadow.camera.far = e
- }
- },
- shadowCameraVisible: {
- set: function(e) {
- console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
- }
- },
- shadowBias: {
- set: function(e) {
- console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
- this.shadow.bias = e
- }
- },
- shadowDarkness: {
- set: function(e) {
- console.warn("THREE.Light: .shadowDarkness has been removed.")
- }
- },
- shadowMapWidth: {
- set: function(e) {
- console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
- this.shadow.mapSize.width = e
- }
- },
- shadowMapHeight: {
- set: function(e) {
- console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
- this.shadow.mapSize.height = e
- }
- }
- }),
- Object.defineProperties(Ci.BufferAttribute.prototype, {
- length: {
- get: function() {
- return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
- this.array.length
- }
- }
- }),
- Object.defineProperties(Ci.BufferGeometry.prototype, {
- drawcalls: {
- get: function() {
- return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
- this.groups
- }
- },
- offsets: {
- get: function() {
- return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
- this.groups
- }
- },
- addIndex: {
- value: function(e) {
- console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
- this.setIndex(e)
- }
- },
- addDrawCall: {
- value: function(e, t, i) {
- void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
- console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
- this.addGroup(e, t)
- }
- },
- clearDrawCalls: {
- value: function() {
- console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
- this.clearGroups()
- }
- },
- computeTangents: {
- value: function() {
- console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
- }
- },
- computeOffsets: {
- value: function() {
- console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
- }
- }
- }),
- Object.defineProperties(Ci.Material.prototype, {
- wrapAround: {
- get: function() {
- console.warn("THREE." + this.type + ": .wrapAround has been removed.")
- },
- set: function(e) {
- console.warn("THREE." + this.type + ": .wrapAround has been removed.")
- }
- },
- wrapRGB: {
- get: function() {
- return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
- new Ci.Color
- }
- }
- }),
- Object.defineProperties(Ci, {
- PointCloudMaterial: {
- value: function(e) {
- return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
- new Ci.PointsMaterial(e)
- }
- },
- ParticleBasicMaterial: {
- value: function(e) {
- return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
- new Ci.PointsMaterial(e)
- }
- },
- ParticleSystemMaterial: {
- value: function(e) {
- return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
- new Ci.PointsMaterial(e)
- }
- }
- }),
- Object.defineProperties(Ci.MeshPhongMaterial.prototype, {
- metal: {
- get: function() {
- return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
- !1
- },
- set: function(e) {
- console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
- }
- }
- }),
- Object.defineProperties(Ci.ShaderMaterial.prototype, {
- derivatives: {
- get: function() {
- return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
- this.extensions.derivatives
- },
- set: function(e) {
- console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
- this.extensions.derivatives = e
- }
- }
- }),
- Object.defineProperties(Ci.WebGLRenderer.prototype, {
- supportsFloatTextures: {
- value: function() {
- return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
- this.extensions.get("OES_texture_float")
- }
- },
- supportsHalfFloatTextures: {
- value: function() {
- return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
- this.extensions.get("OES_texture_half_float")
- }
- },
- supportsStandardDerivatives: {
- value: function() {
- return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
- this.extensions.get("OES_standard_derivatives")
- }
- },
- supportsCompressedTextureS3TC: {
- value: function() {
- return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
- this.extensions.get("WEBGL_compressed_texture_s3tc")
- }
- },
- supportsCompressedTexturePVRTC: {
- value: function() {
- return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
- this.extensions.get("WEBGL_compressed_texture_pvrtc")
- }
- },
- supportsBlendMinMax: {
- value: function() {
- return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
- this.extensions.get("EXT_blend_minmax")
- }
- },
- supportsVertexTextures: {
- value: function() {
- return this.capabilities.vertexTextures
- }
- },
- supportsInstancedArrays: {
- value: function() {
- return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
- this.extensions.get("ANGLE_instanced_arrays")
- }
- },
- enableScissorTest: {
- value: function(e) {
- console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
- this.setScissorTest(e)
- }
- },
- initMaterial: {
- value: function() {
- console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
- }
- },
- addPrePlugin: {
- value: function() {
- console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
- }
- },
- addPostPlugin: {
- value: function() {
- console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
- }
- },
- updateShadowMap: {
- value: function() {
- console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
- }
- },
- shadowMapEnabled: {
- get: function() {
- return this.shadowMap.enabled
- },
- set: function(e) {
- console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
- this.shadowMap.enabled = e
- }
- },
- shadowMapType: {
- get: function() {
- return this.shadowMap.type
- },
- set: function(e) {
- console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
- this.shadowMap.type = e
- }
- },
- shadowMapCullFace: {
- get: function() {
- return this.shadowMap.cullFace
- },
- set: function(e) {
- console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
- this.shadowMap.cullFace = e
- }
- }
- }),
- Object.defineProperties(Ci.WebGLRenderTarget.prototype, {
- wrapS: {
- get: function() {
- return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
- this.texture.wrapS
- },
- set: function(e) {
- console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
- this.texture.wrapS = e
- }
- },
- wrapT: {
- get: function() {
- return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
- this.texture.wrapT
- },
- set: function(e) {
- console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
- this.texture.wrapT = e
- }
- },
- magFilter: {
- get: function() {
- return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
- this.texture.magFilter
- },
- set: function(e) {
- console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
- this.texture.magFilter = e
- }
- },
- minFilter: {
- get: function() {
- return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
- this.texture.minFilter
- },
- set: function(e) {
- console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
- this.texture.minFilter = e
- }
- },
- anisotropy: {
- get: function() {
- return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
- this.texture.anisotropy
- },
- set: function(e) {
- console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
- this.texture.anisotropy = e
- }
- },
- offset: {
- get: function() {
- return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
- this.texture.offset
- },
- set: function(e) {
- console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
- this.texture.offset = e
- }
- },
- repeat: {
- get: function() {
- return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
- this.texture.repeat
- },
- set: function(e) {
- console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
- this.texture.repeat = e
- }
- },
- format: {
- get: function() {
- return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
- this.texture.format
- },
- set: function(e) {
- console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
- this.texture.format = e
- }
- },
- type: {
- get: function() {
- return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
- this.texture.type
- },
- set: function(e) {
- console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
- this.texture.type = e
- }
- },
- generateMipmaps: {
- get: function() {
- return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
- this.texture.generateMipmaps
- },
- set: function(e) {
- console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
- this.texture.generateMipmaps = e
- }
- }
- }),
- Ci.GeometryUtils = {
- merge: function(e, t, i) {
- var n;
- console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),
- t instanceof Ci.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
- n = t.matrix,
- t = t.geometry),
- e.merge(t, n, i)
- },
- center: function(e) {
- return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
- e.center()
- }
- },
- Ci.ImageUtils = {
- crossOrigin: void 0,
- loadTexture: function(e, t, i, n) {
- console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
- var r = new Ci.TextureLoader;
- r.setCrossOrigin(this.crossOrigin);
- var o = r.load(e, i, void 0, n);
- return t && (o.mapping = t),
- o
- },
- loadTextureCube: function(e, t, i, n) {
- console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
- var r = new Ci.CubeTextureLoader;
- r.setCrossOrigin(this.crossOrigin);
- var o = r.load(e, i, void 0, n);
- return t && (o.mapping = t),
- o
- },
- loadCompressedTexture: function() {
- console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
- },
- loadCompressedTextureCube: function() {
- console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
- }
- },
- Ci.Projector = function() {
- console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
- this.projectVector = function(e, t) {
- console.warn("THREE.Projector: .projectVector() is now vector.project()."),
- e.project(t)
- }
- ,
- this.unprojectVector = function(e, t) {
- console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
- e.unproject(t)
- }
- ,
- this.pickingRay = function(e, t) {
- console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
- }
- }
- ,
- Ci.CanvasRenderer = function() {
- console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
- this.domElement = document.createElement("canvas"),
- this.clear = function() {}
- ,
- this.render = function() {}
- ,
- this.setClearColor = function() {}
- ,
- this.setSize = function() {}
- }
- ,
- Ci.MeshFaceMaterial = Ci.MultiMaterial,
- Ci.CurveUtils = {
- tangentQuadraticBezier: function(e, t, i, n) {
- return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
- },
- tangentCubicBezier: function(e, t, i, n, r) {
- 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
- },
- tangentSpline: function(e, t, i, n, r) {
- return 6 * e * e - 6 * e + (3 * e * e - 4 * e + 1) + (-6 * e * e + 6 * e) + (3 * e * e - 2 * e)
- },
- interpolate: function(e, t, i, n, r) {
- var o = .5 * (i - e)
- , a = .5 * (n - t)
- , s = r * r;
- return (2 * t - 2 * i + o + a) * (r * s) + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
- }
- },
- Ci.SceneUtils = {
- createMultiMaterialObject: function(e, t) {
- for (var i = new Ci.Group, n = 0, r = t.length; n < r; n++)
- i.add(new Ci.Mesh(e,t[n]));
- return i
- },
- detach: function(e, t, i) {
- e.applyMatrix(t.matrixWorld),
- t.remove(e),
- i.add(e)
- },
- attach: function(e, t, i) {
- var n = new Ci.Matrix4;
- n.getInverse(i.matrixWorld),
- e.applyMatrix(n),
- t.remove(e),
- i.add(e)
- }
- },
- Ci.ShapeUtils = {
- area: function(e) {
- for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
- i += e[n].x * e[r].y - e[r].x * e[n].y;
- return .5 * i
- },
- triangulate: function(e, t) {
- var i = e.length;
- if (i < 3)
- return null;
- var n, r, o, a = [], s = [], l = [];
- if (0 < Ci.ShapeUtils.area(e))
- for (r = 0; r < i; r++)
- s[r] = r;
- else
- for (r = 0; r < i; r++)
- s[r] = i - 1 - r;
- var c = i
- , h = 2 * c;
- for (r = c - 1; 2 < c; ) {
- if (h-- <= 0)
- return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
- t ? l : a;
- if (c <= (n = r) && (n = 0),
- c <= (r = n + 1) && (r = 0),
- c <= (o = r + 1) && (o = 0),
- Si(e, n, r, o, c, s)) {
- var u, d, p, f, g;
- for (u = s[n],
- d = s[r],
- p = s[o],
- a.push([e[u], e[d], e[p]]),
- l.push([s[n], s[r], s[o]]),
- g = (f = r) + 1; g < c; f++,
- g++)
- s[f] = s[g];
- h = 2 * --c
- }
- }
- return t ? l : a
- },
- triangulateShape: function(e, t) {
- function w(e, t, i) {
- 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
- }
- function b(e, t, i, n, r) {
- var o = t.x - e.x
- , a = t.y - e.y
- , s = n.x - i.x
- , l = n.y - i.y
- , c = e.x - i.x
- , h = e.y - i.y
- , u = a * s - o * l
- , d = a * c - o * h;
- if (Math.abs(u) > Number.EPSILON) {
- var p;
- if (0 < u) {
- if (d < 0 || u < d)
- return [];
- if ((p = l * c - s * h) < 0 || u < p)
- return []
- } else {
- if (0 < d || d < u)
- return [];
- if (0 < (p = l * c - s * h) || p < u)
- return []
- }
- if (0 === p)
- return !r || 0 != d && d != u ? [e] : [];
- if (p === u)
- return !r || 0 != d && d != u ? [t] : [];
- if (0 == d)
- return [i];
- if (d == u)
- return [n];
- var f = p / u;
- return [{
- x: e.x + f * o,
- y: e.y + f * a
- }]
- }
- if (0 != d || l * c != s * h)
- return [];
- var g, m, v, y, A, C, I, E, _ = 0 == o && 0 == a, b = 0 == s && 0 == l;
- 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,
- (m = t).x) : (v = (g = t).x,
- (m = e).x),
- i.x < n.x ? (I = (A = i).x,
- (C = n).x) : (I = (A = n).x,
- (C = i).x)) : (y = e.y < t.y ? (v = (g = e).y,
- (m = t).y) : (v = (g = t).y,
- (m = e).y),
- i.y < n.y ? (I = (A = i).y,
- (C = n).y) : (I = (A = n).y,
- (C = i).y)),
- 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])
- }
- function T(e, t, i, n) {
- var r = t.x - e.x
- , o = t.y - e.y
- , a = i.x - e.x
- , s = i.y - e.y
- , l = n.x - e.x
- , c = n.y - e.y
- , h = r * s - o * a
- , u = r * c - o * l;
- if (Math.abs(h) > Number.EPSILON) {
- var d = l * s - c * a;
- return 0 < h ? 0 <= u && 0 <= d : 0 <= u || 0 <= d
- }
- return 0 < u
- }
- for (var i, n, r, o, a, s, l = {}, c = e.concat(), h = 0, u = t.length; h < u; h++)
- Array.prototype.push.apply(c, t[h]);
- for (i = 0,
- n = c.length; i < n; i++)
- void 0 !== l[a = c[i].x + ":" + c[i].y] && console.warn("THREE.Shape: Duplicate point", a),
- l[a] = i;
- var d = function(e, a) {
- function t(e, t) {
- var i = m.length - 1
- , n = e - 1;
- n < 0 && (n = i);
- var r = e + 1;
- i < r && (r = 0);
- var o = T(m[e], m[n], m[r], c[t]);
- if (!o)
- return !1;
- var a = c.length - 1
- , s = t - 1;
- s < 0 && (s = a);
- var l = t + 1;
- return a < l && (l = 0),
- !!(o = T(c[t], c[s], c[l], m[e]))
- }
- function i(e, t) {
- var i, n;
- for (i = 0; i < m.length; i++)
- if (n = i + 1,
- n %= m.length,
- 0 < b(e, t, m[i], m[n], !0).length)
- return !0;
- return !1
- }
- function n(e, t) {
- var i, n, r, o;
- for (i = 0; i < v.length; i++)
- for (n = a[v[i]],
- r = 0; r < n.length; r++)
- if (o = r + 1,
- o %= n.length,
- 0 < b(e, t, n[r], n[o], !0).length)
- return !0;
- return !1
- }
- 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++)
- v.push(A);
- for (var I = 0, E = 2 * v.length; 0 < v.length; ) {
- if (--E < 0) {
- console.log("Infinite Loop! Holes left:" + v.length + ", Probably Hole outside Shape!");
- break
- }
- for (o = I; o < m.length; o++) {
- s = m[o],
- r = -1;
- for (A = 0; A < v.length; A++)
- if (h = v[A],
- void 0 === y[u = s.x + ":" + s.y + ":" + h]) {
- c = a[h];
- for (var _ = 0; _ < c.length; _++)
- if (l = c[_],
- t(o, _) && !i(s, l) && !n(s, l)) {
- r = _,
- v.splice(A, 1),
- d = m.slice(0, o + 1),
- p = m.slice(o),
- f = c.slice(r),
- g = c.slice(0, r + 1),
- m = d.concat(f).concat(g).concat(p),
- I = o;
- break
- }
- if (0 <= r)
- break;
- y[u] = !0
- }
- if (0 <= r)
- break
- }
- }
- return m
- }(e, t)
- , p = Ci.ShapeUtils.triangulate(d, !1);
- for (i = 0,
- n = p.length; i < n; i++)
- for (o = p[i],
- r = 0; r < 3; r++)
- void 0 !== (s = l[a = o[r].x + ":" + o[r].y]) && (o[r] = s);
- return p.concat()
- },
- isClockWise: function(e) {
- return Ci.ShapeUtils.area(e) < 0
- },
- b2: function(e, t, i, n) {
- return function(e, t) {
- var i = 1 - e;
- return i * i * t
- }(e, t) + function(e, t) {
- return 2 * (1 - e) * e * t
- }(e, i) + function(e, t) {
- return e * e * t
- }(e, n)
- },
- b3: function(e, t, i, n, r) {
- return function(e, t) {
- var i = 1 - e;
- return i * i * i * t
- }(e, t) + function(e, t) {
- var i = 1 - e;
- return 3 * i * i * e * t
- }(e, i) + function(e, t) {
- return 3 * (1 - e) * e * e * t
- }(e, n) + function(e, t) {
- return e * e * e * t
- }(e, r)
- }
- },
- Ci.Curve = function() {}
- ,
- Ci.Curve.prototype = {
- constructor: Ci.Curve,
- getPoint: function(e) {
- return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
- null
- },
- getPointAt: function(e) {
- var t = this.getUtoTmapping(e);
- return this.getPoint(t)
- },
- getPoints: function(e) {
- e = e || 5;
- var t, i = [];
- for (t = 0; t <= e; t++)
- i.push(this.getPoint(t / e));
- return i
- },
- getSpacedPoints: function(e) {
- e = e || 5;
- var t, i = [];
- for (t = 0; t <= e; t++)
- i.push(this.getPointAt(t / e));
- return i
- },
- getLength: function() {
- var e = this.getLengths();
- return e[e.length - 1]
- },
- getLengths: function(e) {
- if (e = e || (this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
- this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
- return this.cacheArcLengths;
- this.needsUpdate = !1;
- var t, i, n = [], r = this.getPoint(0), o = 0;
- for (n.push(0),
- i = 1; i <= e; i++)
- o += (t = this.getPoint(i / e)).distanceTo(r),
- n.push(o),
- r = t;
- return this.cacheArcLengths = n
- },
- updateArcLengths: function() {
- this.needsUpdate = !0,
- this.getLengths()
- },
- getUtoTmapping: function(e, t) {
- var i, n = this.getLengths(), r = 0, o = n.length;
- i = t || e * n[o - 1];
- for (var a, s = 0, l = o - 1; s <= l; )
- if ((a = n[r = Math.floor(s + (l - s) / 2)] - i) < 0)
- s = r + 1;
- else {
- if (!(0 < a)) {
- l = r;
- break
- }
- l = r - 1
- }
- if (n[r = l] === i)
- return r / (o - 1);
- var c = n[r];
- return (r + (i - c) / (n[r + 1] - c)) / (o - 1)
- },
- getTangent: function(e) {
- var t = e - 1e-4
- , i = e + 1e-4;
- t < 0 && (t = 0),
- 1 < i && (i = 1);
- var n = this.getPoint(t);
- return this.getPoint(i).clone().sub(n).normalize()
- },
- getTangentAt: function(e) {
- var t = this.getUtoTmapping(e);
- return this.getTangent(t)
- }
- },
- Ci.Curve.create = function(e, t) {
- return e.prototype = Object.create(Ci.Curve.prototype),
- (e.prototype.constructor = e).prototype.getPoint = t,
- e
- }
- ,
- Ci.CurvePath = function() {
- this.curves = [],
- this.autoClose = !1
- }
- ,
- Ci.CurvePath.prototype = Object.create(Ci.Curve.prototype),
- Ci.CurvePath.prototype.constructor = Ci.CurvePath,
- Ci.CurvePath.prototype.add = function(e) {
- this.curves.push(e)
- }
- ,
- Ci.CurvePath.prototype.closePath = function() {
- var e = this.curves[0].getPoint(0)
- , t = this.curves[this.curves.length - 1].getPoint(1);
- e.equals(t) || this.curves.push(new Ci.LineCurve(t,e))
- }
- ,
- Ci.CurvePath.prototype.getPoint = function(e) {
- for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
- if (i[n] >= t) {
- var r = i[n] - t
- , o = this.curves[n]
- , a = 1 - r / o.getLength();
- return o.getPointAt(a)
- }
- n++
- }
- return null
- }
- ,
- Ci.CurvePath.prototype.getLength = function() {
- var e = this.getCurveLengths();
- return e[e.length - 1]
- }
- ,
- Ci.CurvePath.prototype.getCurveLengths = function() {
- if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
- return this.cacheLengths;
- for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
- t += this.curves[i].getLength(),
- e.push(t);
- return this.cacheLengths = e
- }
- ,
- Ci.CurvePath.prototype.createPointsGeometry = function(e) {
- var t = this.getPoints(e);
- return this.createGeometry(t)
- }
- ,
- Ci.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
- var t = this.getSpacedPoints(e);
- return this.createGeometry(t)
- }
- ,
- Ci.CurvePath.prototype.createGeometry = function(e) {
- for (var t = new Ci.Geometry, i = 0, n = e.length; i < n; i++) {
- var r = e[i];
- t.vertices.push(new Ci.Vector3(r.x,r.y,r.z || 0))
- }
- return t
- }
- ,
- Ci.Font = function(e) {
- this.data = e
- }
- ,
- Ci.Font.prototype = {
- constructor: Ci.Font,
- generateShapes: function(e, s, b) {
- function l(e, t, i) {
- var n = w.glyphs[e] || w.glyphs["?"];
- if (n) {
- 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;
- if (n.o)
- for (var A = n._cachedOutline || (n._cachedOutline = n.o.split(" ")), C = 0, I = A.length; C < I; ) {
- switch (A[C++]) {
- case "m":
- r = A[C++] * t + i,
- o = A[C++] * t,
- g.moveTo(r, o);
- break;
- case "l":
- r = A[C++] * t + i,
- o = A[C++] * t,
- g.lineTo(r, o);
- break;
- case "q":
- if (a = A[C++] * t + i,
- s = A[C++] * t,
- h = A[C++] * t + i,
- u = A[C++] * t,
- g.quadraticCurveTo(h, u, a, s),
- f = m[m.length - 1]) {
- l = f.x,
- c = f.y;
- for (var E = 1; E <= b; E++) {
- v(_ = E / b, l, h, a),
- v(_, c, u, s)
- }
- }
- break;
- case "b":
- if (a = A[C++] * t + i,
- s = A[C++] * t,
- h = A[C++] * t + i,
- u = A[C++] * t,
- d = A[C++] * t + i,
- p = A[C++] * t,
- g.bezierCurveTo(h, u, d, p, a, s),
- f = m[m.length - 1]) {
- l = f.x,
- c = f.y;
- for (E = 1; E <= b; E++) {
- var _;
- y(_ = E / b, l, h, d, a),
- y(_, c, u, p, s)
- }
- }
- }
- }
- return {
- offset: n.ha * t,
- path: g
- }
- }
- }
- void 0 === s && (s = 100),
- void 0 === b && (b = 4);
- for (var w = this.data, t = function(e) {
- for (var t = String(e).split(""), i = s / w.resolution, n = 0, r = [], o = 0; o < t.length; o++) {
- var a = l(t[o], i, n);
- n += a.offset,
- r.push(a.path)
- }
- return r
- }(e), i = [], n = 0, r = t.length; n < r; n++)
- Array.prototype.push.apply(i, t[n].toShapes());
- return i
- }
- },
- Ci.Path = function(e) {
- Ci.CurvePath.call(this),
- this.actions = [],
- e && this.fromPoints(e)
- }
- ,
- Ci.Path.prototype = Object.create(Ci.CurvePath.prototype),
- Ci.Path.prototype.constructor = Ci.Path,
- Ci.Path.prototype.fromPoints = function(e) {
- this.moveTo(e[0].x, e[0].y);
- for (var t = 1, i = e.length; t < i; t++)
- this.lineTo(e[t].x, e[t].y)
- }
- ,
- Ci.Path.prototype.moveTo = function(e, t) {
- this.actions.push({
- action: "moveTo",
- args: [e, t]
- })
- }
- ,
- Ci.Path.prototype.lineTo = function(e, t) {
- var i = this.actions[this.actions.length - 1].args
- , n = i[i.length - 2]
- , r = i[i.length - 1]
- , o = new Ci.LineCurve(new Ci.Vector2(n,r),new Ci.Vector2(e,t));
- this.curves.push(o),
- this.actions.push({
- action: "lineTo",
- args: [e, t]
- })
- }
- ,
- Ci.Path.prototype.quadraticCurveTo = function(e, t, i, n) {
- var r = this.actions[this.actions.length - 1].args
- , o = r[r.length - 2]
- , a = r[r.length - 1]
- , s = new Ci.QuadraticBezierCurve(new Ci.Vector2(o,a),new Ci.Vector2(e,t),new Ci.Vector2(i,n));
- this.curves.push(s),
- this.actions.push({
- action: "quadraticCurveTo",
- args: [e, t, i, n]
- })
- }
- ,
- Ci.Path.prototype.bezierCurveTo = function(e, t, i, n, r, o) {
- var a = this.actions[this.actions.length - 1].args
- , s = a[a.length - 2]
- , l = a[a.length - 1]
- , c = new Ci.CubicBezierCurve(new Ci.Vector2(s,l),new Ci.Vector2(e,t),new Ci.Vector2(i,n),new Ci.Vector2(r,o));
- this.curves.push(c),
- this.actions.push({
- action: "bezierCurveTo",
- args: [e, t, i, n, r, o]
- })
- }
- ,
- Ci.Path.prototype.splineThru = function(e) {
- var t = Array.prototype.slice.call(arguments)
- , i = this.actions[this.actions.length - 1].args
- , n = i[i.length - 2]
- , r = i[i.length - 1]
- , o = [new Ci.Vector2(n,r)];
- Array.prototype.push.apply(o, e);
- var a = new Ci.SplineCurve(o);
- this.curves.push(a),
- this.actions.push({
- action: "splineThru",
- args: t
- })
- }
- ,
- Ci.Path.prototype.arc = function(e, t, i, n, r, o) {
- var a = this.actions[this.actions.length - 1].args
- , s = a[a.length - 2]
- , l = a[a.length - 1];
- this.absarc(e + s, t + l, i, n, r, o)
- }
- ,
- Ci.Path.prototype.absarc = function(e, t, i, n, r, o) {
- this.absellipse(e, t, i, i, n, r, o)
- }
- ,
- Ci.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
- var l = this.actions[this.actions.length - 1].args
- , c = l[l.length - 2]
- , h = l[l.length - 1];
- this.absellipse(e + c, t + h, i, n, r, o, a, s)
- }
- ,
- Ci.Path.prototype.absellipse = function(e, t, i, n, r, o, a, s) {
- var l = [e, t, i, n, r, o, a, s || 0]
- , c = new Ci.EllipseCurve(e,t,i,n,r,o,a,s);
- this.curves.push(c);
- var h = c.getPoint(1);
- l.push(h.x),
- l.push(h.y),
- this.actions.push({
- action: "ellipse",
- args: l
- })
- }
- ,
- Ci.Path.prototype.getSpacedPoints = function(e) {
- e = e || 40;
- for (var t = [], i = 0; i < e; i++)
- t.push(this.getPoint(i / e));
- return this.autoClose && t.push(t[0]),
- t
- }
- ,
- Ci.Path.prototype.getPoints = function(e) {
- e = e || 12;
- 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++) {
- var v = this.actions[g]
- , y = v.action
- , A = v.args;
- switch (y) {
- case "moveTo":
- case "lineTo":
- f.push(new Ci.Vector2(A[0],A[1]));
- break;
- case "quadraticCurveTo":
- t = A[2],
- i = A[3],
- o = A[0],
- a = A[1],
- l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
- c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
- c[c.length - 1]);
- for (var C = 1; C <= e; C++) {
- h = d(O = C / e, s, o, t),
- u = d(O, l, a, i),
- f.push(new Ci.Vector2(h,u))
- }
- break;
- case "bezierCurveTo":
- t = A[4],
- i = A[5],
- o = A[0],
- a = A[1],
- n = A[2],
- r = A[3],
- l = 0 < f.length ? (s = (c = f[f.length - 1]).x,
- c.y) : (s = (c = this.actions[g - 1].args)[c.length - 2],
- c[c.length - 1]);
- for (C = 1; C <= e; C++) {
- h = p(O = C / e, s, o, n, t),
- u = p(O, l, a, r, i),
- f.push(new Ci.Vector2(h,u))
- }
- break;
- case "splineThru":
- c = this.actions[g - 1].args;
- var I = [new Ci.Vector2(c[c.length - 2],c[c.length - 1])]
- , E = e * A[0].length;
- I = I.concat(A[0]);
- var _ = new Ci.SplineCurve(I);
- for (C = 1; C <= E; C++)
- f.push(_.getPointAt(C / E));
- break;
- case "arc":
- var b = A[0]
- , w = A[1]
- , T = A[2]
- , x = A[3]
- , S = A[4]
- , M = !!A[5]
- , R = S - x
- , P = 2 * e;
- for (C = 1; C <= P; C++) {
- var O = C / P;
- M || (O = 1 - O),
- L = x + O * R,
- h = b + T * Math.cos(L),
- u = w + T * Math.sin(L),
- f.push(new Ci.Vector2(h,u))
- }
- break;
- case "ellipse":
- b = A[0],
- w = A[1];
- var L, D, N, F = A[2], B = A[3], V = (x = A[4],
- S = A[5],
- M = !!A[6],
- A[7]);
- R = S - x,
- P = 2 * e;
- 0 !== V && (D = Math.cos(V),
- N = Math.sin(V));
- for (C = 1; C <= P; C++) {
- O = C / P;
- if (M || (O = 1 - O),
- L = x + O * R,
- h = b + F * Math.cos(L),
- u = w + B * Math.sin(L),
- 0 !== V) {
- var k = h;
- h = (k - b) * D - (u - w) * N + b,
- u = (k - b) * N + (u - w) * D + w
- }
- f.push(new Ci.Vector2(h,u))
- }
- }
- }
- var U = f[f.length - 1];
- 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),
- this.autoClose && f.push(f[0]),
- f
- }
- ,
- Ci.Path.prototype.toShapes = function(e, t) {
- function i(e) {
- for (var t = [], i = 0, n = e.length; i < n; i++) {
- var r = e[i]
- , o = new Ci.Shape;
- o.actions = r.actions,
- o.curves = r.curves,
- t.push(o)
- }
- return t
- }
- function n(e, t) {
- for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
- var a = t[r]
- , s = t[o]
- , l = s.x - a.x
- , c = s.y - a.y;
- if (Math.abs(c) > Number.EPSILON) {
- if (c < 0 && (a = t[o],
- l = -l,
- s = t[r],
- c = -c),
- e.y < a.y || e.y > s.y)
- continue;
- if (e.y === a.y) {
- if (e.x === a.x)
- return !0
- } else {
- var h = c * (e.x - a.x) - l * (e.y - a.y);
- if (0 == h)
- return !0;
- if (h < 0)
- continue;
- n = !n
- }
- } else {
- if (e.y !== a.y)
- continue;
- if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
- return !0
- }
- }
- return n
- }
- var r = Ci.ShapeUtils.isClockWise
- , o = function(e) {
- for (var t = [], i = new Ci.Path, n = 0, r = e.length; n < r; n++) {
- var o = e[n]
- , a = o.args
- , s = o.action;
- "moveTo" === s && 0 !== i.actions.length && (t.push(i),
- i = new Ci.Path),
- i[s].apply(i, a)
- }
- return 0 !== i.actions.length && t.push(i),
- t
- }(this.actions);
- if (0 === o.length)
- return [];
- if (!0 === t)
- return i(o);
- var a, s, l, c = [];
- if (1 === o.length)
- return s = o[0],
- (l = new Ci.Shape).actions = s.actions,
- l.curves = s.curves,
- c.push(l),
- c;
- var h = !r(o[0].getPoints());
- h = e ? !h : h;
- var u, d = [], p = [], f = [], g = 0;
- p[g] = void 0,
- f[g] = [];
- for (var m = 0, v = o.length; m < v; m++)
- a = r(u = (s = o[m]).getPoints()),
- (a = e ? !a : a) ? (!h && p[g] && g++,
- p[g] = {
- s: new Ci.Shape,
- p: u
- },
- p[g].s.actions = s.actions,
- p[g].s.curves = s.curves,
- h && g++,
- f[g] = []) : f[g].push({
- h: s,
- p: u[0]
- });
- if (!p[0])
- return i(o);
- if (1 < p.length) {
- for (var y = !1, A = [], C = 0, I = p.length; C < I; C++)
- d[C] = [];
- for (C = 0,
- I = p.length; C < I; C++)
- for (var E = f[C], _ = 0; _ < E.length; _++) {
- for (var b = E[_], w = !0, T = 0; T < p.length; T++)
- n(b.p, p[T].p) && (C !== T && A.push({
- froms: C,
- tos: T,
- hole: _
- }),
- w ? (w = !1,
- d[T].push(b)) : y = !0);
- w && d[C].push(b)
- }
- 0 < A.length && (y || (f = d))
- }
- m = 0;
- for (var x, S = p.length; m < S; m++) {
- l = p[m].s,
- c.push(l);
- for (var M = 0, R = (x = f[m]).length; M < R; M++)
- l.holes.push(x[M].h)
- }
- return c
- }
- ,
- Ci.Shape = function() {
- Ci.Path.apply(this, arguments),
- this.holes = []
- }
- ,
- Ci.Shape.prototype = Object.create(Ci.Path.prototype),
- Ci.Shape.prototype.constructor = Ci.Shape,
- Ci.Shape.prototype.extrude = function(e) {
- return new Ci.ExtrudeGeometry(this,e)
- }
- ,
- Ci.Shape.prototype.makeGeometry = function(e) {
- return new Ci.ShapeGeometry(this,e)
- }
- ,
- Ci.Shape.prototype.getPointsHoles = function(e) {
- for (var t = [], i = 0, n = this.holes.length; i < n; i++)
- t[i] = this.holes[i].getPoints(e);
- return t
- }
- ,
- Ci.Shape.prototype.extractAllPoints = function(e) {
- return {
- shape: this.getPoints(e),
- holes: this.getPointsHoles(e)
- }
- }
- ,
- Ci.Shape.prototype.extractPoints = function(e) {
- return this.extractAllPoints(e)
- }
- ,
- Ci.LineCurve = function(e, t) {
- this.v1 = e,
- this.v2 = t
- }
- ,
- Ci.LineCurve.prototype = Object.create(Ci.Curve.prototype),
- Ci.LineCurve.prototype.constructor = Ci.LineCurve,
- Ci.LineCurve.prototype.getPoint = function(e) {
- var t = this.v2.clone().sub(this.v1);
- return t.multiplyScalar(e).add(this.v1),
- t
- }
- ,
- Ci.LineCurve.prototype.getPointAt = function(e) {
- return this.getPoint(e)
- }
- ,
- Ci.LineCurve.prototype.getTangent = function(e) {
- return this.v2.clone().sub(this.v1).normalize()
- }
- ,
- Ci.QuadraticBezierCurve = function(e, t, i) {
- this.v0 = e,
- this.v1 = t,
- this.v2 = i
- }
- ,
- Ci.QuadraticBezierCurve.prototype = Object.create(Ci.Curve.prototype),
- Ci.QuadraticBezierCurve.prototype.constructor = Ci.QuadraticBezierCurve,
- Ci.QuadraticBezierCurve.prototype.getPoint = function(e) {
- var t = Ci.ShapeUtils.b2;
- 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))
- }
- ,
- Ci.QuadraticBezierCurve.prototype.getTangent = function(e) {
- var t = Ci.CurveUtils.tangentQuadraticBezier;
- 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()
- }
- ,
- Ci.CubicBezierCurve = function(e, t, i, n) {
- this.v0 = e,
- this.v1 = t,
- this.v2 = i,
- this.v3 = n
- }
- ,
- Ci.CubicBezierCurve.prototype = Object.create(Ci.Curve.prototype),
- Ci.CubicBezierCurve.prototype.constructor = Ci.CubicBezierCurve,
- Ci.CubicBezierCurve.prototype.getPoint = function(e) {
- var t = Ci.ShapeUtils.b3;
- 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))
- }
- ,
- Ci.CubicBezierCurve.prototype.getTangent = function(e) {
- var t = Ci.CurveUtils.tangentCubicBezier;
- 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()
- }
- ,
- Ci.SplineCurve = function(e) {
- this.points = null == e ? [] : e
- }
- ,
- Ci.SplineCurve.prototype = Object.create(Ci.Curve.prototype),
- Ci.SplineCurve.prototype.constructor = Ci.SplineCurve,
- Ci.SplineCurve.prototype.getPoint = function(e) {
- var t = this.points
- , i = (t.length - 1) * e
- , n = Math.floor(i)
- , r = i - n
- , o = t[0 === n ? n : n - 1]
- , a = t[n]
- , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
- , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
- , c = Ci.CurveUtils.interpolate;
- return new Ci.Vector2(c(o.x, a.x, s.x, l.x, r),c(o.y, a.y, s.y, l.y, r))
- }
- ,
- Ci.EllipseCurve = function(e, t, i, n, r, o, a, s) {
- this.aX = e,
- this.aY = t,
- this.xRadius = i,
- this.yRadius = n,
- this.aStartAngle = r,
- this.aEndAngle = o,
- this.aClockwise = a,
- this.aRotation = s || 0
- }
- ,
- Ci.EllipseCurve.prototype = Object.create(Ci.Curve.prototype),
- Ci.EllipseCurve.prototype.constructor = Ci.EllipseCurve,
- Ci.EllipseCurve.prototype.getPoint = function(e) {
- var t, i = this.aEndAngle - this.aStartAngle;
- i < 0 && (i += 2 * Math.PI),
- i > 2 * Math.PI && (i -= 2 * Math.PI),
- t = !0 === this.aClockwise ? this.aEndAngle + (1 - e) * (2 * Math.PI - i) : this.aStartAngle + e * i;
- var n = this.aX + this.xRadius * Math.cos(t)
- , r = this.aY + this.yRadius * Math.sin(t);
- if (0 !== this.aRotation) {
- var o = Math.cos(this.aRotation)
- , a = Math.sin(this.aRotation)
- , s = n
- , l = r;
- n = (s - this.aX) * o - (l - this.aY) * a + this.aX,
- r = (s - this.aX) * a + (l - this.aY) * o + this.aY
- }
- return new Ci.Vector2(n,r)
- }
- ,
- Ci.ArcCurve = function(e, t, i, n, r, o) {
- Ci.EllipseCurve.call(this, e, t, i, i, n, r, o)
- }
- ,
- Ci.ArcCurve.prototype = Object.create(Ci.EllipseCurve.prototype),
- Ci.ArcCurve.prototype.constructor = Ci.ArcCurve,
- Ci.LineCurve3 = Ci.Curve.create(function(e, t) {
- this.v1 = e,
- this.v2 = t
- }, function(e) {
- var t = new Ci.Vector3;
- return t.subVectors(this.v2, this.v1),
- t.multiplyScalar(e),
- t.add(this.v1),
- t
- }),
- Ci.QuadraticBezierCurve3 = Ci.Curve.create(function(e, t, i) {
- this.v0 = e,
- this.v1 = t,
- this.v2 = i
- }, function(e) {
- var t = Ci.ShapeUtils.b2;
- 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))
- }),
- Ci.CubicBezierCurve3 = Ci.Curve.create(function(e, t, i, n) {
- this.v0 = e,
- this.v1 = t,
- this.v2 = i,
- this.v3 = n
- }, function(e) {
- var t = Ci.ShapeUtils.b3;
- 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))
- }),
- Ci.SplineCurve3 = Ci.Curve.create(function(e) {
- console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
- this.points = null == e ? [] : e
- }, function(e) {
- var t = this.points
- , i = (t.length - 1) * e
- , n = Math.floor(i)
- , r = i - n
- , o = t[0 == n ? n : n - 1]
- , a = t[n]
- , s = t[n > t.length - 2 ? t.length - 1 : n + 1]
- , l = t[n > t.length - 3 ? t.length - 1 : n + 2]
- , c = Ci.CurveUtils.interpolate;
- 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))
- }),
- Ci.CatmullRomCurve3 = (qt = new Ci.Vector3,
- Xt = new xi,
- Zt = new xi,
- Kt = new xi,
- xi.prototype.init = function(e, t, i, n) {
- this.c0 = e,
- this.c1 = i,
- this.c2 = -3 * e + 3 * t - 2 * i - n,
- this.c3 = 2 * e - 2 * t + i + n
- }
- ,
- xi.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
- var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
- , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
- s *= o,
- l *= o,
- this.init(t, i, s, l)
- }
- ,
- xi.prototype.initCatmullRom = function(e, t, i, n, r) {
- this.init(t, i, r * (i - e), r * (n - t))
- }
- ,
- xi.prototype.calc = function(e) {
- var t = e * e
- , i = t * e;
- return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
- }
- ,
- Ci.Curve.create(function(e) {
- this.points = e || [],
- this.closed = !1
- }, function(e) {
- var t, i, n, r, o, a, s, l, c = this.points;
- if ((r = c.length) < 2 && console.log("duh, you need at least 2 points"),
- n = (t = (r - (this.closed ? 0 : 1)) * e) - (i = Math.floor(t)),
- this.closed ? i += 0 < i ? 0 : (Math.floor(Math.abs(i) / c.length) + 1) * c.length : 0 === n && i === r - 1 && (i = r - 2,
- n = 1),
- o = this.closed || 0 < i ? c[(i - 1) % r] : (qt.subVectors(c[0], c[1]).add(c[0]),
- qt),
- a = c[i % r],
- s = c[(i + 1) % r],
- l = this.closed || i + 2 < r ? c[(i + 2) % r] : (qt.subVectors(c[r - 1], c[r - 2]).add(c[r - 1]),
- qt),
- void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
- var h = "chordal" === this.type ? .5 : .25
- , u = Math.pow(o.distanceToSquared(a), h)
- , d = Math.pow(a.distanceToSquared(s), h)
- , p = Math.pow(s.distanceToSquared(l), h);
- d < 1e-4 && (d = 1),
- u < 1e-4 && (u = d),
- p < 1e-4 && (p = d),
- Xt.initNonuniformCatmullRom(o.x, a.x, s.x, l.x, u, d, p),
- Zt.initNonuniformCatmullRom(o.y, a.y, s.y, l.y, u, d, p),
- Kt.initNonuniformCatmullRom(o.z, a.z, s.z, l.z, u, d, p)
- } else if ("catmullrom" === this.type) {
- var f = void 0 !== this.tension ? this.tension : .5;
- Xt.initCatmullRom(o.x, a.x, s.x, l.x, f),
- Zt.initCatmullRom(o.y, a.y, s.y, l.y, f),
- Kt.initCatmullRom(o.z, a.z, s.z, l.z, f)
- }
- return new Ci.Vector3(Xt.calc(n),Zt.calc(n),Kt.calc(n))
- })),
- Ci.ClosedSplineCurve3 = function(e) {
- console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
- Ci.CatmullRomCurve3.call(this, e),
- this.type = "catmullrom",
- this.closed = !0
- }
- ,
- Ci.ClosedSplineCurve3.prototype = Object.create(Ci.CatmullRomCurve3.prototype),
- Ci.BoxGeometry = function(e, t, i, n, r, o) {
- Ci.Geometry.call(this),
- this.type = "BoxGeometry",
- this.parameters = {
- width: e,
- height: t,
- depth: i,
- widthSegments: n,
- heightSegments: r,
- depthSegments: o
- },
- this.fromBufferGeometry(new Ci.BoxBufferGeometry(e,t,i,n,r,o)),
- this.mergeVertices()
- }
- ,
- Ci.BoxGeometry.prototype = Object.create(Ci.Geometry.prototype),
- Ci.BoxGeometry.prototype.constructor = Ci.BoxGeometry,
- Ci.CubeGeometry = Ci.BoxGeometry,
- Ci.BoxBufferGeometry = function(e, t, i, n, r, o) {
- function a(e, t, i, n, r, o, a, s, l, c, h) {
- 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++)
- for (var E = I * d - f, _ = 0; _ < m; _++) {
- var b = _ * u - p;
- C[e] = b * n,
- C[t] = E * r,
- C[i] = g,
- P[D] = C.x,
- P[D + 1] = C.y,
- P[D + 2] = C.z,
- C[e] = 0,
- C[t] = 0,
- C[i] = 0 < s ? 1 : -1,
- O[D] = C.x,
- O[D + 1] = C.y,
- O[D + 2] = C.z,
- L[N] = _ / l,
- L[N + 1] = 1 - I / c,
- D += 3,
- N += 2,
- y += 1
- }
- for (I = 0; I < c; I++)
- for (_ = 0; _ < l; _++) {
- var w = B + _ + m * I
- , T = B + _ + m * (I + 1)
- , x = B + (_ + 1) + m * (I + 1)
- , S = B + (_ + 1) + m * I;
- R[F] = w,
- R[F + 1] = T,
- R[F + 2] = S,
- R[F + 3] = T,
- R[F + 4] = x,
- R[F + 5] = S,
- F += 6,
- A += 6
- }
- M.addGroup(V, A, h),
- V += A,
- B += y
- }
- Ci.BufferGeometry.call(this),
- this.type = "BoxBufferGeometry",
- this.parameters = {
- width: e,
- height: t,
- depth: i,
- widthSegments: n,
- heightSegments: r,
- depthSegments: o
- };
- var M = this;
- n = Math.floor(n) || 1,
- r = Math.floor(r) || 1,
- o = Math.floor(o) || 1;
- var s, l, c, h, u = (h = 0,
- h += (s = n) * (l = r) * 2,
- h += s * (c = o) * 2,
- 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;
- a("z", "y", "x", -1, -1, i, t, e, o, r, 0),
- a("z", "y", "x", 1, -1, i, t, -e, o, r, 1),
- a("x", "z", "y", 1, 1, e, i, t, n, o, 2),
- a("x", "z", "y", 1, -1, e, i, -t, n, o, 3),
- a("x", "y", "z", 1, -1, e, t, i, n, r, 4),
- a("x", "y", "z", -1, -1, e, t, -i, n, r, 5),
- this.setIndex(new Ci.BufferAttribute(R,1)),
- this.addAttribute("position", new Ci.BufferAttribute(P,3)),
- this.addAttribute("normal", new Ci.BufferAttribute(O,3)),
- this.addAttribute("uv", new Ci.BufferAttribute(L,2))
- }
- ,
- Ci.BoxBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
- Ci.BoxBufferGeometry.prototype.constructor = Ci.BoxBufferGeometry,
- Ci.CircleGeometry = function(e, t, i, n) {
- Ci.Geometry.call(this),
- this.type = "CircleGeometry",
- this.parameters = {
- radius: e,
- segments: t,
- thetaStart: i,
- thetaLength: n
- },
- this.fromBufferGeometry(new Ci.CircleBufferGeometry(e,t,i,n))
- }
- ,
- Ci.CircleGeometry.prototype = Object.create(Ci.Geometry.prototype),
- Ci.CircleGeometry.prototype.constructor = Ci.CircleGeometry,
- Ci.CircleBufferGeometry = function(e, t, i, n) {
- Ci.BufferGeometry.call(this),
- this.type = "CircleBufferGeometry",
- this.parameters = {
- radius: e,
- segments: t,
- thetaStart: i,
- thetaLength: n
- },
- e = e || 50,
- t = void 0 !== t ? Math.max(3, t) : 8,
- i = void 0 !== i ? i : 0,
- n = void 0 !== n ? n : 2 * Math.PI;
- var r = t + 2
- , o = new Float32Array(3 * r)
- , a = new Float32Array(3 * r)
- , s = new Float32Array(2 * r);
- a[2] = 1,
- s[0] = .5,
- s[1] = .5;
- for (var l = 0, c = 3, h = 2; l <= t; l++,
- c += 3,
- h += 2) {
- var u = i + l / t * n;
- o[c] = e * Math.cos(u),
- o[c + 1] = e * Math.sin(u),
- a[c + 2] = 1,
- s[h] = (o[c] / e + 1) / 2,
- s[h + 1] = (o[c + 1] / e + 1) / 2
- }
- var d = [];
- for (c = 1; c <= t; c++)
- d.push(c, c + 1, 0);
- this.setIndex(new Ci.BufferAttribute(new Uint16Array(d),1)),
- this.addAttribute("position", new Ci.BufferAttribute(o,3)),
- this.addAttribute("normal", new Ci.BufferAttribute(a,3)),
- this.addAttribute("uv", new Ci.BufferAttribute(s,2)),
- this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
- }
- ,
- Ci.CircleBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
- Ci.CircleBufferGeometry.prototype.constructor = Ci.CircleBufferGeometry,
- Ci.CylinderBufferGeometry = function(p, f, g, m, v, e, y, A) {
- function t(e) {
- var t, i, n, r = new Ci.Vector2, o = new Ci.Vector3, a = !0 === e ? p : f, s = !0 === e ? 1 : -1;
- for (i = b,
- t = 1; t <= m; t++)
- I.setXYZ(b, 0, x * s, 0),
- E.setXYZ(b, 0, s, 0),
- !0 === e ? (r.x = t / m,
- r.y = 0) : (r.x = (t - 1) / m,
- r.y = 1),
- _.setXY(b, r.x, r.y),
- b++;
- for (n = b,
- t = 0; t <= m; t++) {
- var l = t / m;
- o.x = a * Math.sin(l * A + y),
- o.y = x * s,
- o.z = a * Math.cos(l * A + y),
- I.setXYZ(b, o.x, o.y, o.z),
- E.setXYZ(b, 0, s, 0),
- _.setXY(b, l, !0 === e ? 1 : 0),
- b++
- }
- for (t = 0; t < m; t++) {
- var c = i + t
- , h = n + t;
- !0 === e ? (C.setX(w, h),
- w++,
- C.setX(w, h + 1)) : (C.setX(w, h + 1),
- w++,
- C.setX(w, h)),
- w++,
- C.setX(w, c),
- w++
- }
- }
- Ci.BufferGeometry.call(this),
- this.type = "CylinderBufferGeometry",
- this.parameters = {
- radiusTop: p,
- radiusBottom: f,
- height: g,
- radialSegments: m,
- heightSegments: v,
- openEnded: e,
- thetaStart: y,
- thetaLength: A
- },
- p = void 0 !== p ? p : 20,
- f = void 0 !== f ? f : 20,
- g = void 0 !== g ? g : 100,
- m = Math.floor(m) || 8,
- v = Math.floor(v) || 1,
- e = void 0 !== e && e,
- y = void 0 !== y ? y : 0,
- A = void 0 !== A ? A : 2 * Math.PI;
- var i, n, r = (n = (m + 1) * (v + 1),
- !1 === e && (n += 2 * (m + 1) + 2 * m),
- n), o = (i = m * v * 2 * 3,
- !1 === e && (i += 2 * m * 3),
- 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;
- (function() {
- var e, t, i = new Ci.Vector3, n = new Ci.Vector3, r = (f - p) / g;
- for (t = 0; t <= v; t++) {
- var o = []
- , a = t / v
- , s = a * (f - p) + p;
- for (e = 0; e <= m; e++) {
- var l = e / m;
- n.x = s * Math.sin(l * A + y),
- n.y = -a * g + x,
- n.z = s * Math.cos(l * A + y),
- I.setXYZ(b, n.x, n.y, n.z),
- i.copy(n),
- (0 === p && 0 === t || 0 === f && t === v) && (i.x = Math.sin(l * A + y),
- i.z = Math.cos(l * A + y)),
- i.setY(Math.sqrt(i.x * i.x + i.z * i.z) * r).normalize(),
- E.setXYZ(b, i.x, i.y, i.z),
- _.setXY(b, l, 1 - a),
- o.push(b),
- b++
- }
- T.push(o)
- }
- for (e = 0; e < m; e++)
- for (t = 0; t < v; t++) {
- var c = T[t][e]
- , h = T[t + 1][e]
- , u = T[t + 1][e + 1]
- , d = T[t][e + 1];
- C.setX(w, c),
- w++,
- C.setX(w, h),
- w++,
- C.setX(w, d),
- w++,
- C.setX(w, h),
- w++,
- C.setX(w, u),
- w++,
- C.setX(w, d),
- w++
- }
- }
- )(),
- !1 === e && (0 < p && t(!0),
- 0 < f && t(!1)),
- this.setIndex(C),
- this.addAttribute("position", I),
- this.addAttribute("normal", E),
- this.addAttribute("uv", _)
- }
- ,
- Ci.CylinderBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
- Ci.CylinderBufferGeometry.prototype.constructor = Ci.CylinderBufferGeometry,
- Ci.CylinderGeometry = function(e, t, i, n, r, o, a, s) {
- Ci.Geometry.call(this),
- this.type = "CylinderGeometry",
- this.parameters = {
- radiusTop: e,
- radiusBottom: t,
- height: i,
- radialSegments: n,
- heightSegments: r,
- openEnded: o,
- thetaStart: a,
- thetaLength: s
- },
- this.fromBufferGeometry(new Ci.CylinderBufferGeometry(e,t,i,n,r,o,a,s)),
- this.mergeVertices()
- }
- ,
- Ci.CylinderGeometry.prototype = Object.create(Ci.Geometry.prototype),
- Ci.CylinderGeometry.prototype.constructor = Ci.CylinderGeometry,
- Ci.EdgesGeometry = function(e, t) {
- function i(e, t) {
- return e - t
- }
- Ci.BufferGeometry.call(this),
- t = void 0 !== t ? t : 1;
- var n, r = Math.cos(Ci.Math.degToRad(t)), o = [0, 0], a = {}, s = ["a", "b", "c"];
- e instanceof Ci.BufferGeometry ? (n = new Ci.Geometry).fromBufferGeometry(e) : n = e.clone(),
- n.mergeVertices(),
- n.computeFaceNormals();
- for (var l = n.vertices, c = n.faces, h = 0, u = c.length; h < u; h++)
- for (var d = c[h], p = 0; p < 3; p++) {
- o[0] = d[s[p]],
- o[1] = d[s[(p + 1) % 3]],
- o.sort(i),
- void 0 === a[g = o.toString()] ? a[g] = {
- vert1: o[0],
- vert2: o[1],
- face1: h,
- face2: void 0
- } : a[g].face2 = h
- }
- var f = [];
- for (var g in a) {
- var m = a[g];
- if (void 0 === m.face2 || c[m.face1].normal.dot(c[m.face2].normal) <= r) {
- var v = l[m.vert1];
- f.push(v.x),
- f.push(v.y),
- f.push(v.z),
- v = l[m.vert2],
- f.push(v.x),
- f.push(v.y),
- f.push(v.z)
- }
- }
- this.addAttribute("position", new Ci.BufferAttribute(new Float32Array(f),3))
- }
- ,
- Ci.EdgesGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
- Ci.EdgesGeometry.prototype.constructor = Ci.EdgesGeometry,
- Ci.ExtrudeGeometry = function(e, t) {
- return void 0 === e ? void (e = []) : (Ci.Geometry.call(this),
- this.type = "ExtrudeGeometry",
- e = Array.isArray(e) ? e : [e],
- this.addShapeList(e, t),
- void this.computeFaceNormals())
- }
- ;
- Ci.ExtrudeGeometry.prototype = Object.create(Ci.Geometry.prototype),
- Ci.ExtrudeGeometry.prototype.constructor = Ci.ExtrudeGeometry,
- Ci.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
- for (var i = e.length, n = 0; n < i; n++) {
- var r = e[n];
- this.addShape(r, t)
- }
- }
- ,
- Ci.ExtrudeGeometry.prototype.addShape = function(e, t) {
- function i(e, t, i) {
- return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
- t.clone().multiplyScalar(i).add(e)
- }
- function n(e, t, i) {
- 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;
- if (Math.abs(u) > Number.EPSILON) {
- var d = Math.sqrt(h)
- , p = Math.sqrt(l * l + c * c)
- , f = t.x - s / d
- , g = t.y + a / d
- , m = ((i.x - c / p - f) * c - (i.y + l / p - g) * l) / (a * c - s * l)
- , v = (n = f + a * m - e.x) * n + (r = g + s * m - e.y) * r;
- if (v <= 2)
- return new Ci.Vector2(n,r);
- o = Math.sqrt(v / 2)
- } else {
- var y = !1;
- a > Number.EPSILON ? l > Number.EPSILON && (y = !0) : a < -Number.EPSILON ? l < -Number.EPSILON && (y = !0) : Math.sign(s) === Math.sign(c) && (y = !0),
- o = y ? (n = -s,
- r = a,
- Math.sqrt(h)) : (n = a,
- r = s,
- Math.sqrt(h / 2))
- }
- return new Ci.Vector2(n / o,r / o)
- }
- function r(e, t) {
- var i, n;
- for (G = e.length; 0 <= --G; ) {
- (n = (i = G) - 1) < 0 && (n = e.length - 1);
- var r = 0
- , o = A + 2 * m;
- for (r = 0; r < o; r++) {
- var a = U * r
- , s = U * (r + 1);
- l(t + i + a, t + n + a, t + n + s, t + i + s, e, r, o, i, n)
- }
- }
- }
- function o(e, t, i) {
- T.vertices.push(new Ci.Vector3(e,t,i))
- }
- function a(e, t, i) {
- e += x,
- t += x,
- i += x,
- T.faces.push(new Ci.Face3(e,t,i,null,null,0));
- var n = E.generateTopUV(T, e, t, i);
- T.faceVertexUvs[0].push(n)
- }
- function l(e, t, i, n) {
- e += x,
- t += x,
- i += x,
- n += x,
- T.faces.push(new Ci.Face3(e,t,n,null,null,1)),
- T.faces.push(new Ci.Face3(t,i,n,null,null,1));
- var r = E.generateSideWallUV(T, e, t, i, n);
- T.faceVertexUvs[0].push([r[0], r[1], r[3]]),
- T.faceVertexUvs[0].push([r[1], r[2], r[3]])
- }
- 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;
- C && (s = C.getSpacedPoints(A),
- v = !(I = !0),
- c = void 0 !== t.frames ? t.frames : new Ci.TubeGeometry.FrenetFrames(C,A,!1),
- h = new Ci.Vector3,
- u = new Ci.Vector3,
- d = new Ci.Vector3),
- v || (g = f = m = 0);
- var _, b, w, T = this, x = this.vertices.length, S = e.extractPoints(y), M = S.shape, R = S.holes, P = !Ci.ShapeUtils.isClockWise(M);
- if (P) {
- for (M = M.reverse(),
- b = 0,
- w = R.length; b < w; b++)
- _ = R[b],
- Ci.ShapeUtils.isClockWise(_) && (R[b] = _.reverse());
- P = !1
- }
- var O = Ci.ShapeUtils.triangulateShape(M, R)
- , L = M;
- for (b = 0,
- w = R.length; b < w; b++)
- _ = R[b],
- M = M.concat(_);
- 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++,
- j++,
- Y++)
- j === W && (j = 0),
- Y === W && (Y = 0),
- z[G] = n(L[G], L[j], L[Y]);
- var q, X, Z = [], K = z.concat();
- for (b = 0,
- w = R.length; b < w; b++) {
- for (_ = R[b],
- q = [],
- G = 0,
- j = (W = _.length) - 1,
- Y = G + 1; G < W; G++,
- j++,
- Y++)
- j === W && (j = 0),
- Y === W && (Y = 0),
- q[G] = n(_[G], _[j], _[Y]);
- Z.push(q),
- K = K.concat(q)
- }
- for (D = 0; D < m; D++) {
- for (B = f * (1 - (F = D / m)),
- N = g * Math.sin(F * Math.PI / 2),
- G = 0,
- W = L.length; G < W; G++)
- o((V = i(L[G], z[G], N)).x, V.y, -B);
- for (b = 0,
- w = R.length; b < w; b++)
- for (_ = R[b],
- q = Z[b],
- G = 0,
- W = _.length; G < W; G++)
- o((V = i(_[G], q[G], N)).x, V.y, -B)
- }
- for (N = g,
- G = 0; G < U; G++)
- V = v ? i(M[G], K[G], N) : M[G],
- I ? (u.copy(c.normals[0]).multiplyScalar(V.x),
- h.copy(c.binormals[0]).multiplyScalar(V.y),
- d.copy(s[0]).add(u).add(h),
- o(d.x, d.y, d.z)) : o(V.x, V.y, 0);
- for (X = 1; X <= A; X++)
- for (G = 0; G < U; G++)
- V = v ? i(M[G], K[G], N) : M[G],
- I ? (u.copy(c.normals[X]).multiplyScalar(V.x),
- h.copy(c.binormals[X]).multiplyScalar(V.y),
- d.copy(s[X]).add(u).add(h),
- o(d.x, d.y, d.z)) : o(V.x, V.y, p / A * X);
- for (D = m - 1; 0 <= D; D--) {
- for (B = f * (1 - (F = D / m)),
- N = g * Math.sin(F * Math.PI / 2),
- G = 0,
- W = L.length; G < W; G++)
- o((V = i(L[G], z[G], N)).x, V.y, p + B);
- for (b = 0,
- w = R.length; b < w; b++)
- for (_ = R[b],
- q = Z[b],
- G = 0,
- W = _.length; G < W; G++)
- V = i(_[G], q[G], N),
- I ? o(V.x, V.y + s[A - 1].y, s[A - 1].x + B) : o(V.x, V.y, p + B)
- }
- (function() {
- if (v) {
- var e = 0
- , t = U * e;
- for (G = 0; G < H; G++)
- a((k = O[G])[2] + t, k[1] + t, k[0] + t);
- for (t = U * (e = A + 2 * m),
- G = 0; G < H; G++)
- a((k = O[G])[0] + t, k[1] + t, k[2] + t)
- } else {
- for (G = 0; G < H; G++)
- a((k = O[G])[2], k[1], k[0]);
- for (G = 0; G < H; G++)
- a((k = O[G])[0] + U * A, k[1] + U * A, k[2] + U * A)
- }
- }
- )(),
- function() {
- var e = 0;
- for (r(L, e),
- e += L.length,
- b = 0,
- w = R.length; b < w; b++)
- r(_ = R[b], e),
- e += _.length
- }()
- }
- ,
- Ci.ExtrudeGeometry.WorldUVGenerator = {
- generateTopUV: function(e, t, i, n) {
- var r = e.vertices
- , o = r[t]
- , a = r[i]
- , s = r[n];
- return [new Ci.Vector2(o.x,o.y), new Ci.Vector2(a.x,a.y), new Ci.Vector2(s.x,s.y)]
- },
- generateSideWallUV: function(e, t, i, n, r) {
- var o = e.vertices
- , a = o[t]
- , s = o[i]
- , l = o[n]
- , c = o[r];
- 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)]
- }
- },
- Ci.ShapeGeometry = function(e, t) {
- Ci.Geometry.call(this),
- !(this.type = "ShapeGeometry") === Array.isArray(e) && (e = [e]),
- this.addShapeList(e, t),
- this.computeFaceNormals()
- }
- ,
- Ci.ShapeGeometry.prototype = Object.create(Ci.Geometry.prototype),
- Ci.ShapeGeometry.prototype.constructor = Ci.ShapeGeometry,
- Ci.ShapeGeometry.prototype.addShapeList = function(e, t) {
- for (var i = 0, n = e.length; i < n; i++)
- this.addShape(e[i], t);
- return this
- }
- ,
- Ci.ShapeGeometry.prototype.addShape = function(e, t) {
- void 0 === t && (t = {});
- 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);
- if (d) {
- for (h = h.reverse(),
- i = 0,
- n = u.length; i < n; i++)
- r = u[i],
- Ci.ShapeUtils.isClockWise(r) && (u[i] = r.reverse());
- d = !1
- }
- var p = Ci.ShapeUtils.triangulateShape(h, u);
- for (i = 0,
- n = u.length; i < n; i++)
- r = u[i],
- h = h.concat(r);
- var f, g, m = h.length, v = p.length;
- for (i = 0; i < m; i++)
- f = h[i],
- this.vertices.push(new Ci.Vector3(f.x,f.y,0));
- for (i = 0; i < v; i++) {
- var y = (g = p[i])[0] + l
- , A = g[1] + l
- , C = g[2] + l;
- this.faces.push(new Ci.Face3(y,A,C,null,null,a)),
- this.faceVertexUvs[0].push(s.generateTopUV(this, y, A, C))
- }
- }
- ,
- Ci.LatheBufferGeometry = function(e, t, i, n) {
- Ci.BufferGeometry.call(this),
- this.type = "LatheBufferGeometry",
- this.parameters = {
- points: e,
- segments: t,
- phiStart: i,
- phiLength: n
- },
- t = Math.floor(t) || 12,
- i = i || 0,
- n = n || 2 * Math.PI,
- n = Ci.Math.clamp(n, 0, 2 * Math.PI);
- 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,
- 1 / t), g = new Ci.Vector3, m = new Ci.Vector2;
- for (o = 0; o <= t; o++) {
- var v = i + o * f * n
- , y = Math.sin(v)
- , A = Math.cos(v);
- for (a = 0; a <= e.length - 1; a++)
- g.x = e[a].x * y,
- g.y = e[a].y,
- g.z = e[a].x * A,
- h.setXYZ(d, g.x, g.y, g.z),
- m.x = o / t,
- m.y = a / (e.length - 1),
- u.setXY(d, m.x, m.y),
- d++
- }
- for (o = 0; o < t; o++)
- for (a = 0; a < e.length - 1; a++) {
- var C = r = a + o * e.length
- , I = r + e.length
- , E = r + e.length + 1
- , _ = r + 1;
- c.setX(p, C),
- p++,
- c.setX(p, I),
- p++,
- c.setX(p, _),
- p++,
- c.setX(p, I),
- p++,
- c.setX(p, E),
- p++,
- c.setX(p, _),
- p++
- }
- if (this.setIndex(c),
- this.addAttribute("position", h),
- this.addAttribute("uv", u),
- this.computeVertexNormals(),
- n === 2 * Math.PI) {
- var b = this.attributes.normal.array
- , w = new Ci.Vector3
- , T = new Ci.Vector3
- , x = new Ci.Vector3;
- for (r = t * e.length * 3,
- a = o = 0; o < e.length; o++,
- a += 3)
- w.x = b[a + 0],
- w.y = b[a + 1],
- w.z = b[a + 2],
- T.x = b[r + a + 0],
- T.y = b[r + a + 1],
- T.z = b[r + a + 2],
- x.addVectors(w, T).normalize(),
- b[a + 0] = b[r + a + 0] = x.x,
- b[a + 1] = b[r + a + 1] = x.y,
- b[a + 2] = b[r + a + 2] = x.z
- }
- }
- ,
- Ci.LatheBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
- Ci.LatheBufferGeometry.prototype.constructor = Ci.LatheBufferGeometry,
- Ci.LatheGeometry = function(e, t, i, n) {
- Ci.Geometry.call(this),
- this.type = "LatheGeometry",
- this.parameters = {
- points: e,
- segments: t,
- phiStart: i,
- phiLength: n
- },
- this.fromBufferGeometry(new Ci.LatheBufferGeometry(e,t,i,n)),
- this.mergeVertices()
- }
- ,
- Ci.LatheGeometry.prototype = Object.create(Ci.Geometry.prototype),
- Ci.LatheGeometry.prototype.constructor = Ci.LatheGeometry,
- Ci.PlaneGeometry = function(e, t, i, n) {
- Ci.Geometry.call(this),
- this.type = "PlaneGeometry",
- this.parameters = {
- width: e,
- height: t,
- widthSegments: i,
- heightSegments: n
- },
- this.fromBufferGeometry(new Ci.PlaneBufferGeometry(e,t,i,n))
- }
- ,
- Ci.PlaneGeometry.prototype = Object.create(Ci.Geometry.prototype),
- Ci.PlaneGeometry.prototype.constructor = Ci.PlaneGeometry,
- Ci.PlaneBufferGeometry = function(e, t, i, n) {
- Ci.BufferGeometry.call(this),
- this.type = "PlaneBufferGeometry",
- this.parameters = {
- width: e,
- height: t,
- widthSegments: i,
- heightSegments: n
- };
- 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++)
- for (var y = v * u - o, A = 0; A < l; A++) {
- var C = A * h - r;
- d[g] = C,
- d[g + 1] = -y,
- p[g + 2] = 1,
- f[m] = A / a,
- f[m + 1] = 1 - v / s,
- g += 3,
- m += 2
- }
- g = 0;
- var I = new (65535 < d.length / 3 ? Uint32Array : Uint16Array)(a * s * 6);
- for (v = 0; v < s; v++)
- for (A = 0; A < a; A++) {
- var E = A + l * v
- , _ = A + l * (v + 1)
- , b = A + 1 + l * (v + 1)
- , w = A + 1 + l * v;
- I[g] = E,
- I[g + 1] = _,
- I[g + 2] = w,
- I[g + 3] = _,
- I[g + 4] = b,
- I[g + 5] = w,
- g += 6
- }
- this.setIndex(new Ci.BufferAttribute(I,1)),
- this.addAttribute("position", new Ci.BufferAttribute(d,3)),
- this.addAttribute("normal", new Ci.BufferAttribute(p,3)),
- this.addAttribute("uv", new Ci.BufferAttribute(f,2))
- }
- ,
- Ci.PlaneBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
- Ci.PlaneBufferGeometry.prototype.constructor = Ci.PlaneBufferGeometry,
- Ci.RingBufferGeometry = function(e, t, i, n, r, o) {
- Ci.BufferGeometry.call(this),
- this.type = "RingBufferGeometry",
- this.parameters = {
- innerRadius: e,
- outerRadius: t,
- thetaSegments: i,
- phiSegments: n,
- thetaStart: r,
- thetaLength: o
- },
- e = e || 20,
- t = t || 50,
- r = void 0 !== r ? r : 0,
- o = void 0 !== o ? o : 2 * Math.PI;
- 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;
- for (s = 0; s <= n; s++) {
- for (l = 0; l <= i; l++)
- a = r + l / i * o,
- A.x = v * Math.cos(a),
- A.y = v * Math.sin(a),
- d.setXYZ(g, A.x, A.y, A.z),
- p.setXYZ(g, 0, 0, 1),
- C.x = (A.x / t + 1) / 2,
- C.y = (A.y / t + 1) / 2,
- f.setXY(g, C.x, C.y),
- g++;
- v += y
- }
- for (s = 0; s < n; s++) {
- var I = s * (i + 1);
- for (l = 0; l < i; l++) {
- var E = a = l + I
- , _ = a + i + 1
- , b = a + i + 2
- , w = a + 1;
- u.setX(m, E),
- m++,
- u.setX(m, _),
- m++,
- u.setX(m, b),
- m++,
- u.setX(m, E),
- m++,
- u.setX(m, b),
- m++,
- u.setX(m, w),
- m++
- }
- }
- this.setIndex(u),
- this.addAttribute("position", d),
- this.addAttribute("normal", p),
- this.addAttribute("uv", f)
- }
- ,
- Ci.RingBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
- Ci.RingBufferGeometry.prototype.constructor = Ci.RingBufferGeometry,
- Ci.RingGeometry = function(e, t, i, n, r, o) {
- Ci.Geometry.call(this),
- this.type = "RingGeometry",
- this.parameters = {
- innerRadius: e,
- outerRadius: t,
- thetaSegments: i,
- phiSegments: n,
- thetaStart: r,
- thetaLength: o
- },
- this.fromBufferGeometry(new Ci.RingBufferGeometry(e,t,i,n,r,o))
- }
- ,
- Ci.RingGeometry.prototype = Object.create(Ci.Geometry.prototype),
- Ci.RingGeometry.prototype.constructor = Ci.RingGeometry,
- Ci.SphereGeometry = function(e, t, i, n, r, o, a) {
- Ci.Geometry.call(this),
- this.type = "SphereGeometry",
- this.parameters = {
- radius: e,
- widthSegments: t,
- heightSegments: i,
- phiStart: n,
- phiLength: r,
- thetaStart: o,
- thetaLength: a
- },
- this.fromBufferGeometry(new Ci.SphereBufferGeometry(e,t,i,n,r,o,a))
- }
- ,
- Ci.SphereGeometry.prototype = Object.create(Ci.Geometry.prototype),
- Ci.SphereGeometry.prototype.constructor = Ci.SphereGeometry,
- Ci.SphereBufferGeometry = function(e, t, i, n, r, o, a) {
- Ci.BufferGeometry.call(this),
- this.type = "SphereBufferGeometry",
- this.parameters = {
- radius: e,
- widthSegments: t,
- heightSegments: i,
- phiStart: n,
- phiLength: r,
- thetaStart: o,
- thetaLength: a
- },
- e = e || 50,
- t = Math.max(3, Math.floor(t) || 8),
- i = Math.max(2, Math.floor(i) || 6),
- n = void 0 !== n ? n : 0,
- r = void 0 !== r ? r : 2 * Math.PI;
- 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++) {
- for (var m = [], v = g / i, y = 0; y <= t; y++) {
- var A = y / t
- , C = -e * Math.cos(n + A * r) * Math.sin(o + v * a)
- , I = e * Math.cos(o + v * a)
- , E = e * Math.sin(n + A * r) * Math.sin(o + v * a);
- f.set(C, I, E).normalize(),
- c.setXYZ(d, C, I, E),
- h.setXYZ(d, f.x, f.y, f.z),
- u.setXY(d, A, 1 - v),
- m.push(d),
- d++
- }
- p.push(m)
- }
- var _ = [];
- for (g = 0; g < i; g++)
- for (y = 0; y < t; y++) {
- var b = p[g][y + 1]
- , w = p[g][y]
- , T = p[g + 1][y]
- , x = p[g + 1][y + 1];
- (0 !== g || 0 < o) && _.push(b, w, x),
- (g !== i - 1 || s < Math.PI) && _.push(w, T, x)
- }
- this.setIndex(new (65535 < c.count ? Ci.Uint32Attribute : Ci.Uint16Attribute)(_,1)),
- this.addAttribute("position", c),
- this.addAttribute("normal", h),
- this.addAttribute("uv", u),
- this.boundingSphere = new Ci.Sphere(new Ci.Vector3,e)
- }
- ,
- Ci.SphereBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
- Ci.SphereBufferGeometry.prototype.constructor = Ci.SphereBufferGeometry,
- Ci.TextGeometry = function(e, t) {
- var i = (t = t || {}).font;
- if (i instanceof Ci.Font == 0)
- return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
- new Ci.Geometry;
- var n = i.generateShapes(e, t.size, t.curveSegments);
- t.amount = void 0 !== t.height ? t.height : 50,
- void 0 === t.bevelThickness && (t.bevelThickness = 10),
- void 0 === t.bevelSize && (t.bevelSize = 8),
- void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
- Ci.ExtrudeGeometry.call(this, n, t),
- this.type = "TextGeometry"
- }
- ,
- Ci.TextGeometry.prototype = Object.create(Ci.ExtrudeGeometry.prototype),
- Ci.TextGeometry.prototype.constructor = Ci.TextGeometry,
- Ci.TorusBufferGeometry = function(e, t, i, n, r) {
- Ci.BufferGeometry.call(this),
- this.type = "TorusBufferGeometry",
- this.parameters = {
- radius: e,
- tube: t,
- radialSegments: i,
- tubularSegments: n,
- arc: r
- },
- e = e || 100,
- t = t || 40,
- i = Math.floor(i) || 8,
- n = Math.floor(n) || 6,
- r = r || 2 * Math.PI;
- 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;
- for (o = 0; o <= i; o++)
- for (a = 0; a <= n; a++) {
- var A = a / n * r
- , C = o / i * Math.PI * 2;
- v.x = (e + t * Math.cos(C)) * Math.cos(A),
- v.y = (e + t * Math.cos(C)) * Math.sin(A),
- v.z = t * Math.sin(C),
- h[p] = v.x,
- h[p + 1] = v.y,
- h[p + 2] = v.z,
- m.x = e * Math.cos(A),
- m.y = e * Math.sin(A),
- y.subVectors(v, m).normalize(),
- u[p] = y.x,
- u[p + 1] = y.y,
- u[p + 2] = y.z,
- d[f] = a / n,
- d[f + 1] = o / i,
- p += 3,
- f += 2
- }
- for (o = 1; o <= i; o++)
- for (a = 1; a <= n; a++) {
- var I = (n + 1) * o + a - 1
- , E = (n + 1) * (o - 1) + a - 1
- , _ = (n + 1) * (o - 1) + a
- , b = (n + 1) * o + a;
- c[g] = I,
- c[g + 1] = E,
- c[g + 2] = b,
- c[g + 3] = E,
- c[g + 4] = _,
- c[g + 5] = b,
- g += 6
- }
- this.setIndex(new Ci.BufferAttribute(c,1)),
- this.addAttribute("position", new Ci.BufferAttribute(h,3)),
- this.addAttribute("normal", new Ci.BufferAttribute(u,3)),
- this.addAttribute("uv", new Ci.BufferAttribute(d,2))
- }
- ,
- Ci.TorusBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
- Ci.TorusBufferGeometry.prototype.constructor = Ci.TorusBufferGeometry,
- Ci.TorusGeometry = function(e, t, i, n, r) {
- Ci.Geometry.call(this),
- this.type = "TorusGeometry",
- this.parameters = {
- radius: e,
- tube: t,
- radialSegments: i,
- tubularSegments: n,
- arc: r
- },
- this.fromBufferGeometry(new Ci.TorusBufferGeometry(e,t,i,n,r))
- }
- ,
- Ci.TorusGeometry.prototype = Object.create(Ci.Geometry.prototype),
- Ci.TorusGeometry.prototype.constructor = Ci.TorusGeometry,
- Ci.TorusKnotBufferGeometry = function(e, t, i, n, r, o) {
- function a(e, t, i, n, r) {
- var o = Math.cos(e)
- , a = Math.sin(e)
- , s = i / t * e
- , l = Math.cos(s);
- r.x = n * (2 + l) * .5 * o,
- r.y = n * (2 + l) * a * .5,
- r.z = n * Math.sin(s) * .5
- }
- Ci.BufferGeometry.call(this),
- this.type = "TorusKnotBufferGeometry",
- this.parameters = {
- radius: e,
- tube: t,
- tubularSegments: i,
- radialSegments: n,
- p: r,
- q: o
- },
- e = e || 100,
- t = t || 40,
- i = Math.floor(i) || 64,
- r = r || 2,
- o = o || 3;
- 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;
- for (s = 0; s <= i; ++s) {
- var w = s / i * r * Math.PI * 2;
- for (a(w, r, o, e, C),
- a(.01 + w, r, o, e, I),
- _.subVectors(I, C),
- b.addVectors(I, C),
- E.crossVectors(_, b),
- b.crossVectors(E, _),
- E.normalize(),
- b.normalize(),
- l = 0; l <= n; ++l) {
- var T = l / n * Math.PI * 2
- , x = -t * Math.cos(T)
- , S = t * Math.sin(T);
- v.x = C.x + (x * b.x + S * E.x),
- v.y = C.y + (x * b.y + S * E.y),
- v.z = C.z + (x * b.z + S * E.z),
- d.setXYZ(g, v.x, v.y, v.z),
- y.subVectors(v, C).normalize(),
- p.setXYZ(g, y.x, y.y, y.z),
- A.x = s / i,
- A.y = l / n,
- f.setXY(g, A.x, A.y),
- g++
- }
- }
- for (l = 1; l <= i; l++)
- for (s = 1; s <= n; s++) {
- var M = (n + 1) * (l - 1) + (s - 1)
- , R = (n + 1) * l + (s - 1)
- , P = (n + 1) * l + s
- , O = (n + 1) * (l - 1) + s;
- u.setX(m, M),
- m++,
- u.setX(m, R),
- m++,
- u.setX(m, O),
- m++,
- u.setX(m, R),
- m++,
- u.setX(m, P),
- m++,
- u.setX(m, O),
- m++
- }
- this.setIndex(u),
- this.addAttribute("position", d),
- this.addAttribute("normal", p),
- this.addAttribute("uv", f)
- }
- ,
- Ci.TorusKnotBufferGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
- Ci.TorusKnotBufferGeometry.prototype.constructor = Ci.TorusKnotBufferGeometry,
- Ci.TorusKnotGeometry = function(e, t, i, n, r, o, a) {
- Ci.Geometry.call(this),
- this.type = "TorusKnotGeometry",
- this.parameters = {
- radius: e,
- tube: t,
- tubularSegments: i,
- radialSegments: n,
- p: r,
- q: o
- },
- void 0 !== a && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
- this.fromBufferGeometry(new Ci.TorusKnotBufferGeometry(e,t,i,n,r,o)),
- this.mergeVertices()
- }
- ,
- Ci.TorusKnotGeometry.prototype = Object.create(Ci.Geometry.prototype),
- Ci.TorusKnotGeometry.prototype.constructor = Ci.TorusKnotGeometry,
- Ci.TubeGeometry = function(e, t, i, n, r, o) {
- Ci.Geometry.call(this),
- this.type = "TubeGeometry",
- this.parameters = {
- path: e,
- segments: t,
- radius: i,
- radialSegments: n,
- closed: r,
- taper: o
- },
- t = t || 64,
- i = i || 1,
- n = n || 8,
- r = r || !1,
- o = o || Ci.TubeGeometry.NoTaper;
- 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;
- for (this.tangents = D,
- this.normals = N,
- this.binormals = F,
- f = 0; f < P; f++)
- for (M[f] = [],
- l = f / (P - 1),
- p = e.getPointAt(l),
- D[f],
- a = N[f],
- s = F[f],
- h = i * o(l),
- g = 0; g < n; g++)
- c = g / n * 2 * Math.PI,
- u = -h * Math.cos(c),
- d = h * Math.sin(c),
- O.copy(p),
- O.x += u * a.x + d * s.x,
- O.y += u * a.y + d * s.y,
- O.z += u * a.z + d * s.z,
- M[f][g] = (T = O.x,
- x = O.y,
- S = O.z,
- R.vertices.push(new Ci.Vector3(T,x,S)) - 1);
- for (f = 0; f < t; f++)
- for (g = 0; g < n; g++)
- m = r ? (f + 1) % t : f + 1,
- v = (g + 1) % n,
- y = M[f][g],
- A = M[m][g],
- C = M[m][v],
- I = M[f][v],
- E = new Ci.Vector2(f / t,g / n),
- _ = new Ci.Vector2((f + 1) / t,g / n),
- b = new Ci.Vector2((f + 1) / t,(g + 1) / n),
- w = new Ci.Vector2(f / t,(g + 1) / n),
- this.faces.push(new Ci.Face3(y,A,I)),
- this.faceVertexUvs[0].push([E, _, w]),
- this.faces.push(new Ci.Face3(A,C,I)),
- this.faceVertexUvs[0].push([_.clone(), b, w.clone()]);
- this.computeFaceNormals(),
- this.computeVertexNormals()
- }
- ,
- Ci.TubeGeometry.prototype = Object.create(Ci.Geometry.prototype),
- Ci.TubeGeometry.prototype.constructor = Ci.TubeGeometry,
- Ci.TubeGeometry.NoTaper = function(e) {
- return 1
- }
- ,
- Ci.TubeGeometry.SinusoidalTaper = function(e) {
- return Math.sin(Math.PI * e)
- }
- ,
- Ci.TubeGeometry.FrenetFrames = function(e, t, i) {
- 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;
- for (this.tangents = u,
- this.normals = d,
- this.binormals = p,
- l = 0; l < m; l++)
- c = l / (m - 1),
- u[l] = e.getTangentAt(c),
- u[l].normalize();
- for (d[0] = new Ci.Vector3,
- p[0] = new Ci.Vector3,
- r = Number.MAX_VALUE,
- o = Math.abs(u[0].x),
- a = Math.abs(u[0].y),
- s = Math.abs(u[0].z),
- o <= r && (r = o,
- h.set(1, 0, 0)),
- a <= r && (r = a,
- h.set(0, 1, 0)),
- s <= r && h.set(0, 0, 1),
- f.crossVectors(u[0], h).normalize(),
- d[0].crossVectors(u[0], f),
- p[0].crossVectors(u[0], d[0]),
- l = 1; l < m; l++)
- d[l] = d[l - 1].clone(),
- p[l] = p[l - 1].clone(),
- f.crossVectors(u[l - 1], u[l]),
- f.length() > Number.EPSILON && (f.normalize(),
- n = Math.acos(Ci.Math.clamp(u[l - 1].dot(u[l]), -1, 1)),
- d[l].applyMatrix4(g.makeRotationAxis(f, n))),
- p[l].crossVectors(u[l], d[l]);
- if (i)
- for (n = Math.acos(Ci.Math.clamp(d[0].dot(d[m - 1]), -1, 1)),
- n /= m - 1,
- 0 < u[0].dot(f.crossVectors(d[0], d[m - 1])) && (n = -n),
- l = 1; l < m; l++)
- d[l].applyMatrix4(g.makeRotationAxis(u[l], n * l)),
- p[l].crossVectors(u[l], d[l])
- }
- ,
- Ci.PolyhedronGeometry = function(e, t, i, n) {
- function f(e) {
- var t = e.normalize().clone();
- t.index = m.vertices.push(t) - 1;
- var i = a(e) / 2 / Math.PI + .5
- , n = function(e) {
- return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
- }(e) / Math.PI + .5;
- return t.uv = new Ci.Vector2(i,1 - n),
- t
- }
- function g(e, t, i, n) {
- var r = new Ci.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,n);
- m.faces.push(r),
- y.copy(e).add(t).add(i).divideScalar(3);
- var o = a(y);
- m.faceVertexUvs[0].push([s(e.uv, e, o), s(t.uv, t, o), s(i.uv, i, o)])
- }
- function r(e, t) {
- 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++) {
- a[l] = [];
- 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++)
- a[l][d] = 0 === d && l === i ? c : f(c.clone().lerp(h, d / u))
- }
- for (l = 0; l < i; l++)
- for (d = 0; d < 2 * (i - l) - 1; d++) {
- var p = Math.floor(d / 2);
- 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)
- }
- }
- function a(e) {
- return Math.atan2(e.z, -e.x)
- }
- function s(e, t, i) {
- return i < 0 && 1 === e.x && (e = new Ci.Vector2(e.x - 1,e.y)),
- 0 === t.x && 0 === t.z && (e = new Ci.Vector2(i / 2 / Math.PI + .5,e.y)),
- e.clone()
- }
- Ci.Geometry.call(this),
- this.type = "PolyhedronGeometry",
- this.parameters = {
- vertices: e,
- indices: t,
- radius: i,
- detail: n
- },
- i = i || 1,
- n = n || 0;
- for (var m = this, o = 0, l = e.length; o < l; o += 3)
- f(new Ci.Vector3(e[o],e[o + 1],e[o + 2]));
- var c = this.vertices
- , h = []
- , u = (o = 0,
- 0);
- for (l = t.length; o < l; o += 3,
- u++) {
- var d = c[t[o]]
- , p = c[t[o + 1]]
- , v = c[t[o + 2]];
- h[u] = new Ci.Face3(d.index,p.index,v.index,[d.clone(), p.clone(), v.clone()],void 0,u)
- }
- var y = new Ci.Vector3;
- for (o = 0,
- l = h.length; o < l; o++)
- r(h[o], n);
- for (o = 0,
- l = this.faceVertexUvs[0].length; o < l; o++) {
- var A = this.faceVertexUvs[0][o]
- , C = A[0].x
- , I = A[1].x
- , E = A[2].x
- , _ = Math.max(C, I, E)
- , b = Math.min(C, I, E);
- .9 < _ && b < .1 && (C < .2 && (A[0].x += 1),
- I < .2 && (A[1].x += 1),
- E < .2 && (A[2].x += 1))
- }
- for (o = 0,
- l = this.vertices.length; o < l; o++)
- this.vertices[o].multiplyScalar(i);
- this.mergeVertices(),
- this.computeFaceNormals(),
- this.boundingSphere = new Ci.Sphere(new Ci.Vector3,i)
- }
- ,
- Ci.PolyhedronGeometry.prototype = Object.create(Ci.Geometry.prototype),
- Ci.PolyhedronGeometry.prototype.constructor = Ci.PolyhedronGeometry,
- Ci.DodecahedronGeometry = function(e, t) {
- var i = (1 + Math.sqrt(5)) / 2
- , n = 1 / i
- , 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];
- 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),
- this.type = "DodecahedronGeometry",
- this.parameters = {
- radius: e,
- detail: t
- }
- }
- ,
- Ci.DodecahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
- Ci.DodecahedronGeometry.prototype.constructor = Ci.DodecahedronGeometry,
- Ci.IcosahedronGeometry = function(e, t) {
- var i = (1 + Math.sqrt(5)) / 2
- , 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];
- 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),
- this.type = "IcosahedronGeometry",
- this.parameters = {
- radius: e,
- detail: t
- }
- }
- ,
- Ci.IcosahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
- Ci.IcosahedronGeometry.prototype.constructor = Ci.IcosahedronGeometry,
- Ci.OctahedronGeometry = function(e, t) {
- 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),
- this.type = "OctahedronGeometry",
- this.parameters = {
- radius: e,
- detail: t
- }
- }
- ,
- Ci.OctahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
- Ci.OctahedronGeometry.prototype.constructor = Ci.OctahedronGeometry,
- Ci.TetrahedronGeometry = function(e, t) {
- 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),
- this.type = "TetrahedronGeometry",
- this.parameters = {
- radius: e,
- detail: t
- }
- }
- ,
- Ci.TetrahedronGeometry.prototype = Object.create(Ci.PolyhedronGeometry.prototype),
- Ci.TetrahedronGeometry.prototype.constructor = Ci.TetrahedronGeometry,
- Ci.ParametricGeometry = function(e, t, i) {
- Ci.Geometry.call(this),
- this.type = "ParametricGeometry",
- this.parameters = {
- func: e,
- slices: t,
- stacks: i
- };
- 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;
- for (n = 0; n <= i; n++)
- for (a = n / i,
- r = 0; r <= t; r++)
- o = e(r / t, a),
- g.push(o);
- for (n = 0; n < i; n++)
- for (r = 0; r < t; r++)
- l = (s = n * y + r) + 1,
- c = (n + 1) * y + r + 1,
- h = (n + 1) * y + r,
- u = new Ci.Vector2(r / t,n / i),
- d = new Ci.Vector2((r + 1) / t,n / i),
- p = new Ci.Vector2((r + 1) / t,(n + 1) / i),
- f = new Ci.Vector2(r / t,(n + 1) / i),
- m.push(new Ci.Face3(s,l,h)),
- v.push([u, d, f]),
- m.push(new Ci.Face3(l,c,h)),
- v.push([d.clone(), p, f.clone()]);
- this.computeFaceNormals(),
- this.computeVertexNormals()
- }
- ,
- Ci.ParametricGeometry.prototype = Object.create(Ci.Geometry.prototype),
- Ci.ParametricGeometry.prototype.constructor = Ci.ParametricGeometry,
- Ci.WireframeGeometry = function(e) {
- function t(e, t) {
- return e - t
- }
- Ci.BufferGeometry.call(this);
- var i = [0, 0]
- , n = {}
- , r = ["a", "b", "c"];
- if (e instanceof Ci.Geometry) {
- for (var o = e.vertices, a = e.faces, s = 0, l = new Uint32Array(6 * a.length), c = 0, h = a.length; c < h; c++)
- for (var u = a[c], d = 0; d < 3; d++) {
- i[0] = u[r[d]],
- i[1] = u[r[(d + 1) % 3]],
- i.sort(t),
- void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
- l[2 * s + 1] = i[1],
- n[E] = !0,
- s++)
- }
- var p = new Float32Array(2 * s * 3);
- for (c = 0,
- h = s; c < h; c++)
- for (d = 0; d < 2; d++) {
- var f = o[l[2 * c + d]];
- p[(_ = 6 * c + 3 * d) + 0] = f.x,
- p[_ + 1] = f.y,
- p[_ + 2] = f.z
- }
- this.addAttribute("position", new Ci.BufferAttribute(p,3))
- } else if (e instanceof Ci.BufferGeometry)
- if (null !== e.index) {
- var g = e.index.array
- , m = (o = e.attributes.position,
- e.groups);
- s = 0;
- 0 === m.length && e.addGroup(0, g.length);
- l = new Uint32Array(2 * g.length);
- for (var v = 0, y = m.length; v < y; ++v)
- for (var A = m[v], C = A.start, I = (c = C,
- C + A.count); c < I; c += 3)
- for (d = 0; d < 3; d++) {
- var E;
- i[0] = g[c + d],
- i[1] = g[c + (d + 1) % 3],
- i.sort(t),
- void 0 === n[E = i.toString()] && (l[2 * s] = i[0],
- l[2 * s + 1] = i[1],
- n[E] = !0,
- s++)
- }
- for (p = new Float32Array(2 * s * 3),
- c = 0,
- h = s; c < h; c++)
- for (d = 0; d < 2; d++) {
- var _ = 6 * c + 3 * d
- , b = l[2 * c + d];
- p[_ + 0] = o.getX(b),
- p[_ + 1] = o.getY(b),
- p[_ + 2] = o.getZ(b)
- }
- this.addAttribute("position", new Ci.BufferAttribute(p,3))
- } else {
- var w = (s = (o = e.attributes.position.array).length / 3) / 3;
- for (p = new Float32Array(2 * s * 3),
- c = 0,
- h = w; c < h; c++)
- for (d = 0; d < 3; d++) {
- var T = 9 * c + 3 * d;
- p[(_ = 18 * c + 6 * d) + 0] = o[T],
- p[_ + 1] = o[1 + T],
- p[_ + 2] = o[2 + T];
- b = 9 * c + (d + 1) % 3 * 3;
- p[_ + 3] = o[b],
- p[_ + 4] = o[b + 1],
- p[_ + 5] = o[b + 2]
- }
- this.addAttribute("position", new Ci.BufferAttribute(p,3))
- }
- }
- ,
- Ci.WireframeGeometry.prototype = Object.create(Ci.BufferGeometry.prototype),
- Ci.WireframeGeometry.prototype.constructor = Ci.WireframeGeometry,
- Ci.AxisHelper = function(e) {
- e = e || 1;
- var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
- , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
- , n = new Ci.BufferGeometry;
- n.addAttribute("position", new Ci.BufferAttribute(t,3)),
- n.addAttribute("color", new Ci.BufferAttribute(i,3));
- var r = new Ci.LineBasicMaterial({
- vertexColors: Ci.VertexColors
- });
- Ci.LineSegments.call(this, n, r)
- }
- ,
- Ci.AxisHelper.prototype = Object.create(Ci.LineSegments.prototype),
- Ci.AxisHelper.prototype.constructor = Ci.AxisHelper,
- Ci.ArrowHelper = function() {
- var a = new Ci.Geometry;
- a.vertices.push(new Ci.Vector3(0,0,0), new Ci.Vector3(0,1,0));
- var s = new Ci.CylinderGeometry(0,.5,1,5,1);
- return s.translate(0, -.5, 0),
- function(e, t, i, n, r, o) {
- Ci.Object3D.call(this),
- void 0 === n && (n = 16776960),
- void 0 === i && (i = 1),
- void 0 === r && (r = .2 * i),
- void 0 === o && (o = .2 * r),
- this.position.copy(t),
- this.line = new Ci.Line(a,new Ci.LineBasicMaterial({
- color: n
- })),
- this.line.matrixAutoUpdate = !1,
- this.add(this.line),
- this.cone = new Ci.Mesh(s,new Ci.MeshBasicMaterial({
- color: n
- })),
- this.cone.matrixAutoUpdate = !1,
- this.add(this.cone),
- this.setDirection(e),
- this.setLength(i, r, o)
- }
- }(),
- Ci.ArrowHelper.prototype = Object.create(Ci.Object3D.prototype),
- Ci.ArrowHelper.prototype.constructor = Ci.ArrowHelper,
- Ci.ArrowHelper.prototype.setDirection = (Ai = new Ci.Vector3,
- function(e) {
- .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(),
- yi = Math.acos(e.y),
- this.quaternion.setFromAxisAngle(Ai, yi))
- }
- ),
- Ci.ArrowHelper.prototype.setLength = function(e, t, i) {
- void 0 === t && (t = .2 * e),
- void 0 === i && (i = .2 * t),
- this.line.scale.set(1, Math.max(0, e - t), 1),
- this.line.updateMatrix(),
- this.cone.scale.set(i, t, i),
- this.cone.position.y = e,
- this.cone.updateMatrix()
- }
- ,
- Ci.ArrowHelper.prototype.setColor = function(e) {
- this.line.material.color.set(e),
- this.cone.material.color.set(e)
- }
- ,
- Ci.BoxHelper = function(e) {
- 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])
- , i = new Float32Array(24)
- , n = new Ci.BufferGeometry;
- n.setIndex(new Ci.BufferAttribute(t,1)),
- n.addAttribute("position", new Ci.BufferAttribute(i,3)),
- Ci.LineSegments.call(this, n, new Ci.LineBasicMaterial({
- color: 16776960
- })),
- void 0 !== e && this.update(e)
- }
- ,
- Ci.BoxHelper.prototype = Object.create(Ci.LineSegments.prototype),
- Ci.BoxHelper.prototype.constructor = Ci.BoxHelper,
- Ci.BoxHelper.prototype.update = (vi = new Ci.Box3,
- function(e) {
- if (vi.setFromObject(e),
- !vi.isEmpty()) {
- var t = vi.min
- , i = vi.max
- , n = this.geometry.attributes.position
- , r = n.array;
- r[0] = i.x,
- r[1] = i.y,
- r[2] = i.z,
- r[3] = t.x,
- r[4] = i.y,
- r[5] = i.z,
- r[6] = t.x,
- r[7] = t.y,
- r[8] = i.z,
- r[9] = i.x,
- r[10] = t.y,
- r[11] = i.z,
- r[12] = i.x,
- r[13] = i.y,
- r[14] = t.z,
- r[15] = t.x,
- r[16] = i.y,
- r[17] = t.z,
- r[18] = t.x,
- r[19] = t.y,
- r[20] = t.z,
- r[21] = i.x,
- r[22] = t.y,
- r[23] = t.z,
- n.needsUpdate = !0,
- this.geometry.computeBoundingSphere()
- }
- }
- ),
- Ci.BoundingBoxHelper = function(e, t) {
- var i = void 0 !== t ? t : 8947848;
- this.object = e,
- this.box = new Ci.Box3,
- Ci.Mesh.call(this, new Ci.BoxGeometry(1,1,1), new Ci.MeshBasicMaterial({
- color: i,
- wireframe: !0
- }))
- }
- ,
- Ci.BoundingBoxHelper.prototype = Object.create(Ci.Mesh.prototype),
- Ci.BoundingBoxHelper.prototype.constructor = Ci.BoundingBoxHelper,
- Ci.BoundingBoxHelper.prototype.update = function() {
- this.box.setFromObject(this.object),
- this.box.size(this.scale),
- this.box.center(this.position)
- }
- ,
- Ci.CameraHelper = function(e) {
- function t(e, t, i) {
- n(e, i),
- n(t, i)
- }
- function n(e, t) {
- i.vertices.push(new Ci.Vector3),
- i.colors.push(new Ci.Color(t)),
- void 0 === o[e] && (o[e] = []),
- o[e].push(i.vertices.length - 1)
- }
- var i = new Ci.Geometry
- , r = new Ci.LineBasicMaterial({
- color: 16777215,
- vertexColors: Ci.FaceColors
- })
- , o = {}
- , a = 16755200
- , s = 16711680
- , l = 3355443;
- t("n1", "n2", a),
- t("n2", "n4", a),
- t("n4", "n3", a),
- t("n3", "n1", a),
- t("f1", "f2", a),
- t("f2", "f4", a),
- t("f4", "f3", a),
- t("f3", "f1", a),
- t("n1", "f1", a),
- t("n2", "f2", a),
- t("n3", "f3", a),
- t("n4", "f4", a),
- t("p", "n1", s),
- t("p", "n2", s),
- t("p", "n3", s),
- t("p", "n4", s),
- t("u1", "u2", 43775),
- t("u2", "u3", 43775),
- t("u3", "u1", 43775),
- t("c", "t", 16777215),
- t("p", "c", l),
- t("cn1", "cn2", l),
- t("cn3", "cn4", l),
- t("cf1", "cf2", l),
- t("cf3", "cf4", l),
- Ci.LineSegments.call(this, i, r),
- this.camera = e,
- this.camera.updateProjectionMatrix(),
- this.matrix = e.matrixWorld,
- this.matrixAutoUpdate = !1,
- this.pointMap = o,
- this.update()
- }
- ,
- Ci.CameraHelper.prototype = Object.create(Ci.LineSegments.prototype),
- Ci.CameraHelper.prototype.constructor = Ci.CameraHelper,
- Ci.CameraHelper.prototype.update = (gi = new Ci.Vector3,
- mi = new Ci.Camera,
- function() {
- pi = this.geometry,
- fi = this.pointMap,
- mi.projectionMatrix.copy(this.camera.projectionMatrix),
- Ni("c", 0, 0, -1),
- Ni("t", 0, 0, 1),
- Ni("n1", -1, -1, -1),
- Ni("n2", 1, -1, -1),
- Ni("n3", -1, 1, -1),
- Ni("n4", 1, 1, -1),
- Ni("f1", -1, -1, 1),
- Ni("f2", 1, -1, 1),
- Ni("f3", -1, 1, 1),
- Ni("f4", 1, 1, 1),
- Ni("u1", .7, 1.1, -1),
- Ni("u2", -.7, 1.1, -1),
- Ni("u3", 0, 2, -1),
- Ni("cf1", -1, 0, 1),
- Ni("cf2", 1, 0, 1),
- Ni("cf3", 0, -1, 1),
- Ni("cf4", 0, 1, 1),
- Ni("cn1", -1, 0, -1),
- Ni("cn2", 1, 0, -1),
- Ni("cn3", 0, -1, -1),
- Ni("cn4", 0, 1, -1),
- pi.verticesNeedUpdate = !0
- }
- ),
- Ci.DirectionalLightHelper = function(e, t) {
- Ci.Object3D.call(this),
- this.light = e,
- this.light.updateMatrixWorld(),
- this.matrix = e.matrixWorld,
- this.matrixAutoUpdate = !1,
- t = t || 1;
- var i = new Ci.Geometry;
- 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));
- var n = new Ci.LineBasicMaterial({
- fog: !1
- });
- n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
- this.lightPlane = new Ci.Line(i,n),
- this.add(this.lightPlane),
- (i = new Ci.Geometry).vertices.push(new Ci.Vector3, new Ci.Vector3),
- (n = new Ci.LineBasicMaterial({
- fog: !1
- })).color.copy(this.light.color).multiplyScalar(this.light.intensity),
- this.targetLine = new Ci.Line(i,n),
- this.add(this.targetLine),
- this.update()
- }
- ,
- Ci.DirectionalLightHelper.prototype = Object.create(Ci.Object3D.prototype),
- Ci.DirectionalLightHelper.prototype.constructor = Ci.DirectionalLightHelper,
- Ci.DirectionalLightHelper.prototype.dispose = function() {
- this.lightPlane.geometry.dispose(),
- this.lightPlane.material.dispose(),
- this.targetLine.geometry.dispose(),
- this.targetLine.material.dispose()
- }
- ,
- Ci.DirectionalLightHelper.prototype.update = (hi = new Ci.Vector3,
- ui = new Ci.Vector3,
- di = new Ci.Vector3,
- function() {
- hi.setFromMatrixPosition(this.light.matrixWorld),
- ui.setFromMatrixPosition(this.light.target.matrixWorld),
- di.subVectors(ui, hi),
- this.lightPlane.lookAt(di),
- this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
- this.targetLine.geometry.vertices[1].copy(di),
- this.targetLine.geometry.verticesNeedUpdate = !0,
- this.targetLine.material.color.copy(this.lightPlane.material.color)
- }
- ),
- Ci.EdgesHelper = function(e, t, i) {
- var n = void 0 !== t ? t : 16777215;
- Ci.LineSegments.call(this, new Ci.EdgesGeometry(e.geometry,i), new Ci.LineBasicMaterial({
- color: n
- })),
- this.matrix = e.matrixWorld,
- this.matrixAutoUpdate = !1
- }
- ,
- Ci.EdgesHelper.prototype = Object.create(Ci.LineSegments.prototype),
- Ci.EdgesHelper.prototype.constructor = Ci.EdgesHelper,
- Ci.FaceNormalsHelper = function(e, t, i, n) {
- this.object = e,
- this.size = void 0 !== t ? t : 1;
- var r = void 0 !== i ? i : 16776960
- , o = void 0 !== n ? n : 1
- , a = 0
- , s = this.object.geometry;
- s instanceof Ci.Geometry ? a = s.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
- var l = new Ci.BufferGeometry
- , c = new Ci.Float32Attribute(2 * a * 3,3);
- l.addAttribute("position", c),
- Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
- color: r,
- linewidth: o
- })),
- this.matrixAutoUpdate = !1,
- this.update()
- }
- ,
- Ci.FaceNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
- Ci.FaceNormalsHelper.prototype.constructor = Ci.FaceNormalsHelper,
- Ci.FaceNormalsHelper.prototype.update = (si = new Ci.Vector3,
- li = new Ci.Vector3,
- ci = new Ci.Matrix3,
- function() {
- this.object.updateMatrixWorld(!0),
- ci.getNormalMatrix(this.object.matrixWorld);
- 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++) {
- var l = r[a]
- , c = l.normal;
- si.copy(n[l.a]).add(n[l.b]).add(n[l.c]).divideScalar(3).applyMatrix4(e),
- li.copy(c).applyMatrix3(ci).normalize().multiplyScalar(this.size).add(si),
- t.setXYZ(o, si.x, si.y, si.z),
- o += 1,
- t.setXYZ(o, li.x, li.y, li.z),
- o += 1
- }
- return t.needsUpdate = !0,
- this
- }
- ),
- Ci.GridHelper = function(e, t) {
- var i = new Ci.Geometry
- , n = new Ci.LineBasicMaterial({
- vertexColors: Ci.VertexColors
- });
- this.color1 = new Ci.Color(4473924),
- this.color2 = new Ci.Color(8947848);
- for (var r = -e; r <= e; r += t) {
- 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));
- var o = 0 === r ? this.color1 : this.color2;
- i.colors.push(o, o, o, o)
- }
- Ci.LineSegments.call(this, i, n)
- }
- ,
- Ci.GridHelper.prototype = Object.create(Ci.LineSegments.prototype),
- Ci.GridHelper.prototype.constructor = Ci.GridHelper,
- Ci.GridHelper.prototype.setColors = function(e, t) {
- this.color1.set(e),
- this.color2.set(t),
- this.geometry.colorsNeedUpdate = !0
- }
- ,
- Ci.HemisphereLightHelper = function(e, t) {
- Ci.Object3D.call(this),
- this.light = e,
- this.light.updateMatrixWorld(),
- this.matrix = e.matrixWorld,
- this.matrixAutoUpdate = !1,
- this.colors = [new Ci.Color, new Ci.Color];
- var i = new Ci.SphereGeometry(t,4,2);
- i.rotateX(-Math.PI / 2);
- for (var n = 0; n < 8; n++)
- i.faces[n].color = this.colors[n < 4 ? 0 : 1];
- var r = new Ci.MeshBasicMaterial({
- vertexColors: Ci.FaceColors,
- wireframe: !0
- });
- this.lightSphere = new Ci.Mesh(i,r),
- this.add(this.lightSphere),
- this.update()
- }
- ,
- Ci.HemisphereLightHelper.prototype = Object.create(Ci.Object3D.prototype),
- Ci.HemisphereLightHelper.prototype.constructor = Ci.HemisphereLightHelper,
- Ci.HemisphereLightHelper.prototype.dispose = function() {
- this.lightSphere.geometry.dispose(),
- this.lightSphere.material.dispose()
- }
- ,
- Ci.HemisphereLightHelper.prototype.update = (ai = new Ci.Vector3,
- function() {
- this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
- this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
- this.lightSphere.lookAt(ai.setFromMatrixPosition(this.light.matrixWorld).negate()),
- this.lightSphere.geometry.colorsNeedUpdate = !0
- }
- ),
- Ci.PointLightHelper = function(e, t) {
- this.light = e,
- this.light.updateMatrixWorld();
- var i = new Ci.SphereGeometry(t,4,2)
- , n = new Ci.MeshBasicMaterial({
- wireframe: !0,
- fog: !1
- });
- n.color.copy(this.light.color).multiplyScalar(this.light.intensity),
- Ci.Mesh.call(this, i, n),
- this.matrix = this.light.matrixWorld,
- this.matrixAutoUpdate = !1
- }
- ,
- Ci.PointLightHelper.prototype = Object.create(Ci.Mesh.prototype),
- Ci.PointLightHelper.prototype.constructor = Ci.PointLightHelper,
- Ci.PointLightHelper.prototype.dispose = function() {
- this.geometry.dispose(),
- this.material.dispose()
- }
- ,
- Ci.PointLightHelper.prototype.update = function() {
- this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
- }
- ,
- Ci.SkeletonHelper = function(e) {
- this.bones = this.getBoneList(e);
- for (var t = new Ci.Geometry, i = 0; i < this.bones.length; i++) {
- this.bones[i].parent instanceof Ci.Bone && (t.vertices.push(new Ci.Vector3),
- t.vertices.push(new Ci.Vector3),
- t.colors.push(new Ci.Color(0,0,1)),
- t.colors.push(new Ci.Color(0,1,0)))
- }
- t.dynamic = !0;
- var n = new Ci.LineBasicMaterial({
- vertexColors: Ci.VertexColors,
- depthTest: !1,
- depthWrite: !1,
- transparent: !0
- });
- Ci.LineSegments.call(this, t, n),
- this.root = e,
- this.matrix = e.matrixWorld,
- this.matrixAutoUpdate = !1,
- this.update()
- }
- ,
- Ci.SkeletonHelper.prototype = Object.create(Ci.LineSegments.prototype),
- Ci.SkeletonHelper.prototype.constructor = Ci.SkeletonHelper,
- Ci.SkeletonHelper.prototype.getBoneList = function(e) {
- var t = [];
- e instanceof Ci.Bone && t.push(e);
- for (var i = 0; i < e.children.length; i++)
- t.push.apply(t, this.getBoneList(e.children[i]));
- return t
- }
- ,
- Ci.SkeletonHelper.prototype.update = function() {
- 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++) {
- var o = this.bones[r];
- o.parent instanceof Ci.Bone && (i.multiplyMatrices(t, o.matrixWorld),
- e.vertices[n].setFromMatrixPosition(i),
- i.multiplyMatrices(t, o.parent.matrixWorld),
- e.vertices[n + 1].setFromMatrixPosition(i),
- n += 2)
- }
- e.verticesNeedUpdate = !0,
- e.computeBoundingSphere()
- }
- ,
- Ci.SpotLightHelper = function(e) {
- Ci.Object3D.call(this),
- this.light = e,
- this.light.updateMatrixWorld(),
- this.matrix = e.matrixWorld,
- this.matrixAutoUpdate = !1;
- var t = new Ci.CylinderGeometry(0,1,1,8,1,!0);
- t.translate(0, -.5, 0),
- t.rotateX(-Math.PI / 2);
- var i = new Ci.MeshBasicMaterial({
- wireframe: !0,
- fog: !1
- });
- this.cone = new Ci.Mesh(t,i),
- this.add(this.cone),
- this.update()
- }
- ,
- Ci.SpotLightHelper.prototype = Object.create(Ci.Object3D.prototype),
- Ci.SpotLightHelper.prototype.constructor = Ci.SpotLightHelper,
- Ci.SpotLightHelper.prototype.dispose = function() {
- this.cone.geometry.dispose(),
- this.cone.material.dispose()
- }
- ,
- Ci.SpotLightHelper.prototype.update = (ri = new Ci.Vector3,
- oi = new Ci.Vector3,
- function() {
- var e = this.light.distance ? this.light.distance : 1e4
- , t = e * Math.tan(this.light.angle);
- this.cone.scale.set(t, t, e),
- ri.setFromMatrixPosition(this.light.matrixWorld),
- oi.setFromMatrixPosition(this.light.target.matrixWorld),
- this.cone.lookAt(oi.sub(ri)),
- this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
- }
- ),
- Ci.VertexNormalsHelper = function(e, t, i, n) {
- this.object = e,
- this.size = void 0 !== t ? t : 1;
- var r = void 0 !== i ? i : 16711680
- , o = void 0 !== n ? n : 1
- , a = 0
- , s = this.object.geometry;
- s instanceof Ci.Geometry ? a = 3 * s.faces.length : s instanceof Ci.BufferGeometry && (a = s.attributes.normal.count);
- var l = new Ci.BufferGeometry
- , c = new Ci.Float32Attribute(2 * a * 3,3);
- l.addAttribute("position", c),
- Ci.LineSegments.call(this, l, new Ci.LineBasicMaterial({
- color: r,
- linewidth: o
- })),
- this.matrixAutoUpdate = !1,
- this.update()
- }
- ,
- Ci.VertexNormalsHelper.prototype = Object.create(Ci.LineSegments.prototype),
- Ci.VertexNormalsHelper.prototype.constructor = Ci.VertexNormalsHelper,
- Ci.VertexNormalsHelper.prototype.update = (ti = new Ci.Vector3,
- ii = new Ci.Vector3,
- ni = new Ci.Matrix3,
- function() {
- var e = ["a", "b", "c"];
- this.object.updateMatrixWorld(!0),
- ni.getNormalMatrix(this.object.matrixWorld);
- var t = this.object.matrixWorld
- , i = this.geometry.attributes.position
- , n = this.object.geometry;
- if (n instanceof Ci.Geometry)
- for (var r = n.vertices, o = n.faces, a = 0, s = 0, l = o.length; s < l; s++)
- for (var c = o[s], h = 0, u = c.vertexNormals.length; h < u; h++) {
- var d = r[c[e[h]]]
- , p = c.vertexNormals[h];
- ti.copy(d).applyMatrix4(t),
- ii.copy(p).applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
- i.setXYZ(a, ti.x, ti.y, ti.z),
- a += 1,
- i.setXYZ(a, ii.x, ii.y, ii.z),
- a += 1
- }
- else if (n instanceof Ci.BufferGeometry) {
- var f = n.attributes.position
- , g = n.attributes.normal;
- for (h = a = 0,
- u = f.count; h < u; h++)
- ti.set(f.getX(h), f.getY(h), f.getZ(h)).applyMatrix4(t),
- ii.set(g.getX(h), g.getY(h), g.getZ(h)),
- ii.applyMatrix3(ni).normalize().multiplyScalar(this.size).add(ti),
- i.setXYZ(a, ti.x, ti.y, ti.z),
- a += 1,
- i.setXYZ(a, ii.x, ii.y, ii.z),
- a += 1
- }
- return i.needsUpdate = !0,
- this
- }
- ),
- Ci.WireframeHelper = function(e, t) {
- var i = void 0 !== t ? t : 16777215;
- Ci.LineSegments.call(this, new Ci.WireframeGeometry(e.geometry), new Ci.LineBasicMaterial({
- color: i
- })),
- this.matrix = e.matrixWorld,
- this.matrixAutoUpdate = !1
- }
- ,
- Ci.WireframeHelper.prototype = Object.create(Ci.LineSegments.prototype),
- Ci.WireframeHelper.prototype.constructor = Ci.WireframeHelper,
- Ci.ImmediateRenderObject = function(e) {
- Ci.Object3D.call(this),
- this.material = e,
- this.render = function(e) {}
- }
- ,
- Ci.ImmediateRenderObject.prototype = Object.create(Ci.Object3D.prototype),
- Ci.ImmediateRenderObject.prototype.constructor = Ci.ImmediateRenderObject,
- Ci.MorphBlendMesh = function(e, t) {
- Ci.Mesh.call(this, e, t),
- this.animationsMap = {},
- this.animationsList = [];
- var i = this.geometry.morphTargets.length
- , n = i - 1
- , r = i / 1;
- this.createAnimation("__default", 0, n, r),
- this.setAnimationWeight("__default", 1)
- }
- ,
- Ci.MorphBlendMesh.prototype = Object.create(Ci.Mesh.prototype),
- Ci.MorphBlendMesh.prototype.constructor = Ci.MorphBlendMesh,
- Ci.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
- var r = {
- start: t,
- end: i,
- length: i - t + 1,
- fps: n,
- duration: (i - t) / n,
- lastFrame: 0,
- currentFrame: 0,
- active: !1,
- time: 0,
- direction: 1,
- weight: 1,
- directionBackwards: !1,
- mirroredLoop: !1
- };
- this.animationsMap[e] = r,
- this.animationsList.push(r)
- }
- ,
- Ci.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
- for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
- var s = r.morphTargets[o].name.match(i);
- if (s && 1 < s.length)
- n[l = s[1]] || (n[l] = {
- start: 1 / 0,
- end: -1 / 0
- }),
- o < (c = n[l]).start && (c.start = o),
- o > c.end && (c.end = o),
- t = t || l
- }
- for (var l in n) {
- var c = n[l];
- this.createAnimation(l, c.start, c.end, e)
- }
- this.firstAnimation = t
- }
- ,
- Ci.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
- var t = this.animationsMap[e];
- t && (t.direction = 1,
- t.directionBackwards = !1)
- }
- ,
- Ci.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
- var t = this.animationsMap[e];
- t && (t.direction = -1,
- t.directionBackwards = !0)
- }
- ,
- Ci.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
- var i = this.animationsMap[e];
- i && (i.fps = t,
- i.duration = (i.end - i.start) / i.fps)
- }
- ,
- Ci.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
- var i = this.animationsMap[e];
- i && (i.duration = t,
- i.fps = (i.end - i.start) / i.duration)
- }
- ,
- Ci.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
- var i = this.animationsMap[e];
- i && (i.weight = t)
- }
- ,
- Ci.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
- var i = this.animationsMap[e];
- i && (i.time = t)
- }
- ,
- Ci.MorphBlendMesh.prototype.getAnimationTime = function(e) {
- var t = 0
- , i = this.animationsMap[e];
- return i && (t = i.time),
- t
- }
- ,
- Ci.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
- var t = -1
- , i = this.animationsMap[e];
- return i && (t = i.duration),
- t
- }
- ,
- Ci.MorphBlendMesh.prototype.playAnimation = function(e) {
- var t = this.animationsMap[e];
- t ? (t.time = 0,
- t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
- }
- ,
- Ci.MorphBlendMesh.prototype.stopAnimation = function(e) {
- var t = this.animationsMap[e];
- t && (t.active = !1)
- }
- ,
- Ci.MorphBlendMesh.prototype.update = function(e) {
- for (var t = 0, i = this.animationsList.length; t < i; t++) {
- var n = this.animationsList[t];
- if (n.active) {
- var r = n.duration / n.length;
- n.time += n.direction * e,
- n.mirroredLoop ? (n.time > n.duration || n.time < 0) && (n.direction *= -1,
- n.time > n.duration && (n.time = n.duration,
- n.directionBackwards = !0),
- n.time < 0 && (n.time = 0,
- n.directionBackwards = !1)) : (n.time = n.time % n.duration,
- n.time < 0 && (n.time += n.duration));
- var o = n.start + Ci.Math.clamp(Math.floor(n.time / r), 0, n.length - 1)
- , a = n.weight;
- o !== n.currentFrame && (this.morphTargetInfluences[n.lastFrame] = 0,
- this.morphTargetInfluences[n.currentFrame] = 1 * a,
- this.morphTargetInfluences[o] = 0,
- n.lastFrame = n.currentFrame,
- n.currentFrame = o);
- var s = n.time % r / r;
- n.directionBackwards && (s = 1 - s),
- n.currentFrame !== n.lastFrame ? (this.morphTargetInfluences[n.currentFrame] = s * a,
- this.morphTargetInfluences[n.lastFrame] = (1 - s) * a) : this.morphTargetInfluences[n.currentFrame] = a
- }
- }
- }
- ,
- void 0 !== i ? (void 0 !== t && t.exports && (i = t.exports = Ci),
- i.THREE = Ci) : this.THREE = Ci
- }
- , {}]
- }, {}, [116]);
|