main_2020_show.js 2.6 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423554245542555426554275542855429554305543155432554335543455435554365543755438554395544055441554425544355444554455544655447554485544955450554515545255453554545545555456554575545855459554605546155462554635546455465554665546755468554695547055471554725547355474554755547655477554785547955480554815548255483554845548555486554875548855489554905549155492554935549455495554965549755498554995550055501555025550355504555055550655507555085550955510555115551255513555145551555516555175551855519555205552155522555235552455525555265552755528555295553055531555325553355534555355553655537555385553955540555415554255543555445554555546555475554855549555505555155552555535555455555555565555755558555595556055561555625556355564555655556655567555685556955570555715557255573555745557555576555775557855579555805558155582555835558455585555865558755588555895559055591555925559355594555955559655597555985559955600556015560255603556045560555606556075560855609556105561155612556135561455615556165561755618556195562055621556225562355624556255562655627556285562955630556315563255633556345563555636556375563855639556405564155642556435564455645556465564755648556495565055651556525565355654556555565655657556585565955660556615566255663556645566555666556675566855669556705567155672556735567455675556765567755678556795568055681556825568355684556855568655687556885568955690556915569255693556945569555696556975569855699557005570155702557035570455705557065570755708557095571055711557125571355714557155571655717557185571955720557215572255723557245572555726557275572855729557305573155732557335573455735557365573755738557395574055741557425574355744557455574655747557485574955750557515575255753557545575555756557575575855759557605576155762557635576455765557665576755768557695577055771557725577355774557755577655777557785577955780557815578255783557845578555786557875578855789557905579155792557935579455795557965579755798557995580055801558025580355804558055580655807558085580955810558115581255813558145581555816558175581855819558205582155822558235582455825558265582755828558295583055831558325583355834558355583655837558385583955840558415584255843558445584555846558475584855849558505585155852558535585455855558565585755858558595586055861558625586355864558655586655867558685586955870558715587255873558745587555876558775587855879558805588155882558835588455885558865588755888558895589055891558925589355894558955589655897558985589955900559015590255903559045590555906559075590855909559105591155912559135591455915559165591755918559195592055921559225592355924559255592655927559285592955930559315593255933559345593555936559375593855939559405594155942559435594455945559465594755948559495595055951559525595355954559555595655957559585595955960559615596255963559645596555966559675596855969559705597155972559735597455975559765597755978559795598055981559825598355984559855598655987559885598955990559915599255993559945599555996559975599855999560005600156002560035600456005560065600756008560095601056011560125601356014560155601656017560185601956020560215602256023560245602556026560275602856029560305603156032560335603456035560365603756038560395604056041560425604356044560455604656047560485604956050560515605256053560545605556056560575605856059560605606156062560635606456065560665606756068560695607056071560725607356074560755607656077560785607956080560815608256083560845608556086560875608856089560905609156092560935609456095560965609756098560995610056101561025610356104561055610656107561085610956110561115611256113561145611556116561175611856119561205612156122561235612456125561265612756128561295613056131561325613356134561355613656137561385613956140561415614256143561445614556146561475614856149561505615156152561535615456155561565615756158561595616056161561625616356164561655616656167561685616956170561715617256173561745617556176561775617856179561805618156182561835618456185561865618756188561895619056191561925619356194561955619656197561985619956200562015620256203562045620556206562075620856209562105621156212562135621456215562165621756218562195622056221562225622356224562255622656227562285622956230562315623256233562345623556236562375623856239562405624156242562435624456245562465624756248562495625056251562525625356254562555625656257562585625956260562615626256263562645626556266562675626856269562705627156272562735627456275562765627756278562795628056281562825628356284562855628656287562885628956290562915629256293562945629556296562975629856299563005630156302563035630456305563065630756308563095631056311563125631356314563155631656317563185631956320563215632256323563245632556326563275632856329563305633156332563335633456335563365633756338563395634056341563425634356344563455634656347563485634956350563515635256353563545635556356563575635856359563605636156362563635636456365563665636756368563695637056371563725637356374563755637656377563785637956380563815638256383563845638556386563875638856389563905639156392563935639456395563965639756398563995640056401564025640356404564055640656407564085640956410564115641256413564145641556416564175641856419564205642156422564235642456425564265642756428564295643056431564325643356434564355643656437564385643956440564415644256443564445644556446564475644856449564505645156452564535645456455564565645756458564595646056461564625646356464564655646656467564685646956470564715647256473564745647556476564775647856479564805648156482564835648456485564865648756488564895649056491564925649356494564955649656497564985649956500565015650256503565045650556506565075650856509565105651156512565135651456515565165651756518565195652056521565225652356524565255652656527565285652956530565315653256533565345653556536565375653856539565405654156542565435654456545565465654756548565495655056551565525655356554565555655656557565585655956560565615656256563565645656556566565675656856569565705657156572565735657456575565765657756578565795658056581565825658356584565855658656587565885658956590565915659256593565945659556596565975659856599566005660156602566035660456605566065660756608566095661056611566125661356614566155661656617566185661956620566215662256623566245662556626566275662856629566305663156632566335663456635566365663756638566395664056641566425664356644566455664656647566485664956650566515665256653566545665556656566575665856659566605666156662566635666456665566665666756668566695667056671566725667356674566755667656677566785667956680566815668256683566845668556686566875668856689566905669156692566935669456695566965669756698566995670056701567025670356704567055670656707567085670956710567115671256713567145671556716567175671856719567205672156722567235672456725567265672756728567295673056731567325673356734567355673656737567385673956740567415674256743567445674556746567475674856749567505675156752567535675456755567565675756758567595676056761567625676356764567655676656767567685676956770567715677256773567745677556776567775677856779567805678156782567835678456785567865678756788567895679056791567925679356794567955679656797567985679956800568015680256803568045680556806568075680856809568105681156812568135681456815568165681756818568195682056821568225682356824568255682656827568285682956830568315683256833568345683556836568375683856839568405684156842568435684456845568465684756848568495685056851568525685356854568555685656857568585685956860568615686256863568645686556866568675686856869568705687156872568735687456875568765687756878568795688056881568825688356884568855688656887568885688956890568915689256893568945689556896568975689856899569005690156902569035690456905569065690756908569095691056911569125691356914569155691656917569185691956920569215692256923569245692556926569275692856929569305693156932569335693456935569365693756938569395694056941569425694356944569455694656947569485694956950569515695256953569545695556956569575695856959569605696156962569635696456965569665696756968569695697056971569725697356974569755697656977569785697956980569815698256983569845698556986569875698856989569905699156992569935699456995569965699756998569995700057001570025700357004570055700657007570085700957010570115701257013570145701557016570175701857019570205702157022570235702457025570265702757028570295703057031570325703357034570355703657037570385703957040570415704257043570445704557046570475704857049570505705157052570535705457055570565705757058570595706057061570625706357064570655706657067570685706957070570715707257073570745707557076570775707857079570805708157082570835708457085570865708757088570895709057091570925709357094570955709657097570985709957100571015710257103571045710557106571075710857109571105711157112571135711457115571165711757118571195712057121571225712357124571255712657127571285712957130571315713257133571345713557136571375713857139571405714157142571435714457145571465714757148571495715057151571525715357154571555715657157571585715957160571615716257163571645716557166571675716857169571705717157172571735717457175571765717757178571795718057181571825718357184571855718657187571885718957190571915719257193571945719557196571975719857199572005720157202572035720457205572065720757208572095721057211572125721357214572155721657217572185721957220572215722257223572245722557226572275722857229572305723157232572335723457235572365723757238572395724057241572425724357244572455724657247572485724957250572515725257253572545725557256572575725857259572605726157262572635726457265572665726757268572695727057271572725727357274572755727657277572785727957280572815728257283572845728557286572875728857289572905729157292572935729457295572965729757298572995730057301573025730357304573055730657307573085730957310573115731257313573145731557316573175731857319573205732157322573235732457325573265732757328573295733057331573325733357334573355733657337573385733957340573415734257343573445734557346573475734857349573505735157352573535735457355573565735757358573595736057361573625736357364573655736657367573685736957370573715737257373573745737557376573775737857379573805738157382573835738457385573865738757388573895739057391573925739357394573955739657397573985739957400574015740257403574045740557406574075740857409574105741157412574135741457415574165741757418574195742057421574225742357424574255742657427574285742957430574315743257433574345743557436574375743857439574405744157442574435744457445574465744757448574495745057451574525745357454574555745657457574585745957460574615746257463574645746557466574675746857469574705747157472574735747457475574765747757478574795748057481574825748357484574855748657487574885748957490574915749257493574945749557496574975749857499575005750157502575035750457505575065750757508575095751057511575125751357514575155751657517575185751957520575215752257523575245752557526575275752857529575305753157532575335753457535575365753757538575395754057541575425754357544575455754657547575485754957550575515755257553575545755557556575575755857559575605756157562575635756457565575665756757568575695757057571575725757357574575755757657577575785757957580575815758257583575845758557586575875758857589575905759157592575935759457595575965759757598575995760057601576025760357604576055760657607576085760957610576115761257613576145761557616576175761857619576205762157622576235762457625576265762757628576295763057631576325763357634576355763657637576385763957640576415764257643576445764557646576475764857649576505765157652576535765457655576565765757658576595766057661576625766357664576655766657667576685766957670576715767257673576745767557676576775767857679576805768157682576835768457685576865768757688576895769057691576925769357694576955769657697576985769957700577015770257703577045770557706577075770857709577105771157712577135771457715577165771757718577195772057721577225772357724577255772657727577285772957730577315773257733577345773557736577375773857739577405774157742577435774457745577465774757748577495775057751577525775357754577555775657757577585775957760577615776257763577645776557766577675776857769577705777157772577735777457775577765777757778577795778057781577825778357784577855778657787577885778957790577915779257793577945779557796577975779857799578005780157802578035780457805578065780757808578095781057811578125781357814578155781657817578185781957820578215782257823578245782557826578275782857829578305783157832578335783457835578365783757838578395784057841578425784357844578455784657847578485784957850578515785257853578545785557856578575785857859578605786157862578635786457865578665786757868578695787057871578725787357874578755787657877578785787957880578815788257883578845788557886578875788857889578905789157892578935789457895578965789757898578995790057901579025790357904579055790657907579085790957910579115791257913579145791557916579175791857919579205792157922579235792457925579265792757928579295793057931579325793357934579355793657937579385793957940579415794257943579445794557946579475794857949579505795157952579535795457955579565795757958579595796057961579625796357964579655796657967579685796957970579715797257973579745797557976579775797857979579805798157982579835798457985579865798757988579895799057991579925799357994579955799657997579985799958000580015800258003580045800558006580075800858009580105801158012580135801458015580165801758018580195802058021580225802358024580255802658027580285802958030580315803258033580345803558036580375803858039580405804158042580435804458045580465804758048580495805058051580525805358054580555805658057580585805958060580615806258063580645806558066580675806858069580705807158072580735807458075580765807758078580795808058081580825808358084580855808658087580885808958090580915809258093580945809558096580975809858099581005810158102581035810458105581065810758108581095811058111581125811358114581155811658117581185811958120581215812258123581245812558126581275812858129581305813158132581335813458135581365813758138581395814058141581425814358144581455814658147581485814958150581515815258153581545815558156581575815858159581605816158162581635816458165581665816758168581695817058171581725817358174581755817658177581785817958180581815818258183581845818558186581875818858189581905819158192581935819458195581965819758198581995820058201582025820358204582055820658207582085820958210582115821258213582145821558216582175821858219582205822158222582235822458225582265822758228582295823058231582325823358234582355823658237582385823958240582415824258243582445824558246582475824858249582505825158252582535825458255582565825758258582595826058261582625826358264582655826658267582685826958270582715827258273582745827558276582775827858279582805828158282582835828458285582865828758288582895829058291582925829358294582955829658297582985829958300583015830258303583045830558306583075830858309583105831158312583135831458315583165831758318583195832058321583225832358324583255832658327583285832958330583315833258333583345833558336583375833858339583405834158342583435834458345583465834758348583495835058351583525835358354583555835658357583585835958360583615836258363583645836558366583675836858369583705837158372583735837458375583765837758378583795838058381583825838358384583855838658387583885838958390583915839258393583945839558396583975839858399584005840158402584035840458405584065840758408584095841058411584125841358414584155841658417584185841958420584215842258423584245842558426584275842858429584305843158432584335843458435584365843758438584395844058441584425844358444584455844658447584485844958450584515845258453584545845558456584575845858459584605846158462584635846458465584665846758468584695847058471584725847358474584755847658477584785847958480584815848258483584845848558486584875848858489584905849158492584935849458495584965849758498584995850058501585025850358504585055850658507585085850958510585115851258513585145851558516585175851858519585205852158522585235852458525585265852758528585295853058531585325853358534585355853658537585385853958540585415854258543585445854558546585475854858549585505855158552585535855458555585565855758558585595856058561585625856358564585655856658567585685856958570585715857258573585745857558576585775857858579585805858158582585835858458585585865858758588585895859058591585925859358594585955859658597585985859958600586015860258603586045860558606586075860858609586105861158612586135861458615586165861758618586195862058621586225862358624586255862658627586285862958630586315863258633586345863558636586375863858639586405864158642586435864458645586465864758648586495865058651586525865358654586555865658657586585865958660586615866258663586645866558666586675866858669586705867158672586735867458675586765867758678586795868058681586825868358684586855868658687586885868958690586915869258693586945869558696586975869858699587005870158702587035870458705587065870758708587095871058711587125871358714587155871658717587185871958720587215872258723587245872558726587275872858729587305873158732587335873458735587365873758738587395874058741587425874358744587455874658747587485874958750587515875258753587545875558756587575875858759587605876158762587635876458765587665876758768587695877058771587725877358774587755877658777587785877958780587815878258783587845878558786587875878858789587905879158792587935879458795587965879758798587995880058801588025880358804588055880658807588085880958810588115881258813588145881558816588175881858819588205882158822588235882458825588265882758828588295883058831588325883358834588355883658837588385883958840588415884258843588445884558846588475884858849588505885158852588535885458855588565885758858588595886058861588625886358864588655886658867588685886958870588715887258873588745887558876588775887858879588805888158882588835888458885588865888758888588895889058891588925889358894588955889658897588985889958900589015890258903589045890558906589075890858909589105891158912589135891458915589165891758918589195892058921589225892358924589255892658927589285892958930589315893258933589345893558936589375893858939589405894158942589435894458945589465894758948589495895058951589525895358954589555895658957589585895958960589615896258963589645896558966589675896858969589705897158972589735897458975589765897758978589795898058981589825898358984589855898658987589885898958990589915899258993589945899558996589975899858999590005900159002590035900459005590065900759008590095901059011590125901359014590155901659017590185901959020590215902259023590245902559026590275902859029590305903159032590335903459035590365903759038590395904059041590425904359044590455904659047590485904959050590515905259053590545905559056590575905859059590605906159062590635906459065590665906759068590695907059071590725907359074590755907659077590785907959080590815908259083590845908559086590875908859089590905909159092590935909459095590965909759098590995910059101591025910359104591055910659107591085910959110591115911259113591145911559116591175911859119591205912159122591235912459125591265912759128591295913059131591325913359134591355913659137591385913959140591415914259143591445914559146591475914859149591505915159152591535915459155591565915759158591595916059161591625916359164591655916659167591685916959170591715917259173591745917559176591775917859179591805918159182591835918459185591865918759188591895919059191591925919359194591955919659197591985919959200592015920259203592045920559206592075920859209592105921159212592135921459215592165921759218592195922059221592225922359224592255922659227592285922959230592315923259233592345923559236592375923859239592405924159242592435924459245592465924759248592495925059251592525925359254592555925659257592585925959260592615926259263592645926559266592675926859269592705927159272592735927459275592765927759278592795928059281592825928359284592855928659287592885928959290592915929259293592945929559296592975929859299593005930159302593035930459305593065930759308593095931059311593125931359314593155931659317593185931959320593215932259323593245932559326593275932859329593305933159332593335933459335593365933759338593395934059341593425934359344593455934659347593485934959350593515935259353593545935559356593575935859359593605936159362593635936459365593665936759368593695937059371593725937359374593755937659377593785937959380593815938259383593845938559386593875938859389593905939159392593935939459395593965939759398593995940059401594025940359404594055940659407594085940959410594115941259413594145941559416594175941859419594205942159422594235942459425594265942759428594295943059431594325943359434594355943659437594385943959440594415944259443594445944559446594475944859449594505945159452594535945459455594565945759458594595946059461594625946359464594655946659467594685946959470594715947259473594745947559476594775947859479594805948159482594835948459485594865948759488594895949059491594925949359494594955949659497594985949959500595015950259503595045950559506595075950859509595105951159512595135951459515595165951759518595195952059521595225952359524595255952659527595285952959530595315953259533595345953559536595375953859539595405954159542595435954459545595465954759548595495955059551595525955359554595555955659557595585955959560595615956259563595645956559566595675956859569595705957159572595735957459575595765957759578595795958059581595825958359584595855958659587595885958959590595915959259593595945959559596595975959859599596005960159602596035960459605596065960759608596095961059611596125961359614596155961659617596185961959620596215962259623596245962559626596275962859629596305963159632596335963459635596365963759638596395964059641596425964359644596455964659647596485964959650596515965259653596545965559656596575965859659596605966159662596635966459665596665966759668596695967059671596725967359674596755967659677596785967959680596815968259683596845968559686596875968859689596905969159692596935969459695596965969759698596995970059701597025970359704597055970659707597085970959710597115971259713597145971559716597175971859719597205972159722597235972459725597265972759728597295973059731597325973359734597355973659737597385973959740597415974259743597445974559746597475974859749597505975159752597535975459755597565975759758597595976059761597625976359764597655976659767597685976959770597715977259773597745977559776597775977859779597805978159782597835978459785597865978759788597895979059791597925979359794597955979659797597985979959800598015980259803598045980559806598075980859809598105981159812598135981459815598165981759818598195982059821598225982359824598255982659827598285982959830598315983259833598345983559836598375983859839598405984159842598435984459845598465984759848598495985059851598525985359854598555985659857598585985959860598615986259863598645986559866598675986859869598705987159872598735987459875598765987759878598795988059881598825988359884598855988659887598885988959890598915989259893598945989559896598975989859899599005990159902599035990459905599065990759908599095991059911599125991359914599155991659917599185991959920599215992259923599245992559926599275992859929599305993159932599335993459935599365993759938599395994059941599425994359944599455994659947599485994959950599515995259953599545995559956599575995859959599605996159962599635996459965599665996759968599695997059971599725997359974599755997659977599785997959980599815998259983599845998559986599875998859989599905999159992599935999459995599965999759998599996000060001600026000360004600056000660007600086000960010600116001260013600146001560016600176001860019600206002160022600236002460025600266002760028600296003060031600326003360034600356003660037600386003960040600416004260043600446004560046600476004860049600506005160052600536005460055600566005760058600596006060061600626006360064600656006660067600686006960070600716007260073600746007560076600776007860079600806008160082600836008460085600866008760088600896009060091600926009360094600956009660097600986009960100601016010260103601046010560106601076010860109601106011160112601136011460115601166011760118601196012060121601226012360124601256012660127601286012960130601316013260133601346013560136601376013860139601406014160142601436014460145601466014760148601496015060151601526015360154601556015660157601586015960160601616016260163601646016560166601676016860169601706017160172601736017460175601766017760178601796018060181601826018360184601856018660187601886018960190601916019260193601946019560196601976019860199602006020160202602036020460205602066020760208602096021060211602126021360214602156021660217602186021960220602216022260223602246022560226602276022860229602306023160232602336023460235602366023760238602396024060241602426024360244602456024660247602486024960250602516025260253602546025560256602576025860259602606026160262602636026460265602666026760268602696027060271602726027360274602756027660277602786027960280602816028260283602846028560286602876028860289602906029160292602936029460295602966029760298602996030060301603026030360304603056030660307603086030960310603116031260313603146031560316603176031860319603206032160322603236032460325603266032760328603296033060331603326033360334603356033660337603386033960340603416034260343603446034560346603476034860349603506035160352603536035460355603566035760358603596036060361603626036360364603656036660367603686036960370603716037260373603746037560376603776037860379603806038160382603836038460385603866038760388603896039060391603926039360394603956039660397603986039960400604016040260403604046040560406604076040860409604106041160412604136041460415604166041760418604196042060421604226042360424604256042660427604286042960430604316043260433604346043560436604376043860439604406044160442604436044460445604466044760448604496045060451604526045360454604556045660457604586045960460604616046260463604646046560466604676046860469604706047160472604736047460475604766047760478604796048060481604826048360484604856048660487604886048960490604916049260493604946049560496604976049860499605006050160502605036050460505605066050760508605096051060511605126051360514605156051660517605186051960520605216052260523605246052560526605276052860529605306053160532605336053460535605366053760538605396054060541605426054360544605456054660547605486054960550605516055260553605546055560556605576055860559605606056160562605636056460565605666056760568605696057060571605726057360574605756057660577605786057960580605816058260583605846058560586605876058860589605906059160592605936059460595605966059760598605996060060601606026060360604606056060660607606086060960610606116061260613606146061560616606176061860619606206062160622606236062460625606266062760628606296063060631606326063360634606356063660637606386063960640606416064260643606446064560646606476064860649606506065160652606536065460655606566065760658606596066060661606626066360664606656066660667606686066960670606716067260673606746067560676606776067860679606806068160682606836068460685606866068760688606896069060691606926069360694606956069660697606986069960700607016070260703607046070560706607076070860709607106071160712607136071460715607166071760718607196072060721607226072360724607256072660727607286072960730607316073260733607346073560736607376073860739607406074160742607436074460745607466074760748607496075060751607526075360754607556075660757607586075960760607616076260763607646076560766607676076860769607706077160772607736077460775607766077760778607796078060781607826078360784607856078660787607886078960790607916079260793607946079560796607976079860799608006080160802608036080460805608066080760808608096081060811608126081360814608156081660817608186081960820608216082260823608246082560826608276082860829608306083160832608336083460835608366083760838608396084060841608426084360844608456084660847608486084960850608516085260853608546085560856608576085860859608606086160862608636086460865608666086760868608696087060871608726087360874608756087660877608786087960880608816088260883608846088560886608876088860889608906089160892608936089460895608966089760898608996090060901609026090360904609056090660907609086090960910609116091260913609146091560916609176091860919609206092160922609236092460925609266092760928609296093060931609326093360934609356093660937609386093960940609416094260943609446094560946609476094860949609506095160952609536095460955609566095760958609596096060961609626096360964609656096660967609686096960970609716097260973609746097560976609776097860979609806098160982609836098460985609866098760988609896099060991609926099360994609956099660997609986099961000610016100261003610046100561006610076100861009610106101161012610136101461015610166101761018610196102061021610226102361024610256102661027610286102961030610316103261033610346103561036610376103861039610406104161042610436104461045610466104761048610496105061051610526105361054610556105661057610586105961060610616106261063610646106561066610676106861069610706107161072610736107461075610766107761078610796108061081610826108361084610856108661087610886108961090610916109261093610946109561096610976109861099611006110161102611036110461105611066110761108611096111061111611126111361114611156111661117611186111961120611216112261123611246112561126611276112861129611306113161132611336113461135611366113761138611396114061141611426114361144611456114661147611486114961150611516115261153611546115561156611576115861159611606116161162611636116461165611666116761168611696117061171611726117361174611756117661177611786117961180611816118261183611846118561186611876118861189611906119161192611936119461195611966119761198611996120061201612026120361204612056120661207612086120961210612116121261213612146121561216612176121861219612206122161222612236122461225612266122761228612296123061231612326123361234612356123661237612386123961240612416124261243612446124561246612476124861249612506125161252612536125461255612566125761258612596126061261612626126361264612656126661267612686126961270612716127261273612746127561276612776127861279612806128161282612836128461285612866128761288612896129061291612926129361294612956129661297612986129961300613016130261303613046130561306613076130861309613106131161312613136131461315613166131761318613196132061321613226132361324613256132661327613286132961330613316133261333613346133561336613376133861339613406134161342613436134461345613466134761348613496135061351613526135361354613556135661357613586135961360613616136261363613646136561366613676136861369613706137161372613736137461375613766137761378613796138061381613826138361384613856138661387613886138961390613916139261393613946139561396613976139861399614006140161402614036140461405614066140761408614096141061411614126141361414614156141661417614186141961420614216142261423614246142561426614276142861429614306143161432614336143461435614366143761438614396144061441614426144361444614456144661447614486144961450614516145261453614546145561456614576145861459614606146161462614636146461465614666146761468614696147061471614726147361474614756147661477614786147961480614816148261483614846148561486614876148861489614906149161492614936149461495614966149761498614996150061501615026150361504615056150661507615086150961510615116151261513615146151561516615176151861519615206152161522615236152461525615266152761528615296153061531615326153361534615356153661537615386153961540615416154261543615446154561546615476154861549615506155161552615536155461555615566155761558615596156061561615626156361564615656156661567615686156961570615716157261573615746157561576615776157861579615806158161582615836158461585615866158761588615896159061591615926159361594615956159661597615986159961600616016160261603616046160561606616076160861609616106161161612616136161461615616166161761618616196162061621616226162361624616256162661627616286162961630616316163261633616346163561636616376163861639616406164161642616436164461645616466164761648616496165061651616526165361654616556165661657616586165961660616616166261663616646166561666616676166861669616706167161672616736167461675616766167761678616796168061681616826168361684616856168661687616886168961690616916169261693616946169561696616976169861699617006170161702617036170461705617066170761708617096171061711617126171361714617156171661717617186171961720617216172261723617246172561726617276172861729617306173161732617336173461735617366173761738617396174061741617426174361744617456174661747617486174961750617516175261753617546175561756617576175861759617606176161762617636176461765617666176761768617696177061771617726177361774617756177661777617786177961780617816178261783617846178561786617876178861789617906179161792617936179461795617966179761798617996180061801618026180361804618056180661807618086180961810618116181261813618146181561816618176181861819618206182161822618236182461825618266182761828618296183061831618326183361834618356183661837618386183961840618416184261843618446184561846618476184861849618506185161852618536185461855618566185761858618596186061861618626186361864618656186661867618686186961870618716187261873618746187561876618776187861879618806188161882618836188461885618866188761888618896189061891618926189361894618956189661897618986189961900619016190261903619046190561906619076190861909619106191161912619136191461915619166191761918619196192061921619226192361924619256192661927619286192961930619316193261933619346193561936619376193861939619406194161942619436194461945619466194761948619496195061951619526195361954619556195661957619586195961960619616196261963619646196561966619676196861969619706197161972619736197461975619766197761978619796198061981619826198361984619856198661987619886198961990619916199261993619946199561996619976199861999620006200162002620036200462005620066200762008620096201062011620126201362014620156201662017620186201962020620216202262023620246202562026620276202862029620306203162032620336203462035620366203762038620396204062041620426204362044620456204662047620486204962050620516205262053620546205562056620576205862059620606206162062620636206462065620666206762068620696207062071620726207362074620756207662077620786207962080620816208262083620846208562086620876208862089620906209162092620936209462095620966209762098620996210062101621026210362104621056210662107621086210962110621116211262113621146211562116621176211862119621206212162122621236212462125621266212762128621296213062131621326213362134621356213662137621386213962140621416214262143621446214562146621476214862149621506215162152621536215462155621566215762158621596216062161621626216362164621656216662167621686216962170621716217262173621746217562176621776217862179621806218162182621836218462185621866218762188621896219062191621926219362194621956219662197621986219962200622016220262203622046220562206622076220862209622106221162212622136221462215622166221762218622196222062221622226222362224622256222662227622286222962230622316223262233622346223562236622376223862239622406224162242622436224462245622466224762248622496225062251622526225362254622556225662257622586225962260622616226262263622646226562266622676226862269622706227162272622736227462275622766227762278622796228062281622826228362284622856228662287622886228962290622916229262293622946229562296622976229862299623006230162302623036230462305623066230762308623096231062311623126231362314623156231662317623186231962320623216232262323623246232562326623276232862329623306233162332623336233462335623366233762338623396234062341623426234362344623456234662347623486234962350623516235262353623546235562356623576235862359623606236162362623636236462365623666236762368623696237062371623726237362374623756237662377623786237962380623816238262383623846238562386623876238862389623906239162392623936239462395623966239762398623996240062401624026240362404624056240662407624086240962410624116241262413624146241562416624176241862419624206242162422624236242462425624266242762428624296243062431624326243362434624356243662437624386243962440624416244262443624446244562446624476244862449624506245162452624536245462455624566245762458624596246062461624626246362464624656246662467624686246962470624716247262473624746247562476624776247862479624806248162482624836248462485624866248762488624896249062491624926249362494624956249662497624986249962500625016250262503625046250562506625076250862509625106251162512625136251462515625166251762518625196252062521625226252362524625256252662527625286252962530625316253262533625346253562536625376253862539625406254162542625436254462545625466254762548625496255062551625526255362554625556255662557625586255962560625616256262563625646256562566625676256862569625706257162572625736257462575625766257762578625796258062581625826258362584625856258662587625886258962590625916259262593625946259562596625976259862599626006260162602626036260462605626066260762608626096261062611626126261362614626156261662617626186261962620626216262262623626246262562626626276262862629626306263162632626336263462635626366263762638626396264062641626426264362644626456264662647626486264962650626516265262653626546265562656626576265862659626606266162662626636266462665626666266762668626696267062671626726267362674626756267662677626786267962680626816268262683626846268562686626876268862689626906269162692626936269462695626966269762698626996270062701627026270362704627056270662707627086270962710627116271262713627146271562716627176271862719627206272162722627236272462725627266272762728627296273062731627326273362734627356273662737627386273962740627416274262743627446274562746627476274862749627506275162752627536275462755627566275762758627596276062761627626276362764627656276662767627686276962770627716277262773627746277562776627776277862779627806278162782627836278462785627866278762788627896279062791627926279362794627956279662797627986279962800628016280262803628046280562806628076280862809628106281162812628136281462815628166281762818628196282062821628226282362824628256282662827628286282962830628316283262833628346283562836628376283862839628406284162842628436284462845628466284762848628496285062851628526285362854628556285662857628586285962860628616286262863628646286562866628676286862869628706287162872628736287462875628766287762878628796288062881628826288362884628856288662887628886288962890628916289262893628946289562896628976289862899629006290162902629036290462905629066290762908629096291062911629126291362914629156291662917629186291962920629216292262923629246292562926629276292862929629306293162932629336293462935629366293762938629396294062941629426294362944629456294662947629486294962950629516295262953629546295562956629576295862959629606296162962629636296462965629666296762968629696297062971629726297362974629756297662977629786297962980629816298262983629846298562986629876298862989629906299162992629936299462995629966299762998629996300063001630026300363004630056300663007630086300963010630116301263013630146301563016630176301863019630206302163022630236302463025630266302763028630296303063031630326303363034630356303663037630386303963040630416304263043630446304563046630476304863049630506305163052630536305463055630566305763058630596306063061630626306363064630656306663067630686306963070630716307263073630746307563076630776307863079630806308163082630836308463085630866308763088630896309063091630926309363094630956309663097630986309963100631016310263103631046310563106631076310863109631106311163112631136311463115631166311763118631196312063121631226312363124631256312663127631286312963130631316313263133631346313563136631376313863139631406314163142631436314463145631466314763148631496315063151631526315363154631556315663157631586315963160631616316263163631646316563166631676316863169631706317163172631736317463175631766317763178631796318063181631826318363184631856318663187631886318963190631916319263193631946319563196631976319863199632006320163202632036320463205632066320763208632096321063211632126321363214632156321663217632186321963220632216322263223632246322563226632276322863229632306323163232632336323463235632366323763238632396324063241632426324363244632456324663247632486324963250632516325263253632546325563256632576325863259632606326163262632636326463265632666326763268632696327063271632726327363274632756327663277632786327963280632816328263283632846328563286632876328863289632906329163292632936329463295632966329763298632996330063301633026330363304633056330663307633086330963310633116331263313633146331563316633176331863319633206332163322633236332463325633266332763328633296333063331633326333363334633356333663337633386333963340633416334263343633446334563346633476334863349633506335163352633536335463355633566335763358633596336063361633626336363364633656336663367633686336963370633716337263373633746337563376633776337863379633806338163382633836338463385633866338763388633896339063391633926339363394633956339663397633986339963400634016340263403634046340563406634076340863409634106341163412634136341463415634166341763418634196342063421634226342363424634256342663427634286342963430634316343263433634346343563436634376343863439634406344163442634436344463445634466344763448634496345063451634526345363454634556345663457634586345963460634616346263463634646346563466634676346863469634706347163472634736347463475634766347763478634796348063481634826348363484634856348663487634886348963490634916349263493634946349563496634976349863499635006350163502635036350463505635066350763508635096351063511635126351363514635156351663517635186351963520635216352263523635246352563526635276352863529635306353163532635336353463535635366353763538635396354063541635426354363544635456354663547635486354963550635516355263553635546355563556635576355863559635606356163562635636356463565635666356763568635696357063571635726357363574635756357663577635786357963580635816358263583635846358563586635876358863589635906359163592635936359463595635966359763598635996360063601636026360363604636056360663607636086360963610636116361263613636146361563616636176361863619636206362163622636236362463625636266362763628636296363063631636326363363634636356363663637636386363963640636416364263643636446364563646636476364863649636506365163652636536365463655636566365763658636596366063661636626366363664636656366663667636686366963670636716367263673636746367563676636776367863679636806368163682636836368463685636866368763688636896369063691636926369363694636956369663697636986369963700637016370263703637046370563706637076370863709637106371163712637136371463715637166371763718637196372063721637226372363724637256372663727637286372963730637316373263733637346373563736637376373863739637406374163742637436374463745637466374763748637496375063751637526375363754637556375663757637586375963760637616376263763637646376563766637676376863769637706377163772637736377463775637766377763778637796378063781637826378363784637856378663787637886378963790637916379263793637946379563796637976379863799638006380163802638036380463805638066380763808638096381063811638126381363814638156381663817638186381963820638216382263823638246382563826638276382863829638306383163832638336383463835638366383763838638396384063841638426384363844638456384663847638486384963850638516385263853638546385563856638576385863859638606386163862638636386463865638666386763868638696387063871638726387363874638756387663877638786387963880638816388263883638846388563886638876388863889638906389163892638936389463895638966389763898638996390063901639026390363904639056390663907639086390963910639116391263913639146391563916639176391863919639206392163922639236392463925639266392763928639296393063931639326393363934639356393663937639386393963940639416394263943639446394563946639476394863949639506395163952639536395463955639566395763958639596396063961639626396363964639656396663967639686396963970639716397263973639746397563976639776397863979639806398163982639836398463985639866398763988639896399063991639926399363994639956399663997639986399964000640016400264003640046400564006640076400864009640106401164012640136401464015640166401764018640196402064021640226402364024640256402664027640286402964030640316403264033640346403564036640376403864039640406404164042640436404464045640466404764048640496405064051640526405364054640556405664057640586405964060640616406264063640646406564066640676406864069640706407164072640736407464075640766407764078640796408064081640826408364084640856408664087640886408964090640916409264093640946409564096640976409864099641006410164102641036410464105641066410764108641096411064111641126411364114641156411664117641186411964120641216412264123641246412564126641276412864129641306413164132641336413464135641366413764138641396414064141641426414364144641456414664147641486414964150641516415264153641546415564156641576415864159641606416164162641636416464165641666416764168641696417064171641726417364174641756417664177641786417964180641816418264183641846418564186641876418864189641906419164192641936419464195641966419764198641996420064201642026420364204642056420664207642086420964210642116421264213642146421564216642176421864219642206422164222642236422464225642266422764228642296423064231642326423364234642356423664237642386423964240642416424264243642446424564246642476424864249642506425164252642536425464255642566425764258642596426064261642626426364264642656426664267642686426964270642716427264273642746427564276642776427864279642806428164282642836428464285642866428764288642896429064291642926429364294642956429664297642986429964300643016430264303643046430564306643076430864309643106431164312643136431464315643166431764318643196432064321643226432364324643256432664327643286432964330643316433264333643346433564336643376433864339643406434164342643436434464345643466434764348643496435064351643526435364354643556435664357643586435964360643616436264363643646436564366643676436864369643706437164372643736437464375643766437764378643796438064381643826438364384643856438664387643886438964390643916439264393643946439564396643976439864399644006440164402644036440464405644066440764408644096441064411644126441364414644156441664417644186441964420644216442264423644246442564426644276442864429644306443164432644336443464435644366443764438644396444064441644426444364444644456444664447644486444964450644516445264453644546445564456644576445864459644606446164462644636446464465644666446764468644696447064471644726447364474644756447664477644786447964480644816448264483644846448564486644876448864489644906449164492644936449464495644966449764498644996450064501645026450364504645056450664507645086450964510645116451264513645146451564516645176451864519645206452164522645236452464525645266452764528645296453064531645326453364534645356453664537645386453964540645416454264543645446454564546645476454864549645506455164552645536455464555645566455764558645596456064561645626456364564645656456664567645686456964570645716457264573645746457564576645776457864579645806458164582645836458464585645866458764588645896459064591645926459364594645956459664597645986459964600646016460264603646046460564606646076460864609646106461164612646136461464615646166461764618646196462064621646226462364624646256462664627646286462964630646316463264633646346463564636646376463864639646406464164642646436464464645646466464764648646496465064651646526465364654646556465664657646586465964660646616466264663646646466564666646676466864669646706467164672646736467464675646766467764678646796468064681646826468364684646856468664687646886468964690646916469264693646946469564696646976469864699647006470164702647036470464705647066470764708647096471064711647126471364714647156471664717647186471964720647216472264723647246472564726647276472864729647306473164732647336473464735647366473764738647396474064741647426474364744647456474664747647486474964750647516475264753647546475564756647576475864759647606476164762647636476464765647666476764768647696477064771647726477364774647756477664777647786477964780647816478264783647846478564786647876478864789647906479164792647936479464795647966479764798647996480064801648026480364804648056480664807648086480964810648116481264813648146481564816648176481864819648206482164822648236482464825648266482764828648296483064831648326483364834648356483664837648386483964840648416484264843648446484564846648476484864849648506485164852648536485464855648566485764858648596486064861648626486364864648656486664867648686486964870648716487264873648746487564876648776487864879648806488164882648836488464885648866488764888648896489064891648926489364894648956489664897648986489964900649016490264903649046490564906649076490864909649106491164912649136491464915649166491764918649196492064921649226492364924649256492664927649286492964930649316493264933649346493564936649376493864939649406494164942649436494464945649466494764948649496495064951649526495364954649556495664957649586495964960649616496264963649646496564966649676496864969649706497164972649736497464975649766497764978649796498064981649826498364984649856498664987649886498964990649916499264993649946499564996649976499864999650006500165002650036500465005650066500765008650096501065011650126501365014650156501665017650186501965020650216502265023650246502565026650276502865029650306503165032650336503465035650366503765038650396504065041650426504365044650456504665047650486504965050650516505265053650546505565056650576505865059650606506165062650636506465065650666506765068650696507065071650726507365074650756507665077650786507965080650816508265083650846508565086650876508865089650906509165092650936509465095650966509765098650996510065101651026510365104651056510665107651086510965110651116511265113651146511565116651176511865119651206512165122651236512465125651266512765128651296513065131651326513365134651356513665137651386513965140651416514265143651446514565146651476514865149651506515165152651536515465155651566515765158651596516065161651626516365164651656516665167651686516965170651716517265173651746517565176651776517865179651806518165182651836518465185651866518765188651896519065191651926519365194651956519665197651986519965200652016520265203652046520565206652076520865209652106521165212652136521465215652166521765218652196522065221652226522365224652256522665227652286522965230652316523265233652346523565236652376523865239652406524165242652436524465245652466524765248652496525065251652526525365254652556525665257652586525965260652616526265263652646526565266652676526865269652706527165272652736527465275652766527765278652796528065281652826528365284652856528665287652886528965290652916529265293652946529565296652976529865299653006530165302653036530465305653066530765308653096531065311653126531365314653156531665317653186531965320653216532265323653246532565326653276532865329653306533165332653336533465335653366533765338653396534065341653426534365344653456534665347653486534965350653516535265353653546535565356653576535865359653606536165362653636536465365653666536765368653696537065371653726537365374653756537665377653786537965380653816538265383653846538565386653876538865389653906539165392653936539465395653966539765398653996540065401654026540365404654056540665407654086540965410654116541265413654146541565416654176541865419654206542165422654236542465425654266542765428654296543065431654326543365434654356543665437654386543965440654416544265443654446544565446654476544865449654506545165452654536545465455654566545765458654596546065461654626546365464654656546665467654686546965470654716547265473654746547565476654776547865479654806548165482654836548465485654866548765488654896549065491654926549365494654956549665497654986549965500655016550265503655046550565506655076550865509655106551165512655136551465515655166551765518655196552065521655226552365524655256552665527655286552965530655316553265533655346553565536655376553865539655406554165542655436554465545655466554765548655496555065551655526555365554655556555665557655586555965560655616556265563655646556565566655676556865569655706557165572655736557465575655766557765578655796558065581655826558365584655856558665587655886558965590655916559265593655946559565596655976559865599656006560165602656036560465605656066560765608656096561065611656126561365614656156561665617656186561965620656216562265623656246562565626656276562865629656306563165632656336563465635656366563765638656396564065641656426564365644656456564665647656486564965650656516565265653656546565565656656576565865659656606566165662656636566465665656666566765668656696567065671656726567365674656756567665677656786567965680656816568265683656846568565686656876568865689656906569165692656936569465695656966569765698656996570065701657026570365704657056570665707657086570965710657116571265713657146571565716657176571865719657206572165722657236572465725657266572765728657296573065731657326573365734657356573665737657386573965740657416574265743657446574565746657476574865749657506575165752657536575465755657566575765758657596576065761657626576365764657656576665767657686576965770657716577265773657746577565776657776577865779657806578165782657836578465785657866578765788657896579065791657926579365794657956579665797657986579965800658016580265803658046580565806658076580865809658106581165812658136581465815658166581765818658196582065821658226582365824658256582665827658286582965830658316583265833658346583565836658376583865839658406584165842658436584465845658466584765848658496585065851658526585365854658556585665857658586585965860658616586265863658646586565866658676586865869658706587165872658736587465875658766587765878658796588065881658826588365884658856588665887658886588965890658916589265893658946589565896658976589865899659006590165902659036590465905659066590765908659096591065911659126591365914659156591665917659186591965920659216592265923659246592565926659276592865929659306593165932659336593465935659366593765938659396594065941659426594365944659456594665947659486594965950659516595265953659546595565956659576595865959659606596165962659636596465965659666596765968659696597065971659726597365974659756597665977659786597965980659816598265983659846598565986659876598865989659906599165992659936599465995659966599765998659996600066001660026600366004660056600666007660086600966010660116601266013660146601566016660176601866019660206602166022660236602466025660266602766028660296603066031660326603366034660356603666037660386603966040660416604266043660446604566046660476604866049660506605166052660536605466055660566605766058660596606066061660626606366064660656606666067660686606966070660716607266073660746607566076660776607866079660806608166082660836608466085660866608766088660896609066091660926609366094660956609666097660986609966100661016610266103661046610566106661076610866109661106611166112661136611466115661166611766118661196612066121661226612366124661256612666127661286612966130661316613266133661346613566136661376613866139661406614166142661436614466145661466614766148661496615066151661526615366154661556615666157661586615966160661616616266163661646616566166661676616866169661706617166172661736617466175661766617766178661796618066181661826618366184661856618666187661886618966190661916619266193661946619566196661976619866199662006620166202662036620466205662066620766208662096621066211662126621366214662156621666217662186621966220662216622266223662246622566226662276622866229662306623166232662336623466235662366623766238662396624066241662426624366244662456624666247662486624966250662516625266253662546625566256662576625866259662606626166262
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. let highMapAddColor = 0 //true
  5. !(function () {
  6. 'use strict'
  7. function t(t, i) {
  8. return typeof t === i
  9. }
  10. function i(t, i) {
  11. return t instanceof i
  12. }
  13. function n(t) {
  14. return t && t.nodeType
  15. }
  16. function e(t) {
  17. return n(t) ? t : i(t, g) ? t[0] : void 0
  18. }
  19. function o(t, i, n) {
  20. return (
  21. g.each(t, function (t, e) {
  22. n = i.call(e, n, t, e)
  23. }),
  24. n
  25. )
  26. }
  27. function r(t, i, n) {
  28. var e, o, r
  29. if (t === i) return !0
  30. if (!t || !i || t.constructor !== i.constructor) return !1
  31. for (e = 0, o = n.length; o > e; e += 1) {
  32. if (((r = n[e]), t[r] && y(t[r].equals) && !t[r].equals(i[r]))) return !1
  33. if (t[r] !== i[r]) return !1
  34. }
  35. return !0
  36. }
  37. function s(t, i, n, e) {
  38. ;(this.left = E(t)),
  39. (this.top = E(i)),
  40. (this.width = E(n)),
  41. (this.height = E(e)),
  42. (this.right = this.left + this.width),
  43. (this.bottom = this.top + this.height)
  44. }
  45. function h(t, i, n, e) {
  46. ;(this.visible = t || 0),
  47. (this.viewport = i || 0),
  48. (this.possible = n || 0),
  49. (this.rects = (e && T({}, e)) || null)
  50. }
  51. function l(t, i) {
  52. ;(this.els = t), (this.viewport = i)
  53. }
  54. function c(t, i, n) {
  55. var e
  56. return (
  57. g.inArray(n, q) >= 0 ? (e = s.ofElement(t)) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  58. e ? e[n] : 0
  59. )
  60. }
  61. function u(t, i) {
  62. return t.val - i.val
  63. }
  64. function a(t, i) {
  65. return i.val - t.val
  66. }
  67. function f(t) {
  68. var i = s.ofContent(t, !0),
  69. n = s.ofViewport(t, !0),
  70. e = i.width - n.width,
  71. o = i.height - n.height
  72. ;(this.content = i),
  73. (this.viewport = n),
  74. (this.width = 0 >= e ? null : n.left / e),
  75. (this.height = 0 >= o ? null : n.top / o),
  76. (this.left = n.left),
  77. (this.top = n.top),
  78. (this.right = i.right - n.right),
  79. (this.bottom = i.bottom - n.bottom)
  80. }
  81. function p(t) {
  82. this.el = t || window
  83. }
  84. function d(t, i) {
  85. ;(this.context = t), (this.viewport = i), this.init()
  86. }
  87. function v(t, i, n, e) {
  88. ;(this.context = new l(t, i)), (this.property = n), (this.descending = e), this.init()
  89. }
  90. function w(t) {
  91. t && t !== window && t !== document
  92. ? ((this.context = t), (this.$autoTarget = g(t)))
  93. : (this.context = window),
  94. this.init()
  95. }
  96. var g = jQuery,
  97. m = g(window),
  98. b = g(document),
  99. T = g.extend,
  100. y = g.isFunction,
  101. k = Math.max,
  102. V = Math.min,
  103. E = Math.round,
  104. x = (function () {
  105. var t = {},
  106. i = 1
  107. return function (n) {
  108. return n ? (t[n] || ((t[n] = i), (i += 1)), t[n]) : 0
  109. }
  110. })()
  111. T(s.prototype, {
  112. equals: function (t) {
  113. return r(this, t, ['left', 'top', 'width', 'height'])
  114. },
  115. area: function () {
  116. return this.width * this.height
  117. },
  118. relativeTo: function (t) {
  119. return new s(this.left - t.left, this.top - t.top, this.width, this.height)
  120. },
  121. intersection: function (t) {
  122. if (!i(t, s)) return null
  123. var n = k(this.left, t.left),
  124. e = V(this.right, t.right),
  125. o = k(this.top, t.top),
  126. r = V(this.bottom, t.bottom),
  127. h = e - n,
  128. l = r - o
  129. return h >= 0 && l >= 0 ? new s(n, o, h, l) : null
  130. },
  131. envelope: function (t) {
  132. if (!i(t, s)) return this
  133. var n = V(this.left, t.left),
  134. e = k(this.right, t.right),
  135. o = V(this.top, t.top),
  136. r = k(this.bottom, t.bottom),
  137. h = e - n,
  138. l = r - o
  139. return new s(n, o, h, l)
  140. }
  141. }),
  142. T(s, {
  143. ofContent: function (t, i) {
  144. return t && t !== document && t !== window
  145. ? i
  146. ? new s(0, 0, t.scrollWidth, t.scrollHeight)
  147. : new s(
  148. t.offsetLeft - t.scrollLeft,
  149. t.offsetTop - t.scrollTop,
  150. t.scrollWidth,
  151. t.scrollHeight
  152. )
  153. : new s(0, 0, b.width(), b.height())
  154. },
  155. ofViewport: function (t, i) {
  156. return t && t !== document && t !== window
  157. ? i
  158. ? new s(t.scrollLeft, t.scrollTop, t.clientWidth, t.clientHeight)
  159. : new s(t.offsetLeft, t.offsetTop, t.clientWidth, t.clientHeight)
  160. : new s(m.scrollLeft(), m.scrollTop(), m.width(), m.height())
  161. },
  162. ofElement: function (t) {
  163. var i = g(t)
  164. if (!i.is(':visible')) return null
  165. var n = i.offset()
  166. return new s(n.left, n.top, i.outerWidth(), i.outerHeight())
  167. }
  168. }),
  169. T(h.prototype, {
  170. equals: function (t) {
  171. return this.fracsEqual(t) && this.rectsEqual(t)
  172. },
  173. fracsEqual: function (t) {
  174. return r(this, t, ['visible', 'viewport', 'possible'])
  175. },
  176. rectsEqual: function (t) {
  177. return r(this.rects, t.rects, ['document', 'element', 'viewport'])
  178. }
  179. }),
  180. T(h, {
  181. of: function (t, i) {
  182. var e, o, r
  183. return (
  184. (t = (n(t) && s.ofElement(t)) || t),
  185. (i = (n(i) && s.ofViewport(i)) || i || s.ofViewport()),
  186. t instanceof s && (e = t.intersection(i))
  187. ? ((o = e.area()),
  188. (r = V(t.width, i.width) * V(t.height, i.height)),
  189. new h(o / t.area(), o / i.area(), o / r, {
  190. document: e,
  191. element: e.relativeTo(t),
  192. viewport: e.relativeTo(i)
  193. }))
  194. : new h()
  195. )
  196. }
  197. })
  198. var q = ['width', 'height', 'left', 'right', 'top', 'bottom'],
  199. S = ['possible', 'visible', 'viewport']
  200. T(l.prototype, {
  201. sorted: function (t, i) {
  202. var n = this.viewport
  203. return g
  204. .map(this.els, function (i) {
  205. return {
  206. el: i,
  207. val: c(i, n, t)
  208. }
  209. })
  210. .sort(i ? a : u)
  211. },
  212. best: function (t, i) {
  213. return this.els.length ? this.sorted(t, i)[0] : null
  214. }
  215. }),
  216. T(f.prototype, {
  217. equals: function (t) {
  218. return r(this, t, [
  219. 'width',
  220. 'height',
  221. 'left',
  222. 'top',
  223. 'right',
  224. 'bottom',
  225. 'content',
  226. 'viewport'
  227. ])
  228. }
  229. }),
  230. T(p.prototype, {
  231. equals: function (t) {
  232. return r(this, t, ['el'])
  233. },
  234. scrollState: function () {
  235. return new f(this.el)
  236. },
  237. scrollTo: function (t, i, n) {
  238. var e = g(this.el === window ? 'html,body' : this.el)
  239. ;(t = t || 0),
  240. (i = i || 0),
  241. (n = isNaN(n) ? 1e3 : n),
  242. e.stop(!0).animate(
  243. {
  244. scrollLeft: t,
  245. scrollTop: i
  246. },
  247. n
  248. )
  249. },
  250. scroll: function (t, i, n) {
  251. var e = this.el === window ? m : g(this.el)
  252. ;(t = t || 0), (i = i || 0), this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  253. },
  254. scrollToRect: function (t, i, n, e) {
  255. ;(i = i || 0), (n = n || 0), this.scrollTo(t.left - i, t.top - n, e)
  256. },
  257. scrollToElement: function (t, i, n, e) {
  258. var o = s.ofElement(t).relativeTo(s.ofContent(this.el))
  259. this.scrollToRect(o, i, n, e)
  260. }
  261. })
  262. var C = {
  263. init: function () {
  264. ;(this.callbacks = g.Callbacks('memory unique')),
  265. (this.currVal = null),
  266. (this.prevVal = null),
  267. (this.checkProxy = g.proxy(this.check, this)),
  268. this.autoCheck()
  269. },
  270. bind: function (t) {
  271. this.callbacks.add(t)
  272. },
  273. unbind: function (t) {
  274. t ? this.callbacks.remove(t) : this.callbacks.empty()
  275. },
  276. trigger: function () {
  277. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  278. },
  279. check: function (t) {
  280. var i = this.updatedValue(t)
  281. return void 0 !== i && ((this.prevVal = this.currVal), (this.currVal = i), this.trigger(), !0)
  282. },
  283. $autoTarget: m,
  284. autoEvents: 'load resize scroll',
  285. autoCheck: function (t) {
  286. this.$autoTarget[t === !1 ? 'off' : 'on'](this.autoEvents, this.checkProxy)
  287. }
  288. }
  289. T(d.prototype, C, {
  290. updatedValue: function () {
  291. var t = h.of(this.context, this.viewport)
  292. return this.currVal && this.currVal.equals(t) ? void 0 : t
  293. }
  294. }),
  295. T(v.prototype, C, {
  296. updatedValue: function () {
  297. var t = this.context.best(this.property, this.descending)
  298. return t && ((t = t.val > 0 ? t.el : null), this.currVal !== t) ? t : void 0
  299. }
  300. }),
  301. T(w.prototype, C, {
  302. updatedValue: function () {
  303. var t = new f(this.context)
  304. return this.currVal && this.currVal.equals(t) ? void 0 : t
  305. }
  306. })
  307. var L = function (t, i) {
  308. var n = [].slice,
  309. e = jQuery,
  310. o = e.extend,
  311. r = e.isFunction,
  312. s = o({}, i),
  313. h = function (i, n, o, s) {
  314. return (
  315. (o = r(o) ? o.apply(i, n) : o),
  316. r(s[o])
  317. ? s[o].apply(i, n)
  318. : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  319. )
  320. },
  321. l = function () {
  322. return h(this, n.call(arguments), s.defaultStatic, l)
  323. },
  324. c = function (t) {
  325. return r(c[t])
  326. ? c[t].apply(this, n.call(arguments, 1))
  327. : h(this, n.call(arguments), s.defaultMethod, c)
  328. },
  329. u = function (t) {
  330. t && (o(l, t.statics), o(c, t.methods)), (l.modplug = u)
  331. }
  332. ;(u.prev = {
  333. statics: e[t],
  334. methods: e.fn[t]
  335. }),
  336. u(i),
  337. (e[t] = l),
  338. (e.fn[t] = c)
  339. },
  340. M = 'fracs'
  341. L(M, {
  342. statics: {
  343. version: '0.15.0',
  344. Rect: s,
  345. Fractions: h,
  346. Group: l,
  347. ScrollState: f,
  348. Viewport: p,
  349. FracsCallbacks: d,
  350. GroupCallbacks: v,
  351. ScrollStateCallbacks: w,
  352. fracs: function (t, i) {
  353. return h.of(t, i)
  354. }
  355. },
  356. methods: {
  357. content: function (t) {
  358. return this.length ? s.ofContent(this[0], t) : null
  359. },
  360. envelope: function () {
  361. return o(this, function (t) {
  362. var i = s.ofElement(this)
  363. return t ? t.envelope(i) : i
  364. })
  365. },
  366. fracs: function (i, n, o) {
  367. t(i, 'string') || ((o = n), (n = i), (i = null)), y(n) || ((o = n), (n = null)), (o = e(o))
  368. var r = M + '.fracs.' + x(o)
  369. return 'unbind' === i
  370. ? this.each(function () {
  371. var t = g(this).data(r)
  372. t && t.unbind(n)
  373. })
  374. : 'check' === i
  375. ? this.each(function () {
  376. var t = g(this).data(r)
  377. t && t.check()
  378. })
  379. : y(n)
  380. ? this.each(function () {
  381. var t = g(this),
  382. i = t.data(r)
  383. i || ((i = new d(this, o)), t.data(r, i)), i.bind(n)
  384. })
  385. : this.length
  386. ? h.of(this[0], o)
  387. : null
  388. },
  389. intersection: function () {
  390. return o(this, function (t) {
  391. var i = s.ofElement(this)
  392. return t ? t.intersection(i) : i
  393. })
  394. },
  395. max: function (t, i, n) {
  396. return (
  397. y(i) || ((n = i), (i = null)),
  398. (n = e(n)),
  399. i ? (new v(this, n, t, !0).bind(i), this) : this.pushStack(new l(this, n).best(t, !0).el)
  400. )
  401. },
  402. min: function (t, i, n) {
  403. return (
  404. y(i) || ((n = i), (i = null)),
  405. (n = e(n)),
  406. i ? (new v(this, n, t).bind(i), this) : this.pushStack(new l(this, n).best(t).el)
  407. )
  408. },
  409. rect: function () {
  410. return this.length ? s.ofElement(this[0]) : null
  411. },
  412. scrollState: function (i, n) {
  413. var e = M + '.scrollState'
  414. return (
  415. t(i, 'string') || ((n = i), (i = null)),
  416. 'unbind' === i
  417. ? this.each(function () {
  418. var t = g(this).data(e)
  419. t && t.unbind(n)
  420. })
  421. : 'check' === i
  422. ? this.each(function () {
  423. var t = g(this).data(e)
  424. t && t.check()
  425. })
  426. : y(n)
  427. ? this.each(function () {
  428. var t = g(this),
  429. i = t.data(e)
  430. i || ((i = new w(this)), t.data(e, i)), i.bind(n)
  431. })
  432. : this.length
  433. ? new f(this[0])
  434. : null
  435. )
  436. },
  437. scroll: function (t, i, n) {
  438. return this.each(function () {
  439. new p(this).scroll(t, i, n)
  440. })
  441. },
  442. scrollTo: function (t, i, n, o) {
  443. return (
  444. g.isNumeric(t) && ((o = n), (n = i), (i = t), (t = null)),
  445. (t = e(t)),
  446. this.each(function () {
  447. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  448. })
  449. )
  450. },
  451. scrollToThis: function (t, i, n, o) {
  452. return (o = new p(e(o))), o.scrollToElement(this[0], t, i, n), this
  453. },
  454. softLink: function (t, i, n, o) {
  455. return (
  456. (o = new p(e(o))),
  457. this.filter('a[href^=#]').each(function () {
  458. var e = g(this)
  459. e.on('click', function () {
  460. o.scrollToElement(g(e.attr('href'))[0], t, i, n)
  461. })
  462. })
  463. )
  464. },
  465. sort: function (i, n, o) {
  466. return (
  467. t(n, 'boolean') || ((o = n), (n = null)),
  468. (o = e(o)),
  469. this.pushStack(
  470. g.map(new l(this, o).sorted(i, !n), function (t) {
  471. return t.el
  472. })
  473. )
  474. )
  475. },
  476. viewport: function (t) {
  477. return this.length ? s.ofViewport(this[0], t) : null
  478. }
  479. },
  480. defaultStatic: 'fracs',
  481. defaultMethod: 'fracs'
  482. })
  483. })()
  484. if ('undefined' == typeof jQuery) throw new Error("Bootstrap's JavaScript requires jQuery")
  485. ;+(function (t) {
  486. 'use strict'
  487. function e(e) {
  488. return this.each(function () {
  489. var o = t(this),
  490. s = o.data('bs.tooltip'),
  491. n = 'object' == typeof e && e
  492. ;(s || 'destroy' != e) &&
  493. (s || o.data('bs.tooltip', (s = new i(this, n))), 'string' == typeof e && s[e]())
  494. })
  495. }
  496. var i = function (t, e) {
  497. ;(this.type =
  498. this.options =
  499. this.enabled =
  500. this.timeout =
  501. this.hoverState =
  502. this.$element =
  503. null),
  504. this.init('tooltip', t, e)
  505. }
  506. ;(i.VERSION = '3.2.0'),
  507. (i.DEFAULTS = {
  508. animation: !0,
  509. placement: 'top',
  510. selector: !1,
  511. template:
  512. '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  513. trigger: 'hover focus',
  514. title: '',
  515. delay: 0,
  516. html: !1,
  517. container: !1,
  518. viewport: {
  519. selector: 'body',
  520. padding: 0
  521. }
  522. }),
  523. (i.prototype.init = function (e, i, o) {
  524. ;(this.enabled = !0),
  525. (this.type = e),
  526. (this.$element = t(i)),
  527. (this.options = this.getOptions(o)),
  528. (this.$viewport =
  529. this.options.viewport && t(this.options.viewport.selector || this.options.viewport))
  530. for (var s = this.options.trigger.split(' '), n = s.length; n--; ) {
  531. var r = s[n]
  532. if ('click' == r)
  533. this.$element.on('click.' + this.type, this.options.selector, t.proxy(this.toggle, this))
  534. else if ('manual' != r) {
  535. var a = 'hover' == r ? 'mouseenter' : 'focusin',
  536. l = 'hover' == r ? 'mouseleave' : 'focusout'
  537. this.$element.on(a + '.' + this.type, this.options.selector, t.proxy(this.enter, this)),
  538. this.$element.on(l + '.' + this.type, this.options.selector, t.proxy(this.leave, this))
  539. }
  540. }
  541. this.options.selector
  542. ? (this._options = t.extend({}, this.options, {
  543. trigger: 'manual',
  544. selector: ''
  545. }))
  546. : this.fixTitle()
  547. }),
  548. (i.prototype.getDefaults = function () {
  549. return i.DEFAULTS
  550. }),
  551. (i.prototype.getOptions = function (e) {
  552. return (
  553. (e = t.extend({}, this.getDefaults(), this.$element.data(), e)),
  554. e.delay &&
  555. 'number' == typeof e.delay &&
  556. (e.delay = {
  557. show: e.delay,
  558. hide: e.delay
  559. }),
  560. e
  561. )
  562. }),
  563. (i.prototype.getDelegateOptions = function () {
  564. var e = {},
  565. i = this.getDefaults()
  566. return (
  567. this._options &&
  568. t.each(this._options, function (t, o) {
  569. i[t] != o && (e[t] = o)
  570. }),
  571. e
  572. )
  573. }),
  574. (i.prototype.enter = function (e) {
  575. var i = e instanceof this.constructor ? e : t(e.currentTarget).data('bs.' + this.type)
  576. return (
  577. i ||
  578. ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())),
  579. t(e.currentTarget).data('bs.' + this.type, i)),
  580. clearTimeout(i.timeout),
  581. (i.hoverState = 'in'),
  582. i.options.delay && i.options.delay.show
  583. ? void (i.timeout = setTimeout(function () {
  584. // "in" == i.hoverState && i.show()
  585. }, i.options.delay.show))
  586. : i.show()
  587. )
  588. }),
  589. (i.prototype.leave = function (e) {
  590. var i = e instanceof this.constructor ? e : t(e.currentTarget).data('bs.' + this.type)
  591. return (
  592. i ||
  593. ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())),
  594. t(e.currentTarget).data('bs.' + this.type, i)),
  595. clearTimeout(i.timeout),
  596. (i.hoverState = 'out'),
  597. i.options.delay && i.options.delay.hide
  598. ? void (i.timeout = setTimeout(function () {
  599. 'out' == i.hoverState && i.hide()
  600. }, i.options.delay.hide))
  601. : i.hide()
  602. )
  603. }),
  604. (i.prototype.show = function () {
  605. var e = t.Event('show.bs.' + this.type)
  606. if (this.hasContent() && this.enabled) {
  607. this.$element.trigger(e)
  608. var i = t.contains(document.documentElement, this.$element[0])
  609. if (e.isDefaultPrevented() || !i) return
  610. var o = this,
  611. s = this.tip(),
  612. n = this.getUID(this.type)
  613. this.setContent(),
  614. s.attr('id', n),
  615. this.$element.attr('aria-describedby', n),
  616. this.options.animation && s.addClass('fade')
  617. var r =
  618. 'function' == typeof this.options.placement
  619. ? this.options.placement.call(this, s[0], this.$element[0])
  620. : this.options.placement,
  621. a = /\s?auto?\s?/i,
  622. l = a.test(r)
  623. l && (r = r.replace(a, '') || 'top'),
  624. s
  625. .detach()
  626. .css({
  627. top: 0,
  628. left: 0,
  629. display: 'block'
  630. })
  631. .addClass(r)
  632. .data('bs.' + this.type, this),
  633. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element)
  634. var p = this.getPosition(),
  635. h = s[0].offsetWidth,
  636. f = s[0].offsetHeight
  637. if (l) {
  638. var u = r,
  639. c = this.$element.parent(),
  640. d = this.getPosition(c)
  641. ;(r =
  642. 'bottom' == r && p.top + p.height + f - d.scroll > d.height
  643. ? 'top'
  644. : 'top' == r && p.top - d.scroll - f < 0
  645. ? 'bottom'
  646. : 'right' == r && p.right + h > d.width
  647. ? 'left'
  648. : 'left' == r && p.left - h < d.left
  649. ? 'right'
  650. : r),
  651. s.removeClass(u).addClass(r)
  652. }
  653. var g = this.getCalculatedOffset(r, p, h, f)
  654. this.applyPlacement(g, r)
  655. var y = function () {
  656. o.$element.trigger('shown.bs.' + o.type), (o.hoverState = null)
  657. }
  658. t.support.transition && this.$tip.hasClass('fade')
  659. ? s.one('bsTransitionEnd', y).emulateTransitionEnd(150)
  660. : y()
  661. }
  662. }),
  663. (i.prototype.applyPlacement = function (e, i) {
  664. var o = this.tip(),
  665. s = o[0].offsetWidth,
  666. n = o[0].offsetHeight,
  667. r = parseInt(o.css('margin-top'), 10),
  668. a = parseInt(o.css('margin-left'), 10)
  669. isNaN(r) && (r = 0),
  670. isNaN(a) && (a = 0),
  671. (e.top = e.top + r),
  672. (e.left = e.left + a),
  673. t.offset.setOffset(
  674. o[0],
  675. t.extend(
  676. {
  677. using: function (t) {
  678. o.css({
  679. top: Math.round(t.top),
  680. left: Math.round(t.left)
  681. })
  682. }
  683. },
  684. e
  685. ),
  686. 0
  687. ),
  688. o.addClass('in')
  689. var l = o[0].offsetWidth,
  690. p = o[0].offsetHeight
  691. 'top' == i && p != n && (e.top = e.top + n - p)
  692. var h = this.getViewportAdjustedDelta(i, e, l, p)
  693. h.left ? (e.left += h.left) : (e.top += h.top)
  694. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p,
  695. u = h.left ? 'left' : 'top',
  696. c = h.left ? 'offsetWidth' : 'offsetHeight'
  697. o.offset(e), this.replaceArrow(f, o[0][c], u)
  698. }),
  699. (i.prototype.replaceArrow = function (t, e, i) {
  700. this.arrow().css(i, t ? 50 * (1 - t / e) + '%' : '')
  701. }),
  702. (i.prototype.setContent = function () {
  703. var t = this.tip(),
  704. e = this.getTitle()
  705. t.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](e),
  706. t.removeClass('fade in top bottom left right')
  707. }),
  708. (i.prototype.hide = function () {
  709. function e() {
  710. 'in' != i.hoverState && o.detach(), i.$element.trigger('hidden.bs.' + i.type)
  711. }
  712. var i = this,
  713. o = this.tip(),
  714. s = t.Event('hide.bs.' + this.type)
  715. if (
  716. (this.$element.removeAttr('aria-describedby'),
  717. this.$element.trigger(s),
  718. !s.isDefaultPrevented())
  719. )
  720. return (
  721. o.removeClass('in'),
  722. t.support.transition && this.$tip.hasClass('fade')
  723. ? o.one('bsTransitionEnd', e).emulateTransitionEnd(150)
  724. : e(),
  725. (this.hoverState = null),
  726. this
  727. )
  728. }),
  729. (i.prototype.fixTitle = function () {
  730. var t = this.$element
  731. ;(t.attr('title') || 'string' != typeof t.attr('data-original-title')) &&
  732. t.attr('data-original-title', t.attr('title') || '').attr('title', '')
  733. }),
  734. (i.prototype.hasContent = function () {
  735. return this.getTitle()
  736. }),
  737. (i.prototype.getPosition = function (e) {
  738. e = e || this.$element
  739. var i = e[0],
  740. o = 'BODY' == i.tagName
  741. return t.extend(
  742. {},
  743. 'function' == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null,
  744. {
  745. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  746. width: o ? t(window).width() : e.outerWidth(),
  747. height: o ? t(window).height() : e.outerHeight()
  748. },
  749. o
  750. ? {
  751. top: 0,
  752. left: 0
  753. }
  754. : e.offset()
  755. )
  756. }),
  757. (i.prototype.getCalculatedOffset = function (t, e, i, o) {
  758. return 'bottom' == t
  759. ? {
  760. top: e.top + e.height,
  761. left: e.left + e.width / 2 - i / 2
  762. }
  763. : 'top' == t
  764. ? {
  765. top: e.top - o,
  766. left: e.left + e.width / 2 - i / 2
  767. }
  768. : 'left' == t
  769. ? {
  770. top: e.top + e.height / 2 - o / 2,
  771. left: e.left - i
  772. }
  773. : {
  774. top: e.top + e.height / 2 - o / 2,
  775. left: e.left + e.width
  776. }
  777. }),
  778. (i.prototype.getViewportAdjustedDelta = function (t, e, i, o) {
  779. var s = {
  780. top: 0,
  781. left: 0
  782. }
  783. if (!this.$viewport) return s
  784. var n = (this.options.viewport && this.options.viewport.padding) || 0,
  785. r = this.getPosition(this.$viewport)
  786. if (/right|left/.test(t)) {
  787. var a = e.top - n - r.scroll,
  788. l = e.top + n - r.scroll + o
  789. a < r.top ? (s.top = r.top - a) : l > r.top + r.height && (s.top = r.top + r.height - l)
  790. } else {
  791. var p = e.left - n,
  792. h = e.left + n + i
  793. p < r.left ? (s.left = r.left - p) : h > r.width && (s.left = r.left + r.width - h)
  794. }
  795. return s
  796. }),
  797. (i.prototype.getTitle = function () {
  798. var t,
  799. e = this.$element,
  800. i = this.options
  801. return (t =
  802. e.attr('data-original-title') ||
  803. ('function' == typeof i.title ? i.title.call(e[0]) : i.title))
  804. }),
  805. (i.prototype.getUID = function (t) {
  806. do t += ~~(1e6 * Math.random())
  807. while (document.getElementById(t))
  808. return t
  809. }),
  810. (i.prototype.tip = function () {
  811. return (this.$tip = this.$tip || t(this.options.template))
  812. }),
  813. (i.prototype.arrow = function () {
  814. return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
  815. }),
  816. (i.prototype.validate = function () {
  817. this.$element[0].parentNode || (this.hide(), (this.$element = null), (this.options = null))
  818. }),
  819. (i.prototype.enable = function () {
  820. this.enabled = !0
  821. }),
  822. (i.prototype.disable = function () {
  823. this.enabled = !1
  824. }),
  825. (i.prototype.toggleEnabled = function () {
  826. this.enabled = !this.enabled
  827. }),
  828. (i.prototype.toggle = function (e) {
  829. var i = this
  830. e &&
  831. ((i = t(e.currentTarget).data('bs.' + this.type)),
  832. i ||
  833. ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())),
  834. t(e.currentTarget).data('bs.' + this.type, i))),
  835. i.tip().hasClass('in') ? i.leave(i) : i.enter(i)
  836. }),
  837. (i.prototype.destroy = function () {
  838. clearTimeout(this.timeout),
  839. this.hide()
  840. .$element.off('.' + this.type)
  841. .removeData('bs.' + this.type)
  842. })
  843. var o = t.fn.tooltip
  844. ;(t.fn.tooltip = e),
  845. (t.fn.tooltip.Constructor = i),
  846. (t.fn.tooltip.noConflict = function () {
  847. return (t.fn.tooltip = o), this
  848. })
  849. })(jQuery)
  850. !(function (e, t, n) {
  851. 'undefined' != typeof module && module.exports
  852. ? (module.exports = n())
  853. : 'function' == typeof define && define.amd
  854. ? define(n)
  855. : (t[e] = n())
  856. })('Keen', this, function () {
  857. 'use strict'
  858. function Keen() {
  859. return _init.apply(this, arguments)
  860. }
  861. function _init(e) {
  862. if (_isUndefined(e))
  863. throw new Error(
  864. 'Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/'
  865. )
  866. if (_isUndefined(e.projectId) || 'String' !== _type(e.projectId) || e.projectId.length < 1)
  867. throw new Error('Please provide a projectId')
  868. this.configure(e)
  869. }
  870. function _extend(e) {
  871. for (var t = 1; t < arguments.length; t++) for (var n in arguments[t]) e[n] = arguments[t][n]
  872. return e
  873. }
  874. function _isUndefined(e) {
  875. return void 0 === e
  876. }
  877. function _type(e) {
  878. var t = e && e.constructor ? e.constructor.toString() : void 0
  879. return t ? t.match(/function (.*)\(/)[1] : 'Null'
  880. }
  881. function _each(e, t, n) {
  882. var r
  883. if (!e) return 0
  884. if (((n = n ? n : e), 'array' === _type(e))) {
  885. for (r = 0; r < e.length; r++) if (t.call(n, e[r], r, e) === !1) return 0
  886. } else for (r in e) if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1) return 0
  887. return 1
  888. }
  889. function _parse_params(e) {
  890. for (
  891. var t,
  892. n = {},
  893. r = /\+/g,
  894. i = /([^&=]+)=?([^&]*)/g,
  895. o = function (e) {
  896. return decodeURIComponent(e.replace(r, ' '))
  897. },
  898. a = e.split('?')[1];
  899. (t = i.exec(a));
  900. )
  901. n[o(t[1])] = o(t[2])
  902. return n
  903. }
  904. function _set_protocol(e) {
  905. switch (e) {
  906. case 'http':
  907. return 'http'
  908. case 'auto':
  909. return location.protocol.replace(/:/g, '')
  910. case 'https':
  911. case void 0:
  912. default:
  913. return 'https'
  914. }
  915. }
  916. function _set_request_type(e) {
  917. var t = e || 'jsonp',
  918. n = !1
  919. return (
  920. ('Object' === _type(XMLHttpRequest) || 'Function' === _type(XMLHttpRequest)) &&
  921. 'withCredentials' in new XMLHttpRequest() &&
  922. (n = !0),
  923. null == t || 'xhr' == t ? (n ? 'xhr' : 'jsonp') : t
  924. )
  925. }
  926. function _build_url(e) {
  927. return this.client.endpoint + '/projects/' + this.client.projectId + e
  928. }
  929. function _uploadEvent(e, t, n, r, i) {
  930. var o = _build_url.apply(this, ['/events/' + e]),
  931. a = {}
  932. ;(n = n !== !1), this.client.globalProperties && (a = this.client.globalProperties(e))
  933. for (var c in t) t.hasOwnProperty(c) && (a[c] = t[c])
  934. switch (this.client.requestType) {
  935. case 'xhr':
  936. _request.xhr.apply(this, ['POST', o, null, a, this.client.writeKey, n, r, i])
  937. break
  938. case 'jsonp':
  939. var s = JSON.stringify(a),
  940. l = Keen.Base64.encode(s)
  941. ;(o = o + '?api_key=' + this.client.writeKey),
  942. (o = o + '&data=' + l),
  943. (o = o + '&modified=' + new Date().getTime()),
  944. _request.jsonp.apply(this, [o, this.client.writeKey, r, i])
  945. break
  946. case 'beacon':
  947. var s = JSON.stringify(a),
  948. l = Keen.Base64.encode(s)
  949. ;(o = o + '?api_key=' + encodeURIComponent(this.client.writeKey)),
  950. (o = o + '&data=' + encodeURIComponent(l)),
  951. (o = o + '&modified=' + encodeURIComponent(new Date().getTime())),
  952. (o += '&c=clv1'),
  953. _request.beacon.apply(this, [o, null, r, i])
  954. }
  955. }
  956. Keen.prototype.configure = function (e) {
  957. return (
  958. (e.host = _isUndefined(e.host) ? 'api.keen.io/3.0' : e.host.replace(/.*?:\/\//g, '')),
  959. (e.protocol = _set_protocol(e.protocol)),
  960. (e.requestType = _set_request_type(e.requestType)),
  961. (this.client = {
  962. projectId: e.projectId,
  963. writeKey: e.writeKey,
  964. readKey: e.readKey,
  965. globalProperties: null,
  966. endpoint: e.protocol + '://' + e.host,
  967. requestType: e.requestType
  968. }),
  969. Keen.trigger('client', this, e),
  970. this.trigger('ready'),
  971. this
  972. )
  973. }
  974. var _request = {
  975. xhr: function (e, t, n, r, i, o, a, c) {
  976. if (!i)
  977. return Keen.log(
  978. 'Please provide a writeKey for https://keen.io/project/' + this.client.projectId
  979. )
  980. var s = new XMLHttpRequest()
  981. if (
  982. ((s.onreadystatechange = function () {
  983. if (4 == s.readyState)
  984. if (s.status >= 200 && s.status < 300) {
  985. var e
  986. try {
  987. e = JSON.parse(s.responseText)
  988. } catch (e) {
  989. Keen.log('Could not JSON parse HTTP response: ' + s.responseText), c && c(s, e)
  990. }
  991. a && e && a(e)
  992. } else Keen.log('HTTP request failed.'), c && c(s, null)
  993. }),
  994. s.open(e, t, o),
  995. i && s.setRequestHeader('Authorization', i),
  996. r && s.setRequestHeader('Content-Type', 'application/json'),
  997. n)
  998. )
  999. for (var l in n) n.hasOwnProperty(l) && s.setRequestHeader(l, n[l])
  1000. var u = r ? JSON.stringify(r) : null
  1001. s.send(u)
  1002. },
  1003. jsonp: function (e, t, n, r) {
  1004. if (!t)
  1005. return Keen.log(
  1006. 'Please provide a writeKey for https://keen.io/project/' + this.client.projectId
  1007. )
  1008. if (t && e.indexOf('api_key') < 0) {
  1009. var i = e.indexOf('?') > 0 ? '&' : '?'
  1010. e = e + i + 'api_key=' + t
  1011. }
  1012. for (var o = 'keenJSONPCallback' + new Date().getTime(); o in window; ) o += 'a'
  1013. var a = !1
  1014. ;(window[o] = function (e) {
  1015. ;(a = !0), n && e && n(e), (window[o] = void 0)
  1016. }),
  1017. (e = e + '&jsonp=' + o)
  1018. var c = document.createElement('script')
  1019. ;(c.id = 'keen-jsonp'),
  1020. (c.src = e),
  1021. document.getElementsByTagName('head')[0].appendChild(c),
  1022. (c.onreadystatechange = function () {
  1023. a === !1 && 'loaded' === this.readyState && ((a = !0), r && r())
  1024. }),
  1025. (c.onerror = function () {
  1026. a === !1 && ((a = !0), r && r())
  1027. })
  1028. },
  1029. beacon: function (e, t, n, r) {
  1030. if (t && e.indexOf('api_key') < 0) {
  1031. var i = e.indexOf('?') > 0 ? '&' : '?'
  1032. e = e + i + 'api_key=' + t
  1033. }
  1034. var o = !1,
  1035. a = document.createElement('img')
  1036. ;(a.onload = function () {
  1037. if (((o = !0), 'naturalHeight' in this)) {
  1038. if (this.naturalHeight + this.naturalWidth === 0) return void this.onerror()
  1039. } else if (this.width + this.height === 0) return void this.onerror()
  1040. n &&
  1041. n({
  1042. created: !0
  1043. })
  1044. }),
  1045. (a.onerror = function () {
  1046. ;(o = !0), r && r()
  1047. }),
  1048. (a.src = e)
  1049. }
  1050. },
  1051. Events = (Keen.Events = {
  1052. on: function (e, t) {
  1053. this.listeners || (this.listeners = {})
  1054. var n = this.listeners[e] || (this.listeners[e] = [])
  1055. return (
  1056. n.push({
  1057. callback: t
  1058. }),
  1059. this
  1060. )
  1061. },
  1062. off: function (e, t) {
  1063. if (!e && !t) return (this.listeners = void 0), delete this.listeners, this
  1064. for (var n = this.listeners[e] || [], r = n.length; r--; )
  1065. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1066. (t && 0 != n.length) || ((this.listeners[e] = void 0), delete this.listeners[e])
  1067. return this
  1068. },
  1069. trigger: function (e) {
  1070. if (!this.listeners) return this
  1071. for (
  1072. var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0;
  1073. r < n.length;
  1074. r++
  1075. )
  1076. n[r].callback.apply(this, t)
  1077. return this
  1078. }
  1079. })
  1080. _extend(Keen.prototype, Events),
  1081. _extend(Keen, Events),
  1082. (Keen.loaded = !0),
  1083. (Keen.utils = {
  1084. each: _each,
  1085. extend: _extend,
  1086. parseParams: _parse_params
  1087. }),
  1088. (Keen.ready = function (e) {
  1089. Keen.loaded ? e() : Keen.on('ready', e)
  1090. }),
  1091. (Keen.log = function (e) {
  1092. 'object' == typeof console && console.log('[Keen IO]', e)
  1093. })
  1094. var Plugins = (Keen.Plugins = {})
  1095. ;(Keen.prototype.addEvent = function () {
  1096. _uploadEvent.apply(this, arguments)
  1097. }),
  1098. (Keen.prototype.addEventSync = function (e, t, n, r) {
  1099. _uploadEvent.apply(this, [e, t, !1, n, r])
  1100. }),
  1101. (Keen.prototype.trackExternalLink = function (e, t, n, r, i) {
  1102. var o = e,
  1103. a = o.metaKey,
  1104. c = o.target,
  1105. s = !1,
  1106. l = function () {}
  1107. return (
  1108. void 0 === r && (r = 500),
  1109. 'A' === c.nodeName
  1110. ? (l = function () {
  1111. a || s || ((s = !0), (window.location = c.href))
  1112. })
  1113. : 'FORM' === c.nodeName &&
  1114. (l = function () {
  1115. s || ((s = !0), c.submit())
  1116. }),
  1117. i &&
  1118. (l = function () {
  1119. s || ((s = !0), i())
  1120. }),
  1121. _uploadEvent.call(this, t, n, l, l),
  1122. setTimeout(function () {
  1123. l()
  1124. }, r),
  1125. !!a && void 0
  1126. )
  1127. }),
  1128. (Keen.prototype.setGlobalProperties = function (e) {
  1129. if (!this.client)
  1130. return Keen.log(
  1131. 'Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/'
  1132. )
  1133. if (!e || 'function' != typeof e) throw new Error('Invalid value for global properties: ' + e)
  1134. this.client.globalProperties = e
  1135. }),
  1136. (Keen.Base64 = {
  1137. map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
  1138. encode: function (e) {
  1139. var t,
  1140. n,
  1141. r,
  1142. i,
  1143. o,
  1144. a,
  1145. c,
  1146. s = '',
  1147. l = 0,
  1148. u = this.map
  1149. for (e = this.utf8.encode(e); l < e.length; )
  1150. (t = e.charCodeAt(l++)),
  1151. (n = e.charCodeAt(l++)),
  1152. (r = e.charCodeAt(l++)),
  1153. (i = t >> 2),
  1154. (o = ((3 & t) << 4) | (n >> 4)),
  1155. (a = isNaN(n) ? 64 : ((15 & n) << 2) | (r >> 6)),
  1156. (c = isNaN(n) || isNaN(r) ? 64 : 63 & r),
  1157. (s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c))
  1158. return s
  1159. },
  1160. decode: function (e) {
  1161. var t,
  1162. n,
  1163. r,
  1164. i,
  1165. o,
  1166. a,
  1167. c,
  1168. s = '',
  1169. l = 0,
  1170. u = this.map,
  1171. f = String.fromCharCode
  1172. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ''); l < e.length; )
  1173. (t = u.indexOf(e.charAt(l++))),
  1174. (n = u.indexOf(e.charAt(l++))),
  1175. (r = u.indexOf(e.charAt(l++))),
  1176. (i = u.indexOf(e.charAt(l++))),
  1177. (o = (t << 2) | (n >> 4)),
  1178. (a = ((15 & n) << 4) | (r >> 2)),
  1179. (c = ((3 & r) << 6) | i),
  1180. (s = s + (f(o) + (64 != r ? f(a) : '')) + (64 != i ? f(c) : ''))
  1181. return this.utf8.decode(s)
  1182. },
  1183. utf8: {
  1184. encode: function (e) {
  1185. for (var t, n = '', r = 0, i = String.fromCharCode; r < e.length; )
  1186. (t = e.charCodeAt(r++)),
  1187. (n +=
  1188. 128 > t
  1189. ? i(t)
  1190. : t > 127 && 2048 > t
  1191. ? i((t >> 6) | 192) + i((63 & t) | 128)
  1192. : i((t >> 12) | 224) + i(((t >> 6) & 63) | 128) + i((63 & t) | 128))
  1193. return n
  1194. },
  1195. decode: function (e) {
  1196. for (var t, n, r = '', i = 0, o = String.fromCharCode; i < e.length; )
  1197. (n = e.charCodeAt(i)),
  1198. (r +=
  1199. 128 > n
  1200. ? [o(n), i++][0]
  1201. : n > 191 && 224 > n
  1202. ? [o(((31 & n) << 6) | (63 & (t = e.charCodeAt(i + 1)))), (i += 2)][0]
  1203. : [
  1204. o(
  1205. ((15 & n) << 12) |
  1206. ((63 & (t = e.charCodeAt(i + 1))) << 6) |
  1207. (63 & (c3 = e.charCodeAt(i + 2)))
  1208. ),
  1209. (i += 3)
  1210. ][0])
  1211. return r
  1212. }
  1213. }
  1214. }),
  1215. 'object' != typeof JSON && (JSON = {}),
  1216. (function () {
  1217. function f(e) {
  1218. return 10 > e ? '0' + e : e
  1219. }
  1220. function quote(e) {
  1221. return (
  1222. (escapable.lastIndex = 0),
  1223. escapable.test(e)
  1224. ? '"' +
  1225. e.replace(escapable, function (e) {
  1226. var t = meta[e]
  1227. return 'string' == typeof t
  1228. ? t
  1229. : '\\u' + ('0000' + e.charCodeAt(0).toString(16)).slice(-4)
  1230. }) +
  1231. '"'
  1232. : '"' + e + '"'
  1233. )
  1234. }
  1235. function str(e, t) {
  1236. var n,
  1237. r,
  1238. i,
  1239. o,
  1240. a,
  1241. c = gap,
  1242. s = t[e]
  1243. switch (
  1244. (s && 'object' == typeof s && 'function' == typeof s.toJSON && (s = s.toJSON(e)),
  1245. 'function' == typeof rep && (s = rep.call(t, e, s)),
  1246. typeof s)
  1247. ) {
  1248. case 'string':
  1249. return quote(s)
  1250. case 'number':
  1251. return isFinite(s) ? String(s) : 'null'
  1252. case 'boolean':
  1253. case 'null':
  1254. return String(s)
  1255. case 'object':
  1256. if (!s) return 'null'
  1257. if (
  1258. ((gap += indent), (a = []), '[object Array]' === Object.prototype.toString.apply(s))
  1259. ) {
  1260. for (o = s.length, n = 0; o > n; n += 1) a[n] = str(n, s) || 'null'
  1261. return (
  1262. (i =
  1263. 0 === a.length
  1264. ? '[]'
  1265. : gap
  1266. ? '[\n' + gap + a.join(',\n' + gap) + '\n' + c + ']'
  1267. : '[' + a.join(',') + ']'),
  1268. (gap = c),
  1269. i
  1270. )
  1271. }
  1272. if (rep && 'object' == typeof rep)
  1273. for (o = rep.length, n = 0; o > n; n += 1)
  1274. 'string' == typeof rep[n] &&
  1275. ((r = rep[n]), (i = str(r, s)), i && a.push(quote(r) + (gap ? ': ' : ':') + i))
  1276. else
  1277. for (r in s)
  1278. Object.prototype.hasOwnProperty.call(s, r) &&
  1279. ((i = str(r, s)), i && a.push(quote(r) + (gap ? ': ' : ':') + i))
  1280. return (
  1281. (i =
  1282. 0 === a.length
  1283. ? '{}'
  1284. : gap
  1285. ? '{\n' + gap + a.join(',\n' + gap) + '\n' + c + '}'
  1286. : '{' + a.join(',') + '}'),
  1287. (gap = c),
  1288. i
  1289. )
  1290. }
  1291. }
  1292. 'function' != typeof Date.prototype.toJSON &&
  1293. ((Date.prototype.toJSON = function () {
  1294. return isFinite(this.valueOf())
  1295. ? this.getUTCFullYear() +
  1296. '-' +
  1297. f(this.getUTCMonth() + 1) +
  1298. '-' +
  1299. f(this.getUTCDate()) +
  1300. 'T' +
  1301. f(this.getUTCHours()) +
  1302. ':' +
  1303. f(this.getUTCMinutes()) +
  1304. ':' +
  1305. f(this.getUTCSeconds()) +
  1306. 'Z'
  1307. : null
  1308. }),
  1309. (String.prototype.toJSON =
  1310. Number.prototype.toJSON =
  1311. Boolean.prototype.toJSON =
  1312. function () {
  1313. return this.valueOf()
  1314. }))
  1315. var cx =
  1316. /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  1317. escapable =
  1318. /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  1319. gap,
  1320. indent,
  1321. meta = {
  1322. '\b': '\\b',
  1323. '\t': '\\t',
  1324. '\n': '\\n',
  1325. '\f': '\\f',
  1326. '\r': '\\r',
  1327. '"': '\\"',
  1328. '\\': '\\\\'
  1329. },
  1330. rep
  1331. 'function' != typeof JSON.stringify &&
  1332. (JSON.stringify = function (e, t, n) {
  1333. var r
  1334. if (((gap = ''), (indent = ''), 'number' == typeof n))
  1335. for (r = 0; n > r; r += 1) indent += ' '
  1336. else 'string' == typeof n && (indent = n)
  1337. if (
  1338. ((rep = t),
  1339. t && 'function' != typeof t && ('object' != typeof t || 'number' != typeof t.length))
  1340. )
  1341. throw new Error('JSON.stringify')
  1342. return str('', {
  1343. '': e
  1344. })
  1345. }),
  1346. 'function' != typeof JSON.parse &&
  1347. (JSON.parse = function (text, reviver) {
  1348. function walk(e, t) {
  1349. var n,
  1350. r,
  1351. i = e[t]
  1352. if (i && 'object' == typeof i)
  1353. for (n in i)
  1354. Object.prototype.hasOwnProperty.call(i, n) &&
  1355. ((r = walk(i, n)), void 0 !== r ? (i[n] = r) : delete i[n])
  1356. return reviver.call(e, t, i)
  1357. }
  1358. var j
  1359. if (
  1360. ((text = String(text)),
  1361. (cx.lastIndex = 0),
  1362. cx.test(text) &&
  1363. (text = text.replace(cx, function (e) {
  1364. return '\\u' + ('0000' + e.charCodeAt(0).toString(16)).slice(-4)
  1365. })),
  1366. /^[\],:{}\s]*$/.test(
  1367. text
  1368. .replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
  1369. .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
  1370. .replace(/(?:^|:|,)(?:\s*\[)+/g, '')
  1371. ))
  1372. )
  1373. return (
  1374. (j = eval('(' + text + ')')),
  1375. 'function' == typeof reviver
  1376. ? walk(
  1377. {
  1378. '': j
  1379. },
  1380. ''
  1381. )
  1382. : j
  1383. )
  1384. throw new SyntaxError('JSON.parse')
  1385. })
  1386. })(),
  1387. !(function (e, t, n) {
  1388. 'undefined' != typeof module && module.exports
  1389. ? (module.exports = n())
  1390. : 'function' == typeof define && define.amd
  1391. ? define(n)
  1392. : (t[e] = n())
  1393. })('domready', Keen.utils, function (e) {
  1394. function t(e) {
  1395. for (d = 1; (e = r.shift()); ) e()
  1396. }
  1397. var n,
  1398. r = [],
  1399. i = !1,
  1400. o = document,
  1401. a = o.documentElement,
  1402. c = a.doScroll,
  1403. s = 'DOMContentLoaded',
  1404. l = 'addEventListener',
  1405. u = 'onreadystatechange',
  1406. f = 'readyState',
  1407. p = c ? /^loaded|^c/ : /^loaded|c/,
  1408. d = p.test(o[f])
  1409. return (
  1410. o[l] &&
  1411. o[l](
  1412. s,
  1413. (n = function () {
  1414. o.removeEventListener(s, n, i), t()
  1415. }),
  1416. i
  1417. ),
  1418. c &&
  1419. o.attachEvent(
  1420. u,
  1421. (n = function () {
  1422. ;/^c/.test(o[f]) && (o.detachEvent(u, n), t())
  1423. })
  1424. ),
  1425. (e = c
  1426. ? function (t) {
  1427. self != top
  1428. ? d
  1429. ? t()
  1430. : r.push(t)
  1431. : (function () {
  1432. try {
  1433. a.doScroll('left')
  1434. } catch (n) {
  1435. return setTimeout(function () {
  1436. e(t)
  1437. }, 50)
  1438. }
  1439. t()
  1440. })()
  1441. }
  1442. : function (e) {
  1443. d ? e() : r.push(e)
  1444. })
  1445. )
  1446. })
  1447. var loaded = window.Keen,
  1448. cached = window._Keen || {},
  1449. clients,
  1450. ready
  1451. if (loaded && cached) {
  1452. ;(clients = cached.clients || {}), (ready = cached.ready || [])
  1453. for (var instance in clients)
  1454. if (clients.hasOwnProperty(instance)) {
  1455. var client = clients[instance]
  1456. for (var method in Keen.prototype)
  1457. Keen.prototype.hasOwnProperty(method) &&
  1458. (loaded.prototype[method] = Keen.prototype[method])
  1459. if (
  1460. ((loaded.Query = Keen.Query ? Keen.Query : function () {}),
  1461. (loaded.Visualization = Keen.Visualization ? Keen.Visualization : function () {}),
  1462. client._config && (client.configure.call(client, client._config), delete client._config),
  1463. client._setGlobalProperties)
  1464. ) {
  1465. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1466. client.setGlobalProperties.apply(client, globals[i])
  1467. delete client._setGlobalProperties
  1468. }
  1469. if (client._addEvent) {
  1470. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1471. client.addEvent.apply(client, queue[i])
  1472. delete client._addEvent
  1473. }
  1474. var callback = client._on || []
  1475. if (client._on) {
  1476. for (var i = 0; i < callback.length; i++) client.on.apply(client, callback[i])
  1477. client.trigger('ready'), delete client._on
  1478. }
  1479. }
  1480. for (var i = 0; i < ready.length; i++) {
  1481. var callback = ready[i]
  1482. Keen.on('ready', function () {
  1483. callback()
  1484. })
  1485. }
  1486. }
  1487. return (
  1488. Keen.loaded &&
  1489. setTimeout(function () {
  1490. Keen.utils.domready(function () {
  1491. Keen.trigger('ready')
  1492. })
  1493. }, 0),
  1494. Keen
  1495. )
  1496. })
  1497. !(function () {
  1498. var t = (window.analytics = window.analytics || [])
  1499. if (!t.initialize) {
  1500. if (t.invoked)
  1501. return void (
  1502. window.console &&
  1503. console.error &&
  1504. console.error('Segment snippet included twice.')
  1505. )
  1506. ;(t.invoked = !0),
  1507. (t.methods = [
  1508. 'trackSubmit',
  1509. 'trackClick',
  1510. 'trackLink',
  1511. 'trackForm',
  1512. 'pageview',
  1513. 'identify',
  1514. 'reset',
  1515. 'group',
  1516. 'track',
  1517. 'ready',
  1518. 'alias',
  1519. 'debug',
  1520. 'page',
  1521. 'once',
  1522. 'off',
  1523. 'on'
  1524. ]),
  1525. (t.factory = function (e) {
  1526. return function () {
  1527. var n = Array.prototype.slice.call(arguments)
  1528. return n.unshift(e), t.push(n), t
  1529. }
  1530. })
  1531. for (var e = 0; e < t.methods.length; e++) {
  1532. var n = t.methods[e]
  1533. t[n] = t.factory(n)
  1534. }
  1535. ;(t.load = function (t) {
  1536. var e = document.createElement('script')
  1537. ;(e.type = 'text/javascript'),
  1538. (e.async = !0),
  1539. (e.src =
  1540. ('https:' === document.location.protocol ? 'https://' : 'http://') +
  1541. 'cdn.segment.com/analytics.js/v1/' +
  1542. t +
  1543. '/analytics.min.js')
  1544. var n = document.getElementsByTagName('script')[0]
  1545. n.parentNode.insertBefore(e, n)
  1546. }),
  1547. (t.SNIPPET_VERSION = '4.0.0')
  1548. }
  1549. })()
  1550. !(function (i, e) {
  1551. 'use strict'
  1552. var s = '',
  1553. r = '?',
  1554. o = 'function',
  1555. a = 'undefined',
  1556. n = 'object',
  1557. t = 'major',
  1558. d = 'model',
  1559. w = 'name',
  1560. l = 'type',
  1561. p = 'vendor',
  1562. m = 'version',
  1563. c = 'architecture',
  1564. u = 'console',
  1565. g = 'mobile',
  1566. f = 'tablet',
  1567. h = 'smarttv',
  1568. b = {
  1569. has: function (i, e) {
  1570. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1571. },
  1572. lowerize: function (i) {
  1573. return i.toLowerCase()
  1574. }
  1575. },
  1576. y = {
  1577. rgx: function () {
  1578. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1579. var c = m[p],
  1580. u = m[p + 1]
  1581. if (typeof i === a) {
  1582. i = {}
  1583. for (t in u) (d = u[t]), typeof d === n ? (i[d[0]] = e) : (i[d] = e)
  1584. }
  1585. for (s = r = 0; s < c.length; s++)
  1586. if ((w = c[s].exec(this.getUA()))) {
  1587. for (t = 0; t < u.length; t++)
  1588. (l = w[++r]),
  1589. (d = u[t]),
  1590. typeof d === n && d.length > 0
  1591. ? 2 == d.length
  1592. ? typeof d[1] == o
  1593. ? (i[d[0]] = d[1].call(this, l))
  1594. : (i[d[0]] = d[1])
  1595. : 3 == d.length
  1596. ? typeof d[1] !== o || (d[1].exec && d[1].test)
  1597. ? (i[d[0]] = l ? l.replace(d[1], d[2]) : e)
  1598. : (i[d[0]] = l ? d[1].call(this, l, d[2]) : e)
  1599. : 4 == d.length && (i[d[0]] = l ? d[3].call(this, l.replace(d[1], d[2])) : e)
  1600. : (i[d] = l ? l : e)
  1601. break
  1602. }
  1603. if (w) break
  1604. }
  1605. return i
  1606. },
  1607. str: function (i, s) {
  1608. for (var o in s)
  1609. if (typeof s[o] === n && s[o].length > 0) {
  1610. for (var a = 0; a < s[o].length; a++) if (b.has(s[o][a], i)) return o === r ? e : o
  1611. } else if (b.has(s[o], i)) return o === r ? e : o
  1612. return i
  1613. }
  1614. },
  1615. v = {
  1616. browser: {
  1617. oldsafari: {
  1618. major: {
  1619. 1: ['/8', '/1', '/3'],
  1620. 2: '/4',
  1621. '?': '/'
  1622. },
  1623. version: {
  1624. '1.0': '/8',
  1625. 1.2: '/1',
  1626. 1.3: '/3',
  1627. '2.0': '/412',
  1628. '2.0.2': '/416',
  1629. '2.0.3': '/417',
  1630. '2.0.4': '/419',
  1631. '?': '/'
  1632. }
  1633. }
  1634. },
  1635. device: {
  1636. sprint: {
  1637. model: {
  1638. 'Evo Shift 4G': '7373KT'
  1639. },
  1640. vendor: {
  1641. HTC: 'APA',
  1642. Sprint: 'Sprint'
  1643. }
  1644. }
  1645. },
  1646. os: {
  1647. windows: {
  1648. version: {
  1649. ME: '4.90',
  1650. 'NT 3.11': 'NT3.51',
  1651. 'NT 4.0': 'NT4.0',
  1652. 2e3: 'NT 5.0',
  1653. XP: ['NT 5.1', 'NT 5.2'],
  1654. Vista: 'NT 6.0',
  1655. 7: 'NT 6.1',
  1656. 8: 'NT 6.2',
  1657. 8.1: 'NT 6.3',
  1658. RT: 'ARM'
  1659. }
  1660. }
  1661. }
  1662. },
  1663. k = {
  1664. browser: [
  1665. [
  1666. /(opera\smini)\/((\d+)?[\w\.-]+)/i,
  1667. /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i,
  1668. /(opera).+version\/((\d+)?[\w\.]+)/i,
  1669. /(opera)[\/\s]+((\d+)?[\w\.]+)/i
  1670. ],
  1671. [w, m, t],
  1672. [/\s(opr)\/((\d+)?[\w\.]+)/i],
  1673. [[w, 'Opera'], m, t],
  1674. [
  1675. /(kindle)\/((\d+)?[\w\.]+)/i,
  1676. /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,
  1677. /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i,
  1678. /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i,
  1679. /(rekonq)((?:\/)[\w\.]+)*/i,
  1680. /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i
  1681. ],
  1682. [w, m, t],
  1683. [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i],
  1684. [[w, 'IE'], m, t],
  1685. [/(yabrowser)\/((\d+)?[\w\.]+)/i],
  1686. [[w, 'Yandex'], m, t],
  1687. [/(comodo_dragon)\/((\d+)?[\w\.]+)/i],
  1688. [[w, /_/g, ' '], m, t],
  1689. [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i],
  1690. [w, m, t],
  1691. [/(dolfin)\/((\d+)?[\w\.]+)/i],
  1692. [[w, 'Dolphin'], m, t],
  1693. [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i],
  1694. [[w, 'Chrome'], m, t],
  1695. [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i],
  1696. [m, t, [w, 'Mobile Safari']],
  1697. [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i],
  1698. [m, t, w],
  1699. [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i],
  1700. [w, [t, y.str, v.browser.oldsafari.major], [m, y.str, v.browser.oldsafari.version]],
  1701. [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i],
  1702. [w, m, t],
  1703. [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i],
  1704. [[w, 'Netscape'], m, t],
  1705. [
  1706. /(swiftfox)/i,
  1707. /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,
  1708. /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,
  1709. /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i,
  1710. /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i,
  1711. /(links)\s\(((\d+)?[\w\.]+)/i,
  1712. /(gobrowser)\/?((\d+)?[\w\.]+)*/i,
  1713. /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i,
  1714. /(mosaic)[\/\s]((\d+)?[\w\.]+)/i
  1715. ],
  1716. [w, m, t],
  1717. [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i],
  1718. [w, m, t],
  1719. [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i],
  1720. [w, m],
  1721. [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i],
  1722. [w, m, t],
  1723. [
  1724. /(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i,
  1725. /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i,
  1726. /(lg player|nexplayer)\s((\d+)[\d\.]+)/i,
  1727. /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i
  1728. ],
  1729. [w, m, t],
  1730. [/(nexplayer)\s((\d+)[\w\.-]+)/i],
  1731. [w, m, t],
  1732. [/(flrp)\/((\d+)[\w\.-]+)/i],
  1733. [[w, 'Flip Player'], m, t],
  1734. [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i],
  1735. [w],
  1736. [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i],
  1737. [w, m, t],
  1738. [
  1739. /(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i,
  1740. /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i,
  1741. /(lavf)((\d+)[\d\.]+)/i
  1742. ],
  1743. [w, m, t],
  1744. [/(htc_one_s)\/((\d+)[\d\.]+)/i],
  1745. [[w, /_/g, ' '], m, t],
  1746. [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i],
  1747. [w, m],
  1748. [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i],
  1749. [w, m, t],
  1750. [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i],
  1751. [w],
  1752. [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i],
  1753. [w, m, t],
  1754. [/(nokia\d+)\/((\d+)[\w\.-]+)/i],
  1755. [w, m, t],
  1756. [/\s(songbird)\/((\d+)[\w\.-]+)/i],
  1757. [w, m, t],
  1758. [
  1759. /(winamp)3 version ((\d+)[\w\.-]+)/i,
  1760. /(winamp)\s((\d+)[\w\.-]+)/i,
  1761. /(winamp)mpeg\/((\d+)[\w\.-]+)/i
  1762. ],
  1763. [w, m, t],
  1764. [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i],
  1765. [w],
  1766. [
  1767. /(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i
  1768. ],
  1769. [w, m, t],
  1770. [/(smp)((\d+)[\d\.]+)/i],
  1771. [w, m, t],
  1772. [
  1773. /(vlc) media player - version ((\d+)[\w\.]+)/i,
  1774. /(vlc)\/((\d+)[\w\.-]+)/i,
  1775. /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i,
  1776. /(foobar2000)\/((\d+)[\d\.]+)/i,
  1777. /(itunes)\/((\d+)[\d\.]+)/i
  1778. ],
  1779. [w, m, t],
  1780. [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i],
  1781. [[w, /-/g, ' '], m, t],
  1782. [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i],
  1783. [m, t, [w, 'Windows']],
  1784. [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i],
  1785. [w, m, t],
  1786. [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i],
  1787. [[w, 'rad.io'], m, t]
  1788. ],
  1789. cpu: [
  1790. [/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],
  1791. [[c, 'amd64']],
  1792. [/(ia32(?=;))/i],
  1793. [[c, b.lowerize]],
  1794. [/((?:i[346]|x)86)[;\)]/i],
  1795. [[c, 'ia32']],
  1796. [/windows\s(ce|mobile);\sppc;/i],
  1797. [[c, 'arm']],
  1798. [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],
  1799. [[c, /ower/, '', b.lowerize]],
  1800. [/(sun4\w)[;\)]/i],
  1801. [[c, 'sparc']],
  1802. [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],
  1803. [c, b.lowerize]
  1804. ],
  1805. device: [
  1806. [/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],
  1807. [d, p, [l, f]],
  1808. [/applecoremedia\/[\w\.]+ \((ipad)/],
  1809. [d, [p, 'Apple'], [l, f]],
  1810. [/(apple\s{0,1}tv)/i],
  1811. [
  1812. [d, 'Apple TV'],
  1813. [p, 'Apple']
  1814. ],
  1815. [
  1816. /(hp).+(touchpad)/i,
  1817. /(kindle)\/([\w\.]+)/i,
  1818. /\s(nook)[\w\s]+build\/(\w+)/i,
  1819. /(dell)\s(strea[kpr\s\d]*[\dko])/i
  1820. ],
  1821. [p, d, [l, f]],
  1822. [/\((ip[honed|\s\w*]+);.+(apple)/i],
  1823. [d, p, [l, g]],
  1824. [/\((ip[honed|\s\w*]+);/i],
  1825. [d, [p, 'Apple'], [l, g]],
  1826. [
  1827. /(blackberry)[\s-]?(\w+)/i,
  1828. /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i,
  1829. /(hp)\s([\w\s]+\w)/i,
  1830. /(asus)-?(\w+)/i
  1831. ],
  1832. [p, d, [l, g]],
  1833. [/\((bb10);\s(\w+)/i],
  1834. [[p, 'BlackBerry'], d, [l, g]],
  1835. [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i],
  1836. [[p, 'Asus'], d, [l, f]],
  1837. [/(sony)\s(tablet\s[ps])/i],
  1838. [p, d, [l, f]],
  1839. [/(nintendo)\s([wids3u]+)/i],
  1840. [p, d, [l, u]],
  1841. [/((playstation)\s[3portablevi]+)/i],
  1842. [[p, 'Sony'], d, [l, u]],
  1843. [/(sprint\s(\w+))/i],
  1844. [
  1845. [p, y.str, v.device.sprint.vendor],
  1846. [d, y.str, v.device.sprint.model],
  1847. [l, g]
  1848. ],
  1849. [
  1850. /(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,
  1851. /(zte)-(\w+)*/i,
  1852. /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i
  1853. ],
  1854. [p, [d, /_/g, ' '], [l, g]],
  1855. [
  1856. /\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i,
  1857. /(mot)[\s-]?(\w+)*/i
  1858. ],
  1859. [[p, 'Motorola'], d, [l, g]],
  1860. [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i],
  1861. [[p, 'Motorola'], d, [l, f]],
  1862. [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i],
  1863. [[p, 'Samsung'], d, [l, f]],
  1864. [
  1865. /((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i,
  1866. /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,
  1867. /sec-((sgh\w+))/i
  1868. ],
  1869. [[p, 'Samsung'], d, [l, g]],
  1870. [/(sie)-(\w+)*/i],
  1871. [[p, 'Siemens'], d, [l, g]],
  1872. [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i],
  1873. [[p, 'Nokia'], d, [l, g]],
  1874. [/android\s3\.[\s\w-;]{10}((a\d{3}))/i],
  1875. [[p, 'Acer'], d, [l, f]],
  1876. [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i],
  1877. [[p, 'LG'], d, [l, f]],
  1878. [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i],
  1879. [[p, 'LG'], d, [l, g]],
  1880. [/android.+((ideatab[a-z0-9\-\s]+))/i],
  1881. [[p, 'Lenovo'], d, [l, f]],
  1882. [/(lg) netcast\.tv/i],
  1883. [p, [l, h]],
  1884. [/(mobile|tablet);.+rv\:.+gecko\//i],
  1885. [l, p, d]
  1886. ],
  1887. engine: [
  1888. [
  1889. /(presto)\/([\w\.]+)/i,
  1890. /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,
  1891. /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,
  1892. /(icab)[\/\s]([23]\.[\d\.]+)/i
  1893. ],
  1894. [w, m],
  1895. [/rv\:([\w\.]+).*(gecko)/i],
  1896. [m, w]
  1897. ],
  1898. os: [
  1899. [/microsoft\s(windows)\s(vista|xp)/i],
  1900. [w, m],
  1901. [
  1902. /(windows)\snt\s6\.2;\s(arm)/i,
  1903. /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i
  1904. ],
  1905. [w, [m, y.str, v.os.windows.version]],
  1906. [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],
  1907. [
  1908. [w, 'Windows'],
  1909. [m, y.str, v.os.windows.version]
  1910. ],
  1911. [/\((bb)(10);/i],
  1912. [[w, 'BlackBerry'], m],
  1913. [
  1914. /(blackberry)\w*\/?([\w\.]+)*/i,
  1915. /(tizen)\/([\w\.]+)/i,
  1916. /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i
  1917. ],
  1918. [w, m],
  1919. [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],
  1920. [[w, 'Symbian'], m],
  1921. [/mozilla.+\(mobile;.+gecko.+firefox/i],
  1922. [[w, 'Firefox OS'], m],
  1923. [
  1924. /(nintendo|playstation)\s([wids3portablevu]+)/i,
  1925. /(mint)[\/\s\(]?(\w+)*/i,
  1926. /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i,
  1927. /(hurd|linux)\s?([\w\.]+)*/i,
  1928. /(gnu)\s?([\w\.]+)*/i
  1929. ],
  1930. [w, m],
  1931. [/(cros)\s[\w]+\s([\w\.]+\w)/i],
  1932. [[w, 'Chromium OS'], m],
  1933. [/(sunos)\s?([\w\.]+\d)*/i],
  1934. [[w, 'Solaris'], m],
  1935. [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],
  1936. [w, m],
  1937. [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],
  1938. [
  1939. [w, 'iOS'],
  1940. [m, /_/g, '.']
  1941. ],
  1942. [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i],
  1943. [w, [m, /_/g, '.']],
  1944. [
  1945. /(haiku)\s(\w+)/i,
  1946. /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,
  1947. /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i,
  1948. /(unix)\s?([\w\.]+)*/i
  1949. ],
  1950. [w, m]
  1951. ]
  1952. },
  1953. x = function (e) {
  1954. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s)
  1955. return this instanceof x
  1956. ? ((this.getBrowser = function () {
  1957. return y.rgx.apply(this, k.browser)
  1958. }),
  1959. (this.getCPU = function () {
  1960. return y.rgx.apply(this, k.cpu)
  1961. }),
  1962. (this.getDevice = function () {
  1963. return y.rgx.apply(this, k.device)
  1964. }),
  1965. (this.getEngine = function () {
  1966. return y.rgx.apply(this, k.engine)
  1967. }),
  1968. (this.getOS = function () {
  1969. return y.rgx.apply(this, k.os)
  1970. }),
  1971. (this.getResult = function () {
  1972. return {
  1973. ua: this.getUA(),
  1974. browser: this.getBrowser(),
  1975. engine: this.getEngine(),
  1976. os: this.getOS(),
  1977. device: this.getDevice(),
  1978. cpu: this.getCPU()
  1979. }
  1980. }),
  1981. (this.getUA = function () {
  1982. return r
  1983. }),
  1984. (this.setUA = function (i) {
  1985. return (r = i), this
  1986. }),
  1987. void this.setUA(r))
  1988. : new x(e).getResult()
  1989. }
  1990. if (typeof exports !== a)
  1991. typeof module !== a && module.exports && (exports = module.exports = x), (exports.UAParser = x)
  1992. else if (
  1993. ((i.UAParser = x),
  1994. typeof define === o &&
  1995. define.amd &&
  1996. define(function () {
  1997. return x
  1998. }),
  1999. typeof i.jQuery !== a)
  2000. ) {
  2001. var A = i.jQuery,
  2002. _ = new x()
  2003. ;(A.ua = _.getResult()),
  2004. (A.ua.get = function () {
  2005. return _.getUA()
  2006. }),
  2007. (A.ua.set = function (i) {
  2008. _.setUA(i)
  2009. var e = _.getResult()
  2010. for (var s in e) A.ua[s] = e[s]
  2011. })
  2012. }
  2013. })(this)
  2014. window.Modernizr = (function (n, e, t) {
  2015. function o(n) {
  2016. d.cssText = n
  2017. }
  2018. function r(n, e) {
  2019. return typeof n === e
  2020. }
  2021. var i,
  2022. c,
  2023. u,
  2024. a = '2.8.2',
  2025. f = {},
  2026. s = e.documentElement,
  2027. l = 'modernizr',
  2028. p = e.createElement(l),
  2029. d = p.style,
  2030. y = ({}.toString, {}),
  2031. w = [],
  2032. b = w.slice,
  2033. v = {}.hasOwnProperty
  2034. ;(u =
  2035. r(v, 'undefined') || r(v.call, 'undefined')
  2036. ? function (n, e) {
  2037. return e in n && r(n.constructor.prototype[e], 'undefined')
  2038. }
  2039. : function (n, e) {
  2040. return v.call(n, e)
  2041. }),
  2042. Function.prototype.bind ||
  2043. (Function.prototype.bind = function (n) {
  2044. var e = this
  2045. if ('function' != typeof e) throw new TypeError()
  2046. var t = b.call(arguments, 1),
  2047. o = function () {
  2048. if (this instanceof o) {
  2049. var r = function () {}
  2050. r.prototype = e.prototype
  2051. var i = new r(),
  2052. c = e.apply(i, t.concat(b.call(arguments)))
  2053. return Object(c) === c ? c : i
  2054. }
  2055. return e.apply(n, t.concat(b.call(arguments)))
  2056. }
  2057. return o
  2058. }),
  2059. (y.webgl = function () {
  2060. return !!n.WebGLRenderingContext
  2061. })
  2062. for (var h in y)
  2063. u(y, h) && ((c = h.toLowerCase()), (f[c] = y[h]()), w.push((f[c] ? '' : 'no-') + c))
  2064. return (
  2065. (f.addTest = function (n, e) {
  2066. if ('object' == typeof n) for (var o in n) u(n, o) && f.addTest(o, n[o])
  2067. else {
  2068. if (((n = n.toLowerCase()), f[n] !== t)) return f
  2069. ;(e = 'function' == typeof e ? e() : e),
  2070. 'undefined' != typeof enableClasses &&
  2071. enableClasses &&
  2072. (s.className += ' ' + (e ? '' : 'no-') + n),
  2073. (f[n] = e)
  2074. }
  2075. return f
  2076. }),
  2077. o(''),
  2078. (p = i = null),
  2079. (f._version = a),
  2080. f
  2081. )
  2082. })(this, this.document)
  2083. !(function (e, t, a) {
  2084. 'use strict'
  2085. function n(t, h, m) {
  2086. function H(a) {
  2087. var n = 0,
  2088. i = Ee.length
  2089. if (
  2090. ((Ce.old = e.extend({}, Ce)),
  2091. (Ie = we ? 0 : be[ge.horizontal ? 'width' : 'height']()),
  2092. (ke = Be[ge.horizontal ? 'width' : 'height']()),
  2093. (ze = we ? t : Pe[ge.horizontal ? 'outerWidth' : 'outerHeight']()),
  2094. (Ee.length = 0),
  2095. (Ce.start = 0),
  2096. (Ce.end = q(ze - Ie, 0)),
  2097. Re)
  2098. ) {
  2099. ;(n = Ne.length), (qe = Pe.children(ge.itemSelector)), (Ne.length = 0)
  2100. var r,
  2101. s = c(Pe, ge.horizontal ? 'paddingLeft' : 'paddingTop'),
  2102. o = c(Pe, ge.horizontal ? 'paddingRight' : 'paddingBottom'),
  2103. l = 'border-box' === e(qe).css('boxSizing'),
  2104. u = 'none' !== qe.css('float'),
  2105. f = 0,
  2106. v = qe.length - 1
  2107. ;(ze = 0),
  2108. qe.each(function (t, a) {
  2109. var n = e(a),
  2110. i = a.getBoundingClientRect(),
  2111. l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top),
  2112. d = c(n, ge.horizontal ? 'marginLeft' : 'marginTop'),
  2113. p = c(n, ge.horizontal ? 'marginRight' : 'marginBottom'),
  2114. h = l + d + p,
  2115. m = !d || !p,
  2116. g = {}
  2117. ;(g.el = a),
  2118. (g.size = m ? l : h),
  2119. (g.half = g.size / 2),
  2120. (g.start = ze + (m ? d : 0)),
  2121. (g.center = g.start - E(Ie / 2 - g.size / 2)),
  2122. (g.end = g.start - Ie + g.size),
  2123. t || (ze += s),
  2124. (ze += h),
  2125. ge.horizontal || u || (p && d && t > 0 && (ze -= N(d, p))),
  2126. t === v && ((g.end += o), (ze += o), (f = m ? p : 0)),
  2127. Ne.push(g),
  2128. (r = g)
  2129. }),
  2130. (Pe[0].style[ge.horizontal ? 'width' : 'height'] = (l ? ze : ze - s - o) + 'px'),
  2131. (ze -= f),
  2132. Ne.length
  2133. ? ((Ce.start = Ne[0][Me ? 'center' : 'start']),
  2134. (Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start))
  2135. : (Ce.start = Ce.end = 0)
  2136. }
  2137. if (
  2138. ((Ce.center = E(Ce.end / 2 + Ce.start / 2)),
  2139. Q(),
  2140. Se.length &&
  2141. ke > 0 &&
  2142. (ge.dynamicHandle
  2143. ? ((Te = Ce.start === Ce.end ? ke : E((ke * Ie) / ze)),
  2144. (Te = d(Te, ge.minHandleSize, ke)),
  2145. (Se[0].style[ge.horizontal ? 'width' : 'height'] = Te + 'px'))
  2146. : (Te = Se[ge.horizontal ? 'outerWidth' : 'outerHeight']()),
  2147. (xe.end = ke - Te),
  2148. it || j()),
  2149. !we && Ie > 0)
  2150. ) {
  2151. var p = Ce.start,
  2152. h = ''
  2153. if (Re)
  2154. e.each(Ne, function (e, t) {
  2155. Me
  2156. ? Ee.push(t.center)
  2157. : t.start + t.size > p &&
  2158. p <= Ce.end &&
  2159. ((p = t.start),
  2160. Ee.push(p),
  2161. (p += Ie),
  2162. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  2163. })
  2164. else for (; p - Ie < Ce.end; ) Ee.push(p), (p += Ie)
  2165. if (De[0] && i !== Ee.length) {
  2166. for (var m = 0; m < Ee.length; m++) h += ge.pageBuilder.call(ye, m)
  2167. ;(Ae = De.html(h).children()), Ae.eq(Oe.activePage).addClass(ge.activeClass)
  2168. }
  2169. }
  2170. if (((Oe.slideeSize = ze), (Oe.frameSize = Ie), (Oe.sbSize = ke), (Oe.handleSize = Te), Re)) {
  2171. a && null != ge.startAt && (W(ge.startAt), ye[Le ? 'toCenter' : 'toStart'](ge.startAt))
  2172. var g = Ne[Oe.activeItem]
  2173. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  2174. } else a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end))
  2175. pe('load')
  2176. }
  2177. function X(e, t, a) {
  2178. if (Re && at.released && !a) {
  2179. var n = $(e),
  2180. i = e > Ce.start && e < Ce.end
  2181. Le
  2182. ? (i && (e = Ne[n.centerItem].center), Me && ge.activateMiddle && W(n.centerItem))
  2183. : i && (e = Ne[n.firstItem].start)
  2184. }
  2185. at.init && at.slidee && ge.elasticBounds
  2186. ? e > Ce.end
  2187. ? (e = Ce.end + (e - Ce.end) / 6)
  2188. : e < Ce.start && (e = Ce.start + (e - Ce.start) / 6)
  2189. : (e = d(e, Ce.start, Ce.end)),
  2190. (et.start = +new Date()),
  2191. (et.time = 0),
  2192. (et.from = Ce.cur),
  2193. (et.to = e),
  2194. (et.delta = e - Ce.cur),
  2195. (et.tweesing = at.tweese || (at.init && !at.slidee)),
  2196. (et.immediate = !et.tweesing && (t || (at.init && at.slidee) || !ge.speed)),
  2197. (at.tweese = 0),
  2198. e !== Ce.dest && ((Ce.dest = e), pe('change'), it || Y()),
  2199. K(),
  2200. Q(),
  2201. Z(),
  2202. F()
  2203. }
  2204. function Y() {
  2205. if (ye.initialized) {
  2206. if (!it) return (it = w(Y)), void (at.released && pe('moveStart'))
  2207. et.immediate
  2208. ? (Ce.cur = et.to)
  2209. : et.tweesing
  2210. ? ((et.tweeseDelta = et.to - Ce.cur),
  2211. x(et.tweeseDelta) < 0.1
  2212. ? (Ce.cur = et.to)
  2213. : (Ce.cur += et.tweeseDelta * (at.released ? ge.swingSpeed : ge.syncSpeed)))
  2214. : ((et.time = N(+new Date() - et.start, ge.speed)),
  2215. (Ce.cur =
  2216. et.from +
  2217. et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed))),
  2218. et.to === Ce.cur ? ((Ce.cur = et.to), (at.tweese = it = 0)) : (it = w(Y)),
  2219. pe('move'),
  2220. we ||
  2221. (f
  2222. ? (Pe[0].style[f] =
  2223. v + (ge.horizontal ? 'translateX' : 'translateY') + '(' + -Ce.cur + 'px)')
  2224. : (Pe[0].style[ge.horizontal ? 'left' : 'top'] = -E(Ce.cur) + 'px')),
  2225. !it && at.released && pe('moveEnd'),
  2226. j()
  2227. }
  2228. }
  2229. function j() {
  2230. Se.length &&
  2231. ((xe.cur =
  2232. Ce.start === Ce.end
  2233. ? 0
  2234. : (((at.init && !at.slidee ? Ce.dest : Ce.cur) - Ce.start) / (Ce.end - Ce.start)) *
  2235. xe.end),
  2236. (xe.cur = d(E(xe.cur), xe.start, xe.end)),
  2237. _e.hPos !== xe.cur &&
  2238. ((_e.hPos = xe.cur),
  2239. f
  2240. ? (Se[0].style[f] =
  2241. v + (ge.horizontal ? 'translateX' : 'translateY') + '(' + xe.cur + 'px)')
  2242. : (Se[0].style[ge.horizontal ? 'left' : 'top'] = xe.cur + 'px')))
  2243. }
  2244. function F() {
  2245. Ae[0] &&
  2246. _e.page !== Oe.activePage &&
  2247. ((_e.page = Oe.activePage),
  2248. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  2249. pe('activePage', _e.page))
  2250. }
  2251. function M() {
  2252. ;(tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start)) || ye.stop(),
  2253. (ot = at.init ? w(M) : 0),
  2254. (tt.now = +new Date()),
  2255. (tt.pos = Ce.cur + ((tt.now - tt.lastTime) / 1e3) * tt.speed),
  2256. X(at.init ? tt.pos : E(tt.pos)),
  2257. at.init || Ce.cur !== Ce.dest || pe('moveEnd'),
  2258. (tt.lastTime = tt.now)
  2259. }
  2260. function L(e, t, n) {
  2261. if (('boolean' === i(t) && ((n = t), (t = a)), t === a)) X(Ce[e], n)
  2262. else {
  2263. if (Le && 'center' !== e) return
  2264. var r = ye.getPos(t)
  2265. r && X(r[e], n, !Le)
  2266. }
  2267. }
  2268. function R(e) {
  2269. return null != e ? (l(e) ? (e >= 0 && e < Ne.length ? e : -1) : qe.index(e)) : -1
  2270. }
  2271. function U(e) {
  2272. return R(l(e) && 0 > e ? e + Ne.length : e)
  2273. }
  2274. function W(e, t) {
  2275. var a = R(e)
  2276. return (
  2277. !(!Re || 0 > a) &&
  2278. ((_e.active !== a || t) &&
  2279. (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2280. qe.eq(a).addClass(ge.activeClass),
  2281. (_e.active = Oe.activeItem = a),
  2282. Z(),
  2283. pe('active', a)),
  2284. a)
  2285. )
  2286. }
  2287. function $(e) {
  2288. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end)
  2289. var t = {},
  2290. a = Me ? 0 : Ie / 2
  2291. if (!we)
  2292. for (var n = 0, i = Ee.length; i > n; n++) {
  2293. if (e >= Ce.end || n === Ee.length - 1) {
  2294. t.activePage = Ee.length - 1
  2295. break
  2296. }
  2297. if (e <= Ee[n] + a) {
  2298. t.activePage = n
  2299. break
  2300. }
  2301. }
  2302. if (Re) {
  2303. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  2304. if (
  2305. (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  2306. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  2307. c === u - 1 || e <= Ne[c].end + Ne[c].half)
  2308. ) {
  2309. s = c
  2310. break
  2311. }
  2312. ;(t.firstItem = l(r) ? r : 0),
  2313. (t.centerItem = l(o) ? o : t.firstItem),
  2314. (t.lastItem = l(s) ? s : t.centerItem)
  2315. }
  2316. return t
  2317. }
  2318. function Q(t) {
  2319. e.extend(Oe, $(t))
  2320. }
  2321. function Z() {
  2322. var e = Ce.dest <= Ce.start,
  2323. t = Ce.dest >= Ce.end,
  2324. a = (e ? 1 : 0) | (t ? 2 : 0)
  2325. if (
  2326. (_e.slideePosState !== a &&
  2327. ((_e.slideePosState = a),
  2328. Je.is('button,input') && Je.prop('disabled', e),
  2329. Ke.is('button,input') && Ke.prop('disabled', t),
  2330. Je.add(Qe)[e ? 'addClass' : 'removeClass'](ge.disabledClass),
  2331. Ke.add($e)[t ? 'addClass' : 'removeClass'](ge.disabledClass)),
  2332. _e.fwdbwdState !== a &&
  2333. at.released &&
  2334. ((_e.fwdbwdState = a),
  2335. Qe.is('button,input') && Qe.prop('disabled', e),
  2336. $e.is('button,input') && $e.prop('disabled', t)),
  2337. Re && null != Oe.activeItem)
  2338. ) {
  2339. var n = 0 === Oe.activeItem,
  2340. i = Oe.activeItem >= Ne.length - 1,
  2341. r = (n ? 1 : 0) | (i ? 2 : 0)
  2342. _e.itemsButtonState !== r &&
  2343. ((_e.itemsButtonState = r),
  2344. Ze.is('button,input') && Ze.prop('disabled', n),
  2345. Ge.is('button,input') && Ge.prop('disabled', i),
  2346. Ze[n ? 'addClass' : 'removeClass'](ge.disabledClass),
  2347. Ge[i ? 'addClass' : 'removeClass'](ge.disabledClass))
  2348. }
  2349. }
  2350. function G(e, t, a) {
  2351. if (
  2352. ((e = U(e)),
  2353. (t = U(t)),
  2354. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1))
  2355. ) {
  2356. qe.eq(e)[a ? 'insertAfter' : 'insertBefore'](Ne[t].el)
  2357. var n = t > e ? e : a ? t : t - 1,
  2358. i = e > t ? e : a ? t + 1 : t,
  2359. r = e > t
  2360. null != Oe.activeItem &&
  2361. (e === Oe.activeItem
  2362. ? (_e.active = Oe.activeItem = a ? (r ? t + 1 : t) : r ? t : t - 1)
  2363. : Oe.activeItem > n && Oe.activeItem < i && (_e.active = Oe.activeItem += r ? 1 : -1)),
  2364. H()
  2365. }
  2366. }
  2367. function J(e, t) {
  2368. for (var a = 0, n = Ve[e].length; n > a; a++) if (Ve[e][a] === t) return a
  2369. return -1
  2370. }
  2371. function K() {
  2372. at.released && !ye.isPaused && ye.resume()
  2373. }
  2374. function V(e) {
  2375. return E((d(e, xe.start, xe.end) / xe.end) * (Ce.end - Ce.start)) + Ce.start
  2376. }
  2377. function _() {
  2378. ;(at.history[0] = at.history[1]),
  2379. (at.history[1] = at.history[2]),
  2380. (at.history[2] = at.history[3]),
  2381. (at.history[3] = at.delta)
  2382. }
  2383. function ee(e) {
  2384. ;(at.released = 0), (at.source = e), (at.slidee = 'slidee' === e)
  2385. }
  2386. function te(t) {
  2387. var a = 'touchstart' === t.type,
  2388. n = t.data.source,
  2389. i = 'slidee' === n
  2390. at.init ||
  2391. (!a && ie(t.target)) ||
  2392. (('handle' !== n || (ge.dragHandle && xe.start !== xe.end)) &&
  2393. (!i || (a ? ge.touchDragging : ge.mouseDragging && t.which < 2)) &&
  2394. (a || r(t),
  2395. ee(n),
  2396. (at.init = 0),
  2397. (at.$source = e(t.target)),
  2398. (at.touch = a),
  2399. (at.pointer = a ? t.originalEvent.touches[0] : t),
  2400. (at.initX = at.pointer.pageX),
  2401. (at.initY = at.pointer.pageY),
  2402. (at.initPos = i ? Ce.cur : xe.cur),
  2403. (at.start = +new Date()),
  2404. (at.time = 0),
  2405. (at.path = 0),
  2406. (at.delta = 0),
  2407. (at.locked = 0),
  2408. (at.history = [0, 0, 0, 0]),
  2409. (at.pathToLock = i ? (a ? 30 : 10) : 0),
  2410. b.on(a ? z : I, ae),
  2411. ye.pause(1),
  2412. (i ? Pe : Se).addClass(ge.draggedClass),
  2413. pe('moveStart'),
  2414. i && (rt = setInterval(_, 10))))
  2415. }
  2416. function ae(e) {
  2417. if (
  2418. ((at.released = 'mouseup' === e.type || 'touchend' === e.type),
  2419. (at.pointer = at.touch
  2420. ? e.originalEvent[at.released ? 'changedTouches' : 'touches'][0]
  2421. : e),
  2422. (at.pathX = at.pointer.pageX - at.initX),
  2423. (at.pathY = at.pointer.pageY - at.initY),
  2424. (at.path = D(A(at.pathX, 2) + A(at.pathY, 2))),
  2425. (at.delta = ge.horizontal ? at.pathX : at.pathY),
  2426. at.released || !(at.path < 1))
  2427. ) {
  2428. if (!at.init) {
  2429. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY))) return ne()
  2430. at.init = 1
  2431. }
  2432. r(e),
  2433. !at.locked &&
  2434. at.path > at.pathToLock &&
  2435. at.slidee &&
  2436. ((at.locked = 1), at.$source.on(B, s)),
  2437. at.released &&
  2438. (ne(),
  2439. ge.releaseSwing &&
  2440. at.slidee &&
  2441. ((at.swing = ((at.delta - at.history[0]) / 40) * 300),
  2442. (at.delta += at.swing),
  2443. (at.tweese = x(at.swing) > 10))),
  2444. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  2445. }
  2446. }
  2447. function ne() {
  2448. clearInterval(rt),
  2449. (at.released = !0),
  2450. b.off(at.touch ? z : I, ae),
  2451. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  2452. setTimeout(function () {
  2453. at.$source.off(B, s)
  2454. }),
  2455. Ce.cur === Ce.dest && at.init && pe('moveEnd'),
  2456. ye.resume(1),
  2457. (at.init = 0)
  2458. }
  2459. function ie(t) {
  2460. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  2461. }
  2462. function re() {
  2463. ye.stop(), b.off('mouseup', re)
  2464. }
  2465. function se(e) {
  2466. switch ((r(e), this)) {
  2467. case $e[0]:
  2468. case Qe[0]:
  2469. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy), b.on('mouseup', re)
  2470. break
  2471. case Ze[0]:
  2472. ye.prev()
  2473. break
  2474. case Ge[0]:
  2475. ye.next()
  2476. break
  2477. case Je[0]:
  2478. ye.prevPage()
  2479. break
  2480. case Ke[0]:
  2481. ye.nextPage()
  2482. }
  2483. }
  2484. function oe(e) {
  2485. return (
  2486. (nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta),
  2487. (nt.curDelta /= 1 === e.deltaMode ? 3 : 100),
  2488. Re
  2489. ? ((p = +new Date()),
  2490. nt.last < p - nt.resetTime && (nt.delta = 0),
  2491. (nt.last = p),
  2492. (nt.delta += nt.curDelta),
  2493. x(nt.delta) < 1
  2494. ? (nt.finalDelta = 0)
  2495. : ((nt.finalDelta = E(nt.delta / 1)), (nt.delta %= 1)),
  2496. nt.finalDelta)
  2497. : nt.curDelta
  2498. )
  2499. }
  2500. function le(e) {
  2501. e.originalEvent[g] = ye
  2502. var t = +new Date()
  2503. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window) return void (O = t)
  2504. if (ge.scrollBy && Ce.start !== Ce.end) {
  2505. var a = oe(e.originalEvent)
  2506. ;(ge.scrollTrap || (a > 0 && Ce.dest < Ce.end) || (0 > a && Ce.dest > Ce.start)) && r(e, 1),
  2507. ye.slideBy(ge.scrollBy * a)
  2508. }
  2509. }
  2510. function ce(e) {
  2511. ge.clickBar &&
  2512. e.target === Be[0] &&
  2513. (r(e),
  2514. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  2515. }
  2516. function de(e) {
  2517. if (ge.keyboardNavBy)
  2518. switch (e.which) {
  2519. case ge.horizontal ? 37 : 38:
  2520. r(e), ye['pages' === ge.keyboardNavBy ? 'prevPage' : 'prev']()
  2521. break
  2522. case ge.horizontal ? 39 : 40:
  2523. r(e), ye['pages' === ge.keyboardNavBy ? 'nextPage' : 'next']()
  2524. }
  2525. }
  2526. function ue(e) {
  2527. return ie(this)
  2528. ? void (e.originalEvent[g + 'ignore'] = !0)
  2529. : void (this.parentNode !== Pe[0] || e.originalEvent[g + 'ignore'] || ye.activate(this))
  2530. }
  2531. function fe() {
  2532. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  2533. }
  2534. function ve(e) {
  2535. ge.pauseOnHover && ye['mouseenter' === e.type ? 'pause' : 'resume'](2)
  2536. }
  2537. function pe(e, t) {
  2538. if (Ve[e]) {
  2539. for (me = Ve[e].length, T.length = 0, he = 0; me > he; he++) T.push(Ve[e][he])
  2540. for (he = 0; me > he; he++) T[he].call(ye, e, t)
  2541. }
  2542. }
  2543. var he,
  2544. me,
  2545. ge = e.extend({}, n.defaults, h),
  2546. ye = this,
  2547. we = l(t),
  2548. be = e(t),
  2549. Pe = ge.slidee ? e(ge.slidee).eq(0) : be.children().eq(0),
  2550. Ie = 0,
  2551. ze = 0,
  2552. Ce = {
  2553. start: 0,
  2554. center: 0,
  2555. end: 0,
  2556. cur: 0,
  2557. dest: 0
  2558. },
  2559. Be = e(ge.scrollBar).eq(0),
  2560. Se = Be.children().eq(0),
  2561. ke = 0,
  2562. Te = 0,
  2563. xe = {
  2564. start: 0,
  2565. end: 0,
  2566. cur: 0
  2567. },
  2568. De = e(ge.pagesBar),
  2569. Ae = 0,
  2570. Ee = [],
  2571. qe = 0,
  2572. Ne = [],
  2573. Oe = {
  2574. firstItem: 0,
  2575. lastItem: 0,
  2576. centerItem: 0,
  2577. activeItem: null,
  2578. activePage: 0
  2579. },
  2580. He = new u(be[0]),
  2581. Xe = new u(Pe[0]),
  2582. Ye = new u(Be[0]),
  2583. je = new u(Se[0]),
  2584. Fe = 'basic' === ge.itemNav,
  2585. Me = 'forceCentered' === ge.itemNav,
  2586. Le = 'centered' === ge.itemNav || Me,
  2587. Re = !we && (Fe || Le || Me),
  2588. Ue = ge.scrollSource ? e(ge.scrollSource) : be,
  2589. We = ge.dragSource ? e(ge.dragSource) : be,
  2590. $e = e(ge.forward),
  2591. Qe = e(ge.backward),
  2592. Ze = e(ge.prev),
  2593. Ge = e(ge.next),
  2594. Je = e(ge.prevPage),
  2595. Ke = e(ge.nextPage),
  2596. Ve = {},
  2597. _e = {},
  2598. et = {},
  2599. tt = {},
  2600. at = {
  2601. released: 1
  2602. },
  2603. nt = {
  2604. last: 0,
  2605. delta: 0,
  2606. resetTime: 200
  2607. },
  2608. it = 0,
  2609. rt = 0,
  2610. st = 0,
  2611. ot = 0
  2612. we || (t = be[0]),
  2613. (ye.initialized = 0),
  2614. (ye.frame = t),
  2615. (ye.slidee = Pe[0]),
  2616. (ye.pos = Ce),
  2617. (ye.rel = Oe),
  2618. (ye.items = Ne),
  2619. (ye.pages = Ee),
  2620. (ye.isPaused = 0),
  2621. (ye.options = ge),
  2622. (ye.dragging = at),
  2623. (ye.reload = function () {
  2624. H()
  2625. }),
  2626. (ye.getPos = function (e) {
  2627. if (Re) {
  2628. var t = R(e)
  2629. return -1 !== t && Ne[t]
  2630. }
  2631. var a = Pe.find(e).eq(0)
  2632. if (a[0]) {
  2633. var n = ge.horizontal
  2634. ? a.offset().left - Pe.offset().left
  2635. : a.offset().top - Pe.offset().top,
  2636. i = a[ge.horizontal ? 'outerWidth' : 'outerHeight']()
  2637. return {
  2638. start: n,
  2639. center: n - Ie / 2 + i / 2,
  2640. end: n - Ie + i,
  2641. size: i
  2642. }
  2643. }
  2644. return !1
  2645. }),
  2646. (ye.moveBy = function (e) {
  2647. ;(tt.speed = e),
  2648. !at.init &&
  2649. tt.speed &&
  2650. Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) &&
  2651. ((tt.lastTime = +new Date()),
  2652. (tt.startPos = Ce.cur),
  2653. ee('button'),
  2654. (at.init = 1),
  2655. pe('moveStart'),
  2656. y(ot),
  2657. M())
  2658. }),
  2659. (ye.stop = function () {
  2660. 'button' === at.source && ((at.init = 0), (at.released = 1))
  2661. }),
  2662. (ye.prev = function () {
  2663. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2664. }),
  2665. (ye.next = function () {
  2666. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2667. }),
  2668. (ye.prevPage = function () {
  2669. ye.activatePage(Oe.activePage - 1)
  2670. }),
  2671. (ye.nextPage = function () {
  2672. ye.activatePage(Oe.activePage + 1)
  2673. }),
  2674. (ye.slideBy = function (e, t) {
  2675. e &&
  2676. (Re
  2677. ? ye[Le ? 'toCenter' : 'toStart'](
  2678. d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)
  2679. )
  2680. : X(Ce.dest + e, t))
  2681. }),
  2682. (ye.slideTo = function (e, t) {
  2683. X(e, t)
  2684. }),
  2685. (ye.toStart = function (e, t) {
  2686. L('start', e, t)
  2687. }),
  2688. (ye.toEnd = function (e, t) {
  2689. L('end', e, t)
  2690. }),
  2691. (ye.toCenter = function (e, t) {
  2692. L('center', e, t)
  2693. }),
  2694. (ye.getIndex = R),
  2695. (ye.activate = function (e, t) {
  2696. var a = W(e)
  2697. ge.smart &&
  2698. a !== !1 &&
  2699. (Le
  2700. ? ye.toCenter(a, t)
  2701. : a >= Oe.lastItem
  2702. ? ye.toStart(a, t)
  2703. : a <= Oe.firstItem
  2704. ? ye.toEnd(a, t)
  2705. : K())
  2706. }),
  2707. (ye.activatePage = function (e, t) {
  2708. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2709. }),
  2710. (ye.resume = function (e) {
  2711. ge.cycleBy &&
  2712. ge.cycleInterval &&
  2713. ('items' !== ge.cycleBy || (Ne[0] && null != Oe.activeItem)) &&
  2714. !(e < ye.isPaused) &&
  2715. ((ye.isPaused = 0),
  2716. st ? (st = clearTimeout(st)) : pe('resume'),
  2717. (st = setTimeout(function () {
  2718. switch ((pe('cycle'), ge.cycleBy)) {
  2719. case 'items':
  2720. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1)
  2721. break
  2722. case 'pages':
  2723. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2724. }
  2725. }, ge.cycleInterval)))
  2726. }),
  2727. (ye.pause = function (e) {
  2728. e < ye.isPaused || ((ye.isPaused = e || 100), st && ((st = clearTimeout(st)), pe('pause')))
  2729. }),
  2730. (ye.toggle = function () {
  2731. ye[st ? 'pause' : 'resume']()
  2732. }),
  2733. (ye.set = function (t, a) {
  2734. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2735. }),
  2736. (ye.add = function (t, a) {
  2737. var n = e(t)
  2738. Re
  2739. ? (null == a || !Ne[0] || a >= Ne.length
  2740. ? n.appendTo(Pe)
  2741. : Ne.length && n.insertBefore(Ne[a].el),
  2742. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length))
  2743. : Pe.append(n),
  2744. H()
  2745. }),
  2746. (ye.remove = function (t) {
  2747. if (Re) {
  2748. var a = U(t)
  2749. if (a > -1) {
  2750. qe.eq(a).remove()
  2751. var n = a === Oe.activeItem
  2752. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2753. H(),
  2754. n && ((_e.active = null), ye.activate(Oe.activeItem))
  2755. }
  2756. } else e(t).remove(), H()
  2757. }),
  2758. (ye.moveAfter = function (e, t) {
  2759. G(e, t, 1)
  2760. }),
  2761. (ye.moveBefore = function (e, t) {
  2762. G(e, t)
  2763. }),
  2764. (ye.on = function (e, t) {
  2765. if ('object' === i(e)) for (var a in e) e.hasOwnProperty(a) && ye.on(a, e[a])
  2766. else if ('function' === i(t))
  2767. for (var n = e.split(' '), r = 0, s = n.length; s > r; r++)
  2768. (Ve[n[r]] = Ve[n[r]] || []), -1 === J(n[r], t) && Ve[n[r]].push(t)
  2769. else if ('array' === i(t)) for (var o = 0, l = t.length; l > o; o++) ye.on(e, t[o])
  2770. }),
  2771. (ye.one = function (e, t) {
  2772. function a() {
  2773. t.apply(ye, arguments), ye.off(e, a)
  2774. }
  2775. ye.on(e, a)
  2776. }),
  2777. (ye.off = function (e, t) {
  2778. if (t instanceof Array) for (var a = 0, n = t.length; n > a; a++) ye.off(e, t[a])
  2779. else
  2780. for (var i = e.split(' '), r = 0, s = i.length; s > r; r++)
  2781. if (((Ve[i[r]] = Ve[i[r]] || []), null == t)) Ve[i[r]].length = 0
  2782. else {
  2783. var o = J(i[r], t)
  2784. ;-1 !== o && Ve[i[r]].splice(o, 1)
  2785. }
  2786. }),
  2787. (ye.destroy = function () {
  2788. return (
  2789. Ue.add(Se)
  2790. .add(Be)
  2791. .add(De)
  2792. .add($e)
  2793. .add(Qe)
  2794. .add(Ze)
  2795. .add(Ge)
  2796. .add(Je)
  2797. .add(Ke)
  2798. .off('.' + g),
  2799. b.off('keydown', de),
  2800. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2801. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2802. De.empty(),
  2803. we ||
  2804. (be.off('.' + g),
  2805. He.restore(),
  2806. Xe.restore(),
  2807. Ye.restore(),
  2808. je.restore(),
  2809. e.removeData(t, g)),
  2810. (Ne.length = Ee.length = 0),
  2811. (_e = {}),
  2812. (ye.initialized = 0),
  2813. ye
  2814. )
  2815. }),
  2816. (ye.init = function () {
  2817. if (!ye.initialized) {
  2818. ye.on(m)
  2819. var e = ['overflow', 'position'],
  2820. t = [
  2821. 'position',
  2822. 'webkitTransform',
  2823. 'msTransform',
  2824. 'transform',
  2825. 'left',
  2826. 'top',
  2827. 'width',
  2828. 'height'
  2829. ]
  2830. He.save.apply(He, e), Ye.save.apply(Ye, e), Xe.save.apply(Xe, t), je.save.apply(je, t)
  2831. var a = Se
  2832. return (
  2833. we ||
  2834. ((a = a.add(Pe)),
  2835. be.css('overflow', 'hidden'),
  2836. f || 'static' !== be.css('position') || be.css('position', 'relative')),
  2837. f
  2838. ? v && a.css(f, v)
  2839. : ('static' === Be.css('position') && Be.css('position', 'relative'),
  2840. a.css({
  2841. position: 'absolute'
  2842. })),
  2843. ge.forward && $e.on(S, se),
  2844. ge.backward && Qe.on(S, se),
  2845. ge.prev && Ze.on(B, se),
  2846. ge.next && Ge.on(B, se),
  2847. ge.prevPage && Je.on(B, se),
  2848. ge.nextPage && Ke.on(B, se),
  2849. Ue.on(C, le), // C是 "wheel.sly" 滚动监听
  2850. Be[0] && Be.on(B, ce),
  2851. Re && ge.activateOn && be.on(ge.activateOn + '.' + g, '*', ue),
  2852. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + '.' + g, '*', fe),
  2853. We.on(
  2854. P,
  2855. {
  2856. source: 'slidee'
  2857. },
  2858. te
  2859. ),
  2860. Se &&
  2861. Se.on(
  2862. P,
  2863. {
  2864. source: 'handle'
  2865. },
  2866. te
  2867. ),
  2868. b.on('keydown', de),
  2869. we || (be.on('mouseenter.' + g + ' mouseleave.' + g, ve), be.on('scroll.' + g, o)),
  2870. (ye.initialized = 1),
  2871. H(!0),
  2872. ge.cycleBy && !we && ye[ge.startPaused ? 'pause' : 'resume'](),
  2873. ye
  2874. )
  2875. }
  2876. })
  2877. }
  2878. function i(e) {
  2879. return null == e
  2880. ? String(e)
  2881. : 'object' == typeof e || 'function' == typeof e
  2882. ? Object.prototype.toString
  2883. .call(e)
  2884. .match(/\s([a-z]+)/i)[1]
  2885. .toLowerCase() || 'object'
  2886. : typeof e
  2887. }
  2888. function r(e, t) {
  2889. e.preventDefault(), t && e.stopPropagation()
  2890. }
  2891. function s(t) {
  2892. r(t, 1), e(this).off(t.type, s)
  2893. }
  2894. function o() {
  2895. ;(this.scrollLeft = 0), (this.scrollTop = 0)
  2896. }
  2897. function l(e) {
  2898. return !isNaN(parseFloat(e)) && isFinite(e)
  2899. }
  2900. function c(e, t) {
  2901. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ''))
  2902. }
  2903. function d(e, t, a) {
  2904. return t > e ? t : e > a ? a : e
  2905. }
  2906. function u(e) {
  2907. var t = {}
  2908. return (
  2909. (t.style = {}),
  2910. (t.save = function () {
  2911. if (e && e.nodeType) {
  2912. for (var a = 0; a < arguments.length; a++) t.style[arguments[a]] = e.style[arguments[a]]
  2913. return t
  2914. }
  2915. }),
  2916. (t.restore = function () {
  2917. if (e && e.nodeType) {
  2918. for (var a in t.style) t.style.hasOwnProperty(a) && (e.style[a] = t.style[a])
  2919. return t
  2920. }
  2921. }),
  2922. t
  2923. )
  2924. }
  2925. var f,
  2926. v,
  2927. p,
  2928. h = 'sly',
  2929. m = 'Sly',
  2930. g = h,
  2931. y = t.cancelAnimationFrame || t.cancelRequestAnimationFrame,
  2932. w = t.requestAnimationFrame,
  2933. b = e(document),
  2934. P = 'touchstart.' + g + ' mousedown.' + g,
  2935. I = 'mousemove.' + g + ' mouseup.' + g,
  2936. z = 'touchmove.' + g + ' touchend.' + g,
  2937. C = (document.implementation.hasFeature('Event.wheel', '3.0') ? 'wheel.' : 'mousewheel.') + g,
  2938. B = 'click.' + g,
  2939. S = 'mousedown.' + g,
  2940. k = ['INPUT', 'SELECT', 'BUTTON', 'TEXTAREA'],
  2941. T = [],
  2942. x = Math.abs,
  2943. D = Math.sqrt,
  2944. A = Math.pow,
  2945. E = Math.round,
  2946. q = Math.max,
  2947. N = Math.min,
  2948. O = 0
  2949. b.on(C, function (e) {
  2950. var t = e.originalEvent[g],
  2951. a = +new Date()
  2952. ;(!t || t.options.scrollHijack < a - O) && (O = a)
  2953. }),
  2954. (function (e) {
  2955. function t(e) {
  2956. var t = new Date().getTime(),
  2957. n = Math.max(0, 16 - (t - a)),
  2958. i = setTimeout(e, n)
  2959. return (a = t), i
  2960. }
  2961. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t
  2962. var a = new Date().getTime(),
  2963. n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout
  2964. y = function (t) {
  2965. n.call(e, t)
  2966. }
  2967. })(window),
  2968. (function () {
  2969. function e(e) {
  2970. for (var n = 0, i = t.length; i > n; n++) {
  2971. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e
  2972. if (null != a.style[r]) return r
  2973. }
  2974. }
  2975. var t = ['', 'webkit', 'moz', 'ms', 'o'],
  2976. a = document.createElement('div')
  2977. ;(f = e('transform')), (v = e('perspective') ? 'translateZ(0) ' : '')
  2978. })(),
  2979. (t[m] = n),
  2980. (e.fn[h] = function (t, a) {
  2981. var r, s
  2982. return (
  2983. e.isPlainObject(t) ||
  2984. (('string' === i(t) || t === !1) &&
  2985. ((r = t === !1 ? 'destroy' : t), (s = Array.prototype.slice.call(arguments, 1))),
  2986. (t = {})),
  2987. this.each(function (i, o) {
  2988. var l = e.data(o, g)
  2989. l || r ? l && r && l[r] && l[r].apply(l, s) : (l = e.data(o, g, new n(o, t, a).init()))
  2990. })
  2991. )
  2992. }),
  2993. (n.defaults = {
  2994. slidee: null,
  2995. horizontal: !1,
  2996. itemNav: null,
  2997. itemSelector: null,
  2998. smart: !1,
  2999. activateOn: null,
  3000. activateMiddle: !1,
  3001. scrollSource: null,
  3002. scrollBy: 0,
  3003. scrollHijack: 300,
  3004. scrollTrap: !1,
  3005. dragSource: null,
  3006. mouseDragging: !1,
  3007. touchDragging: !1,
  3008. releaseSwing: !1,
  3009. swingSpeed: 0.2,
  3010. elasticBounds: !1,
  3011. interactive: null,
  3012. scrollBar: null,
  3013. dragHandle: !1,
  3014. dynamicHandle: !1,
  3015. minHandleSize: 50,
  3016. clickBar: !1,
  3017. syncSpeed: 0.5,
  3018. pagesBar: null,
  3019. activatePageOn: null,
  3020. pageBuilder: function (e) {
  3021. return '<li>' + (e + 1) + '</li>'
  3022. },
  3023. forward: null,
  3024. backward: null,
  3025. prev: null,
  3026. next: null,
  3027. prevPage: null,
  3028. nextPage: null,
  3029. cycleBy: null,
  3030. cycleInterval: 5e3,
  3031. pauseOnHover: !1,
  3032. startPaused: !1,
  3033. moveBy: 300,
  3034. speed: 0,
  3035. easing: 'swing',
  3036. startAt: null,
  3037. keyboardNavBy: null,
  3038. draggedClass: 'dragged',
  3039. activeClass: 'active',
  3040. disabledClass: 'disabled'
  3041. })
  3042. })(jQuery, window)
  3043. !(function e(t, i, n) {
  3044. function r(a, s) {
  3045. if (!i[a]) {
  3046. if (!t[a]) {
  3047. var l = 'function' == typeof require && require
  3048. if (!s && l) return l(a, !0)
  3049. if (o) return o(a, !0)
  3050. var c = new Error("Cannot find module '" + a + "'")
  3051. throw ((c.code = 'MODULE_NOT_FOUND'), c)
  3052. }
  3053. var h = (i[a] = {
  3054. exports: {}
  3055. })
  3056. t[a][0].call(
  3057. h.exports,
  3058. function (e) {
  3059. var i = t[a][1][e]
  3060. return r(i ? i : e)
  3061. },
  3062. h,
  3063. h.exports,
  3064. e,
  3065. t,
  3066. i,
  3067. n
  3068. )
  3069. }
  3070. return i[a].exports
  3071. }
  3072. for (var o = 'function' == typeof require && require, a = 0; a < n.length; a++) r(n[a])
  3073. return r
  3074. })(
  3075. {
  3076. 1: [
  3077. function (e, t, i) {
  3078. ;(function (i) {
  3079. 'use strict'
  3080. function n(e) {
  3081. ;(this.player = null),
  3082. (this.director = null),
  3083. (this.modelManager = null),
  3084. (this.container = null),
  3085. (this.tagManager = null),
  3086. (this.fadeInSpeed = e),
  3087. (null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed) || (this.fadeInSpeed = 0)
  3088. }
  3089. var r = e('three'),
  3090. o = e('./util/logger'),
  3091. a = (e('./util/common'), e('./enum/PlayerEvents')),
  3092. s = e('./enum/DirectorEvents'),
  3093. l = e('./settings'),
  3094. c = e('./enum/Viewmode'),
  3095. h = (e('./enum/WarpStyle'), e('./enum/BlackoutStyle'), e('./enum/ModelManagerEvents')),
  3096. u = e('./enum/tagEvents'),
  3097. d = e('./util/transitions'),
  3098. p = e('./util/lerp'),
  3099. f = new o(i)
  3100. //window.THREE = r;
  3101. ;(n.prototype.init = function (e, t, i, n, r) {
  3102. window.app = this
  3103. ;(this.player = t),
  3104. (this.director = e),
  3105. (this.modelManager = i),
  3106. (this.tagManager = n),
  3107. (this.container = r),
  3108. this.updateModel(),
  3109. this.bindEvents()
  3110. }),
  3111. (n.prototype.bindEvents = function () {
  3112. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  3113. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  3114. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  3115. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  3116. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  3117. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  3118. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  3119. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  3120. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  3121. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  3122. }),
  3123. (n.prototype.updateModel = function () {
  3124. //模型this.model
  3125. this.model = this.modelManager.getActiveModel()
  3126. }),
  3127. (n.prototype.handleWarpStarted = function () {
  3128. this.hidePlayerReticule()
  3129. }),
  3130. (n.prototype.ontagActivated = function () {
  3131. this.hidePlayerReticule()
  3132. }),
  3133. (n.prototype.onNavigationTotag = function () {
  3134. this.hidePlayerReticule()
  3135. }),
  3136. (n.prototype.handlePlayerModeChanging = function (e, t, i) {
  3137. var n = this.modelManager.getActiveModel(),
  3138. r =
  3139. this.player.is360View(t, i) || this.director.tourIsPlaying
  3140. ? 0
  3141. : l[t].markerOpacity
  3142. n.fadePanoMarkers(r), n.setMode(t)
  3143. }),
  3144. (n.prototype.handlePlayerModeChanged = function (e, t) {
  3145. var i = this.modelManager.getActiveModel(),
  3146. n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide
  3147. i.setSide(n), i.setMode(t)
  3148. }),
  3149. (n.prototype.handleClosestPanoChanging = function (e, t, i) {
  3150. i !== c.TRANSITIONING &&
  3151. (e && !this.director.tourIsPlaying && e.hoverOff(i),
  3152. t && !this.director.tourIsPlaying && t.hoverOn(i))
  3153. }),
  3154. (n.prototype.handleActionInterruption = function () {}),
  3155. (n.prototype.handleStartInside = function (e) {
  3156. var t = l[this.player.mode],
  3157. i = e ? 0 : t.transitionTime * t.skyboxOpacityLength
  3158. this.fadeIn(this.fadeInSpeed),
  3159. (this.model.alpha = 0),
  3160. (this.model.skybox.material.uniforms.opacity.value = 1),
  3161. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity)
  3162. var n = this.player.reticule
  3163. d.start(p.property(n.material, 'opacity', 0), i, null, 0, null, 'retReOpac')
  3164. }),
  3165. (n.prototype.handleStartOutside = function (e) {
  3166. this.fadeIn(e)
  3167. }),
  3168. (n.prototype.fadeIn = function (e) {
  3169. ;(null !== e && void 0 !== e) ||
  3170. ((e = 2e3),
  3171. f.warn(
  3172. 'DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.'
  3173. )),
  3174. $(this.container).fadeIn(e)
  3175. }),
  3176. (n.prototype.hidePlayerReticule = function () {
  3177. this.player.reticule.hide()
  3178. }),
  3179. (t.exports = n)
  3180. }).call(this, '/js/DisplayController.js')
  3181. },
  3182. {
  3183. './enum/BlackoutStyle': 18,
  3184. './enum/DirectorEvents': 23,
  3185. './enum/tagEvents': 32,
  3186. './enum/ModelManagerEvents': 33,
  3187. './enum/PlayerEvents': 40,
  3188. './enum/Viewmode': 51,
  3189. './enum/WarpStyle': 52,
  3190. './settings': 166,
  3191. './util/common': 185,
  3192. './util/lerp': 188,
  3193. './util/logger': 189,
  3194. './util/transitions': 195,
  3195. three: 217
  3196. }
  3197. ],
  3198. 2: [
  3199. function (e, t, i) {
  3200. 'use strict'
  3201. function n() {
  3202. ;(this.baseStartTime = performance.timing.navigationStart),
  3203. (this.loadingStartTime = null),
  3204. (this.waitingStartTime = null),
  3205. (this.appReadyTime = null)
  3206. }
  3207. ;(n.prototype.setBaseStartTime = function (e) {
  3208. this.baseStartTime = e || Date.now()
  3209. }),
  3210. (n.prototype.setWaitingStartTime = function (e) {
  3211. this.waitingStartTime = e || Date.now()
  3212. }),
  3213. (n.prototype.setLoadingStartTime = function (e) {
  3214. this.loadingStartTime = e || Date.now()
  3215. }),
  3216. (n.prototype.setAppReadyTime = function (e) {
  3217. this.appReadyTime = e || Date.now()
  3218. }),
  3219. (n.prototype.calcFullLoadingTime = function () {
  3220. var e = this.appReadyTime - this.baseStartTime
  3221. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime), e
  3222. }),
  3223. (t.exports = n)
  3224. },
  3225. {}
  3226. ],
  3227. 3: [
  3228. function (e, t, i) {
  3229. ;(function (i) {
  3230. 'use strict'
  3231. function n() {
  3232. return 100 * Math.random()
  3233. }
  3234. var r = e('./util/logger'),
  3235. o = e('./util/browser'),
  3236. a = new r(i),
  3237. s = (window.MP_AB_TESTS = window.MP_AB_TESTS || {
  3238. initialized: !1,
  3239. init: function (e, t) {
  3240. if (((t = t || {}), !this.initialized)) {
  3241. ;(this.initialized = !0),
  3242. o.valueFromHash('tilegen') && (t.tilegen = 1 === o.valueFromHash('tilegen', 0)),
  3243. o.valueFromHash('imgopt') && (t.imgopt = 1 === o.valueFromHash('imgopt', 0))
  3244. for (var i in e) {
  3245. var r = i.match('^sc_tilegen_([0-9]+)$')
  3246. r && (s.tilegen = n() < parseInt(r[1]))
  3247. var l = i.match('^sc_imgopt_([0-9]+)$')
  3248. l && (s.imgopt = n() < parseInt(l[1]))
  3249. }
  3250. for (var c in t) (s[c] = t[c]), a.debug('A/B override:', c, s[c])
  3251. }
  3252. },
  3253. changeIfTileGenerating: function (e) {
  3254. return s.tilegen && ((e += e.indexOf('?') === -1 ? '?' : '&'), (e += '')), e
  3255. },
  3256. changeIfImageOptimzing: function (e) {
  3257. return (
  3258. s.imgopt &&
  3259. e.indexOf('imgopt=1') === -1 &&
  3260. ((e += e.indexOf('?') === -1 ? '?' : '&'), (e += '')),
  3261. e
  3262. )
  3263. },
  3264. tilegen: !1,
  3265. imgopt: !1
  3266. })
  3267. t.exports = s
  3268. }).call(this, '/js/ab.js')
  3269. },
  3270. {
  3271. './util/browser': 182,
  3272. './util/logger': 189
  3273. }
  3274. ],
  3275. 4: [
  3276. function (e, t, i) {
  3277. ;(function (i) {
  3278. 'use strict'
  3279. function n() {
  3280. return {
  3281. addons: [
  3282. {
  3283. name: 'keen:ua_parser',
  3284. input: {
  3285. ua_string: 'user_agent'
  3286. },
  3287. output: 'parsed_user_agent'
  3288. }
  3289. ]
  3290. }
  3291. }
  3292. function r(e, t, i, n) {
  3293. function r(t) {
  3294. l[t.sid] = !0
  3295. var i = t.billboard.media && t.billboard.media.type,
  3296. n = {
  3297. tag_id: t.sid,
  3298. tags_visited: Object.keys(l).length,
  3299. tag_count: Object.keys(e.tags).length,
  3300. tag_view_count: ++E,
  3301. has_media: !!i
  3302. }
  3303. i && (n.media_type = i), u('tag_opened', n)
  3304. }
  3305. var l = {},
  3306. h = Date.now() - N,
  3307. f = null
  3308. n && (f = Date.now() - window.navigationStart)
  3309. var g
  3310. try {
  3311. g = /* e.data.player_options.highlight_reel && */ e.heroLocations.length > 0
  3312. } catch (e) {
  3313. g = !1
  3314. }
  3315. var v,
  3316. A = e.supportsVR
  3317. A ||
  3318. ((v = 'VR disabled at the model/account level'),
  3319. m.valueFromHash('vr') === _.NONE
  3320. ? (v = 'VR disabled, using &vr=0')
  3321. : m.detectAndroid()
  3322. ? b.isDeviceSupported(w.Android) || (v = 'VR disabled, unsupported Android version')
  3323. : m.detectIOS() &&
  3324. (b.isDeviceSupported(w.IOS) || (v = 'VR disabled, unsupported iOS version'))),
  3325. u('model_loaded', {
  3326. duration: h,
  3327. duration_from_navigation_start: f,
  3328. has_hlr: g,
  3329. has_vr: A,
  3330. vr_reason: v
  3331. })
  3332. var I = 0
  3333. e.panos.forEach(function (e) {
  3334. e.on('enter', function () {
  3335. c('pano_viewed', {
  3336. pano_id: e.id,
  3337. pano_view_count: ++I,
  3338. alignment_type: e.alignmentType,
  3339. interaction_source: O,
  3340. navigation_source: p
  3341. })
  3342. })
  3343. })
  3344. var E = 0
  3345. for (var T in e.tags) e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]))
  3346. t.on('tour_auto', function (e) {
  3347. p = 'tour_' + e
  3348. }),
  3349. t.on('tour_manual', function (e) {
  3350. ;(O = 'gui-' + e), (p = 'tour_manual')
  3351. }),
  3352. i.on(C.InteractionKey, function () {
  3353. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  3354. }),
  3355. i.on(C.InteractionDirect, function () {
  3356. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  3357. }),
  3358. o(t),
  3359. a(),
  3360. s()
  3361. }
  3362. function o(e) {
  3363. I.on(T.OPENED, function () {
  3364. c('showcase_share_intent', {
  3365. pano_id: e.currentPano && e.currentPano.id
  3366. })
  3367. }),
  3368. I.on(T.LINK_CLICKED, function (t) {
  3369. c('showcase_share_action', {
  3370. channel: t.channel,
  3371. pano_id: e.currentPano && e.currentPano.id
  3372. })
  3373. }),
  3374. E.on(x.ORIGIN_LINK_CLICKED, function () {
  3375. c('showcase_share_origin_link_clicked')
  3376. })
  3377. }
  3378. function a() {}
  3379. function s() {
  3380. b.on(
  3381. S.OPENED,
  3382. c.bind(this, 'showcase_gui', {
  3383. gui_action: 'click_vr_button'
  3384. })
  3385. ),
  3386. b.on(S.LAUNCH, function (e) {
  3387. c('showcase_gui', {
  3388. gui_action: 'launch_vr',
  3389. vr_platform: e.vr_platform,
  3390. vr_app: e.vr_app
  3391. })
  3392. }),
  3393. b.on(
  3394. S.PREV,
  3395. c.bind(this, 'showcase_gui', {
  3396. gui_action: 'vr_modal_prev'
  3397. })
  3398. ),
  3399. b.on(S.NEXT, function (e) {
  3400. c('showcase_gui', {
  3401. gui_action: e.nextAction
  3402. })
  3403. }),
  3404. b.on(
  3405. S.CLOSED,
  3406. c.bind(this, 'showcase_gui', {
  3407. gui_action: 'vr_modal_close'
  3408. })
  3409. ),
  3410. b.on(S.falseICECHOSEN, function (e) {
  3411. c('showcase_gui', {
  3412. gui_action: e.name + ' '
  3413. })
  3414. }),
  3415. b.on(S.STORE, function (e) {
  3416. c('showcase_gui', {
  3417. gui_action: 'launch_store',
  3418. store: e
  3419. })
  3420. })
  3421. }
  3422. function l(e, t) {
  3423. if (f)
  3424. try {
  3425. f.addEvent(
  3426. e,
  3427. v.extendObject(
  3428. {
  3429. host: window.location.host,
  3430. keen: n(),
  3431. user_agent: '${keen.user_agent}',
  3432. referrer: {
  3433. url: v.normalizeUrl(document.referrer),
  3434. domain: v.domainFromUrl(document.referrer),
  3435. url_original: document.referrer
  3436. },
  3437. embedded: m.inIframe(),
  3438. is_mobile: m.isMobile(),
  3439. version: '2.25.6-0-gd87e5b1'
  3440. },
  3441. t
  3442. )
  3443. )
  3444. } catch (e) {
  3445. P.warn(
  3446. 'analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: ' +
  3447. e
  3448. )
  3449. }
  3450. }
  3451. function c(e, t) {
  3452. if (((t = t || {}), L))
  3453. try {
  3454. window.analytics.track(e, v.extendObject(t, B), {
  3455. context: {
  3456. app: {
  3457. name: 'showcase',
  3458. version: '2.25.6-0-gd87e5b1'
  3459. },
  3460. screen: {
  3461. width: window.screen.width,
  3462. height: window.screen.height,
  3463. density: window.devicePixelRatio
  3464. }
  3465. }
  3466. })
  3467. } catch (t) {
  3468. console.warn('Failed to send data to segment for ' + e)
  3469. }
  3470. }
  3471. function h(e, t) {
  3472. if (((t = t || {}), navigator.sendBeacon && L))
  3473. try {
  3474. navigator.sendBeacon(
  3475. 'https://api.segment.io/v1/t',
  3476. JSON.stringify({
  3477. event: e,
  3478. anonymousId: window.analytics.user().anonymousId(),
  3479. properties: v.extendObject(t, B),
  3480. writeKey: L,
  3481. sentAt: Date.now(),
  3482. type: 'track',
  3483. context: {
  3484. userAgent: m.userAgent(),
  3485. library: {
  3486. name: 'showcase-beacon',
  3487. version: '2.25.6-0-gd87e5b1'
  3488. },
  3489. app: {
  3490. name: 'showcase',
  3491. version: '2.25.6-0-gd87e5b1'
  3492. }
  3493. }
  3494. })
  3495. )
  3496. } catch (e) {
  3497. console.warn('Failed to send async segment request')
  3498. }
  3499. }
  3500. function u(e, t) {
  3501. ;(t = t || {}), c(e, t)
  3502. }
  3503. function d(e, t) {
  3504. ;(O = e === C.InteractionGui ? 'gui-' + t : e), (p = 'self_guided')
  3505. }
  3506. var p,
  3507. f,
  3508. g = (e('three'), e('./util/ajax'), e('./ab')),
  3509. m = e('./util/browser'),
  3510. v = e('./util/common'),
  3511. A = e('./settings'),
  3512. y = (e('./localization/localize'), e('./enum/Viewmode')),
  3513. C = e('./enum/ControlEvents'),
  3514. I = e('./gui/sharing/modal'),
  3515. E = e('./gui/title/titleBar'),
  3516. b = e('./gui/vr/vrModal'),
  3517. w = e('./enum/VRPlatforms'),
  3518. _ = e('./enum/VROption'),
  3519. T = e('./gui/sharing/ShareEvents'),
  3520. x = e('./gui/title/TitleEvents'),
  3521. S = e('./gui/vr/vrEvent'),
  3522. M = e('./tag/Billboard/BillboardEvent'),
  3523. R = e('./util/logger'),
  3524. P = new R(i),
  3525. O = (e('./enum/PlayerEvents'), 'direct'),
  3526. L = null,
  3527. D = !1,
  3528. N = null,
  3529. B = null,
  3530. F = v.uuid4()
  3531. t.exports = {
  3532. report: function (e, t, i, n) {
  3533. l('Session starts', {
  3534. model: e,
  3535. status: t,
  3536. loadtime: Date.now() - (N || Date.now()),
  3537. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  3538. autoplay: i,
  3539. quickstart: n,
  3540. ab_tilegen: g.tilegen,
  3541. ab_imgopt: g.imgopt
  3542. })
  3543. },
  3544. impression: function (e) {
  3545. e = e || {}
  3546. var t = void 0 === e.isVisible || e.isVisible,
  3547. i =
  3548. (void 0 !== e.immediate && e.immediate,
  3549. window.location.search.substr(1).split('&'))
  3550. u('impression', {
  3551. visible: t,
  3552. url_params: i
  3553. })
  3554. },
  3555. initKeen: function (e) {
  3556. return e.token && e.appId
  3557. ? void (f = new Keen({
  3558. projectId: e.appId,
  3559. writeKey: e.token,
  3560. readKey: '',
  3561. requestType: 'xhr'
  3562. }))
  3563. : void P.warn('no keen token/appId')
  3564. },
  3565. initSegment: function (e) {
  3566. return e.token
  3567. ? ((L = e.token),
  3568. window.analytics.load(e.token),
  3569. (B = {
  3570. model_id: e.model,
  3571. start_source: e.startSource,
  3572. autoplay: e.autoplay,
  3573. quickstart: e.quickstart,
  3574. language_tag: A.languageTag,
  3575. is_mobile: m.isMobile(),
  3576. iframe: m.inIframe(),
  3577. aspect_ratio: m.aspectRatio(),
  3578. session_id: F,
  3579. window: {
  3580. width: $('#player').width(),
  3581. height: $('#player').height()
  3582. },
  3583. platform: {
  3584. browser: {
  3585. name: $.ua.browser.name,
  3586. major: $.ua.browser.major,
  3587. version: $.ua.browser.version
  3588. },
  3589. os: {
  3590. name: $.ua.os.name,
  3591. version: $.ua.os.version
  3592. },
  3593. device: {
  3594. vendor: $.ua.device.vendor,
  3595. model: $.ua.device.model,
  3596. type: $.ua.device.type
  3597. }
  3598. }
  3599. }),
  3600. (D = Math.random() < A.analytics.sessionTrackingRate),
  3601. P.debug('tracking sample rate = ' + A.analytics.sessionTrackingRate),
  3602. void P.debug('tracking this session = ' + D))
  3603. : void P.warn('no segment token')
  3604. },
  3605. sessionStart: function (e) {
  3606. P.debug('analytics user_session_start'),
  3607. c('session_started'),
  3608. (N = Date.now()),
  3609. window.addEventListener('unload', function () {
  3610. h('session_ended', {
  3611. duration: Date.now() - N
  3612. })
  3613. })
  3614. },
  3615. modelLoaded: function (e, t, i, n) {
  3616. r(e, t, i, n)
  3617. },
  3618. loadComplete: function (e) {
  3619. var t = {
  3620. time_to_app_start: e
  3621. }
  3622. c('load_times', t)
  3623. },
  3624. track: function (e, t) {
  3625. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + ' )'), c(e, t))
  3626. },
  3627. trackAlways: function (e, t) {
  3628. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + ' )'), c(e, t)
  3629. },
  3630. getSessionId: function () {
  3631. return F
  3632. },
  3633. updateInteraction: d
  3634. }
  3635. }).call(this, '/js/analytics.js')
  3636. },
  3637. {
  3638. './ab': 3,
  3639. './enum/ControlEvents': 21,
  3640. './enum/PlayerEvents': 40,
  3641. './enum/VROption': 47,
  3642. './enum/VRPlatforms': 49,
  3643. './enum/Viewmode': 51,
  3644. './gui/sharing/ShareEvents': 76,
  3645. './gui/sharing/modal': 77,
  3646. './gui/title/TitleEvents': 80,
  3647. './gui/title/titleBar': 82,
  3648. './gui/vr/vrEvent': 85,
  3649. './gui/vr/vrModal': 87,
  3650. './localization/localize': 108,
  3651. './tag/Billboard/BillboardEvent': 120,
  3652. './settings': 166,
  3653. './util/ajax': 181,
  3654. './util/browser': 182,
  3655. './util/common': 185,
  3656. './util/logger': 189,
  3657. three: 217
  3658. }
  3659. ],
  3660. 5: [
  3661. function (e, t, i) {
  3662. 'use strict'
  3663. function n() {
  3664. r.PerspectiveCamera.call(
  3665. this,
  3666. a.clampVFOV(o.dollhouseFOV),
  3667. $('#player').width() / $('#player').height(),
  3668. o.dollhouseNear,
  3669. o.dollhouseFar
  3670. ),
  3671. (this.controls = null)
  3672. }
  3673. var r = e('three'),
  3674. o = e('../constants'),
  3675. a = e('../util/cameraLight')
  3676. ;(n.prototype = Object.create(r.PerspectiveCamera.prototype)),
  3677. (n.prototype.updateAspect = function (e) {
  3678. ;(this.aspect = e), this.updateProjectionMatrix()
  3679. }),
  3680. (t.exports = n)
  3681. },
  3682. {
  3683. '../constants': 8,
  3684. '../util/cameraLight': 184,
  3685. three: 217
  3686. }
  3687. ],
  3688. 6: [
  3689. function (e, t, i) {
  3690. 'use strict'
  3691. function n() {
  3692. var e = $('#player').width() / $('#player').height()
  3693. r.OrthographicCamera.call(
  3694. this,
  3695. -o.orthoBase,
  3696. o.orthoBase,
  3697. o.orthoBase / e,
  3698. -o.orthoBase / e,
  3699. o.orthoNear,
  3700. o.orthoFar
  3701. ),
  3702. (this.controls = null),
  3703. this.updateAspect(e)
  3704. }
  3705. var r = e('three'),
  3706. o = e('../constants')
  3707. ;(n.prototype = Object.create(r.OrthographicCamera.prototype)),
  3708. (n.prototype.updateAspect = function (e) {
  3709. ;(this.aspect = e),
  3710. (this.top = o.orthoBase / e),
  3711. (this.bottom = -o.orthoBase / e),
  3712. this.updateProjectionMatrix()
  3713. }),
  3714. (t.exports = n)
  3715. },
  3716. {
  3717. '../constants': 8,
  3718. three: 217
  3719. }
  3720. ],
  3721. 7: [
  3722. function (e, t, i) {
  3723. 'use strict'
  3724. function n() {
  3725. r.PerspectiveCamera.call(
  3726. this,
  3727. a.clampVFOV(o.insideFOV),
  3728. $('#player').width() / $('#player').height(),
  3729. o.insideNear,
  3730. o.insideFar
  3731. ),
  3732. (this.controls = null)
  3733. }
  3734. var r = e('three'),
  3735. o = e('../settings'),
  3736. a = e('../util/cameraLight')
  3737. ;(n.prototype = Object.create(r.PerspectiveCamera.prototype)),
  3738. (n.prototype.updateAspect = function (e) {
  3739. ;(this.aspect = e), this.updateProjectionMatrix()
  3740. }),
  3741. (t.exports = n)
  3742. },
  3743. {
  3744. '../settings': 166,
  3745. '../util/cameraLight': 184,
  3746. three: 217
  3747. }
  3748. ],
  3749. 8: [
  3750. function (e, t, i) {
  3751. 'use strict'
  3752. t.exports = {
  3753. signedUrlDefaultExpireTime: 24e4,
  3754. signedUrlCheckInterval: 1e4,
  3755. signedUrlRefreshBuffer: 15e3,
  3756. dollhouseFOV: 70,
  3757. dollhouseNear: 1,
  3758. dollhouseFar: 5e3,
  3759. insideFOV: 70,
  3760. insideFOVMax: 120,
  3761. insideNear: 0.1,
  3762. insideFar: 5e3,
  3763. insideLookSpeed: 0.12,
  3764. insideLookLimitUp: 40, //视角
  3765. insideLookLimitDown: -40,
  3766. orthoNear: 1,
  3767. orthoFar: 5e3,
  3768. orthoBase: 10,
  3769. narrowLandscapeHeight: 290,
  3770. reallyNarrowLandscapeHeight: 250,
  3771. visionTilingStartDate: new Date('8/26/2016'),
  3772. visionTilingStartVersion: '1.1.407.13667',
  3773. windowHeightHighQualityThreshold: 900,
  3774. tourStepDelayDefault: 3500,
  3775. tourStepDelaySlideShow: 5e3,
  3776. workshopApsect: 9 / 16,
  3777. highQualityMaxZoom: 2,
  3778. ultraHighQualityMaxZoom: 3
  3779. }
  3780. },
  3781. {}
  3782. ],
  3783. 9: [
  3784. function (e, t, i) {
  3785. 'use strict'
  3786. function n() {
  3787. ;(this.activeControl = null), (this.controls = {}), (this.cameras = {})
  3788. }
  3789. var r = e('./PanoramaControls'),
  3790. o = e('./DollhouseControls'),
  3791. a = e('./FloorplanControls'),
  3792. s = e('../cameras/PanoramaCamera'),
  3793. l = e('../cameras/DollhouseCamera'),
  3794. c = e('../cameras/FloorplanCamera'),
  3795. h = e('events').EventEmitter,
  3796. u = e('../enum/ControlEvents'),
  3797. d = e('../enum/ModelManagerEvents'),
  3798. p = e('../enum/Viewmode'),
  3799. f = e('../settings')
  3800. ;(n.prototype = Object.create(h.prototype)),
  3801. (n.prototype.init = function (e, t) {
  3802. this.setUpControls(), this.bindEvents(e, t)
  3803. }),
  3804. (n.prototype.activateControls = function (e) {
  3805. this.activeControl && (this.activeControl.reset(), (this.activeControl.enabled = !1)),
  3806. this.controls[e] && (this.controls[e].enabled = !0),
  3807. (this.activeControl = this.controls[e])
  3808. }),
  3809. (n.prototype.setUpControls = function () {
  3810. var e = {},
  3811. t = {},
  3812. i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN],
  3813. n = [s, l, c],
  3814. h = [r, o, a]
  3815. i.forEach(
  3816. function (i, r) {
  3817. ;(e[i] = new n[r]()),
  3818. (t[i] = new h[r](e[i])),
  3819. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3820. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3821. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3822. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3823. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3824. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3825. }.bind(this)
  3826. ),
  3827. (this.controls = t),
  3828. (this.cameras = e)
  3829. }),
  3830. (n.prototype.bindEvents = function (e, t) {
  3831. e.addEventListener('mousemove', this.onMouseMove.bind(this)),
  3832. e.addEventListener('mousedown', this.onMouseDown.bind(this)),
  3833. e.addEventListener('mouseup', this.onMouseUp.bind(this)),
  3834. e.addEventListener('mouseover', this.onMouseOver.bind(this)),
  3835. f.useWheel &&
  3836. (e.addEventListener('mousewheel', this.onMouseWheel.bind(this), { passive: false }),
  3837. e.addEventListener('DOMMouseScroll', this.onMouseWheel.bind(this))),
  3838. e.addEventListener('touchstart', this.onTouchStart.bind(this)),
  3839. e.addEventListener('touchmove', this.onTouchMove.bind(this)),
  3840. e.addEventListener('touchend', this.onTouchEnd.bind(this)),
  3841. e.addEventListener('contextmenu', function (e) {
  3842. e.preventDefault()
  3843. }),
  3844. e.addEventListener('pointerdown', this.onPointerDown.bind(this)),
  3845. e.addEventListener('pointermove', this.onPointerMove.bind(this)),
  3846. e.addEventListener('pointerup', this.onPointerUp.bind(this)),
  3847. e.addEventListener('pointerout', this.onPointerCancel.bind(this)),
  3848. e.addEventListener('pointercancel', this.onPointerCancel.bind(this)),
  3849. document.addEventListener('keydown', this.onKeyDown.bind(this)),
  3850. document.addEventListener('keyup', this.onKeyUp.bind(this)),
  3851. t.on(
  3852. d.ActiveModelChanged,
  3853. function (e) {
  3854. this.setModelForControls(e.model)
  3855. }.bind(this)
  3856. )
  3857. }),
  3858. (n.prototype.setModelForControls = function (e) {
  3859. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox)
  3860. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding)
  3861. ;[p.DOLLHOUSE, p.FLOORPLAN].forEach(
  3862. function (e) {
  3863. this.controls[e].setBounds(t)
  3864. }.bind(this)
  3865. )
  3866. }),
  3867. (n.prototype.onMouseDown = function (e) {
  3868. e.preventDefault(), this.activeControl && this.activeControl.onMouseDown(e)
  3869. }),
  3870. (n.prototype.onMouseMove = function (e) {
  3871. e.preventDefault(), this.activeControl && this.activeControl.onMouseMove(e)
  3872. }),
  3873. (n.prototype.onMouseUp = function (e) {
  3874. e.preventDefault(), this.activeControl && this.activeControl.onMouseUp(e)
  3875. }),
  3876. (n.prototype.onMouseOver = function (e) {
  3877. e.preventDefault(), this.activeControl && this.activeControl.onMouseOver(e)
  3878. }),
  3879. (n.prototype.onMouseWheel = function (e) {
  3880. e.preventDefault(), this.activeControl && this.activeControl.onMouseWheel(e)
  3881. }),
  3882. (n.prototype.onTouchStart = function (e) {
  3883. e.preventDefault(), this.activeControl && this.activeControl.onTouchStart(e)
  3884. var hotList = $('#hotListWrap')[0]
  3885. hotList.classList.remove('hotListActive')
  3886. $('#hotListContent ul .active').removeClass('active')
  3887. $('#hotList')[0].classList.remove('active')
  3888. }),
  3889. (n.prototype.onTouchMove = function (e) {
  3890. e.preventDefault(), this.activeControl && this.activeControl.onTouchMove(e)
  3891. }),
  3892. (n.prototype.onTouchEnd = function (e) {
  3893. e.preventDefault(), this.activeControl && this.activeControl.onTouchEnd(e)
  3894. }),
  3895. (n.prototype.onPointerDown = function (e) {
  3896. if ((e.preventDefault(), this.activeControl))
  3897. switch (e.pointerType) {
  3898. case 'mouse':
  3899. this.activeControl.onMouseDown(e)
  3900. break
  3901. default:
  3902. this.activeControl.onPointerDown(e)
  3903. }
  3904. }),
  3905. (n.prototype.onPointerMove = function (e) {
  3906. if ((e.preventDefault(), this.activeControl))
  3907. switch (e.pointerType) {
  3908. case 'mouse':
  3909. this.activeControl.onMouseMove(e)
  3910. break
  3911. default:
  3912. this.activeControl.onPointerMove(e)
  3913. }
  3914. }),
  3915. (n.prototype.onPointerUp = function (e) {
  3916. if ((e.preventDefault(), this.activeControl))
  3917. switch (e.pointerType) {
  3918. case 'mouse':
  3919. this.activeControl.onMouseUp(e)
  3920. break
  3921. default:
  3922. this.activeControl.onPointerUp(e)
  3923. }
  3924. }),
  3925. (n.prototype.onPointerCancel = function (e) {
  3926. e.preventDefault(),
  3927. this.activeControl && 'mouse' !== e.pointerType && this.activeControl.onPointerUp(e)
  3928. }),
  3929. (n.prototype.onKeyDown = function (e) {
  3930. e.metaKey ||
  3931. e.ctrlKey ||
  3932. (e.preventDefault(), this.activeControl && this.activeControl.onKeyDown(e))
  3933. }),
  3934. (n.prototype.onKeyUp = function (e) {
  3935. e.preventDefault(), this.activeControl && this.activeControl.onKeyUp(e)
  3936. }),
  3937. (t.exports = n)
  3938. },
  3939. {
  3940. '../cameras/DollhouseCamera': 5,
  3941. '../cameras/FloorplanCamera': 6,
  3942. '../cameras/PanoramaCamera': 7,
  3943. '../enum/ControlEvents': 21,
  3944. '../enum/ModelManagerEvents': 33,
  3945. '../enum/Viewmode': 51,
  3946. '../settings': 166,
  3947. './DollhouseControls': 10,
  3948. './FloorplanControls': 11,
  3949. './PanoramaControls': 13,
  3950. events: 202
  3951. }
  3952. ],
  3953. 10: [
  3954. function (e, t, i) {
  3955. 'use strict'
  3956. function n(e) {
  3957. a.call(this, e),
  3958. (this.minPolarAngle = o.dollhouseDefault.minPolarAngle),
  3959. (this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle),
  3960. (this.minDistance = o.dollhouseDefault.minDistance),
  3961. (this.maxDistance = o.dollhouseDefault.maxDistance),
  3962. (this.adjustedMinDistance = this.minDistance),
  3963. (this.adjustedMaxDistance = this.maxDistance)
  3964. }
  3965. var r = e('three'),
  3966. o = e('../settings'),
  3967. a = e('./OutsideControls')
  3968. ;(n.prototype = Object.create(a.prototype)),
  3969. (n.prototype.pan = function (e, t) {
  3970. this.camera.updateMatrix()
  3971. var i = this.camera.position.clone().sub(this.target).length()
  3972. ;(i *= Math.tan(((this.camera.fov / 2) * Math.PI) / 180)),
  3973. this.panLeft((2 * e * i) / $('#player').height()),
  3974. this.panUp((-2 * t * i) / $('#player').height())
  3975. }),
  3976. (n.prototype.updateZoom = function () {
  3977. var e = this.offset.length()
  3978. return e * this.scale
  3979. }),
  3980. (n.prototype.setZoomBounds = function (e) {
  3981. var t = e.min.distanceTo(e.max)
  3982. ;(this.adjustedMinDistance = Math.max(
  3983. Math.min(t / 2, o.dollhouseDefault.minDistance),
  3984. 0
  3985. )),
  3986. (this.adjustedMaxDistance = Math.min(
  3987. Math.max(t, o.dollhouseDefault.maxDistance),
  3988. o.skyboxRadius
  3989. )),
  3990. (this.minDistance = this.adjustedMinDistance),
  3991. (this.maxDistance = this.adjustedMaxDistance)
  3992. }),
  3993. (n.prototype.resetRanges = function (e, t) {
  3994. e
  3995. ? ((this.minDistance = Math.min(e, this.minDistance)),
  3996. (this.maxDistance = Math.max(e, this.maxDistance)))
  3997. : ((this.minDistance = this.adjustedMinDistance),
  3998. (this.maxDistance = this.adjustedMaxDistance)),
  3999. t
  4000. ? ((this.minPolarAngle = r.Math.degToRad(-15)),
  4001. (this.maxPolarAngle = r.Math.degToRad(89.9)))
  4002. : ((this.minPolarAngle = o.dollhouseDefault.minPolarAngle),
  4003. (this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle))
  4004. }),
  4005. (n.prototype.toJSON = function () {
  4006. return a.prototype.toJSON.call(this)
  4007. }),
  4008. (t.exports = n)
  4009. },
  4010. {
  4011. '../settings': 166,
  4012. './OutsideControls': 12,
  4013. three: 217
  4014. }
  4015. ],
  4016. 11: [
  4017. function (e, t, i) {
  4018. 'use strict'
  4019. function n(e) {
  4020. a.call(this, e),
  4021. (this.minDistance = 15),
  4022. (this.maxDistance = 50),
  4023. (this.noRotateUpDown = !0),
  4024. (this.minPolarAngle = 0),
  4025. (this.maxPolarAngle = 0),
  4026. (this.mouseActions[l.LEFT] = s.PAN),
  4027. (this.mouseActions[l.MIDDLE] = s.DOLLY),
  4028. (this.mouseActions[l.RIGHT] = s.ROTATE),
  4029. (this.touchActions[1] = s.PAN),
  4030. (this.touchActions[2] = s.ROTATE_DOLLY),
  4031. (this.absoluteScale = 1),
  4032. (this.currentScale = 1)
  4033. }
  4034. var r = e('three'),
  4035. o = e('../settings'),
  4036. a = e('./OutsideControls'),
  4037. s = e('../enum/ControlActions'),
  4038. l = e('../enum/MouseButton'),
  4039. c = e('../util/math'),
  4040. h = e('../util/browser')
  4041. ;(n.prototype = Object.create(a.prototype)),
  4042. (n.prototype.zoomToContain = function (e) {
  4043. this.absoluteScale = this.getDefaultAbsoluteScale(e)
  4044. this.currentScale = this.absoluteScale
  4045. }),
  4046. (n.prototype.getDefaultAbsoluteScale = function (modelSize, ratio) {
  4047. let defaultRatio = 1.2,
  4048. absoluteScale
  4049. if (_settings.floorPlanAngle) {
  4050. //指定了角度的话,就和browser.aspectRatio()无关,总使用纵向
  4051. var angle = parseFloat(_settings.floorPlanAngle)
  4052. modelSize = modelSize.clone().applyEuler(new THREE.Euler(0, angle, 0))
  4053. var n = Math.max(Math.abs(modelSize.x), Math.abs(modelSize.z) * this.camera.aspect) //视口宽高比 >= 1 情况下,模型所占最大视口尺寸
  4054. var screenSize = Math.min($('#player').width(), $('#player').height())
  4055. var maxSize = 800 //模型最大占据像素
  4056. ratio =
  4057. ratio != void 0
  4058. ? ratio
  4059. : Math.max((screenSize * defaultRatio) / maxSize, defaultRatio)
  4060. absoluteScale = (n / 2 / o.orthoBase) * ratio //根据模型所占最大视口尺寸调整缩放
  4061. } else {
  4062. var t = Math.max(modelSize.x, modelSize.z),
  4063. i = Math.min(modelSize.x, modelSize.z),
  4064. n = Math.max(t, i * this.camera.aspect),
  4065. r = Math.max(i, t * this.camera.aspect)
  4066. absoluteScale = ((h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase) * defaultRatio
  4067. }
  4068. return absoluteScale
  4069. }),
  4070. /* n.prototype.rotateToView = function(e, t) {
  4071. var i = 0
  4072. , n = h.aspectRatio() < 1
  4073. , r = e.x < e.z;
  4074. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  4075. this.rotateLeft(i),
  4076. this.update(0)
  4077. },
  4078. */
  4079. (n.prototype.rotateToView = function (modelSize, direction) {
  4080. let i = 0,
  4081. n = h.aspectRatio() < 1 //是否模型尺寸显“细长”
  4082. if (_settings.floorPlanAngle) {
  4083. //规定了cadImage旋转值的话 (0是无效的,将不设置)
  4084. i = parseFloat(_settings.floorPlanAngle)
  4085. } else {
  4086. let r = modelSize.x < modelSize.z //是否视口为“窄屏”
  4087. if (n === r) {
  4088. //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  4089. if (direction.z > 0) {
  4090. //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  4091. i = Math.PI //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  4092. }
  4093. //(第二种情况) 不做处理
  4094. } else if (direction.x > 0) {
  4095. i = Math.PI / 2
  4096. } else {
  4097. i = -Math.PI / 2
  4098. }
  4099. }
  4100. this.rotateLeft(i)
  4101. this.update(0)
  4102. }),
  4103. (n.prototype.rotateToAngle = function (angle) {
  4104. //add 旋转到特定角度
  4105. this.rotateLeft(angle + this.lon)
  4106. this.update(0)
  4107. }),
  4108. (n.prototype.pan = function (e, t) {
  4109. this.camera.updateMatrix(),
  4110. this.panLeft((e * (this.camera.right - this.camera.left)) / $('#player').width()),
  4111. this.panUp((-t * (this.camera.top - this.camera.bottom)) / $('#player').height())
  4112. }),
  4113. (n.prototype.updateZoom = function () {
  4114. return (
  4115. (this.absoluteScale *= this.scale - 0.03 * this.keyboardZoomSpeed),
  4116. (this.absoluteScale = Math.max(
  4117. o.zoomNearLimit,
  4118. Math.min(this.absoluteScale, o.zoomFarLimit)
  4119. )),
  4120. (this.currentScale = 0.8 * this.currentScale + 0.2 * this.absoluteScale),
  4121. (this.camera.left = -o.orthoBase * this.currentScale),
  4122. (this.camera.right = o.orthoBase * this.currentScale),
  4123. (this.camera.top = (o.orthoBase * this.currentScale) / this.camera.aspect),
  4124. (this.camera.bottom = (-o.orthoBase * this.currentScale) / this.camera.aspect),
  4125. this.camera.updateProjectionMatrix(),
  4126. this.offset.length()
  4127. )
  4128. }),
  4129. (n.prototype.toJSON = (function () {
  4130. var e = new r.Quaternion(),
  4131. t = new r.Quaternion().setFromAxisAngle(new r.Vector3(0, 1, 0), r.Math.degToRad(90)),
  4132. i = new r.Quaternion()
  4133. return function () {
  4134. var n = a.prototype.toJSON.call(this)
  4135. return (
  4136. e.copy(n.camera_quaternion),
  4137. i.copy(t),
  4138. i.multiply(e),
  4139. (n.camera_quaternion.x = c.toPrecision(i.x, 4)),
  4140. (n.camera_quaternion.y = c.toPrecision(i.y, 4)),
  4141. (n.camera_quaternion.z = c.toPrecision(i.z, 4)),
  4142. (n.camera_quaternion.w = c.toPrecision(i.w, 4)),
  4143. (n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4)),
  4144. n
  4145. )
  4146. }
  4147. })()),
  4148. (t.exports = n)
  4149. },
  4150. {
  4151. '../enum/ControlActions': 20,
  4152. '../enum/MouseButton': 34,
  4153. '../settings': 166,
  4154. '../util/browser': 182,
  4155. '../util/math': 190,
  4156. './OutsideControls': 12,
  4157. three: 217
  4158. }
  4159. ],
  4160. 12: [
  4161. function (e, t, i) {
  4162. 'use strict'
  4163. function n(e) {
  4164. ;(this.camera = e),
  4165. (this.camera.controls = this),
  4166. (this.enabled = !1),
  4167. (this.target = new r.Vector3()),
  4168. (this.targetBounds = new r.Box3()),
  4169. (this.zoomSpeed = 1),
  4170. (this.minDistance = 0),
  4171. (this.maxDistance = 1 / 0),
  4172. (this.noRotateUpDown = !1),
  4173. (this.rotateSpeed = 1),
  4174. (this.keyboardZoomSpeed = 0),
  4175. (this.keyPanSpeed = 7),
  4176. (this.autoRotate = !1),
  4177. (this.autoRotateSpeed = 2),
  4178. (this.autoPan = !1),
  4179. (this.autoPanPosition = new r.Vector3()),
  4180. (this.minPolarAngle = r.Math.degToRad(25)),
  4181. (this.maxPolarAngle = r.Math.degToRad(65)),
  4182. (this.rotationAcceleration = new r.Vector2()),
  4183. (this.rotationSpeed = new r.Vector2()),
  4184. (this.panAcceleration = new r.Vector2()),
  4185. (this.panSpeed = new r.Vector2()),
  4186. (this.rotateStart = new r.Vector2()),
  4187. (this.rotateEnd = new r.Vector2()),
  4188. (this.rotateDelta = new r.Vector2()),
  4189. (this.panStart = new r.Vector2()),
  4190. (this.panEnd = new r.Vector2()),
  4191. (this.panDelta = new r.Vector2()),
  4192. (this.panOffset = new r.Vector3()),
  4193. (this.offset = new r.Vector3()),
  4194. (this.dollyStart = new r.Vector2()),
  4195. (this.dollyEnd = new r.Vector2()),
  4196. (this.dollyDelta = new r.Vector2()),
  4197. (this.phiDelta = 0),
  4198. (this.thetaDelta = 0),
  4199. (this.scale = 1),
  4200. (this.panVector = new r.Vector3()),
  4201. (this.lastPosition = new r.Vector3()),
  4202. (this.state = c.NONE),
  4203. (this.mouseActions = {}),
  4204. (this.mouseActions[h.LEFT] = c.ROTATE),
  4205. (this.mouseActions[h.MIDDLE] = c.DOLLY),
  4206. (this.mouseActions[h.RIGHT] = c.PAN),
  4207. (this.touchActions = {}),
  4208. (this.touchActions[1] = c.ROTATE),
  4209. (this.touchActions[2] = c.PAN_DOLLY),
  4210. (this.lastMoveTime = 0),
  4211. (this.pointersLimit = 2),
  4212. (this.pointers = [])
  4213. }
  4214. var r = e('three'),
  4215. o = e('../settings'),
  4216. a = e('../util/common'),
  4217. s = e('../util/math'),
  4218. l = e('../enum/Vectors'),
  4219. c = e('../enum/ControlActions'),
  4220. h = e('../enum/MouseButton'),
  4221. u = e('../enum/Keys'),
  4222. d = e('../enum/ControlEvents'),
  4223. p = e('events').EventEmitter,
  4224. f = 1e-6
  4225. ;(n.prototype = Object.create(p.prototype)),
  4226. (n.prototype.setBounds = function (e) {
  4227. this.targetBounds = e
  4228. }),
  4229. (n.prototype.isEngaged = function () {
  4230. return this.state !== c.NONE
  4231. }),
  4232. (n.prototype.rotateLeft = function (e) {
  4233. void 0 === e && (e = this.getAutoRotationAngle()), (this.thetaDelta -= e)
  4234. }),
  4235. (n.prototype.rotateUp = function (e) {
  4236. this.noRotateUpDown ||
  4237. (void 0 === e && (e = this.getAutoRotationAngle()), (this.phiDelta -= e))
  4238. }),
  4239. (n.prototype.panLeft = function (e) {
  4240. var t = this.camera.matrix.elements
  4241. this.panOffset.set(t[0], 0, t[2]).normalize(),
  4242. this.panOffset.multiplyScalar(-e),
  4243. this.panVector.add(this.panOffset)
  4244. }),
  4245. (n.prototype.panUp = function (e) {
  4246. var t = this.camera.matrix.elements
  4247. this.panOffset.set(t[4], 0, t[6]).normalize(),
  4248. this.panOffset.multiplyScalar(-e),
  4249. this.panVector.add(this.panOffset)
  4250. }),
  4251. (n.prototype.startRotating = function (e, t) {
  4252. e && this.navRotationAcc('x', e), t && this.navRotationAcc('y', t)
  4253. }),
  4254. (n.prototype.stopRotating = function (e) {
  4255. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4256. this.navRotationAcc('x', 0),
  4257. this.navRotationAcc('y', 0)
  4258. }),
  4259. (n.prototype.setAutoPanPosition = (function (e, t) {
  4260. var i = new r.Vector3(),
  4261. n = new r.Vector3()
  4262. return function (e, t) {
  4263. i.copy(this.camera.position),
  4264. (void 0 === e && null === e) || i.setX(e),
  4265. (void 0 === t && null === t) || i.setZ(t)
  4266. var r = this.camera.position.distanceTo(this.target),
  4267. o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion)
  4268. ;(this.targetClamped = !1),
  4269. n.copy(i).addScaledVector(o, r),
  4270. this.targetBounds.containsPoint(n) ||
  4271. (this.targetBounds.clampPoint(n, n),
  4272. i.copy(n).addScaledVector(o, -r),
  4273. (this.targetClamped = !0)),
  4274. (this.autoPanPosition.x = i.x),
  4275. (this.autoPanPosition.z = i.z),
  4276. this.autoPan && this.stopAutoPanning()
  4277. }
  4278. })()),
  4279. (n.prototype.stopAutoPanning = function () {
  4280. var e = this.autoPan
  4281. ;(this.autoPan = !1),
  4282. this.emit(
  4283. this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete
  4284. )
  4285. }),
  4286. (n.prototype.dollyIn = function (e) {
  4287. void 0 === e && (e = this.getZoomScale()), (this.scale /= e)
  4288. }),
  4289. (n.prototype.dollyOut = function (e) {
  4290. void 0 === e && (e = this.getZoomScale()), (this.scale *= e)
  4291. }),
  4292. (n.prototype.updatePan = function (e) {
  4293. if (
  4294. (this.panSpeed
  4295. .multiplyScalar(1 - o.panFriction)
  4296. .addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  4297. this.pan(-this.panSpeed.x, this.panSpeed.y),
  4298. this.autoPan)
  4299. ) {
  4300. var t = new r.Vector3().copy(this.autoPanPosition).sub(this.camera.position)
  4301. t.setY(0).clampLength(0, 50 * e),
  4302. this.target.add(t),
  4303. this.camera.position.add(t),
  4304. this.autoPanPosition.x === this.camera.position.x &&
  4305. this.autoPanPosition.z === this.camera.position.z &&
  4306. ((this.autoPan = !1), this.stopAutoPanning())
  4307. }
  4308. }),
  4309. (n.prototype.update = function (e) {
  4310. e || (e = 1 / 60)
  4311. var friction = Math.min(1, o.rotationFriction * e * 60) //add 如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  4312. this.rotationSpeed
  4313. .multiplyScalar(1 - friction)
  4314. .addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  4315. this.rotateLeft(-this.rotationSpeed.x),
  4316. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  4317. this.updatePan(e)
  4318. var t = this.camera.position
  4319. this.offset.copy(t).sub(this.target)
  4320. var i = Math.atan2(this.offset.x, this.offset.z),
  4321. n = Math.atan2(
  4322. Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z),
  4323. this.offset.y
  4324. )
  4325. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  4326. (i += this.thetaDelta),
  4327. (n += this.phiDelta),
  4328. (n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n))),
  4329. (n = Math.max(f, Math.min(Math.PI - f, n)))
  4330. ;(this.lon = i), (this.lat = n) //add
  4331. var r = this.updateZoom()
  4332. ;(r = Math.max(this.minDistance, Math.min(this.maxDistance, r))),
  4333. this.target.add(this.panVector),
  4334. this.targetBounds.clampPoint(this.target, this.target),
  4335. (this.offset.x = r * Math.sin(n) * Math.sin(i)),
  4336. (this.offset.y = r * Math.cos(n)),
  4337. (this.offset.z = r * Math.sin(n) * Math.cos(i)),
  4338. t.copy(this.target).add(this.offset),
  4339. this.camera.lookAt(this.target),
  4340. (this.thetaDelta = 0),
  4341. (this.phiDelta = 0),
  4342. (this.scale = 1),
  4343. this.panVector.set(0, 0, 0),
  4344. this.lastPosition.distanceTo(this.camera.position) > 0 &&
  4345. this.lastPosition.copy(this.camera.position)
  4346. }),
  4347. (n.prototype.getAutoRotationAngle = function () {
  4348. return ((2 * Math.PI) / 60 / 60) * this.autoRotateSpeed
  4349. }),
  4350. (n.prototype.getZoomScale = function () {
  4351. return Math.pow(0.95, this.zoomSpeed)
  4352. }),
  4353. (n.prototype.onMouseDown = function (e) {
  4354. if (this.enabled) {
  4355. switch (
  4356. (e.preventDefault(),
  4357. this.stopAutoPanning(),
  4358. (this.mouseDown = !0),
  4359. (this.state = this.mouseActions[e.button]),
  4360. this.state)
  4361. ) {
  4362. case c.ROTATE:
  4363. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  4364. this.rotationSpeed.set(0, 0)
  4365. break
  4366. case c.DOLLY:
  4367. this.dollyStart.set(e.clientX, e.clientY)
  4368. break
  4369. case c.PAN:
  4370. this.panStart.set(e.clientX, e.clientY)
  4371. }
  4372. this.emit(d.InputStart, 'mouse')
  4373. }
  4374. }),
  4375. (n.prototype.onMouseMove = function (e) {
  4376. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  4377. switch ((e.preventDefault(), this.state)) {
  4378. case c.ROTATE:
  4379. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  4380. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  4381. this.rotateLeft(
  4382. ((2 * Math.PI * this.rotateDelta.x) / $('#player').width()) * this.rotateSpeed
  4383. ),
  4384. this.rotateUp(
  4385. ((2 * Math.PI * this.rotateDelta.y) / $('#player').height()) *
  4386. this.rotateSpeed
  4387. ),
  4388. this.rotateStart.copy(this.rotateEnd)
  4389. break
  4390. case c.DOLLY:
  4391. this.dollyEnd.set(e.clientX, e.clientY),
  4392. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart)
  4393. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut
  4394. t.call(this), this.dollyStart.copy(this.dollyEnd)
  4395. break
  4396. case c.PAN:
  4397. this.panEnd.set(e.clientX, e.clientY),
  4398. this.panDelta.subVectors(this.panEnd, this.panStart),
  4399. this.pan(this.panDelta.x, this.panDelta.y),
  4400. this.panStart.copy(this.panEnd)
  4401. }
  4402. this.emit(d.Move, 'mouse'), (this.lastMoveTime = e.timeStamp), this.update()
  4403. }
  4404. }),
  4405. (n.prototype.onMouseUp = function (e) {
  4406. this.enabled &&
  4407. ((this.mouseDown = !1),
  4408. (this.state = c.NONE),
  4409. 'mouseover' !== e.type &&
  4410. (e.timeStamp > this.lastMoveTime + 100
  4411. ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0))
  4412. : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  4413. this.update(),
  4414. this.rotationAcceleration.set(0, 0),
  4415. this.rotateDelta.set(0, 0)))
  4416. }),
  4417. (n.prototype.onMouseOver = function (e) {
  4418. ;(0 !== e.which && 0 !== e.buttons) || this.onMouseUp(e)
  4419. }),
  4420. (n.prototype.onMouseWheel = function (e) {
  4421. if (this.enabled && o.useWheel) {
  4422. this.emit(d.Move, 'wheel')
  4423. var t = e.wheelDelta || -e.detail,
  4424. i = t > 0 ? this.dollyOut : this.dollyIn
  4425. i.call(this), this.update()
  4426. }
  4427. }),
  4428. (n.prototype.onKeyDown = function (e) {
  4429. this.enabled &&
  4430. (e.metaKey || e.ctrlKey || (e.preventDefault(), this.handleKeyDown(e.which)))
  4431. }),
  4432. (n.prototype.navRotationAcc = function (e, t) {
  4433. 'y' === e
  4434. ? this.noRotateUpDown
  4435. ? (this.keyboardZoomSpeed = t)
  4436. : (this.rotationAcceleration.y = t)
  4437. : (this.rotationAcceleration.x = t)
  4438. }),
  4439. (n.prototype.navPanAcc = function (e, t) {
  4440. this.stopAutoPanning(), (this.panAcceleration[e] = t)
  4441. }),
  4442. (n.prototype.handleKeyDown = function (e) {
  4443. var t = !0
  4444. switch (e) {
  4445. case u.UPARROW:
  4446. case u.I:
  4447. this.navRotationAcc('y', 1)
  4448. break
  4449. case u.DOWNARROW:
  4450. case u.K:
  4451. this.navRotationAcc('y', -1)
  4452. break
  4453. case u.LEFTARROW:
  4454. case u.J:
  4455. this.navRotationAcc('x', -1)
  4456. break
  4457. case u.RIGHTARROW:
  4458. case u.L:
  4459. this.navRotationAcc('x', 1)
  4460. break
  4461. case u.W:
  4462. this.navPanAcc('y', 1)
  4463. break
  4464. case u.S:
  4465. this.navPanAcc('y', -1)
  4466. break
  4467. case u.A:
  4468. this.navPanAcc('x', -1)
  4469. break
  4470. case u.D:
  4471. this.navPanAcc('x', 1)
  4472. break
  4473. default:
  4474. t = !1
  4475. }
  4476. t && this.emit(d.Move, 'key')
  4477. }),
  4478. (n.prototype.onKeyUp = function (e) {
  4479. this.enabled && (e.preventDefault(), e.stopPropagation(), this.handleKeyUp(e.which))
  4480. }),
  4481. (n.prototype.handleKeyUp = function (e) {
  4482. switch (e) {
  4483. case u.I:
  4484. case u.K:
  4485. case u.UPARROW:
  4486. case u.DOWNARROW:
  4487. ;(this.keyboardZoomSpeed = 0), (this.rotationAcceleration.y = 0)
  4488. break
  4489. case u.J:
  4490. case u.L:
  4491. case u.LEFTARROW:
  4492. case u.RIGHTARROW:
  4493. this.rotationAcceleration.x = 0
  4494. break
  4495. case u.S:
  4496. case u.W:
  4497. this.panAcceleration.y = 0
  4498. break
  4499. case u.A:
  4500. case u.D:
  4501. this.panAcceleration.x = 0
  4502. }
  4503. }),
  4504. (n.prototype.onTouchStart = function (e) {
  4505. if (this.enabled || this.state === c.NONE) {
  4506. e.preventDefault(), e.stopPropagation(), this.stopAutoPanning()
  4507. var t = function () {
  4508. if (2 === e.touches.length) {
  4509. var t = e.touches[0].pageX - e.touches[1].pageX,
  4510. i = e.touches[0].pageY - e.touches[1].pageY
  4511. this.dollyStart.set(t, i)
  4512. }
  4513. }.bind(this),
  4514. i = function () {
  4515. this.panStart.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY'))
  4516. }.bind(this),
  4517. n = function () {
  4518. this.rotateStart.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY'))
  4519. }.bind(this)
  4520. switch (((this.state = this.touchActions[e.touches.length]), this.state)) {
  4521. case c.PAN_DOLLY:
  4522. t()
  4523. case c.PAN:
  4524. i()
  4525. break
  4526. case c.ROTATE_DOLLY:
  4527. t()
  4528. case c.ROTATE:
  4529. n()
  4530. }
  4531. this.rotationSpeed.set(0, 0), this.emit(d.InputStart, 'touch')
  4532. }
  4533. }),
  4534. (n.prototype.onTouchMove = function (e) {
  4535. if (this.enabled && this.state !== c.NONE) {
  4536. e.preventDefault(), e.stopPropagation()
  4537. var t = function () {
  4538. var t = e.touches[0].pageX - e.touches[1].pageX,
  4539. i = e.touches[0].pageY - e.touches[1].pageY
  4540. this.dollyEnd.set(t, i)
  4541. var n = this.dollyStart.length() - this.dollyEnd.length()
  4542. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  4543. this.dollyStart.copy(this.dollyEnd)
  4544. }.bind(this),
  4545. i = function () {
  4546. this.panEnd.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY')),
  4547. this.panDelta.subVectors(this.panEnd, this.panStart),
  4548. this.pan(this.panDelta.x, this.panDelta.y),
  4549. this.panStart.copy(this.panEnd),
  4550. this.rotateDelta.set(0, 0)
  4551. }.bind(this),
  4552. n = function () {
  4553. this.rotateEnd.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY')),
  4554. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  4555. this.rotateLeft(
  4556. ((2 * Math.PI * this.rotateDelta.x) / $('#player').width()) * this.rotateSpeed
  4557. ),
  4558. this.rotateUp(
  4559. ((2 * Math.PI * this.rotateDelta.y) / $('#player').height()) *
  4560. this.rotateSpeed
  4561. ),
  4562. this.rotateStart.copy(this.rotateEnd)
  4563. }.bind(this),
  4564. r = function () {
  4565. if (2 === e.touches.length) {
  4566. var i = window.devicePixelRatio || 1,
  4567. r = e.touches[1].pageX - e.touches[0].pageX,
  4568. s = e.touches[1].pageY - e.touches[0].pageY,
  4569. l = Math.sqrt(r * r + s * s),
  4570. h = Math.abs(this.dollyStart.length() - l)
  4571. if (h > o.input.touchMoveThreshold * i) (this.state = c.DOLLY), t()
  4572. else {
  4573. var u = a.average(e.touches, 'pageX'),
  4574. d = a.average(e.touches, 'pageY'),
  4575. p = this.rotateDelta.set(u, d).sub(this.rotateStart).length()
  4576. p > o.input.touchMoveThreshold &&
  4577. ((this.state = c.ROTATE), this.rotateStart.set(u, d), n())
  4578. }
  4579. }
  4580. }.bind(this)
  4581. switch (this.state) {
  4582. case c.PAN_DOLLY:
  4583. t()
  4584. case c.PAN:
  4585. i()
  4586. break
  4587. case c.ROTATE_DOLLY:
  4588. r()
  4589. break
  4590. case c.DOLLY:
  4591. t()
  4592. break
  4593. case c.ROTATE:
  4594. n()
  4595. break
  4596. default:
  4597. this.state = c.NONE
  4598. }
  4599. ;(this.lastMoveTime = e.timeStamp), this.emit(d.Move, 'touch')
  4600. }
  4601. }),
  4602. (n.prototype.onTouchEnd = function (e) {
  4603. this.enabled &&
  4604. (this.state === c.ROTATE &&
  4605. (e.timeStamp > this.lastMoveTime + 100
  4606. ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0))
  4607. : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  4608. (this.state = c.NONE),
  4609. this.update(),
  4610. this.rotationAcceleration.set(0, 0),
  4611. this.rotateDelta.set(0, 0))
  4612. }),
  4613. (n.prototype.onPointerDown = function (e) {
  4614. this.enabled &&
  4615. ('touch' === e.pointerType &&
  4616. (this.pointers.length < this.pointersLimit &&
  4617. this.pointers.push({
  4618. id: e.pointerId,
  4619. pageX: e.pageX,
  4620. pageY: e.pageY
  4621. }),
  4622. (e.touches = this.pointers),
  4623. this.onTouchStart(e)),
  4624. this.emit(d.InputStart, 'pointer'))
  4625. }),
  4626. (n.prototype.onPointerMove = function (e) {
  4627. this.enabled &&
  4628. 'touch' === e.pointerType &&
  4629. (this.pointers.forEach(function (t) {
  4630. e.pointerId === t.id && ((t.pageX = e.pageX), (t.pageY = e.pageY))
  4631. }),
  4632. (e.touches = this.pointers),
  4633. this.onTouchMove(e))
  4634. }),
  4635. (n.prototype.onPointerUp = function (e) {
  4636. this.enabled &&
  4637. 'touch' === e.pointerType &&
  4638. (this.pointers.forEach(
  4639. function (t, i) {
  4640. e.pointerId === t.id && this.pointers.splice(i, 1)
  4641. }.bind(this)
  4642. ),
  4643. (e.touches = this.pointers),
  4644. this.onTouchEnd(e))
  4645. }),
  4646. (n.prototype.reset = function () {
  4647. ;(this.state = c.NONE),
  4648. this.stopAutoPanning(),
  4649. this.rotationSpeed.set(0, 0),
  4650. this.rotationAcceleration.set(0, 0),
  4651. this.panSpeed.set(0, 0),
  4652. this.panAcceleration.set(0, 0)
  4653. }),
  4654. (n.prototype.toJSON = function () {
  4655. var e = {
  4656. camera_position: {
  4657. x: s.toPrecision(this.camera.position.x, 4),
  4658. y: s.toPrecision(this.camera.position.y, 4),
  4659. z: s.toPrecision(this.camera.position.z, 4)
  4660. },
  4661. camera_quaternion: {
  4662. x: s.toPrecision(this.camera.quaternion.x, 4),
  4663. y: s.toPrecision(this.camera.quaternion.y, 4),
  4664. z: s.toPrecision(this.camera.quaternion.z, 4),
  4665. w: s.toPrecision(this.camera.quaternion.w, 4)
  4666. }
  4667. }
  4668. return e
  4669. }),
  4670. (t.exports = n)
  4671. },
  4672. {
  4673. '../enum/ControlActions': 20,
  4674. '../enum/ControlEvents': 21,
  4675. '../enum/Keys': 30,
  4676. '../enum/MouseButton': 34,
  4677. '../enum/Vectors': 50,
  4678. '../settings': 166,
  4679. '../util/common': 185,
  4680. '../util/math': 190,
  4681. events: 202,
  4682. three: 217
  4683. }
  4684. ],
  4685. 13: [
  4686. function (e, t, i) {
  4687. ;(function (i) {
  4688. 'use strict'
  4689. function n(e) {
  4690. ;(this.camera = e),
  4691. (this.camera.controls = this),
  4692. (this.target = new r.Vector3(0, 0, 0)),
  4693. (this.lookVector = new r.Vector3()),
  4694. (this.lookSpeed = 0.05),
  4695. (this.rotationAcc = new r.Vector2()),
  4696. (this.rotationSpeed = new r.Vector2()),
  4697. (this.lat = 0),
  4698. (this.lon = 0),
  4699. (this.phi = 0),
  4700. (this.theta = 0),
  4701. (this.enabled = !1),
  4702. (this.locked = !1),
  4703. (this.pointer = new r.Vector2(0, 0)),
  4704. (this.rotationHistory = []),
  4705. (this.rotationDifference = new r.Vector2()),
  4706. (this.pointerDragOn = !1),
  4707. (this.pointerDragStart = new r.Vector2(0, 0)),
  4708. (this.pinchDistance = 0),
  4709. (this.moveStart = new r.Vector2()),
  4710. (this.moveTolerance = 0.01),
  4711. (this.pointersLimit = 2),
  4712. (this.pointers = [])
  4713. }
  4714. var r = e('three'),
  4715. o = e('../util/logger'),
  4716. a = e('../settings'),
  4717. s = e('../util/common'),
  4718. l = e('../util/math'),
  4719. c = (e('../enum/Vectors'), e('../enum/MouseButton')),
  4720. h = e('../enum/Keys'),
  4721. u = e('../enum/ControlEvents'),
  4722. d = e('events').EventEmitter
  4723. new o(i)
  4724. ;(n.prototype = Object.create(d.prototype)),
  4725. (n.prototype.usable = function () {
  4726. return this.enabled && !this.locked
  4727. }),
  4728. /* n.prototype.lookAt = function(e) {
  4729. var t = this.camera.position.clone().sub(e)
  4730. , i = Math.atan(t.z / t.x);
  4731. i += t.x < 0 ? Math.PI : 0,
  4732. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4733. this.lon = r.Math.radToDeg(i) + 180;
  4734. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4735. , o = Math.atan(t.y / n);
  4736. this.lat = -r.Math.radToDeg(o)
  4737. }
  4738. */
  4739. (n.prototype.lookAt = function (aim, dir) {
  4740. var t = dir || this.camera.position.clone().sub(aim) //aim所指点的笛卡尔坐标系
  4741. var i = Math.atan(t.z / t.x)
  4742. i += t.x < 0 ? Math.PI : 0
  4743. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0
  4744. this.lon = r.Math.radToDeg(i) + 180
  4745. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  4746. o = Math.atan(t.y / n)
  4747. this.lat = -r.Math.radToDeg(o)
  4748. }),
  4749. (n.prototype.startRotationFrom = function (e, t) {
  4750. l.convertScreenPositionToNDC(e, t, this.pointer),
  4751. (this.pointerDragOn = !0),
  4752. this.pointerDragStart.copy(this.pointer),
  4753. this.moveStart.copy(this.pointer),
  4754. (this.rotationHistory = []),
  4755. this.rotationSpeed.set(0, 0)
  4756. }),
  4757. (n.prototype.onMouseOver = function (e) {
  4758. !this.pointerDragOn || (0 !== e.which && 0 !== e.buttons) || this.onMouseUp(e)
  4759. }),
  4760. (n.prototype.onTouchStart = function (e) {
  4761. if (this.usable()) {
  4762. switch ((e.preventDefault(), e.stopPropagation(), e.touches.length)) {
  4763. case 1:
  4764. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY)
  4765. break
  4766. case 2:
  4767. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width(),
  4768. i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height()
  4769. this.pinchDistance = Math.sqrt(t * t + i * i)
  4770. }
  4771. this.emit(u.InputStart, 'touch')
  4772. }
  4773. }),
  4774. (n.prototype.onPointerDown = function (e) {
  4775. this.usable() &&
  4776. 'touch' === e.pointerType &&
  4777. (this.pointers.length < this.pointersLimit &&
  4778. this.pointers.push({
  4779. id: e.pointerId,
  4780. clientX: e.clientX,
  4781. clientY: e.clientY
  4782. }),
  4783. (e.touches = this.pointers),
  4784. this.onTouchStart(e),
  4785. this.emit(u.InputStart, 'pointer'))
  4786. }),
  4787. (n.prototype.onMouseDown = function (e) {
  4788. if (this.usable()) {
  4789. switch ((e.preventDefault(), e.stopPropagation(), e.button)) {
  4790. case c.LEFT:
  4791. this.startRotationFrom(e.clientX, e.clientY)
  4792. }
  4793. SoundManager.pause('tour') // zeg 点击场景时停止语音
  4794. this.emit(u.InputStart, 'mouse')
  4795. }
  4796. }),
  4797. (n.prototype.updateRotation = function () {
  4798. if (this.usable() && this.pointerDragOn) {
  4799. var e = new r.Vector3(
  4800. this.pointerDragStart.x,
  4801. this.pointerDragStart.y,
  4802. -1
  4803. ).unproject(this.camera),
  4804. t = new r.Vector3(this.pointer.x, this.pointer.y, -1).unproject(this.camera),
  4805. i = Math.sqrt(e.x * e.x + e.z * e.z),
  4806. n = Math.sqrt(t.x * t.x + t.z * t.z),
  4807. o = Math.atan2(e.y, i),
  4808. a = Math.atan2(t.y, n)
  4809. ;(this.rotationDifference.y = r.Math.radToDeg(o - a)), (e.y = 0), (t.y = 0)
  4810. var s = Math.acos(e.dot(t) / e.length() / t.length())
  4811. isNaN(s) ||
  4812. ((this.rotationDifference.x = r.Math.radToDeg(s)),
  4813. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4814. this.pointerDragStart.copy(this.pointer)
  4815. }
  4816. }),
  4817. (n.prototype.onMouseMove = function (e) {
  4818. this.usable() &&
  4819. (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4820. this.pointerDragOn &&
  4821. (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance ||
  4822. Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) &&
  4823. this.emit(u.Move, 'mouse'))
  4824. }),
  4825. (n.prototype.onTouchMove = function (e) {
  4826. if (this.usable())
  4827. switch ((this.emit(u.Move, 'touch'), e.touches.length)) {
  4828. case 1:
  4829. l.convertScreenPositionToNDC(
  4830. e.touches[0].clientX,
  4831. e.touches[0].clientY,
  4832. this.pointer
  4833. )
  4834. break
  4835. case 2:
  4836. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width(),
  4837. i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height(),
  4838. n = this.pinchDistance - Math.sqrt(t * t + i * i)
  4839. Math.abs(n) > 0.01 &&
  4840. (this.emit(u.InteractionDirect),
  4841. this.emit(u.Pinch, n),
  4842. (this.pinchDistance -= n))
  4843. }
  4844. }),
  4845. (n.prototype.onPointerMove = function (e) {
  4846. this.usable() &&
  4847. 'touch' === e.pointerType &&
  4848. (this.pointers.forEach(function (t) {
  4849. e.pointerId === t.id && ((t.clientX = e.clientX), (t.clientY = e.clientY))
  4850. }),
  4851. (e.touches = this.pointers),
  4852. this.onTouchMove(e))
  4853. }),
  4854. (n.prototype.endRotation = function () {
  4855. this.pointerDragOn = !1
  4856. var e = s.averageVectors(this.rotationHistory)
  4857. this.rotationSpeed.set(
  4858. e.x * a.rotationAfterMoveMultiplier,
  4859. e.y * a.rotationAfterMoveMultiplier
  4860. )
  4861. }),
  4862. (n.prototype.onTouchEnd = function (e) {
  4863. this.usable() && (e.preventDefault(), e.stopPropagation(), this.endRotation())
  4864. }),
  4865. (n.prototype.onMouseUp = function (e) {
  4866. this.usable() && (e.preventDefault(), e.stopPropagation(), this.endRotation())
  4867. }),
  4868. (n.prototype.onPointerUp = function (e) {
  4869. this.usable() &&
  4870. 'touch' === e.pointerType &&
  4871. (this.pointers.forEach(
  4872. function (t, i) {
  4873. e.pointerId === t.id && this.pointers.splice(i, 1)
  4874. }.bind(this)
  4875. ),
  4876. (e.touches = this.pointers),
  4877. this.onTouchEnd(e))
  4878. }),
  4879. (n.prototype.update = function (e) {
  4880. this.lon, this.lat
  4881. for (
  4882. this.updateRotation(), this.rotationHistory.push(this.rotationDifference.clone());
  4883. this.rotationHistory.length > a.rotationAfterMoveHistoryCount;
  4884. )
  4885. this.rotationHistory.shift()
  4886. ;(this.lon += this.rotationDifference.x),
  4887. (this.lat += this.rotationDifference.y),
  4888. this.rotationDifference.set(0, 0)
  4889. //改
  4890. var friction = Math.min(1, a.rotationFriction * e * 60) //如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  4891. ;(this.rotationSpeed.x =
  4892. this.rotationSpeed.x * (1 - friction) +
  4893. this.rotationAcc.x * a.rotationAccelerationInside),
  4894. (this.rotationSpeed.y =
  4895. this.rotationSpeed.y * (1 - friction) +
  4896. this.rotationAcc.y * a.rotationAccelerationInside),
  4897. (this.lon += this.rotationSpeed.x * e),
  4898. (this.lat += this.rotationSpeed.y * e)
  4899. //this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4900. let insideLookLimitDown =
  4901. this.insideLookLimitDown != void 0
  4902. ? this.insideLookLimitDown
  4903. : a.insideLookLimitDown
  4904. let insideLookLimitUp =
  4905. this.insideLookLimitUp != void 0 ? this.insideLookLimitUp : a.insideLookLimitUp
  4906. insideLookLimitDown = insideLookLimitDown - a.insideFOV / 2 + this.camera.fov / 2
  4907. insideLookLimitUp = insideLookLimitUp + a.insideFOV / 2 - this.camera.fov / 2
  4908. this.lat = Math.max(insideLookLimitDown, Math.min(insideLookLimitUp, this.lat)) //通过预定义的俯仰角最大最小范围(insideLookLimitUp、insideLookLimitDown)来限制俯仰角。 注:这种数学计算很常见,因此API也很常见(clamp),等价于 this.lat = THREE.Math.clamp( this.lat, settings.insideLookLimitDown, settings.insideLookLimitUp );
  4909. ;(this.phi = r.Math.degToRad(90 - this.lat)),
  4910. (this.theta = r.Math.degToRad(this.lon)),
  4911. (this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta)),
  4912. (this.lookVector.y = Math.cos(this.phi)),
  4913. (this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta)),
  4914. this.target.copy(this.lookVector).add(this.camera.position),
  4915. this.camera.lookAt(this.target)
  4916. }),
  4917. (n.prototype.onMouseWheel = function (e) {
  4918. if (this.usable()) {
  4919. var t = e.wheelDelta || -e.detail
  4920. this.emit(u.InteractionDirect), this.emit(u.Scroll, t)
  4921. }
  4922. }),
  4923. (n.prototype.onKeyDown = function (e) {
  4924. this.usable() &&
  4925. (e.metaKey || e.ctrlKey || (e.preventDefault(), this.handleKeyDown(e.which)))
  4926. }),
  4927. (n.prototype.handleKeyDown = function (e) {
  4928. var t = function (e, t) {
  4929. this.rotationAcc[e] = t
  4930. }.bind(this)
  4931. this.emit(u.InteractionKey)
  4932. var i = !0
  4933. switch (e) {
  4934. case h.LEFTARROW:
  4935. case h.J:
  4936. t('x', -1)
  4937. break
  4938. case h.RIGHTARROW:
  4939. case h.L:
  4940. t('x', 1)
  4941. break
  4942. case h.I:
  4943. t('y', 1)
  4944. break
  4945. case h.K:
  4946. t('y', -1)
  4947. break
  4948. default:
  4949. i = !1
  4950. }
  4951. i && this.emit(u.Move, 'key')
  4952. }),
  4953. (n.prototype.onKeyUp = function (e) {
  4954. this.usable() && (e.preventDefault(), e.stopPropagation(), this.handleKeyUp(e.which))
  4955. }),
  4956. (n.prototype.handleKeyUp = function (e) {
  4957. switch (e) {
  4958. case h.LEFTARROW:
  4959. case h.J:
  4960. case h.RIGHTARROW:
  4961. case h.L:
  4962. this.rotationAcc.x = 0
  4963. break
  4964. case h.I:
  4965. case h.K:
  4966. this.rotationAcc.y = 0
  4967. }
  4968. }),
  4969. (n.prototype.startRotating = function (e, t) {
  4970. e && (this.rotationAcc.x = e), t && (this.rotationAcc.y = t)
  4971. }),
  4972. (n.prototype.stopRotating = function (e) {
  4973. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0), this.rotationAcc.set(0, 0)
  4974. }),
  4975. (n.prototype.reset = function () {
  4976. ;(this.pointerDragOn = !1),
  4977. this.rotationAcc.set(0, 0),
  4978. this.rotationSpeed.set(0, 0),
  4979. (this.pointers = [])
  4980. }),
  4981. (n.prototype.toJSON = function () {
  4982. var e = {
  4983. camera_position: {
  4984. x: l.toPrecision(this.camera.position.x, 4),
  4985. y: l.toPrecision(this.camera.position.y, 4),
  4986. z: l.toPrecision(this.camera.position.z, 4)
  4987. },
  4988. camera_quaternion: {
  4989. x: l.toPrecision(this.camera.quaternion.x, 4),
  4990. y: l.toPrecision(this.camera.quaternion.y, 4),
  4991. z: l.toPrecision(this.camera.quaternion.z, 4),
  4992. w: l.toPrecision(this.camera.quaternion.w, 4)
  4993. }
  4994. }
  4995. return e
  4996. }),
  4997. (n.prototype.setStateFromJSON = function (e) {
  4998. this.camera.position.copy(e.camera_position),
  4999. this.camera.quaternion.copy(e.camera_quaternion)
  5000. }),
  5001. (t.exports = n)
  5002. }).call(this, '/js/controls/PanoramaControls.js')
  5003. },
  5004. {
  5005. '../enum/ControlEvents': 21,
  5006. '../enum/Keys': 30,
  5007. '../enum/MouseButton': 34,
  5008. '../enum/Vectors': 50,
  5009. '../settings': 166,
  5010. '../util/common': 185,
  5011. '../util/logger': 189,
  5012. '../util/math': 190,
  5013. events: 202,
  5014. three: 217
  5015. }
  5016. ],
  5017. 14: [
  5018. function (e, t, i) {
  5019. ;(function (i) {
  5020. 'use strict'
  5021. var n = e('three'),
  5022. r = e('../enum/Viewmode'),
  5023. o = e('../util/logger'),
  5024. a = new o(i)
  5025. t.exports = {
  5026. serialize: function (e) {
  5027. return encodeURI(JSON.stringify(e))
  5028. },
  5029. deserialize: function (e) {
  5030. function t(e) {
  5031. function t(e, t) {
  5032. return e && 'number' == typeof t && !isNaN(t)
  5033. }
  5034. return e.reduce(t, !0)
  5035. }
  5036. try {
  5037. var i = JSON.parse(decodeURI(e)),
  5038. o = {
  5039. mode: r.fromInt(i.camera_mode),
  5040. panoId: i.scan_id,
  5041. position: new n.Vector3().copy(i.camera_position),
  5042. quaternion: new n.Quaternion().copy(i.camera_quaternion),
  5043. zoom: i.ortho_zoom,
  5044. floorVisibility: i.floor_visibility
  5045. },
  5046. s = o.position
  5047. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0)
  5048. var l = o.quaternion
  5049. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1), o
  5050. } catch (i) {
  5051. a.debug(
  5052. 'Not able to parse start location as JSON; falling back to old array style parsing'
  5053. )
  5054. try {
  5055. var c = e.split(','),
  5056. h = {
  5057. x: parseFloat(c[2]),
  5058. y: parseFloat(c[3]),
  5059. z: parseFloat(c[4])
  5060. },
  5061. u = {
  5062. x: parseFloat(c[5]),
  5063. y: parseFloat(c[6]),
  5064. z: parseFloat(c[7]),
  5065. w: parseFloat(c[8])
  5066. }
  5067. return (
  5068. t([h.x, h.y, h.z]) || ((h.x = 0), (h.y = 0), (h.z = 0)),
  5069. t([u.x, u.y, u.z, u.w]) || ((u.x = 0), (u.y = 0), (u.z = 0), (u.w = 1)),
  5070. {
  5071. mode: r.fromInt(c[0]),
  5072. panoId: c[1],
  5073. position: new n.Vector3().copy(h),
  5074. quaternion: new n.Quaternion().copy(u)
  5075. }
  5076. )
  5077. } catch (t) {
  5078. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  5079. }
  5080. }
  5081. return null
  5082. }
  5083. }
  5084. }).call(this, '/js/controls/serializer.js')
  5085. },
  5086. {
  5087. '../enum/Viewmode': 51,
  5088. '../util/logger': 189,
  5089. three: 217
  5090. }
  5091. ],
  5092. 15: [
  5093. function (e, t, i) {
  5094. ;(function (i) {
  5095. 'use strict'
  5096. function n() {
  5097. ;(this.endlessLoop = a.warp.loop),
  5098. (this.clock = new r.Clock(!0)),
  5099. (this.model = null),
  5100. (this.player = null),
  5101. (this.currentItem = null),
  5102. (this.destinationItem = null),
  5103. (this.tourIsPlaying = !1),
  5104. (this.transitionStage = y.None),
  5105. (this.nextFunc = null),
  5106. (this.onTheBus = !1),
  5107. (this.tourInProgress = !1),
  5108. (this.reachSource = null),
  5109. (this.interrupted = !1),
  5110. (this.nItems = 0),
  5111. (this.walkingSectionPaused = !1)
  5112. }
  5113. var r = e('three'),
  5114. o = e('./util/logger'),
  5115. a = e('./settings'),
  5116. s = e('./util/transitions'),
  5117. l = e('events').EventEmitter,
  5118. c = e('./enum/Viewmode'),
  5119. h = e('./analytics'),
  5120. u = e('./enum/WarpStyle'),
  5121. s = e('./util/transitions'),
  5122. d = (e('./model/ModelManager'), e('./enum/ModelManagerEvents')),
  5123. p = e('./enum/DirectorEvents'),
  5124. f = e('./enum/PlayerEvents'),
  5125. g = (e('./enum/ControlEvents'), e('./enum/BlackoutStyle')),
  5126. m = e('./enum/PathDiscardMode'),
  5127. v = e('./enum/PathDisplayMode'),
  5128. A = (e('./player'), new o(i)),
  5129. y = Object.freeze({
  5130. None: 0,
  5131. Moving: 1,
  5132. Aiming: 2,
  5133. Interlude: 3
  5134. }),
  5135. C = Object.freeze({
  5136. Forward: 1,
  5137. NoChange: 0,
  5138. Backwards: -1
  5139. }),
  5140. I = s.getUniqueId()
  5141. ;(n.prototype = Object.create(l.prototype)),
  5142. (n.prototype.init = function (e, t) {
  5143. ;(this.player = e),
  5144. (this.modelManager = t),
  5145. this.updateModel(),
  5146. this.resetAll(),
  5147. this.bindEvents()
  5148. // // zeg 查询pano对应的导览片段
  5149. // if(!this.panoIdMap) {
  5150. // this.panoIdMap = new Map()
  5151. // this.model.heroLocations.forEach( (value, index) => {
  5152. // // value.heroLocations.forEach( hl => {
  5153. // if(!value.heroLocations) return
  5154. // let hl = value.heroLocations[0]
  5155. // let arr = this.panoIdMap.get(hl.panoId)
  5156. // if(arr){
  5157. // this.panoIdMap.set(hl.panoId, [...arr, index])
  5158. // } else {
  5159. // this.panoIdMap.set(hl.panoId, [index])
  5160. // }
  5161. // // })
  5162. // })
  5163. // }
  5164. }),
  5165. (n.prototype.resetAll = function () {
  5166. if (
  5167. ((this.currentItem = null),
  5168. (this.destinationItem = null),
  5169. (this.tourIsPlaying = !1),
  5170. //this.bgmReplay(),//xzw
  5171. (this.transitionStage = y.None),
  5172. (this.nextFunc = null),
  5173. (this.onTheBus = !1),
  5174. (this.reachSource = null),
  5175. (this.interrupted = !1),
  5176. this.model)
  5177. ) {
  5178. var e = a.path.typ === u.WALK ? u.WALK : u.STD
  5179. this.defaultWarpStyle =
  5180. this.model.data.hasOwnProperty('player_options') &&
  5181. this.model.data.player_options &&
  5182. this.model.data.player_options.fast_transitions === !1
  5183. ? e
  5184. : u.BLACK
  5185. } else
  5186. (this.defaultWarpStyle = u.BLACK),
  5187. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions')
  5188. this.resetSpecialTransition()
  5189. }),
  5190. (n.prototype.updateModel = function () {
  5191. ;(this.model = this.modelManager.getActiveModel()),
  5192. (this.nItems = this.model.heroLocations.length)
  5193. }),
  5194. (n.prototype.bindEvents = function () {
  5195. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  5196. this.player.on(
  5197. f.WarpInterruptedWithFlyTo,
  5198. this.checkAndHandleWalkingtourInterruption.bind(this)
  5199. ),
  5200. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  5201. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  5202. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  5203. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  5204. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  5205. this.player.once(f.Move, function () {
  5206. s.cancelById(I)
  5207. })
  5208. }),
  5209. (n.prototype.checkAndHandleWalkingtourInterruption = function (e) {
  5210. //快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  5211. return (
  5212. /* e === u.WALK && ( */ this.interrupt(g.NONE),
  5213. this.pauseWalkingSection(),
  5214. this.player.fastForwardActivePanoFlight(),
  5215. !0
  5216. ) /* ) */
  5217. }),
  5218. (n.prototype.handlePlayerMove = function (e) {
  5219. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  5220. this.emit('update.controls')
  5221. }),
  5222. (n.prototype.handlePlayerPanoChosen = function (e, t) {
  5223. this.intermediateState() ||
  5224. e.id === t.id ||
  5225. ((this.onTheBus = !1), this.emit('update.controls'))
  5226. }),
  5227. (n.prototype.handlePlayerModeChanged = function (e, t) {
  5228. this.intermediateState() ||
  5229. e === t ||
  5230. ((this.onTheBus = !1), this.emit('update.controls'))
  5231. }),
  5232. (n.prototype.handlePlayerInputStart = function (e) {
  5233. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  5234. }),
  5235. (n.prototype.handlePlayerFlyingStarted = function () {
  5236. this.clearWalkingSectionPaused()
  5237. }),
  5238. (n.prototype.describe = function () {
  5239. return {
  5240. nItems: this.nItems,
  5241. currentItem: this.currentItem,
  5242. destinationItem: this.destinationItem,
  5243. tourIsPlaying: this.tourIsPlaying,
  5244. onTheBus: this.onTheBus,
  5245. endlessLoop: this.endlessLoop,
  5246. viewMode: this.player.mode,
  5247. inTransition: this._inTransition(),
  5248. transitionStage: this.transitionStage,
  5249. tourInProgress: this.tourInProgress
  5250. }
  5251. }),
  5252. (n.prototype._inTransition = function () {
  5253. return (
  5254. this.player.flying ||
  5255. this.player.isWarping() ||
  5256. this.player.isWaitingToWarp() ||
  5257. this.player.mode === c.TRANSITIONING ||
  5258. this.tourIsPlaying
  5259. )
  5260. }),
  5261. (n.prototype.bounceable = function () {
  5262. var e = this.clock.getDelta()
  5263. return (
  5264. this.isInterrupted() ||
  5265. (e < 0.9 && e > 0.01) ||
  5266. (this.player.flying && !this.player.isWarping())
  5267. )
  5268. }),
  5269. (n.prototype.itemCompare = function (item1, item2, type) {
  5270. //add
  5271. if (type == 'equal') {
  5272. //==
  5273. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  5274. } else if (type == 'less') {
  5275. //<
  5276. return (
  5277. (item1 && item2 && item1[0] < item2[0]) ||
  5278. (item1[0] == item2[0] && item1[1] < item2[1])
  5279. )
  5280. }
  5281. })
  5282. ;(n.prototype.currentMoveDirection = function () {
  5283. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  5284. return null === this.currentItem || void 0 === this.currentItem
  5285. ? y.Forward
  5286. : this.itemCompare(this.destinationItem, this.currentItem, 'equal')
  5287. ? y.NoChange
  5288. : this.itemCompare(this.currentItem, this.destinationItem, 'less')
  5289. ? y.Forward
  5290. : y.Backwards
  5291. }),
  5292. (n.prototype.clearPath = function () {
  5293. this._inTransition() || this.player.path.discardPathObject()
  5294. }),
  5295. (n.prototype.allFloors = function () {
  5296. this.model.toggleAllFloors()
  5297. }),
  5298. (n.prototype.actionComplete = function (e) {
  5299. if (
  5300. ((this.interrupted = !1),
  5301. (this.transitionStage = y.None),
  5302. this.resetSpecialTransition(),
  5303. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  5304. this.tourIsPlaying ||
  5305. (this.player.disablePreRendering(),
  5306. this.player.mode === c.PANORAMA &&
  5307. this.player.currentPano.isAligned() &&
  5308. this.model.fadePanoMarkers()),
  5309. this.emit('update.controls'),
  5310. this.nextFunc)
  5311. ) {
  5312. var t = this.nextFunc
  5313. ;(this.nextFunc = null), t()
  5314. }
  5315. }),
  5316. (n.prototype.awaitCompletion = function (e, t) {
  5317. ;(this.nextFunc = t), e()
  5318. }),
  5319. (n.prototype.updateSuccessFunction = function (e) {
  5320. this.nextFunc = e
  5321. }),
  5322. (n.prototype.interrupt = function (e, t) {
  5323. //滑动屏幕或按下键盘等
  5324. return (
  5325. !!this.wouldInterrupt() &&
  5326. (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  5327. (this.tourIsPlaying = !1),
  5328. //this.bgmReplay(),//xzw
  5329. (this.interrupted = !0),
  5330. (this.nextFunc = null),
  5331. this.emit(p.ActionInterrupted),
  5332. (null !== e && void 0 !== e) || (e = g.BEGINNING),
  5333. this.player.interruptAndFastForward(e, t),
  5334. !0)
  5335. )
  5336. }),
  5337. (n.prototype.wouldInterrupt = function () {
  5338. return this.transitionStage !== y.None
  5339. }),
  5340. (n.prototype.intermediateState = function () {
  5341. return this.transitionStage !== y.None
  5342. }),
  5343. (n.prototype.isInterrupted = function () {
  5344. return this.interrupted
  5345. }),
  5346. (n.prototype.pauseWalkingSection = function () {
  5347. this.walkingSectionPaused = !0
  5348. }),
  5349. (n.prototype.clearWalkingSectionPaused = function () {
  5350. this.walkingSectionPaused = !1
  5351. }),
  5352. (n.prototype.autoTour = function () {
  5353. var e = Date.now()
  5354. this.model.auxDataPromise.then(
  5355. function () {
  5356. e = Date.now() - e
  5357. var t = a.warp.auto,
  5358. i =
  5359. this.model.data &&
  5360. this.model.data
  5361. .player_options /* && this.model.data.player_options.highlight_reel */
  5362. t >= 0 &&
  5363. this.model.heroCount() > 1 &&
  5364. i &&
  5365. s.trigger({
  5366. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  5367. done: function () {
  5368. this.playTour()
  5369. }.bind(this),
  5370. name: '_atr',
  5371. id: I
  5372. })
  5373. }.bind(this)
  5374. )
  5375. }),
  5376. (n.prototype.atDestinationPano = function (pano) {
  5377. if (null === this.destinationItem) return !1
  5378. pano = pano || this.player.currentPano
  5379. if (!pano) {
  5380. return !1
  5381. }
  5382. var destination =
  5383. this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  5384. return destination && destination.panoId == pano.id
  5385. }),
  5386. (n.prototype.redirectToItem = function (e, t) {
  5387. if (null === e || void 0 === e)
  5388. return void A.warn('Director.redirectToItem() -> Redirecting to null item.')
  5389. if (!this.wouldInterrupt())
  5390. return void A.warn(
  5391. 'Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.'
  5392. )
  5393. if (this.player.mode === c.TRANSITIONING)
  5394. return void A.debug(
  5395. 'Director.redirectToItem() -> Cannot redirect while transitioning.'
  5396. )
  5397. A.debug('Director.redirectToItem() -> Redirecting to ' + e + ' via ' + t)
  5398. var i = function () {
  5399. s.setTimeout(
  5400. function () {
  5401. this.setDestinationItem(e),
  5402. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  5403. }.bind(this),
  5404. 0
  5405. )
  5406. }.bind(this)
  5407. this.interrupt(g.END, 0), this.updateSuccessFunction(i)
  5408. }),
  5409. (n.prototype.useSpecialTransition = function (e) {
  5410. void 0 !== e &&
  5411. this.defaultWarpStyle !== u.BLACK &&
  5412. A.debug('useSpecialTransition(): ' + e),
  5413. (this.nextWarpStyle = u.BLACK)
  5414. }),
  5415. (n.prototype.resetSpecialTransition = function () {
  5416. this.nextWarpStyle = this.defaultWarpStyle
  5417. }),
  5418. (n.prototype.arrivedAtDestination = function (e) {
  5419. if (this.player.flying || this.player.isWarping())
  5420. A.warn('Cannot advance to interlude or aiming while player is flying or warping.')
  5421. else {
  5422. this.transitionStage = y.Aiming
  5423. var t = this.tourIsPlaying
  5424. ? this.tourInterlude.bind(this, this.nextItem(this.currentItem))
  5425. : null
  5426. this.player.model.fadePanoMarkers(0),
  5427. this.awaitCompletion(
  5428. function () {
  5429. this.resetSpecialTransition(),
  5430. e
  5431. ? this.player.aimTourCamera(
  5432. this.destinationItem,
  5433. v.Retain,
  5434. v.Slow,
  5435. this.actionComplete.bind(this)
  5436. )
  5437. : this.actionComplete()
  5438. }.bind(this),
  5439. t
  5440. )
  5441. }
  5442. }),
  5443. (n.prototype.goToDestination = function (e, t, i, n) {
  5444. //音频
  5445. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  5446. // zeg 手动导览不播放音频
  5447. if (musicInfo && musicInfo.music && !e) {
  5448. let musicType = localStorage.getItem('xunirole') || 'male'
  5449. let isMale = musicType.indexOf('female') < 0
  5450. let fixMusic = isMale ? musicInfo.music : musicInfo.fmusic || musicInfo.music
  5451. // let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  5452. let src = fixMusic
  5453. let audioObj = SoundManager.list.find(e => e.name == 'tour')
  5454. let audioSrc1 = common.getFileNameFromUrl(audioObj.src)
  5455. let audioSrc2 = common.getFileNameFromUrl(src)
  5456. if (audioSrc1 == audioSrc2) {
  5457. //应该是继续播放该folder
  5458. if (this.destinationItem[1] == 0) {
  5459. //从头开始播放 因为可能暂停后然后再点该缩略图播
  5460. SoundManager.play('tour', null, 0) // currentTime = 0;
  5461. } else if (
  5462. audioObj.audio.paused &&
  5463. audioObj.audio.currentTime < audioObj.audio.duration
  5464. ) {
  5465. //未播完
  5466. SoundManager.play('tour') //继续播。为什么会有暂停的情况?如果手动切换到bgm了呢?
  5467. }
  5468. } else {
  5469. //很可能是该folder的起始
  5470. SoundManager.play('tour', manage.dealURL(src))
  5471. }
  5472. }
  5473. let oldPos = this.player.position.clone()
  5474. let oldPano = this.player.currentPano
  5475. if (
  5476. ((this.onTheBus = !0),
  5477. this.emit('update.controls'),
  5478. this.player.updateLastView(),
  5479. !n && this.atDestinationPano())
  5480. ) {
  5481. /*
  5482. // 原地旋转时, 写到_warpCameraAim里,因那有时间
  5483. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  5484. if(r.zoom && r.zoom != this.player.zoomLevel){//add
  5485. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  5486. } */
  5487. return void this.arrivedAtDestination(!0)
  5488. }
  5489. if (this.player.flying || this.player.isWarping())
  5490. A.warn('Cannot go to new destination while player is flying or warping.')
  5491. else {
  5492. var r = this.model.getHeroDescriptorByIndex(this.destinationItem),
  5493. o = null,
  5494. a1 = null
  5495. if (r.isPano()) {
  5496. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  5497. //var walk = window.DATA.black ? 'black' : 'walk';
  5498. //若是点击item,直接瞬间过渡。
  5499. var s = e ? 'black' : this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  5500. if (this.destinationItem[0] == 0 && this.destinationItem[1] == 0)
  5501. s = 'black' // 周恩光加 返回最初导览点是瞬间过渡
  5502. ;(a1 = this.player.warpToPanoByHeroIndex.bind(
  5503. this.player,
  5504. this.destinationItem,
  5505. v.Show,
  5506. m.Slow,
  5507. s,
  5508. true,
  5509. i,
  5510. this.actionComplete.bind(this)
  5511. )),
  5512. (o = this.arrivedAtDestination.bind(this, !0))
  5513. if (s == 'black' && r.zoom && r.zoom != this.player.zoomLevel) {
  5514. //add
  5515. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  5516. }
  5517. } else {
  5518. ;(a1 = this.player.warpToNonPanoByHeroIndex.bind(
  5519. this.player,
  5520. this.destinationItem,
  5521. this.actionComplete.bind(this)
  5522. )),
  5523. (o = this.arrivedAtDestination.bind(this, !1))
  5524. }
  5525. ;(this.transitionStage = y.Moving),
  5526. this.model.fadePanoMarkers(0),
  5527. this.awaitCompletion(
  5528. function () {
  5529. a1()
  5530. }.bind(this),
  5531. o
  5532. ),
  5533. this.emit('update.controls')
  5534. }
  5535. }),
  5536. (n.prototype.tourInterlude = function () {
  5537. if (
  5538. (h.trackAlways('reach_highlight', {
  5539. reach_source: this.reachSource
  5540. }),
  5541. this.model.fadePanoMarkers(0),
  5542. this.emit('update.controls'),
  5543. this.tourIsPlaying)
  5544. )
  5545. return this.atEndOfTour() && !this.endlessLoop
  5546. ? ((this.tourInProgress = !1),
  5547. void this.awaitCompletion(
  5548. function () {
  5549. ;(this.transitionStage = y.Interlude),
  5550. this.player.tourInterlude(
  5551. this.nextItem(this.currentItem),
  5552. this.actionComplete.bind(this)
  5553. )
  5554. }.bind(this),
  5555. function () {
  5556. ;(this.currentItem = [0, 0]), this.stopTour(true), this.emit(p.TourEnd)
  5557. }.bind(this)
  5558. ),
  5559. void (
  5560. this.player.mode === c.PANORAMA &&
  5561. this.model.fadePanoMarkers(a.panorama.markerOpacity)
  5562. ))
  5563. : void this.awaitCompletion(
  5564. function () {
  5565. ;(this.transitionStage = y.Interlude),
  5566. this.player.tourInterlude(
  5567. this.nextItem(this.currentItem),
  5568. this.actionComplete.bind(this)
  5569. )
  5570. }.bind(this),
  5571. this.goNext.bind(this)
  5572. )
  5573. }),
  5574. (n.prototype.findNearestItem = function (endToStart = true) {
  5575. //找到离currentPano最近的导览
  5576. /* if(this.atDestinationPano(this.player.currentPano)){//在终点直接从头。但有的场景可能不希望如此,就想跳到所属的展区开始。
  5577. return [0,0] //2023.7.7发现在点击item后播放会从头开始
  5578. } */
  5579. //注:没有判断此刻是否在panorama模式,就使用currentPano
  5580. var result = { item: [0, 0], dis: Infinity }
  5581. var compare = (location, item) => {
  5582. if (location.panoId != void 0 && location.panoId != 'outside') {
  5583. var pano = this.model.panos.index[location.panoId]
  5584. var dis = pano.position.distanceTo(this.player.currentPano.position)
  5585. if (dis < result.dis) {
  5586. ;(result.item = item), (result.dis = dis)
  5587. } else if (dis == result.dis) {
  5588. //如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
  5589. /* if(this.itemCompare(item, this.currentItem, 'equal')){
  5590. result.item = item, result.dis = dis
  5591. } */
  5592. if (
  5593. this.currentItem &&
  5594. Math.abs(item[0] - this.currentItem[0]) <
  5595. Math.abs(result.item[0] - this.currentItem[0])
  5596. ) {
  5597. ;(result.item = item), (result.dis = dis)
  5598. }
  5599. }
  5600. }
  5601. }
  5602. this.model.heroLocations.forEach((e, i) => {
  5603. if (e.heroLocations) {
  5604. /* e.heroLocations.forEach((a,j)=>{
  5605. compare(a, [i,j])
  5606. }) */
  5607. var location = e.heroLocations.find(e => e.panoId != void 0)
  5608. location && compare(location, [i, 0]) //跳到此区域开头
  5609. } else {
  5610. compare(e, [i, 0])
  5611. }
  5612. })
  5613. if (endToStart && this.atEndOfTour(result.item)) {
  5614. //如果是最后一个点,直接跳到开头,否则导览开始就在终点的话不会从头开始
  5615. return [0, 0] //但注意最后是区域的话result.item是区域开头,除非站在最末最末尾的位置,上面的atDestinationPano直接返回
  5616. }
  5617. return result.item
  5618. })
  5619. n.prototype.playTour = function () {
  5620. if (!this.bounceable() && this.model.heroLocations.length) {
  5621. // ------------这部分处理逻辑目前已由playTourNearBy()取代------------------------------------
  5622. // if(!this.currentItem) this.currentItem = []
  5623. // if(this.currentItem[0] != 0 || this.destinationItem[0]!= this.nItems-1){
  5624. // // zeg 从当前pano进行自动导览
  5625. // let currentPanoDestinations = this.panoIdMap.get(this.player.currentPano.id)
  5626. // // this.model.heroLocations.forEach( (value, index) => {
  5627. // // if(value.heroLocations.find( hl => hl.panoId == this.player.currentPano.id )) {
  5628. // // currentPanoDestinations.push(index)
  5629. // // }
  5630. // // })
  5631. // if(!currentPanoDestinations) {
  5632. // // let panoIndex = this.model.panos.list.findIndex( pano => pano.id == this.player.currentPano.id )
  5633. // let panoIndex = this.model.panos.list.indexOf( this.player.currentPano )
  5634. // let neighbourIndex = [ panoIndex + 1, panoIndex - 1, panoIndex + 2, panoIndex - 2, panoIndex + 3, panoIndex - 3 ]
  5635. // for(var i = 0; i < neighbourIndex.length; i++) {
  5636. // currentPanoDestinations = this.panoIdMap.get(this.model.panos.list[neighbourIndex[i]]&&this.model.panos.list[neighbourIndex[i]].id)
  5637. // if(currentPanoDestinations && currentPanoDestinations[0] != 0) break
  5638. // }
  5639. // if(!currentPanoDestinations) currentPanoDestinations = [0];
  5640. // }
  5641. // if(currentPanoDestinations.indexOf(this.currentItem[0]) == -1) {
  5642. // this.currentItem[0] = currentPanoDestinations[0]
  5643. // }
  5644. // }
  5645. return this.tourIsPlaying
  5646. ? void A.info('tour is already playing')
  5647. : void (
  5648. this.wouldInterrupt() ||
  5649. (this.player.emit('tour_auto', this.defaultWarpStyle),
  5650. (this.tourInProgress = !0),
  5651. (this.reachSource = 'play'),
  5652. (this.tourIsPlaying = !0),
  5653. (this.wasZoomEnabled = this.player.zoomEnabled),
  5654. (this.player.zoomEnabled = !1),
  5655. this.resetSpecialTransition(),
  5656. this.emit('update.controls'),
  5657. this.emit(p.TourStart),
  5658. this.player.enablePreRendering(),
  5659. // this.currentItem[1] = null,
  5660. this.walkingSectionPaused
  5661. ? (this.clearWalkingSectionPaused(), this.goToDestination())
  5662. : /* this.goNext() */ (this.tourAdvance(0), this.goToDestination()))
  5663. ) //xzw: 不要直接跳到下一个点开始,从当前点开始,否则当一段区域内只有一个导览时播放会立刻跳到下一个缩略图进行。
  5664. }
  5665. }
  5666. ;(n.prototype.playTourNearBy = function () {
  5667. //就近导览
  5668. if (!this.bounceable()) {
  5669. return this.tourIsPlaying
  5670. ? void A.info('tour is already playing')
  5671. : void (
  5672. this.wouldInterrupt() ||
  5673. (this.player.emit('tour_auto', this.defaultWarpStyle),
  5674. (this.tourInProgress = !0),
  5675. (this.reachSource = 'play'),
  5676. (this.tourIsPlaying = !0),
  5677. (this.wasZoomEnabled = this.player.zoomEnabled),
  5678. (this.player.zoomEnabled = !1),
  5679. this.resetSpecialTransition(),
  5680. this.emit('update.controls'),
  5681. this.emit(p.TourStart),
  5682. this.player.enablePreRendering(),
  5683. /* this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  5684. this.goToDestination()) : this.goNext())) */
  5685. this.setDestinationItem(this.findNearestItem()),
  5686. this.goToDestination())
  5687. )
  5688. }
  5689. }),
  5690. /* n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  5691. } */
  5692. (n.prototype.stopTour = function (isAutoStop) {
  5693. //停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  5694. SoundManager.pause('tour'), // zeg 自动导览暂停时同时停止语音
  5695. this.isInterrupted() ||
  5696. (this.transitionStage === y.Moving &&
  5697. this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle)) ||
  5698. (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  5699. (this.tourIsPlaying = !1),
  5700. this.interrupt(),
  5701. this.clearWalkingSectionPaused(),
  5702. this.resetSpecialTransition(),
  5703. this.emit('update.controls'))
  5704. }),
  5705. (n.prototype.endTourProgress = function () {
  5706. ;(this.tourInProgress = !1), this.emit('update.controls'), this.emit(p.TourEnd)
  5707. }),
  5708. (n.prototype.goToHighlight = function (e) {
  5709. if (this.wouldInterrupt())
  5710. this.itemCompare(this.destinationItem, e, 'equal')
  5711. ? this.interrupt()
  5712. : this.redirectToItem(e, 'goToHighlight')
  5713. else {
  5714. if ((A.debug('<tour.goto ' + e + '>'), this.isInterrupted())) return
  5715. this.clearWalkingSectionPaused(),
  5716. this.setDestinationItem(e),
  5717. this.useSpecialTransition('Hilight')
  5718. this.goToDestination(true), //add true
  5719. h.trackAlways('reach_highlight', {
  5720. reach_source: 'thumb'
  5721. })
  5722. }
  5723. }),
  5724. (n.prototype.prevHighlight = function () {
  5725. this.bounceable() ||
  5726. (this.player.emit('tour_manual', 'prev'),
  5727. this.interrupt(g.BEGINNING) ||
  5728. this.isInterrupted() ||
  5729. (this.clearWalkingSectionPaused(), (this.reachSource = 'prev'), this.goPrev()))
  5730. }),
  5731. (n.prototype.nextHighlight = function () {
  5732. this.bounceable() ||
  5733. (this.player.emit('tour_manual', 'next'),
  5734. this.interrupt(g.BEGINNING) ||
  5735. this.isInterrupted() ||
  5736. (this.clearWalkingSectionPaused(), (this.reachSource = 'next'), this.goNext()))
  5737. }),
  5738. (n.prototype.changeMode = function (e) {
  5739. var t = $.Deferred(),
  5740. i = t.resolve.bind(t),
  5741. n = t.reject.bind(t)
  5742. this.emit(p.StartModeChange)
  5743. var r = function () {
  5744. return (
  5745. this.clearWalkingSectionPaused(),
  5746. !!this.wouldInterrupt() && (this.interrupt(), !0)
  5747. )
  5748. }.bind(this)
  5749. if (!r()) {
  5750. switch (e) {
  5751. case c.PANORAMA:
  5752. this.player.mode === c.PANORAMA
  5753. ? this.player.currentPano.isAligned() ||
  5754. this.player.goToLastView(!0).done(i).fail(n)
  5755. : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n)
  5756. break
  5757. case c.DOLLHOUSE:
  5758. case c.FLOORPLAN:
  5759. this.player
  5760. .flyToNewMode({
  5761. mode: e
  5762. })
  5763. .done(i)
  5764. .fail(n)
  5765. break
  5766. case c.OUTDOOR:
  5767. this.player.model.has360Views &&
  5768. (this.player.mode !== c.PANORAMA ||
  5769. (this.player.mode === c.PANORAMA && this.player.currentPano.isAligned())) &&
  5770. this.player.goToLastView(!1).done(i).fail(n)
  5771. }
  5772. return t.promise()
  5773. }
  5774. }),
  5775. (n.prototype.atEndOfTour = function (currentItem = this.currentItem) {
  5776. var end = currentItem && currentItem[0] >= this.nItems - 1
  5777. if (end) {
  5778. var heroLocations = this.model.heroLocations[this.nItems - 1].heroLocations
  5779. if (heroLocations) {
  5780. end = currentItem[1] >= heroLocations.length - 1
  5781. }
  5782. }
  5783. return end
  5784. }),
  5785. (n.prototype.firstDestination = function () {
  5786. //return 0 < this.nItems ? 0 : null
  5787. return 0 < this.nItems ? [0, 0] : null
  5788. }),
  5789. (n.prototype.finalDestination = function () {
  5790. //return 0 < this.nItems ? this.nItems - 1 : null
  5791. return 0 < this.nItems ? [this.nItems - 1, 0] : null
  5792. }),
  5793. (n.prototype.goPrev = function () {
  5794. this.tourAdvance(-1)
  5795. }),
  5796. (n.prototype.goNext = function () {
  5797. this.tourAdvance(1)
  5798. }),
  5799. (n.prototype.setDestinationItem = function (e) {
  5800. ;(this.destinationItem = e), this.emit('update.controls')
  5801. }),
  5802. (n.prototype.setCurrentItem = function (e) {
  5803. ;(this.currentItem = e), this.emit('update.controls')
  5804. }),
  5805. (n.prototype.nextItem = function (currentItem) {
  5806. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  5807. if (currentItem == void 0) return this.firstDestination()
  5808. var currentLocation = this.model.heroLocations[currentItem[0]]
  5809. var currentChildNum = currentLocation.heroLocations
  5810. ? currentLocation.heroLocations.length
  5811. : 1
  5812. var item
  5813. if (this.currentItem[1] >= currentChildNum - 1) {
  5814. //子目录中最后一个
  5815. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  5816. } else {
  5817. item = [currentItem[0], currentItem[1] + 1]
  5818. }
  5819. if (item[0] >= this.nItems) {
  5820. item = this.firstDestination()
  5821. }
  5822. return item
  5823. //暂时不理会endlessLoop,默认为false
  5824. }),
  5825. (n.prototype.prevItem = function (currentItem) {
  5826. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  5827. if (currentItem == void 0) return this.firstDestination()
  5828. var item
  5829. var lastLocation = this.model.heroLocations[currentItem[0] - 1]
  5830. if (!lastLocation)
  5831. return this.finalDestination() //[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  5832. else {
  5833. var lastChildNum = lastLocation.heroLocations
  5834. ? lastLocation.heroLocations.length
  5835. : 1
  5836. if (this.currentItem[1] == 0) {
  5837. //子目录中第一个
  5838. return [currentItem[0] - 1, lastChildNum - 1]
  5839. } else {
  5840. return [currentItem[0], currentItem[1] - 1]
  5841. }
  5842. }
  5843. }),
  5844. (n.prototype.tourAdvance = function (e) {
  5845. //e是1或-1 或 0
  5846. A.debug('tourAdvance(' + e + ')')
  5847. // // zeg改
  5848. if (null === this.currentItem || void 0 === this.currentItem) {
  5849. // this.setDestinationItem(this.firstDestination())
  5850. // this.setDestinationItem([currentPanoDestinations[0], 0])
  5851. this.setDestinationItem([this.currentItem[0], 0])
  5852. }
  5853. // else if(this.currentItem[1] == null) {
  5854. // this.setDestinationItem([this.currentItem[0], 0])
  5855. // }
  5856. else {
  5857. var item = this.currentItem
  5858. if (e == 1) {
  5859. item = this.nextItem(this.currentItem)
  5860. } else if (e == -1) {
  5861. item = this.prevItem(this.currentItem)
  5862. }
  5863. this.setDestinationItem(item)
  5864. }
  5865. if (this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')) {
  5866. this.useSpecialTransition('reverse-looping to end')
  5867. } else if (this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')) {
  5868. this.useSpecialTransition('looping back to start')
  5869. }
  5870. /* var momentTour = this.getMomentTour(this.destinationItem);
  5871. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5872. var zoomLevel = this.player.zoomLevel;
  5873. this.player.zoomEnabled = true;
  5874. var zoom = function(e, d) {
  5875. this.player.zoomTo((1-e)*zoomLevel, true)
  5876. }.bind(this)
  5877. s.start(zoom, 1500, function(){
  5878. }, 0, d.easeOutQuad, "zoom")
  5879. } */
  5880. this.goToDestination()
  5881. }),
  5882. (n.prototype.getMomentTour = function (destinationItem) {
  5883. //add
  5884. var wholeMomentTour = window.DATA.momentTour || 'walk' //最外层 还有一种是'std'
  5885. if (!destinationItem) return wholeMomentTour
  5886. else {
  5887. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem) //最内层。 如果有使用最内层
  5888. if (currentLocation.momentTour) return currentLocation.momentTour
  5889. var currentLocation_ = this.model.heroLocations[destinationItem[0]]
  5890. return currentLocation_.momentTour || wholeMomentTour //若中间层或最内层有就使用,否则使用最外层
  5891. }
  5892. }),
  5893. (t.exports = n)
  5894. }).call(this, '/js/director.js')
  5895. },
  5896. {
  5897. './analytics': 4,
  5898. './enum/BlackoutStyle': 18,
  5899. './enum/ControlEvents': 21,
  5900. './enum/DirectorEvents': 23,
  5901. './enum/ModelManagerEvents': 33,
  5902. './enum/PathDiscardMode': 38,
  5903. './enum/PathDisplayMode': 39,
  5904. './enum/PlayerEvents': 40,
  5905. './enum/Viewmode': 51,
  5906. './enum/WarpStyle': 52,
  5907. './model/ModelManager': 140,
  5908. './player': 155,
  5909. './settings': 166,
  5910. './util/logger': 189,
  5911. './util/transitions': 195,
  5912. events: 202,
  5913. three: 217
  5914. }
  5915. ],
  5916. 16: [
  5917. function (e, t, i) {
  5918. 'use strict'
  5919. var n = e('three'),
  5920. r = e('./enum/Viewmode'),
  5921. o = (e('./settings'), e('./util/transitions')),
  5922. a = e('./enum/PlayerEvents'),
  5923. s = new n.ShaderPass(n.HorizontalBlurShader),
  5924. l = new n.ShaderPass(n.VerticalBlurShader)
  5925. l.renderToScreen = !0
  5926. var c = $('#player').width() / $('#player').height()
  5927. isNaN(c) && (c = 1)
  5928. var h = {
  5929. currentBlur: 0,
  5930. aspect: c,
  5931. blurStrength: 1,
  5932. hblurPass: s,
  5933. vblurPass: l,
  5934. fastTranMaskPass: new n.TransitionPass(),
  5935. bindEvents: function (e) {
  5936. e.on(a.ModeChanged, function (e, t) {
  5937. e === r.PANORAMA &&
  5938. (o.cancel(h.blur),
  5939. o.cancel(h.addBlur),
  5940. o.start(h.removeBlur, 500, null, 0, null, 'deblur'))
  5941. })
  5942. },
  5943. blur: function (e) {
  5944. h.currentBlur = e
  5945. var t = e * h.blurStrength
  5946. ;(l.uniforms.v.value = (t / 512) * h.aspect), (s.uniforms.h.value = t / 512)
  5947. },
  5948. addBlur: function (e) {
  5949. ;(e = Math.max(e, h.currentBlur)), h.blur(e)
  5950. },
  5951. removeBlur: function (e) {
  5952. ;(e = Math.min(1 - e, h.currentBlur)), h.blur(e)
  5953. }
  5954. }
  5955. h.blur(0), (t.exports = h)
  5956. },
  5957. {
  5958. './enum/PlayerEvents': 40,
  5959. './enum/Viewmode': 51,
  5960. './settings': 166,
  5961. './util/transitions': 195,
  5962. three: 217
  5963. }
  5964. ],
  5965. 17: [
  5966. function (e, t, i) {
  5967. 'use strict'
  5968. t.exports = {
  5969. UNKNOWN: 0,
  5970. ALIGNED: 1,
  5971. UNALIGNED: 2,
  5972. PLACED: 3
  5973. }
  5974. },
  5975. {}
  5976. ],
  5977. 18: [
  5978. function (e, t, i) {
  5979. 'use strict'
  5980. t.exports = {
  5981. NONE: 0,
  5982. MIDDLE: 1,
  5983. END: 2,
  5984. BEGINNING: 3,
  5985. FADEIN: 4
  5986. }
  5987. },
  5988. {}
  5989. ],
  5990. 19: [
  5991. function (e, t, i) {
  5992. 'use strict'
  5993. var n = e('three')
  5994. t.exports = {
  5995. newBlue: new n.Color(4967932),
  5996. altBlue: new n.Color(47355),
  5997. tagDefault: new n.Color(223357),
  5998. classicBlue: new n.Color(53759),
  5999. mpYellow: new n.Color(16502016),
  6000. mpOrange: new n.Color(16428055),
  6001. mpBlue: new n.Color(12096),
  6002. mpLtGrey: new n.Color(13751252),
  6003. mpDkGrey: new n.Color(10000019),
  6004. mpRed: new n.Color(12525854),
  6005. mpOrangeDesat: new n.Color(16764529),
  6006. mpBlueDesat: new n.Color(4034734),
  6007. mpRedDesat: new n.Color(14705505),
  6008. white: new n.Color(16777215),
  6009. black: new n.Color(0),
  6010. _desat: function (e, t) {
  6011. var i = t || 0.3,
  6012. r = new n.Color().copy(e).getHSL()
  6013. return new n.Color().setHSL(r.h, r.s * (1 - i), r.l)
  6014. },
  6015. _darken: function (e, t) {
  6016. var i = t || 0.2,
  6017. r = e.getHSL()
  6018. return new n.Color().setHSL(r.h, r.s, r.l * (1 - i))
  6019. }
  6020. }
  6021. },
  6022. {
  6023. three: 217
  6024. }
  6025. ],
  6026. 20: [
  6027. function (e, t, i) {
  6028. 'use strict'
  6029. t.exports = {
  6030. NONE: -1,
  6031. ROTATE: 0,
  6032. DOLLY: 1,
  6033. PAN: 2,
  6034. ROTATE_DOLLY: 3,
  6035. PAN_DOLLY: 4
  6036. }
  6037. },
  6038. {}
  6039. ],
  6040. 21: [
  6041. function (e, t, i) {
  6042. 'use strict'
  6043. t.exports = {
  6044. Move: 'move',
  6045. InteractionDirect: 'interaction.direct',
  6046. InteractionKey: 'interaction.key',
  6047. InteractionGui: 'interaction.gui',
  6048. FlyInDirection: 'fly.direction',
  6049. InputStart: 'input.start',
  6050. Pinch: 'input.pinch',
  6051. Scroll: 'input.scroll',
  6052. AutoPanInterrupt: 'autopan.interrupt',
  6053. AutoPanComplete: 'autopan.complete',
  6054. AutoPanClamped: 'autopan.clamped',
  6055. LongTap: 'longtap'
  6056. }
  6057. },
  6058. {}
  6059. ],
  6060. 22: [
  6061. function (e, t, i) {
  6062. 'use strict'
  6063. t.exports = Object.freeze({
  6064. FORWARD: 'FORWARD',
  6065. LEFT: 'LEFT',
  6066. RIGHT: 'RIGHT',
  6067. BACK: 'BACK',
  6068. UP: 'UP',
  6069. DOWN: 'DOWN'
  6070. })
  6071. },
  6072. {}
  6073. ],
  6074. 23: [
  6075. function (e, t, i) {
  6076. 'use strict'
  6077. t.exports = {
  6078. ActionInterrupted: 'action.interrupted',
  6079. TourStart: 'tour.start',
  6080. TourEnd: 'tour.end',
  6081. StartModeChange: 'mode.startChange'
  6082. }
  6083. },
  6084. {}
  6085. ],
  6086. 24: [
  6087. function (e, t, i) {
  6088. 'use strict'
  6089. t.exports = Object.freeze({
  6090. None: 0,
  6091. Queued: 1,
  6092. ForceQueued: 2,
  6093. Downloading: 3,
  6094. Downloaded: 4,
  6095. DownloadFailed: 5
  6096. })
  6097. },
  6098. {}
  6099. ],
  6100. 25: [
  6101. function (e, t, i) {
  6102. 'use strict'
  6103. t.exports = {
  6104. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  6105. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  6106. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  6107. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  6108. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  6109. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  6110. }
  6111. },
  6112. {}
  6113. ],
  6114. 26: [
  6115. function (e, t, i) {
  6116. 'use strict'
  6117. t.exports = {
  6118. Texture2D: 0,
  6119. TextureCube: 1
  6120. }
  6121. },
  6122. {}
  6123. ],
  6124. 27: [
  6125. function (e, t, i) {
  6126. 'use strict'
  6127. t.exports = {
  6128. SMALL: 'small',
  6129. LARGE: 'large'
  6130. }
  6131. },
  6132. {}
  6133. ],
  6134. 28: [
  6135. function (e, t, i) {
  6136. 'use strict'
  6137. var n = e('./Viewmode'),
  6138. r = {
  6139. LANDING: {},
  6140. NAVIGATION: 'navigation',
  6141. MORE_HELP: 'moreHelp',
  6142. TOUR_INTERACTION: {}
  6143. }
  6144. ;(r.LANDING[n.PANORAMA] = 'panorama.landing'),
  6145. (r.LANDING[n.OUTDOOR] = 'outdoor.landing'),
  6146. (r.LANDING[n.DOLLHOUSE] = 'dollhouse.landing'),
  6147. (r.LANDING[n.FLOORPLAN] = 'floorplan.landing'),
  6148. (r.TOUR_INTERACTION.standard = 'standard.tour'),
  6149. (r.TOUR_INTERACTION[n.OUTDOOR] = 'outdoor.tour'),
  6150. (r.TOUR_INTERACTION[n.FLOORPLAN] = 'floorplan.tour'),
  6151. (t.exports = r)
  6152. },
  6153. {
  6154. './Viewmode': 51
  6155. }
  6156. ],
  6157. 29: [
  6158. function (e, t, i) {
  6159. 'use strict'
  6160. var n = {
  6161. UP: 1,
  6162. DOWN: -1,
  6163. LEFT: 'L',
  6164. RIGHT: 'R',
  6165. FORWARD: 'F',
  6166. BACK: 'B',
  6167. reverse: {},
  6168. opposite: function (e) {
  6169. return this.reverse[e.toString()]
  6170. }
  6171. }
  6172. !(function () {
  6173. ;(n.reverse[n.UP] = n.DOWN),
  6174. (n.reverse[n.DOWN] = n.UP),
  6175. (n.reverse[n.LEFT] = n.RIGHT),
  6176. (n.reverse[n.RIGHT] = n.LEFT),
  6177. (n.reverse[n.FORWARD] = n.BACK),
  6178. (n.reverse[n.BACK] = n.FORWARD)
  6179. })(),
  6180. (t.exports = n)
  6181. },
  6182. {}
  6183. ],
  6184. 30: [
  6185. function (e, t, i) {
  6186. 'use strict'
  6187. var n = e('../util/browser'),
  6188. r = {
  6189. ZERO: 48,
  6190. ONE: 49,
  6191. TWO: 50,
  6192. THREE: 51,
  6193. FOUR: 52,
  6194. FIVE: 53,
  6195. SIX: 54,
  6196. SEVEN: 55,
  6197. EIGHT: 56,
  6198. NINE: 57,
  6199. LEFTARROW: 37,
  6200. UPARROW: 38,
  6201. RIGHTARROW: 39,
  6202. DOWNARROW: 40,
  6203. A: 65,
  6204. B: 66,
  6205. C: 67,
  6206. D: 68,
  6207. E: 69,
  6208. F: 70,
  6209. G: 71,
  6210. H: 72,
  6211. I: 73,
  6212. J: 74,
  6213. K: 75,
  6214. L: 76,
  6215. M: 77,
  6216. N: 78,
  6217. O: 79,
  6218. P: 80,
  6219. Q: 81,
  6220. R: 82,
  6221. S: 83,
  6222. T: 84,
  6223. U: 85,
  6224. V: 86,
  6225. W: 87,
  6226. X: 88,
  6227. Y: 89,
  6228. Z: 90,
  6229. SPACE: 32,
  6230. RETURN: 13,
  6231. SEMICOLON: 186,
  6232. PLUSEQUALS: 187,
  6233. DASHUNDERSCORE: 189,
  6234. OPENBRACKET: 219
  6235. }
  6236. n.detectFirefox() && ((r.SEMICOLON = 59), (r.PLUSEQUALS = 61), (r.DASHUNDERSCORE = 173)),
  6237. (t.exports = r)
  6238. },
  6239. {
  6240. '../util/browser': 182
  6241. }
  6242. ],
  6243. 31: [
  6244. function (e, t, i) {
  6245. 'use strict'
  6246. t.exports = {
  6247. EN_US: 'en-US',
  6248. ES_MX: 'es-MX',
  6249. FR_FR: 'fr-FR',
  6250. DE_DE: 'de-DE',
  6251. RU_RU: 'ru-RU',
  6252. CN_CN: 'cn-CN',
  6253. JP_JP: 'jp-JP'
  6254. }
  6255. },
  6256. {}
  6257. ],
  6258. 32: [
  6259. function (e, t, i) {
  6260. 'use strict'
  6261. t.exports = {
  6262. TagActivated: 'tag.activated',
  6263. TagDismissed: 'tag.dismissed',
  6264. TagNavigation: 'tag.navigation'
  6265. }
  6266. },
  6267. {}
  6268. ],
  6269. 33: [
  6270. function (e, t, i) {
  6271. 'use strict'
  6272. t.exports = {
  6273. ModelAdded: 'model-added',
  6274. ActiveModelChanged: 'active-model-changed'
  6275. }
  6276. },
  6277. {}
  6278. ],
  6279. 34: [
  6280. function (e, t, i) {
  6281. 'use strict'
  6282. t.exports = {
  6283. LEFT: 0,
  6284. MIDDLE: 1,
  6285. RIGHT: 2
  6286. }
  6287. },
  6288. {}
  6289. ],
  6290. 35: [
  6291. function (e, t, i) {
  6292. 'use strict'
  6293. t.exports = {
  6294. PanoRenderComplete: 'panorama.render.complete',
  6295. TileRenderFailure: 'panorama.tile.render.failed',
  6296. TileRenderSuccess: 'panorama.tile.render.success',
  6297. TileUploadAttempted: 'panorama.tile.upload.attempted',
  6298. UploadAttemptedForAllTiles: 'panorama.upload.attempted.all.tiles',
  6299. ZoomLevelRenderStarted: 'panorama.zoom.render.started'
  6300. }
  6301. },
  6302. {}
  6303. ],
  6304. 36: [
  6305. function (e, t, i) {
  6306. 'use strict'
  6307. t.exports = {
  6308. BASE: 1,
  6309. STANDARD: 2,
  6310. HIGH: 3,
  6311. ULTRAHIGH: 4
  6312. }
  6313. },
  6314. {}
  6315. ],
  6316. 37: [
  6317. function (e, t, i) {
  6318. 'use strict'
  6319. t.exports = {
  6320. LoadComplete: 'panorama.load.complete',
  6321. LoadFailed: 'panorama.load.failed',
  6322. TileLoaded: 'panorama.tile.loaded'
  6323. }
  6324. },
  6325. {}
  6326. ],
  6327. 38: [
  6328. function (e, t, i) {
  6329. 'use strict'
  6330. t.exports = Object.freeze({
  6331. Standard: 0,
  6332. Slow: 1,
  6333. Retain: 2
  6334. })
  6335. },
  6336. {}
  6337. ],
  6338. 39: [
  6339. function (e, t, i) {
  6340. 'use strict'
  6341. t.exports = Object.freeze({
  6342. Show: 0,
  6343. Hide: 1,
  6344. Retain: 2
  6345. })
  6346. },
  6347. {}
  6348. ],
  6349. 40: [
  6350. function (e, t, i) {
  6351. 'use strict'
  6352. t.exports = {
  6353. Move: 'move',
  6354. MoveComplete: 'move.complete',
  6355. ModeChanged: 'mode.changed',
  6356. ModeChanging: 'mode.changing',
  6357. PanoChosen: 'pano.chosen',
  6358. ClosestPanoChanging: 'closest.pano.changing',
  6359. WarpStarted: 'warp.started',
  6360. WarpInterrupted: 'warp.interrupted',
  6361. WarpEnded: 'warp.ended',
  6362. FlyinFinished: 'flyin.finished',
  6363. FlyingStarted: 'flying.started',
  6364. FlyingInterrupted: 'flying.interrupted',
  6365. FlyingEnded: 'flying.ended',
  6366. Ready: 'ready',
  6367. StartInside: 'start.inside',
  6368. StartOutside: 'start.outside',
  6369. ViewChanged: 'view.changed',
  6370. WarpInterruptedWithFlyTo: 'warp.interrupted.flyto',
  6371. InputStart: 'input.start'
  6372. }
  6373. },
  6374. {}
  6375. ],
  6376. 41: [
  6377. function (e, t, i) {
  6378. 'use strict'
  6379. t.exports = Object.freeze({
  6380. DEFAULT: 0,
  6381. PANOMARKERS: 1,
  6382. RETICULE: 2,
  6383. TAG: 3
  6384. })
  6385. },
  6386. {}
  6387. ],
  6388. 42: [
  6389. function (e, t, i) {
  6390. 'use strict'
  6391. t.exports = {
  6392. visibleFloor: 1,
  6393. ghostFloor: 3,
  6394. boundingSkybox: 1,
  6395. panoMarker: 2,
  6396. reticule: 3,
  6397. tagStem: 4,
  6398. tagDisc: 5,
  6399. ribbon: 100
  6400. }
  6401. },
  6402. {}
  6403. ],
  6404. 43: [
  6405. function (e, t, i) {
  6406. 'use strict'
  6407. t.exports = {
  6408. ContextCreated: 'scene-renderer-context-created',
  6409. AfterRender: 'after-render',
  6410. MemoryUsageUpdated: 'scene-renderer-memory-usage-updated'
  6411. }
  6412. },
  6413. {}
  6414. ],
  6415. 44: [
  6416. function (e, t, i) {
  6417. 'use strict'
  6418. t.exports = {
  6419. IDLE: 'idle',
  6420. BROWSE: 'browse',
  6421. EXAMINE: 'examine'
  6422. }
  6423. },
  6424. {}
  6425. ],
  6426. 45: [
  6427. function (e, t, i) {
  6428. 'use strict'
  6429. t.exports = {
  6430. TileDownloadSuccess: 'tiledownloader.download.success',
  6431. TileDownloadFailure: 'tiledownloader.download.failure',
  6432. PanoDownloadComplete: 'tiledownloader.pano.download.complete'
  6433. }
  6434. },
  6435. {}
  6436. ],
  6437. 46: [
  6438. function (e, t, i) {
  6439. 'use strict'
  6440. t.exports = {
  6441. CardboardAndroid: 'googlevr',
  6442. GearVR: 'gearvr',
  6443. CardboardIOS: 'googlevrios',
  6444. Cardboard: 'googlevr'
  6445. }
  6446. },
  6447. {}
  6448. ],
  6449. 47: [
  6450. function (e, t, i) {
  6451. 'use strict'
  6452. t.exports = {
  6453. NONE: 0,
  6454. CONTEXTUAL: 1,
  6455. ANDROID: 2
  6456. }
  6457. },
  6458. {}
  6459. ],
  6460. 48: [
  6461. function (e, t, i) {
  6462. 'use strict'
  6463. var n = {
  6464. Title: 0,
  6465. Cardboard: 1
  6466. },
  6467. r = {
  6468. Title: 0,
  6469. Cardboard: 1,
  6470. Gear: 2
  6471. }
  6472. !(function () {
  6473. ;[n, r].forEach(function (e) {
  6474. e.pageCount = Object.keys(e).length
  6475. })
  6476. })(),
  6477. (t.exports.ios = n),
  6478. (t.exports.standard = r)
  6479. },
  6480. {}
  6481. ],
  6482. 49: [
  6483. function (e, t, i) {
  6484. 'use strict'
  6485. t.exports = {
  6486. Android: 'android',
  6487. IOS: 'ios',
  6488. Desktop: 'desktop',
  6489. UnsupportedAndroid: 'android-unsupported'
  6490. }
  6491. },
  6492. {}
  6493. ],
  6494. 50: [
  6495. function (e, t, i) {
  6496. 'use strict'
  6497. var n = e('three')
  6498. t.exports = {
  6499. UP: new n.Vector3(0, 1, 0),
  6500. DOWN: new n.Vector3(0, -1, 0),
  6501. LEFT: new n.Vector3(-1, 0, 0),
  6502. RIGHT: new n.Vector3(1, 0, 0),
  6503. FORWARD: new n.Vector3(0, 0, -1),
  6504. BACK: new n.Vector3(0, 0, 1)
  6505. }
  6506. },
  6507. {
  6508. three: 217
  6509. }
  6510. ],
  6511. 51: [
  6512. function (e, t, i) {
  6513. 'use strict'
  6514. var n = e('../exception/ViewmodeConvertException'),
  6515. r = e('./coreViewmodes'),
  6516. o = e('../util/common'),
  6517. a = {
  6518. MESH: 'mesh',
  6519. OUTDOOR: 'outdoor',
  6520. TRANSITIONING: 'transitioning',
  6521. toInt: function (e) {
  6522. switch (e) {
  6523. case this.PANORAMA:
  6524. return 1
  6525. case this.DOLLHOUSE:
  6526. return 2
  6527. case this.FLOORPLAN:
  6528. return 3
  6529. case this.OUTDOOR:
  6530. return 4
  6531. case this.TRANSITIONING:
  6532. return -1
  6533. }
  6534. throw new n('No known conversion for Viewmode to int for mode: ' + e)
  6535. },
  6536. fromInt: function (e) {
  6537. switch (e) {
  6538. case '1':
  6539. case 1:
  6540. return this.PANORAMA
  6541. case '2':
  6542. case 2:
  6543. return this.DOLLHOUSE
  6544. case '3':
  6545. case 3:
  6546. return this.FLOORPLAN
  6547. case '4':
  6548. case 4:
  6549. return this.OUTDOOR
  6550. }
  6551. throw new n('No known conversion for int to viewmode for int: ' + e)
  6552. },
  6553. convertWorkshopModeInt: function (e) {
  6554. switch (e) {
  6555. case '0':
  6556. case 0:
  6557. case undefined: //xzw add
  6558. return this.PANORAMA
  6559. case '1':
  6560. case 1:
  6561. return this.FLOORPLAN
  6562. case '2':
  6563. case 2:
  6564. return this.DOLLHOUSE
  6565. case '3':
  6566. case 3:
  6567. return this.MESH
  6568. }
  6569. throw new n('No known conversion for Workshop int to viewmode for int: ' + e)
  6570. }
  6571. }
  6572. o.extendObject(a, r), (t.exports = a)
  6573. },
  6574. {
  6575. '../exception/ViewmodeConvertException': 58,
  6576. '../util/common': 185,
  6577. './coreViewmodes': 54
  6578. }
  6579. ],
  6580. 52: [
  6581. function (e, t, i) {
  6582. 'use strict'
  6583. t.exports = {
  6584. BLACK: 'black',
  6585. STD: 'std',
  6586. WALK: 'walk'
  6587. }
  6588. },
  6589. {}
  6590. ],
  6591. 53: [
  6592. function (e, t, i) {
  6593. 'use strict'
  6594. t.exports = {
  6595. ZoomIn: 'zoom.in',
  6596. ZoomOut: 'zoom.out',
  6597. ZoomMax: 'zoom.max',
  6598. ZoomMin: 'zoom.min'
  6599. }
  6600. },
  6601. {}
  6602. ],
  6603. 54: [
  6604. function (e, t, i) {
  6605. 'use strict'
  6606. t.exports = {
  6607. PANORAMA: 'panorama',
  6608. DOLLHOUSE: 'dollhouse',
  6609. FLOORPLAN: 'floorplan'
  6610. }
  6611. },
  6612. {}
  6613. ],
  6614. 55: [
  6615. function (e, t, i) {
  6616. 'use strict'
  6617. function n(e) {
  6618. this.message = e
  6619. }
  6620. t.exports = n
  6621. },
  6622. {}
  6623. ],
  6624. 56: [
  6625. function (e, t, i) {
  6626. 'use strict'
  6627. function n(e) {
  6628. r.call(this, e)
  6629. }
  6630. var r = e('./BasicException')
  6631. ;(n.prototype = Object.create(r.prototype)), (t.exports = n)
  6632. },
  6633. {
  6634. './BasicException': 55
  6635. }
  6636. ],
  6637. 57: [
  6638. function (e, t, i) {
  6639. 'use strict'
  6640. function n(e) {
  6641. r.call(this, e)
  6642. }
  6643. var r = e('./BasicException')
  6644. ;(n.prototype = Object.create(r.prototype)), (t.exports = n)
  6645. },
  6646. {
  6647. './BasicException': 55
  6648. }
  6649. ],
  6650. 58: [
  6651. function (e, t, i) {
  6652. 'use strict'
  6653. function n(e) {
  6654. r.call(this, e)
  6655. }
  6656. var r = e('./BasicException')
  6657. ;(n.prototype = Object.create(r.prototype)), (t.exports = n)
  6658. },
  6659. {
  6660. './BasicException': 55
  6661. }
  6662. ],
  6663. 59: [
  6664. function (e, t, i) {
  6665. ;(function (i) {
  6666. 'use strict'
  6667. function n(e) {
  6668. var t = {}
  6669. if (e) {
  6670. var i = e.flags
  6671. if (i) for (var n in i) i.hasOwnProperty(n) && (t[i[n]] = !0)
  6672. return t
  6673. }
  6674. return l.debug('Feature flags -> parseFeatureFlags: rawData is null.'), null
  6675. }
  6676. var r = e('./util/ajax'),
  6677. o = e('./util/showcase'),
  6678. a = e('./util/logger'),
  6679. s = '',
  6680. l = new a(i),
  6681. c = {}
  6682. t.exports = {
  6683. loadFeatureFlags: function (e) {
  6684. var t = $.Deferred()
  6685. return (
  6686. r
  6687. .get(e.urlBase + s, {
  6688. responseType: 'json',
  6689. prefetchFrom: 'user',
  6690. auth: o.getAuthorizationHeader()
  6691. })
  6692. .done(function (e) {
  6693. ;(c = n(e)), c ? t.resolve(c) : t.reject('loading-failed')
  6694. })
  6695. .fail(function () {
  6696. l.debug('Retrieval of feature flags failed.'), t.reject('loading-failed')
  6697. }),
  6698. t.promise()
  6699. )
  6700. },
  6701. getFlags: function () {
  6702. return c
  6703. },
  6704. updateDependentSettings: function (e, t) {
  6705. ;(e = e || c),
  6706. e.labels && (t.labels.enabled = !0),
  6707. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  6708. e.showcase_sdk && (t.sdkInit = !0),
  6709. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  6710. e.showcase_webvr && (t.vr.allowWebVR = !0),
  6711. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  6712. e.hide_sc_sharing && (t.share.enabled = !1)
  6713. }
  6714. }
  6715. }).call(this, '/js/featureflags.js')
  6716. },
  6717. {
  6718. './util/ajax': 181,
  6719. './util/logger': 189,
  6720. './util/showcase': 193
  6721. }
  6722. ],
  6723. 60: [
  6724. function (e, t, i) {
  6725. 'use strict'
  6726. var n =
  6727. (e('../util/common'),
  6728. {
  6729. status: 0,
  6730. set: function (e) {
  6731. if (isNaN(e)) return !1
  6732. var t = $('.progressbar')
  6733. 0 > e && (e = 0)
  6734. e > 100 && (e = 100)
  6735. var width = parseInt(t.css('width').replace('px', '')) / 100 //获取进度条总长度除以100
  6736. var barperc = e * width
  6737. var perc = Math.round(e)
  6738. var labelpos = parseInt(barperc) - 15
  6739. t.find('.bar').css('width', barperc) //已经再跑颜色的百分比
  6740. t.find('.label').css('left', labelpos) //上面跟着的字的百分比
  6741. t.find('.perc').text(perc + '%') //具体数字的百分比
  6742. this.status = e
  6743. },
  6744. done: function (e) {
  6745. return e || this.status ? ((this.status = null), this.set(100)) : this
  6746. }
  6747. })
  6748. t.exports.circleLoader = n
  6749. },
  6750. {
  6751. '../util/common': 185
  6752. }
  6753. ],
  6754. 61: [
  6755. function (e, t, i) {
  6756. 'use strict'
  6757. t.exports = Object.freeze({
  6758. CLOSE: 'modal.closer.close'
  6759. })
  6760. },
  6761. {}
  6762. ],
  6763. 62: [
  6764. function (e, t, i) {
  6765. 'use strict'
  6766. function n(e, t) {
  6767. t && (t.stopPropagation(), t.preventDefault()), e && this.emit(l.CLOSE, e), g.reset()
  6768. }
  6769. function r(e, t) {
  6770. function i() {
  6771. var t = e.offsetHeight >= $('#player').height() && e.offsetWidth >= $('#player').width()
  6772. t !== f &&
  6773. ((f = t),
  6774. t
  6775. ? (e.classList.add('closeByFooter'), h.classList.add('closeByFooter'))
  6776. : (e.classList.remove('closeByFooter'), h.classList.remove('closeByFooter')))
  6777. }
  6778. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  6779. }
  6780. var o = e('../../settings'),
  6781. a = (e('../../tag/Media/MediaEvent'), e('../../util/browser')),
  6782. s = e('../../util/common'),
  6783. l = e('./ModalCloserEvent'),
  6784. c = e('events').EventEmitter,
  6785. h = document.getElementsByClassName('footer')[0],
  6786. u = h.querySelectorAll('.close')[0],
  6787. d = null,
  6788. p = null,
  6789. f = null,
  6790. g =
  6791. (a.isMobile(),
  6792. {
  6793. open: function (e) {
  6794. e &&
  6795. (r(e),
  6796. d && u.removeEventListener('click', d, !0),
  6797. (d = n.bind(this, e.id)),
  6798. u.addEventListener('click', d, !0),
  6799. p && window.removeEventListener('resize', p, !0),
  6800. (p = r.bind(this, e)),
  6801. window.addEventListener('resize', p, !0))
  6802. },
  6803. reset: function () {
  6804. h.classList.remove('closeByFooter'),
  6805. u.removeEventListener('click', d, !0),
  6806. window.removeEventListener('resize', p, !0),
  6807. (d = p = f = null)
  6808. }
  6809. })
  6810. s.extendObject(g, c.prototype), (t.exports = g)
  6811. },
  6812. {
  6813. '../../tag/Media/MediaEvent': 131,
  6814. '../../settings': 166,
  6815. '../../util/browser': 182,
  6816. '../../util/common': 185,
  6817. './ModalCloserEvent': 61,
  6818. events: 202
  6819. }
  6820. ],
  6821. 63: [
  6822. function (e, t, i) {
  6823. 'use strict'
  6824. function n(e, t, i) {
  6825. var n = new r.GUI({
  6826. width: 400
  6827. }),
  6828. u = n.addFolder('Flydown from Dollhouse')
  6829. u.add(h.flydown, 'movementEasing', Object.keys(a)),
  6830. u.add(h.flydown, 'movementDelay', 0, 1).step(0.01),
  6831. u.add(h.flydown, 'rotationEasing', Object.keys(a)),
  6832. u.add(h.flydown, 'rotationDelay', 0, 1).step(0.01),
  6833. u.add(h.flydown, 'modelTextureDelay', 0, 1).step(0.01),
  6834. u.add(h.flydown, 'skyboxDelay', 0, 1).step(0.01),
  6835. u.add(h.dollhouseDefault, 'minPolarAngle', 0, o.Math.degToRad(50)),
  6836. u.add(h.dollhouseDefault, 'maxPolarAngle', o.Math.degToRad(50), o.Math.degToRad(170))
  6837. var d = n.addFolder('Transition between panos')
  6838. d.add(h.transition, 'blur', 0, 10).onFinishChange(function () {}),
  6839. d
  6840. .add(h.transition, 'flySpeed', 0, 10)
  6841. .step(0.01)
  6842. .onFinishChange(function () {
  6843. ;(h.transition.flyTime = 0),
  6844. d.__controllers.forEach(function (e) {
  6845. e.updateDisplay()
  6846. })
  6847. }),
  6848. d.add(h.transition, 'flyTime', 0, 5e3).onFinishChange(function () {
  6849. ;(h.transition.flySpeed = 0),
  6850. d.__controllers.forEach(function (e) {
  6851. e.updateDisplay()
  6852. })
  6853. }),
  6854. d.add(h.transition, 'aimTime', 500, 2500).step(50),
  6855. d.add(h.transition, 'aimSlowFactor', 1, 3).step(0.1),
  6856. d.add(h.transition, 'movementEasing', Object.keys(a))
  6857. var p = n.addFolder('Path Display')
  6858. p
  6859. .add(h.path, 'opacity', 0, 1)
  6860. .step(0.01)
  6861. .onFinishChange(function () {}),
  6862. p
  6863. .add(h.path, 'height', 0, 0.2)
  6864. .step(0.01)
  6865. .onFinishChange(function () {}),
  6866. p
  6867. .add(h.path, 'outsideHeight', 0, 2)
  6868. .step(0.01)
  6869. .onFinishChange(function () {}),
  6870. p
  6871. .add(h.path, 'ribbonWidth', 0.01, 0.35)
  6872. .step(0.01)
  6873. .onFinishChange(function () {}),
  6874. p
  6875. .add(h.path, 'waypointRadius', 0.01, 1.2)
  6876. .step(0.01)
  6877. .onFinishChange(function () {}),
  6878. p
  6879. .add(h.path, 'waypointPulse', 0, 3600)
  6880. .step(20)
  6881. .onFinishChange(function () {}),
  6882. p
  6883. .add(h.path, 'waypointIndoorRadius', 0.01, 1.2)
  6884. .step(0.01)
  6885. .onFinishChange(function () {}),
  6886. p
  6887. .add(h.path, 'fadeInTime', 0, 1200)
  6888. .step(10)
  6889. .onFinishChange(function () {}),
  6890. p
  6891. .add(h.path, 'fadeOutTime', 0, 1200)
  6892. .step(10)
  6893. .onFinishChange(function () {}),
  6894. p.add(h.path, 'color', Object.keys(l)).onFinishChange(function () {
  6895. ;(h.path.color = l[h.path.color]),
  6896. (h.path.colorUp = l._desat(h.path.color)),
  6897. (h.path.colorDown = l.darken(h.path.color))
  6898. }),
  6899. p.add(h, 'reticuleColor', Object.keys(l)).onFinishChange(function () {
  6900. h.reticuleColor = l[h.reticuleColor]
  6901. })
  6902. var f = n.addFolder('Warping'),
  6903. g = f.addFolder('Warp/Teleport')
  6904. g.add(h.warp, 'softPushDist', 0, 2).onFinishChange(function () {}),
  6905. g
  6906. .add(h.warp, 'softPushEnd', 0, 1)
  6907. .step(0.01)
  6908. .onFinishChange(function () {}),
  6909. g.add(h.warp, 'softBendAngle', 0, 45).onFinishChange(function () {}),
  6910. g.add(h.warp, 'softBendTilt', 0, 45).onFinishChange(function () {}),
  6911. g
  6912. .add(h.warp, 'softBendEnd', 0, 1)
  6913. .step(0.01)
  6914. .onFinishChange(function () {}),
  6915. g.add(h.warp, 'burnsAngle', 0, 30).onFinishChange(function () {}),
  6916. g.add(h.warp, 'minBurnsAngle', 0, 10).onFinishChange(function () {}),
  6917. g.add(h.warp, 'brakeStrength', 1, 8).onFinishChange(function () {}),
  6918. g
  6919. .add(h.warp, 'minBrakeAngle', 0, 5)
  6920. .step(0.01)
  6921. .onFinishChange(function () {}),
  6922. g
  6923. .add(h.warp, 'maxBrakeAngle', 0, 5)
  6924. .step(0.01)
  6925. .onFinishChange(function () {}),
  6926. g.add(h.path, 'mapGuides').onFinishChange(function () {}),
  6927. g
  6928. .add(h.warp, 'teleportTime', 0, 5e3)
  6929. .step(10)
  6930. .onFinishChange(function () {}),
  6931. g
  6932. .add(h.warp, 'outsideTime', 0, 5e3)
  6933. .step(10)
  6934. .onFinishChange(function () {}),
  6935. g.add(h.path, 'typ', Object.keys(c)).onFinishChange(function () {
  6936. h.path.typ = c[h.path.typ]
  6937. }),
  6938. g
  6939. .add(h.warp, 'loop')
  6940. .onChange(function () {})
  6941. .onFinishChange(function () {
  6942. t.endlessLoop = h.warp.loop
  6943. }),
  6944. g
  6945. .add(h.warp, 'walkSlideShowThreshhold', 1, 1e4)
  6946. .step(1)
  6947. .onFinishChange(function () {}),
  6948. g
  6949. .add(h.warp, 'walkExtraPanosDistance', 0, 3)
  6950. .step(0.1)
  6951. .onFinishChange(function () {}),
  6952. g
  6953. .add(h.transition, 'fastForwardFactor', 1, 10)
  6954. .step(1)
  6955. .onFinishChange(function () {})
  6956. var m = f.addFolder('Long Warp Only')
  6957. m
  6958. .add(h.warp, 'minWarpTime', 0, 5e3)
  6959. .step(10)
  6960. .onFinishChange(function () {
  6961. ;(h.warp.flySpeed = 0),
  6962. m.__controllers.forEach(function (e) {
  6963. e.updateDisplay()
  6964. })
  6965. }),
  6966. m
  6967. .add(h.warp, 'timePerMeter', 0, 5e3)
  6968. .step(10)
  6969. .onFinishChange(function () {}),
  6970. m
  6971. .add(h.warp, 'lookAheadMax', 0.01, 1)
  6972. .step(0.01)
  6973. .onFinishChange(function () {}),
  6974. m
  6975. .add(h.warp, 'lookAheadDist', 0.01, 4)
  6976. .step(0.01)
  6977. .onFinishChange(function () {}),
  6978. m
  6979. .add(h.warp, 'maxTurnPerSec', 0, 720)
  6980. .step(1)
  6981. .onFinishChange(function () {}),
  6982. m
  6983. .add(h.warp, 'maxAimPerSec', 0, 720)
  6984. .step(1)
  6985. .onFinishChange(function () {}),
  6986. m
  6987. .add(h.warp, 'turnFriction', 0, 1)
  6988. .step(0.01)
  6989. .onFinishChange(function () {}),
  6990. m
  6991. .add(h.warp, 'walkDelay', 0, 2e3)
  6992. .step(10)
  6993. .onFinishChange(function () {}),
  6994. m
  6995. .add(h.transition, 'flytimeMaxDistanceThreshold', 0, 25)
  6996. .step(10)
  6997. .onFinishChange(function () {}),
  6998. m
  6999. .add(h.warp, 'walkMaxDist', 0, 100)
  7000. .step(1)
  7001. .onFinishChange(function () {})
  7002. var v = n.addFolder('Warp Esoterica')
  7003. v
  7004. .add(h.warp, 'nearPanoDist', 0.01, 12)
  7005. .step(0)
  7006. .onFinishChange(function () {}),
  7007. v.add(h.warp, 'blur', 0.01, 1).onFinishChange(function () {}),
  7008. v
  7009. .add(h.warp, 'flySpeed', 0, 10)
  7010. .step(0.01)
  7011. .onFinishChange(function () {
  7012. ;(h.warp.minWarpTime = 0),
  7013. v.__controllers.forEach(function (e) {
  7014. e.updateDisplay()
  7015. })
  7016. }),
  7017. v.add(h.warp, 'showBunny').onFinishChange(function () {}),
  7018. v
  7019. .add(h.warp, 'fastTime', 0, 2500)
  7020. .step(10)
  7021. .onFinishChange(function () {}),
  7022. v.add(h.warp, 'movementEasing', Object.keys(a))
  7023. var A = n.addFolder('Misc')
  7024. A.add(h, 'dollhouseFOV', 10, 180).onChange(function () {
  7025. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  7026. }),
  7027. A.add(h, 'insideFOV', 10, 180).onChange(function () {
  7028. i.cameras[s.PANORAMA].fov = h.insideFOV
  7029. }),
  7030. A.add(h, 'insideLookSpeed', 0.01, 0.3)
  7031. .step(0.01)
  7032. .onChange(function () {}),
  7033. A.add(h, 'rotationAccelerationInside', 0.1, 10)
  7034. .step(0.1)
  7035. .onChange(function () {}),
  7036. A.add(h, 'rotationAccelerationOutside', 0.1, 10)
  7037. .step(0.1)
  7038. .onChange(function () {})
  7039. var y = n.addFolder('Navigation')
  7040. y.add(h.navigation, 'panoScores').onFinishChange(function () {
  7041. h.navigation.panoScores ||
  7042. e.panos.forEach(function (e) {
  7043. e.floor.remove(e.text3d), (e.text3d = null)
  7044. })
  7045. }),
  7046. y.add(h.navigation, 'mouseDirection'),
  7047. y.add(h.navigation, 'filterStrictness', 0, 1),
  7048. y.add(h.navigation, 'angleFactor', -60, 0),
  7049. y.add(h.navigation, 'directionFactor', 1, 20),
  7050. y.add(h.navigation, 'distanceFactor', -5, 5),
  7051. y.add(h.navigation, 'optionalityFactor', 0.1, 10)
  7052. var C = n.addFolder('tags'),
  7053. I = C.addFolder('Tag Creation')
  7054. I.add(h.tags.pole, 'enabled').name('poleEnabled'),
  7055. I.add(h.tags.pole, 'height', 0, 2.5).step(0.01).name('poleHeight'),
  7056. I.add(h.tags.pole, 'width', 1, 10).step(1).name('poleWidth'),
  7057. I.add(h.tags.pole, 'opacity', 0.1, 1).step(0.1).name('poleOpacity')
  7058. var E = C.addFolder('Visibility')
  7059. E.add(h.tags.visibility, 'anyDistance'),
  7060. E.add(h.tags.visibility, 'visibleDistance', 0.1, 30).step(0.1),
  7061. E.add(h.tags.visibility, 'cameraClearance', 0, 1).step(0.01),
  7062. E.add(h.tags.visibility, 'hideViaFloor'),
  7063. E.add(h.tags.visibility, 'hideOffScreenDisc').name('hideEdgeDisc'),
  7064. E.add(h.tags.visibility, 'hideOffScreenObject').name('hideEdgeObject')
  7065. var b = C.addFolder('Disc Parameters')
  7066. b.add(h.tags.disc.scale, 'nearBound', 0.1, 10).step(0.1),
  7067. b.add(h.tags.disc.scale, 'farBound', 0.1, 20).step(0.1).listen(),
  7068. b.add(h.tags.disc.scale, 'linkFarBound').onChange(function (e) {
  7069. e &&
  7070. (h.tags.disc.scale.farBound =
  7071. h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  7072. }),
  7073. b
  7074. .add(h.tags.disc.scale, 'linkPercent', 0, 100)
  7075. .step(1)
  7076. .onChange(function (e) {
  7077. h.tags.disc.scale.linkFarBound &&
  7078. (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  7079. }),
  7080. b.add(h.tags.disc.scale, 'maxSize', 40, 200).step(1),
  7081. b.add(h.tags.disc.scale, 'minSize', 20, 100).step(1),
  7082. b.add(h.tags.disc.scale, 'responsiveness', 0, 100).step(1)
  7083. var w = C.addFolder('Navigate')
  7084. w.add(h.tags.navigate, 'nearestPano').name('nearestPano'),
  7085. w.add(h.tags.navigate, 'lineOfSight').name('lineOfSight'),
  7086. w.add(h.tags.navigate, 'reactivate').name('reactivate'),
  7087. w.add(h.tags.navigate, 'aimAt', ['disc', 'object', 'pole', 'nothing']).name('aim at'),
  7088. w.add(h.tags.navigate, 'tiltTolerance', 0, 50).step(1),
  7089. w.add(h.tags.navigate, 'rotateSpeedFactor', 0, 5).step(0.1)
  7090. var _ = n.addFolder('Debug')
  7091. _.add(h, 'wireframe').onFinishChange(function () {
  7092. e.chunks.forEach(function (t) {
  7093. t.material &&
  7094. (t.wireframeTwin ||
  7095. ((t.wireframeTwin = new o.WireframeHelper(t)),
  7096. (t.wireframeTwin.material.depthWrite = !1),
  7097. (t.wireframeTwin.material.depthTest = !1),
  7098. (t.wireframeTwin.material.opacity = 0.5),
  7099. (t.wireframeTwin.material.transparent = !0)),
  7100. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  7101. })
  7102. }),
  7103. _.add(h, 'skyboxWireframe').onFinishChange(function () {
  7104. h.skyboxWireframe
  7105. ? ((e.skybox.wireframe = new o.WireframeHelper(e.skybox)),
  7106. e.add(e.skybox.wireframe))
  7107. : (e.remove(e.skybox.wireframe), (e.skybox.wireframe = null))
  7108. }),
  7109. _.add(h, 'showSweeps').onFinishChange(function () {
  7110. e.setSweepVisibility(h.showSweeps)
  7111. }),
  7112. _.add(h, 'showMesh').onFinishChange(function () {
  7113. e.chunks.forEach(function (e) {
  7114. e.visible = h.showMesh
  7115. })
  7116. }),
  7117. _.add(h, 'showFloors').onFinishChange(function () {
  7118. e.floors.forEach(function (e) {
  7119. e.collider.children.forEach(function (e) {
  7120. e.material.visible = h.showFloors
  7121. })
  7122. })
  7123. }),
  7124. _.add(h, 'showSkyboxes').onFinishChange(function () {
  7125. e.panos.forEach(function (e) {
  7126. e.skyboxMesh.visible = h.showSkyboxes
  7127. })
  7128. }),
  7129. _.add(h, 'showNeighbors').onChange(function () {}),
  7130. _.add(e, 'alpha', 0, 1)
  7131. }
  7132. var r = e('../lib/dat.gui'),
  7133. o = e('three'),
  7134. a = e('../util/easing'),
  7135. s = e('../enum/Viewmode'),
  7136. l = e('../enum/Colors'),
  7137. c = e('../enum/WarpStyle'),
  7138. h = e('../settings')
  7139. e('../tag/tag')
  7140. ;(r.GUI.prototype.removeFolder = function (e) {
  7141. var t = this.__folders[e]
  7142. t &&
  7143. (t.close(),
  7144. this.__ul.removeChild(t.domElement.parentNode),
  7145. delete this.__folders[e],
  7146. this.onResize())
  7147. }),
  7148. (t.exports.toggle = n)
  7149. },
  7150. {
  7151. '../enum/Colors': 19,
  7152. '../enum/Viewmode': 51,
  7153. '../enum/WarpStyle': 52,
  7154. '../lib/dat.gui': 93,
  7155. '../tag/tag': 123,
  7156. '../settings': 166,
  7157. '../util/easing': 186,
  7158. three: 217
  7159. }
  7160. ],
  7161. 64: [
  7162. function (e, t, i) {
  7163. ;(function (i) {
  7164. 'use strict'
  7165. function n(e, t, i, n) {
  7166. $('.gui-error .error-problem-text').text(e),
  7167. $('.gui-error .error-solution-text').text(t),
  7168. $('.gui-error .error-explanation').text(i),
  7169. $('.gui-error .error-actions').html(n),
  7170. $(window).resize(),
  7171. $('.gui-error').fadeIn(),
  7172. $('#bottom-logo').fadeIn()
  7173. }
  7174. function r(e) {
  7175. var t = [
  7176. '<div class="browser-tiles">',
  7177. '<div class="tile">',
  7178. '<a href="https://www.google.com/chrome/browser/" target="_blank">',
  7179. '<img class="icon" src="images/icon_Google_Chrome_2011.png" ',
  7180. 'rel="tiletip" title="Chrome"></a>',
  7181. '</div>',
  7182. '<div class="tile">',
  7183. '<a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">',
  7184. '<img class="icon" src="images/icon_Mozilla_Firefox.png" ',
  7185. 'rel="tiletip" title="Firefox"></a>',
  7186. '</div>',
  7187. '<div class="tile">',
  7188. '<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie" target="_blank">',
  7189. '<img class="icon" src="images/icon_Internet_Explorer_10.png" ',
  7190. 'rel="tiletip" title="Internet Explorer"></a>',
  7191. '</div>',
  7192. '<div class="tile">',
  7193. '<a href="https://support.apple.com/en-us/HT204416" target="_blank">',
  7194. '<img class="icon" src="images/icon_MacOSX_Safari.png" ',
  7195. 'rel="tiletip" title="Safari"></a>',
  7196. '</div>',
  7197. '</div>'
  7198. ].join('')
  7199. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  7200. s.isMobile() ||
  7201. $('[rel=tiletip]').tooltip({
  7202. placement: 'bottom',
  7203. delay: {
  7204. show: 50,
  7205. hide: 0
  7206. },
  7207. trigger: 'hover',
  7208. viewport: {
  7209. selector: 'body',
  7210. padding: 10
  7211. }
  7212. })
  7213. }
  7214. function o() {
  7215. var e = s.isMobile()
  7216. ? ''
  7217. : '<span class="link install-browser">' +
  7218. h.ERROR_GENERIC_ACTIONS_2 +
  7219. '</span>' +
  7220. h.ERROR_GENERIC_ACTIONS_3,
  7221. t = [h.ERROR_GENERIC_ACTIONS_1, e].join('')
  7222. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, '', t),
  7223. s.isMobile() ||
  7224. $('.install-browser').on('click touchstart', function (e) {
  7225. e.preventDefault(), e.stopPropagation(), r(' ')
  7226. })
  7227. }
  7228. function a(e) {
  7229. if (
  7230. ($('head title').text(c.pageTitle),
  7231. $('#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo').hide(),
  7232. $('#gui-loading').fadeOut(250),
  7233. $('#quick-blackout').hide(),
  7234. l.track('showcase_error', {
  7235. error_key: e
  7236. }),
  7237. h.locale || h.init(),
  7238. 'webgl-unsupported' === e)
  7239. )
  7240. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM)
  7241. else if ('webgl-ios' === e)
  7242. n(
  7243. h.ERROR_WEBGL_IOS_PROBLEM,
  7244. h.ERROR_WEBGL_IOS_SOLUTION,
  7245. '',
  7246. h.ERROR_WEBGL_IOS_ACTIONS_1 +
  7247. '<strong>' +
  7248. h.ERROR_WEBGL_IOS_ACTIONS_2 +
  7249. '</strong>.'
  7250. )
  7251. else if ('webgl-safari' === e)
  7252. n(
  7253. h.ERROR_WEBGL_SAFARI_PROBLEM,
  7254. '',
  7255. '',
  7256. h.ERROR_WEBGL_SAFARI_ACTIONS_1 +
  7257. '<strong>' +
  7258. h.ERROR_WEBGL_SAFARI_ACTIONS_2 +
  7259. '</strong>. ' +
  7260. h.ERROR_WEBGL_SAFARI_ACTIONS_3 +
  7261. '<strong>' +
  7262. h.ERROR_WEBGL_SAFARI_ACTIONS_4 +
  7263. '</strong>.'
  7264. )
  7265. else if ('webgl-generic' === e) o()
  7266. else if ('missing-urls' === e)
  7267. n(h.ERROR_MISSING_URLS_PROBLEM, '', h.ERROR_MISSING_URLS_EXPLANATION)
  7268. else if ('loading-failed' === e)
  7269. n(
  7270. h.ERROR_LOADING_FAILED_PROBLEM,
  7271. '',
  7272. '',
  7273. h.ERROR_LOADING_FAILED_ACTIONS_1 +
  7274. '<a class="link" target="_blank" href=' +
  7275. p +
  7276. '>' +
  7277. h.ERROR_LOADING_FAILED_ACTIONS_2 +
  7278. '</a>.'
  7279. )
  7280. else {
  7281. if ('loading-failed-maintenance' !== e) return void d.error('Unhandled error: ' + e)
  7282. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  7283. }
  7284. }
  7285. var s = e('./../util/browser'),
  7286. l = e('./../analytics'),
  7287. c = e('./../settings'),
  7288. h = e('../localization/localize'),
  7289. u = e('./../util/logger'),
  7290. d = new u(i),
  7291. p = '"https://support.port.com/hc/articles/208220058"'
  7292. t.exports.error = a
  7293. }).call(this, '/js/gui/error.js')
  7294. },
  7295. {
  7296. '../localization/localize': 108,
  7297. './../analytics': 4,
  7298. './../settings': 166,
  7299. './../util/browser': 182,
  7300. './../util/logger': 189
  7301. }
  7302. ],
  7303. 65: [
  7304. function (e, t, i) {
  7305. ;(function (i) {
  7306. 'use strict'
  7307. function n() {
  7308. ;(Ue = []),
  7309. je.floors.visible && Ue.push('.gui-floor', '.gui-floor-title'),
  7310. Ue.push('.hideTarget', '.pinTop.right')
  7311. }
  7312. function r() {
  7313. for (var e in je)
  7314. if (je.hasOwnProperty(e)) {
  7315. var t = je[e]
  7316. if (!t.visible) for (var i = 0; i < t.elements.length; i++) $(t.elements[i]).hide()
  7317. }
  7318. je.highlight.visible && $('.pinBottom').addClass('highlightExists'),
  7319. je.tourControls.visible === !1 && $('#drawer').addClass('fullWidth'),
  7320. n()
  7321. }
  7322. function o(e, t) {
  7323. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying
  7324. $('#gui-zoomin').toggle(i), $('#gui-zoomout').toggle(i)
  7325. }
  7326. function a() {
  7327. c(),
  7328. $('.pinBottom').toggleClass('open'),
  7329. $('#drawer').toggleClass('open'),
  7330. $('.footer').toggleClass('open'),
  7331. $('#drawer').hasClass('open')
  7332. ? ($('#pullTab .icon').attr('data-original-title', Re.CLOSE_HIGHLIGHTS),
  7333. Ze('highlights'))
  7334. : ($('#pullTab .icon').attr('data-original-title', Re.OPEN_HIGHLIGHTS),
  7335. ie.resetDrawer()),
  7336. setTimeout(
  7337. function () {
  7338. $('#pullTab').toggleClass('opened')
  7339. },
  7340. $('#drawer').hasClass('open') ? 0 : Q.highlightAnimationDuration
  7341. ),
  7342. $('.pinBottom').hasClass('open') &&
  7343. s($('.vr-popup')) &&
  7344. $('.vr-popup').is(':visible') &&
  7345. Ae.dismiss()
  7346. }
  7347. function s(e) {
  7348. var t
  7349. 'none' !== e.css('display')
  7350. ? (t = e.position().top + e.outerHeight())
  7351. : (e.attr('style', 'visibility: hidden'),
  7352. (t = e.position().top + e.outerHeight()),
  7353. e.attr('style', 'display: none'))
  7354. var i = $('#player').outerHeight(),
  7355. n = i - 130
  7356. return n < t + 25
  7357. }
  7358. function l(e) {
  7359. 'touchstart' === e.type && e.preventDefault(), e.stopPropagation()
  7360. }
  7361. function c() {
  7362. W && (W.reload(), W.init())
  7363. }
  7364. function h(e) {
  7365. ne.show(e), r()
  7366. }
  7367. function u(e) {
  7368. ne.progress(e)
  7369. }
  7370. function d(e, t, i) {
  7371. var n = t.player
  7372. $('#gui-thumb').fadeOut(2500),
  7373. ne.hide(function () {
  7374. Ge = !1
  7375. }),
  7376. me.init(e, i),
  7377. de.finishSetup(Object.keys(e.tags).length),
  7378. i.on(Te.IMAGE_OPENED, Ze.bind(this, 'tag'))
  7379. var s = function () {
  7380. i.dismissExaminedTag(), i.disableHovering()
  7381. }
  7382. Ae.on(ye.OPENED, s), Ce.on(Me.OPENED, s), he.on(ue.OPENED, s), fe.on(ge.OPENED, s)
  7383. var l = i.enableHovering.bind(i)
  7384. if (
  7385. (Ae.on(ye.CLOSED, l),
  7386. Ce.on(Me.CLOSED, l),
  7387. he.on(ue.CLOSED, l),
  7388. fe.on(ge.CLOSED, l),
  7389. Q.labels.enabled && Object.keys(e.labels).length,
  7390. e.floors.length <= 1 || !je.floors.visible
  7391. ? (je.floors.visible = !1)
  7392. : (y(e, t), C(e.currentFloor, n.mode)),
  7393. getQueryVariable('m') === '372' && ((je.floors.visible = 1), y(e, t)),
  7394. r(),
  7395. o(t, t.player),
  7396. $('#gui').fadeIn(1500),
  7397. je.highlight.visible &&
  7398. (2 !== Q.startHighlights || e.has360Views) &&
  7399. setTimeout(function () {
  7400. a(),
  7401. ((!e.has360Views && 1 !== Q.startHighlights) ||
  7402. (e.has360Views && 0 === Q.startHighlights)) &&
  7403. setTimeout(a, 2e3)
  7404. }, 2e3),
  7405. !K.isMobile())
  7406. )
  7407. for (
  7408. var c = [
  7409. 'a',
  7410. '#title-toggle',
  7411. '.next-button',
  7412. '.prev-button',
  7413. '.gui-floor',
  7414. '.meta-toggle',
  7415. '.thumbImg',
  7416. 'logo-button'
  7417. ],
  7418. h = 0;
  7419. h < c.length;
  7420. h++
  7421. )
  7422. $(c[h]).addClass('hasHover')
  7423. O(e), de.setupToggling()
  7424. //xzw:
  7425. window.editHotPanel && editHotPanel()
  7426. //czj
  7427. navBorderRadius(e)
  7428. //czj 编辑界面
  7429. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  7430. window.EditTools && new EditTools(n.sceneRenderer)
  7431. }
  7432. function navBorderRadius(e) {
  7433. var pullTab = $('#pullTab'),
  7434. mobileRadius = {
  7435. bottom: {
  7436. 'border-bottom-left-radius': '10px',
  7437. 'border-bottom-right-radius': '10px'
  7438. },
  7439. top: { 'border-top-left-radius': '10px', 'border-top-right-radius': '10px' }
  7440. },
  7441. topRadius = {
  7442. bottom: { 'border-top-right-radius': '10px', 'border-bottom-right-radius': '10px' },
  7443. top: { 'border-bottom-left-radius': '10px', 'border-top-left-radius': '10px' }
  7444. }
  7445. function BorderRadius(bottom, top) {
  7446. $('#gui-modes-map > div:visible:last').css(bottom)
  7447. if (pullTab.is(':visible')) {
  7448. $('.viewContainer > div:visible:first').css(top)
  7449. } else {
  7450. $('#gui-modes-map > div:visible:first').css(top)
  7451. }
  7452. }
  7453. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
  7454. BorderRadius(mobileRadius.bottom, mobileRadius.top)
  7455. } else {
  7456. BorderRadius(topRadius.bottom, topRadius.top)
  7457. }
  7458. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  7459. if (window.DATA.model.special || window.DATA.special) {
  7460. window.specialScene && specialScene.special().afterImplement()
  7461. }
  7462. }
  7463. function p(e) {
  7464. e || (e = 0),
  7465. (We = !1),
  7466. window.setTimeout(
  7467. function () {
  7468. We || ((ze = !0), $('#gui-spinner').stop(!0, !0).show())
  7469. }.bind(this),
  7470. e
  7471. )
  7472. }
  7473. function f() {
  7474. $('#gui-spinner').stop(!0, !0), $('#gui-spinner').fadeOut(1e3), (We = !0), (ze = !1)
  7475. }
  7476. function g(e, t) {
  7477. var i = e.mode,
  7478. n = t || e.currentPano
  7479. $('#gui-modes-dollhouse').toggleClass('active', i === _e.DOLLHOUSE),
  7480. $('#gui-modes-floorplan').toggleClass('active', i === _e.FLOORPLAN),
  7481. $('#gui-modes-inside').toggleClass('active', i === _e.PANORAMA),
  7482. i === _e.PANORAMA
  7483. ? ($('#view-controllers').slideUp(500),
  7484. Q.show360Views.enabled && !n.isAligned()
  7485. ? ($('.gui-floor').addClass('hidden'),
  7486. $('#gui-modes-outside').addClass('desktop-only'))
  7487. : ($('.gui-floor').removeClass('hidden'),
  7488. $('#gui-modes-outside').removeClass('desktop-only')),
  7489. $('#gui-modes-outside').removeClass('hidden'))
  7490. : i !== _e.TRANSITIONING &&
  7491. (f(),
  7492. (Be = i),
  7493. $('#gui-modes-outside').addClass('hidden'),
  7494. e.model.has360Views && $('.gui-floor').removeClass('hidden'),
  7495. $('#view-controllers').is(':visible') ||
  7496. $('#view-controllers').slideDown(Q.guiAnimationSpeed))
  7497. }
  7498. function m(e, t) {
  7499. var i = t.player
  7500. $('#gui-modes-inside').on('mousedown touchstart', function (e) {
  7501. l(e),
  7502. J.updateInteraction(Se.InteractionGui, 'inside-button'),
  7503. J.track('USER', {
  7504. event_type: 'showcase_gui',
  7505. gui_action: 'click_inside_mode_button'
  7506. }),
  7507. t.changeMode(_e.PANORAMA)
  7508. }),
  7509. $('#gui-modes-outside')
  7510. .find('a')
  7511. .on('click', function (e) {
  7512. l(e),
  7513. J.track('showcase_gui', {
  7514. gui_action: 'click_outside_mode_button'
  7515. }),
  7516. t.changeMode(Be)
  7517. }),
  7518. $('#gui-modes-floorplan').on('click', function (e) {
  7519. l(e),
  7520. i.mode !== _e.FLOORPLAN &&
  7521. (J.track('showcase_gui', {
  7522. gui_action: 'click_floorplan_mode_button'
  7523. }),
  7524. t.changeMode(_e.FLOORPLAN))
  7525. }),
  7526. $('#gui-modes-dollhouse').on('click', function (e) {
  7527. l(e),
  7528. i.mode !== _e.DOLLHOUSE &&
  7529. (J.track('showcase_gui', {
  7530. gui_action: 'click_dollhouse_mode_button'
  7531. }),
  7532. t.changeMode(_e.DOLLHOUSE))
  7533. })
  7534. }
  7535. function v(e, t) {
  7536. function i() {
  7537. document.getElementById('vr').classList.remove('hidden'),
  7538. Q.vr.allowWebVR
  7539. ? K.getVRDisplay().then(
  7540. function (e) {
  7541. K.supportsFullscreen()
  7542. ? n(e)
  7543. : (De.warn('Unable to use WebVR when full screen is not supported'),
  7544. $('.improper-embed').toggleClass('hidden', !1),
  7545. r())
  7546. },
  7547. function (e) {
  7548. r()
  7549. }
  7550. )
  7551. : r()
  7552. }
  7553. function n(i) {
  7554. De.info(i.displayName + ' detected, VR button activates WebVR experience'),
  7555. Ie.init(e.data, t, i, q),
  7556. Ie.on(Ee.OPENED, Ze.bind(gui, 'vr')),
  7557. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  7558. }
  7559. function r() {
  7560. De.info('WebVR support not found, VR button activates native app VR modal'),
  7561. Ae.init(e.data, q),
  7562. Ae.on(
  7563. ye.OPENED,
  7564. (function () {
  7565. var e = document.getElementById('vr-modal')
  7566. return function () {
  7567. Ze('vr'), le.open(e)
  7568. }
  7569. })()
  7570. ),
  7571. Ae.on(ye.CLOSED, le.reset)
  7572. }
  7573. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash('mls', 0)) {
  7574. /*********************** 方奕卓 VR功能事件监听 ********************/
  7575. K.isMobile() && $('#vr').css('display', '') // 显示vr功能按钮
  7576. switch (Q.vr.option) {
  7577. case Pe.CONTEXTUAL:
  7578. i()
  7579. break
  7580. case Pe.ANDROID:
  7581. K.detectAndroid() && i()
  7582. break
  7583. case Pe.NONE:
  7584. }
  7585. }
  7586. }
  7587. function A(e, t) {
  7588. $('#play').on('mousedown touchstart', function (e) {
  7589. l(e)
  7590. Ze('tour')
  7591. ve.play()
  7592. J.trackAlways('showcase_gui', {
  7593. gui_action: 'play_highlights'
  7594. })
  7595. }),
  7596. (window.startAndPlay = function (e) {
  7597. // l(e);
  7598. Ze('tour')
  7599. ve.play()
  7600. J.trackAlways('showcase_gui', {
  7601. gui_action: 'play_highlights'
  7602. })
  7603. })
  7604. $('#pause').on('mousedown touchstart', function (e) {
  7605. l(e),
  7606. ve.pause(),
  7607. J.trackAlways('showcase_gui', {
  7608. gui_action: 'pause_highlights'
  7609. })
  7610. }),
  7611. $('#gui-zoomin')
  7612. .find('a')
  7613. .on('click', function (e) {
  7614. l(e), t.player.zoomInIncrementally()
  7615. }),
  7616. $('#gui-zoomout')
  7617. .find('a')
  7618. .on('click', function (e) {
  7619. l(e), t.player.zoomOutIncrementally()
  7620. })
  7621. }
  7622. function y(e, t) {
  7623. for (var i = $('.gui-floor'), n = 0; n < e.floors.length; n++) {
  7624. if (getQueryVariable('m') === '372') continue
  7625. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(
  7626. e.floors.get(n).name
  7627. )
  7628. $('.gui-floor').find('.container').prepend(r)
  7629. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  7630. }
  7631. i
  7632. .find('.container')
  7633. .prepend(
  7634. '<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' +
  7635. Re.FLOOR_ALL +
  7636. '</div>'
  7637. ),
  7638. i.on('click', function (e) {
  7639. l(e), Ze('floor'), i.toggleClass('open')
  7640. }),
  7641. $('.floorChoice').on('click', function (e) {
  7642. l(e)
  7643. var n = $(this).data('index')
  7644. 'all' !== n
  7645. ? (J.updateInteraction(Se.InteractionGui, 'floor-control'),
  7646. t.player.gotoFloor(n),
  7647. J.track('showcase_gui', {
  7648. gui_action: 'click_floor_select_button',
  7649. interaction_source: 'gui'
  7650. }))
  7651. : (J.updateInteraction(Se.InteractionGui, 'floor-control'),
  7652. Ze('move'),
  7653. t.allFloors(),
  7654. J.track('showcase_gui', {
  7655. gui_action: 'click_toggle_all_floors_button',
  7656. interaction_source: 'gui'
  7657. })),
  7658. i.removeClass('open')
  7659. })
  7660. }
  7661. function C(e, t) {
  7662. e &&
  7663. (t === _e.DOLLHOUSE || t === _e.FLOORPLAN
  7664. ? ($('.allFloorBtn').show(),
  7665. $('.gui-floor-icon').hide(),
  7666. $('.gui-floor-title').show())
  7667. : ($('.allFloorBtn').hide(),
  7668. $('.gui-floor-icon').show(),
  7669. $('.gui-floor-title').hide()),
  7670. e.model.allFloorsVisible
  7671. ? ($('.gui-floor-title').text(Re.FLOOR_ALL),
  7672. $('.gui-floor-number').text(Re.FLOOR_ALL),
  7673. $('.floorChoice').removeClass('active'),
  7674. $('.floorChoice[data-index="all"]').addClass('active'))
  7675. : ($('.gui-floor-title').text(e.name),
  7676. $('.gui-floor-number').text(' ' + (e.floorIndex + 1)),
  7677. $('.floorChoice').removeClass('active'),
  7678. $('.floorChoice[data-index=' + e.floorIndex + ']').addClass('active')))
  7679. }
  7680. function I(e) {
  7681. return e.describe().inTransition
  7682. }
  7683. function b(e, t, i) {
  7684. Fe = e.heroLocations.length
  7685. var n = '<li class="thumbImg" data-index=""><img src=""></li>',
  7686. r = 100 / Fe + '%',
  7687. o = $('#thumb-container'),
  7688. a = $('#progressBar')
  7689. $('#status').find('.totalSteps').text(Fe)
  7690. for (var s = 0; s < Fe; s++) {
  7691. var c = e.heroLocations[s],
  7692. h = $(n)
  7693. var thumbUrl
  7694. if (c.heroLocations) {
  7695. //有子项,选第一张截图
  7696. thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl) //.replace('https://','').replace('http://','')
  7697. } else {
  7698. thumbUrl = manage.dealURL(c.thumbUrl) //.replace('https://','').replace('http://','')
  7699. }
  7700. h.attr('data-index', s)
  7701. je.highlight.visible && h.find('img').attr('src', thumbUrl)
  7702. if (c.name) {
  7703. var u = $('<div class="overlay"></div>').text(c.name)
  7704. h.prepend(u)
  7705. }
  7706. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  7707. var d = e.panos.get(c.panoId),
  7708. p = d && !d.isAligned(),
  7709. f = p
  7710. ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>'
  7711. : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>'
  7712. h.prepend(f)
  7713. }
  7714. o.append(h),
  7715. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  7716. }
  7717. ;(j = 144 * Fe),
  7718. (Y = 111 * Fe),
  7719. $('.thumbImg').on('mouseover', function () {
  7720. I(t) || i.showPathToHeroLocation([$(this).data('index'), 0]) //改
  7721. }),
  7722. $('.thumbImg').on('mouseout', function () {
  7723. t.clearPath()
  7724. }),
  7725. $('.thumbImg').on('click', function (e) {
  7726. l(e)
  7727. var i = $(this)
  7728. J.updateInteraction(Se.InteractionGui, 'thumbnail'),
  7729. J.trackAlways('showcase_gui', {
  7730. gui_action: 'click_highlight'
  7731. }),
  7732. t.goToHighlight([i.data('index'), 0]) //改
  7733. }),
  7734. $('.sectionCont').on('click', function (e) {
  7735. const imgActIndex = $(this).data('index')
  7736. console.log('imgActIndex')
  7737. t.goToHighlight([imgActIndex, 0])
  7738. }),
  7739. $('.previous')
  7740. .find('a')
  7741. .on('click', function (e) {
  7742. l(e),
  7743. J.trackAlways('showcase_gui', {
  7744. gui_action: 'prev_highlight'
  7745. }),
  7746. t.prevHighlight()
  7747. }),
  7748. $('.next')
  7749. .find('a')
  7750. .on('click', function (e) {
  7751. l(e),
  7752. J.trackAlways('showcase_gui', {
  7753. gui_action: 'next_highlight'
  7754. }),
  7755. t.nextHighlight()
  7756. }),
  7757. $('#drawer').on('mouseleave', function (e) {
  7758. l(e)
  7759. var t
  7760. try {
  7761. t = new MouseEvent('mouseup', {
  7762. clientX: e.clientX,
  7763. clientY: e.clientY,
  7764. screenX: e.screenX,
  7765. screenY: e.screenY
  7766. })
  7767. } catch (i) {
  7768. ;(t = document.createEvent('MouseEvents')),
  7769. t.initMouseEvent(
  7770. 'mouseup',
  7771. e.bubbles,
  7772. e.cancelable,
  7773. e.view,
  7774. e.detail,
  7775. e.screenX,
  7776. e.screenY,
  7777. e.clientX,
  7778. e.clientY,
  7779. e.ctrlKey,
  7780. e.altKey,
  7781. e.shiftKey,
  7782. e.metaKey,
  7783. e.button,
  7784. e.relatedTarget
  7785. )
  7786. }
  7787. document.dispatchEvent(t)
  7788. }),
  7789. (W = new Sly($('#scrollFrame'), {
  7790. horizontal: !0,
  7791. itemNav: 'centered',
  7792. smart: !0,
  7793. scrollTrap: !0,
  7794. scrollBy: 1,
  7795. mouseDragging: !0,
  7796. touchDragging: !0,
  7797. speed: 300,
  7798. dragHandle: !0,
  7799. dynamicHandle: !0,
  7800. clickBar: !0,
  7801. scrollBar: $('#scroller'),
  7802. activateOn: null
  7803. }).init()),
  7804. W.on('active', function (e, t) {
  7805. ;(Ve = t),
  7806. Ze('tour'),
  7807. $('.step').removeClass('active'),
  7808. $('#status')
  7809. .find('.curIdx')
  7810. .text(t + 1)
  7811. for (var i = 0; i <= t; i++)
  7812. $('#progressBar')
  7813. .find("[data-idx='" + i + "']")
  7814. .addClass('active')
  7815. }),
  7816. w()
  7817. //add :
  7818. let scrollFrame = $(W.frame)
  7819. scrollFrame.on('wheel.sly', function () {
  7820. lastMoveScrollTime = Date.now()
  7821. })
  7822. let dragstart
  7823. /* scrollFrame.on("pointerdown", function() {
  7824. dragstart = true
  7825. })
  7826. scrollFrame.on("pointerup", function() {
  7827. dragstart = false
  7828. }) */
  7829. scrollFrame.on('pointermove', function () {
  7830. //if(dragstart){
  7831. lastMoveScrollTime = Date.now()
  7832. //}
  7833. })
  7834. }
  7835. function w() {
  7836. var e = $('#player').width() - 20,
  7837. t = $('#scroller'),
  7838. i = $('#drawer'),
  7839. n = $('.pinBottom')
  7840. if ($('#player').width() < 488 || $('#player').height() < 488)
  7841. t.addClass('hidden'), i.addClass('noScroll'), n.addClass('noScroll')
  7842. else {
  7843. var r = j > e,
  7844. o = !i.hasClass('noScroll'),
  7845. a = r !== o
  7846. a && (t.toggleClass('hidden'), i.toggleClass('noScroll'), n.toggleClass('noScroll'))
  7847. }
  7848. }
  7849. function _(e) {
  7850. je.tourControls.visible = true //e.tour_buttons && K.valueFromHash("gt", 1),
  7851. ;(je.coBrand.visible =
  7852. e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash('mls', !1)),
  7853. (je.highlight.visible =
  7854. /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights)
  7855. }
  7856. function T(e) {
  7857. function t(t, i) {
  7858. return !!e.player_options[t] && e[i || t]
  7859. }
  7860. $('.model-title').text(e.name)
  7861. var i = Q.pageTitle
  7862. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  7863. 2 !== K.valueFromHash('mls', 0) && e.name && (i = e.name),
  7864. (document.title = i),
  7865. K.isMobile()
  7866. ? $('#gui-fullscreen').css('display', 'none')
  7867. : ($('[rel=tooltip]').tooltip({
  7868. delay: {
  7869. show: 50,
  7870. hide: 0
  7871. },
  7872. trigger: 'hover',
  7873. html: !1,
  7874. viewport: {
  7875. selector: 'body',
  7876. padding: 10
  7877. }
  7878. }),
  7879. K.inIframe() &&
  7880. document
  7881. .getElementsByClassName('pinBottom-container')[0]
  7882. .classList.add('embed')),
  7883. // t("presented_by") && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", 0) ? document.getElementById("loaderCoBrandName").innerText = t("presented_by") : document.getElementById("loaderCoBrand").classList.add("hidden"),
  7884. de.populate({
  7885. name: t('model_name', 'name'),
  7886. coBrand: t('presented_by'),
  7887. description: t('model_summary', 'summary') || '暂无内容',
  7888. contactName: t('contact_name'),
  7889. address: t('address'),
  7890. phone: t('contact_phone'),
  7891. formattedPhone: e.formatted_contact_phone,
  7892. email: t('contact_email'),
  7893. url: t('external_url'),
  7894. socialSharing: e.enable_social_sharing && e.is_public
  7895. })
  7896. }
  7897. function x(e, t, i, n, r, o) {
  7898. function a() {
  7899. o.setLoadingStartTime(),
  7900. H(),
  7901. r ? (re.showMessage(t, i, je.coBrand.visible), l()) : h(l)
  7902. }
  7903. var s = $.Deferred(),
  7904. l = s.resolve.bind(s)
  7905. return (
  7906. (Ge = !0),
  7907. O(e),
  7908. e.data.player_options && _(e.data.player_options),
  7909. 1 === Q.specialEdition && $('body').addClass('specialEdition'),
  7910. Re.localizeGUI(),
  7911. T(e.data),
  7912. r || $('.quick').addClass('hidden'),
  7913. //e.data.image && !r && E(e.data.image),
  7914. n ? (J.impression(), a()) : (o.setWaitingStartTime(), oe.show(r, a)),
  7915. s
  7916. )
  7917. }
  7918. function S(e, t, i, n, r, a, s) {
  7919. ;(q = s),
  7920. e.outsideAllowed() || $('#gui-modes-outside').addClass('invisible'),
  7921. e.supportedModes[_e.PANORAMA] || $('#gui-modes-inside').addClass('invisible'),
  7922. ae.init(),
  7923. re.init(e, a),
  7924. Oe.init(e, t, n),
  7925. $('.icon').on('mouseover', function () {
  7926. t.player && t.player.reticule.hide()
  7927. }),
  7928. m(e, t),
  7929. A(e, t),
  7930. e.data.enable_social_sharing &&
  7931. e.data.is_public &&
  7932. Q.share.enabled &&
  7933. (Ce.init(window.DATA.name /* e.data.name */),
  7934. Ce.on(
  7935. Me.OPENED,
  7936. (function () {
  7937. var e = document.getElementById('share-modal')
  7938. return function () {
  7939. Ze('share'), le.open(e)
  7940. }
  7941. })()
  7942. ),
  7943. Ce.on(Me.CLOSED, le.reset)),
  7944. e.heroLocations.length > 0
  7945. ? b(e, t, i)
  7946. : ((je.highlight.visible = !1), (je.tourControls.visible = !1)),
  7947. de.on(pe.OPEN_INFO, Ze.bind(this, 'info')),
  7948. z(),
  7949. g(i),
  7950. v(e, r),
  7951. e.on('floor.changed', C),
  7952. e.on('waiting', R.bind(this, e)),
  7953. e.on('waiting-done', P.bind(this, e)),
  7954. i.on(xe.ModeChanged, function (e, n) {
  7955. g(i),
  7956. o(t, i),
  7957. n === _e.PANORAMA &&
  7958. i.currentPano &&
  7959. !i.currentPano.isAligned() &&
  7960. (n = _e.OUTDOOR),
  7961. he.updateMode(n)
  7962. }),
  7963. n.on(Se.Move, Ze.bind(this, 'move')),
  7964. i.on(xe.Ready, function () {
  7965. ie.init(n, i, i.tagManager, t),
  7966. i.on(xe.ModeChanged, function (e, t) {
  7967. e !== t && $('.vr-popup').is(':visible') && Ae.dismiss()
  7968. })
  7969. }),
  7970. i.on(xe.PanoChosen, function (e, t) {
  7971. g(i, t), he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  7972. }),
  7973. le.on(ce.CLOSE, function (e) {
  7974. switch (e) {
  7975. case 'vr-modal':
  7976. Ae.dismiss()
  7977. break
  7978. case 'share-modal':
  7979. Ce.hide()
  7980. break
  7981. case 'terms-modal':
  7982. fe.hide()
  7983. }
  7984. })
  7985. var l = $('#play').eq(0),
  7986. c = $('#pause').eq(0),
  7987. h = $('.pinBottom').toArray(),
  7988. u = $('#drawer').eq(0),
  7989. d = $('#playHead').eq(0),
  7990. p = $('#progressBar').eq(0),
  7991. f = $('#thumb-container').eq(0),
  7992. y = f.children(),
  7993. I = p.children()
  7994. t.on('update.controls', function () {
  7995. //导览控制
  7996. var n = t.describe()
  7997. n.tourIsPlaying || i.isWarping()
  7998. ? (je.tourControls.visible && (l.hide(), c.show()),
  7999. n.tourInProgress &&
  8000. (h.forEach(function (e) {
  8001. e.classList.add('playing')
  8002. }),
  8003. u.addClass('playing'),
  8004. d.addClass('playing')))
  8005. : (je.tourControls.visible && (l.show(), c.hide()),
  8006. n.tourInProgress ||
  8007. (ve.stopTour(),
  8008. h.forEach(function (e) {
  8009. e.classList.remove('playing')
  8010. }),
  8011. u.removeClass('playing'),
  8012. d.removeClass('playing')))
  8013. var r, a, s
  8014. if (null !== n.currentItem) {
  8015. var p, f
  8016. $('#status')
  8017. .find('.curIdx')
  8018. .text(n.currentItem[0] + 1),
  8019. n.onTheBus ? ((p = 'active'), (f = 'recent')) : ((f = 'active'), (p = 'recent'))
  8020. var g = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0]
  8021. /* for (r = 0; r < e.heroLocations.length; r += 1)
  8022. s = y.eq(r),
  8023. a = I.eq(r),
  8024. s.removeClass(f),
  8025. a.removeClass(f),
  8026. n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
  8027. a.addClass(p),
  8028. W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
  8029. a.addClass(p)) : (s.removeClass(p),
  8030. a.removeClass(p)) */
  8031. for (r = 0; r < e.heroLocations.length; r += 1) {
  8032. ;(s = y.eq(r)), (a = I.eq(r)), s.removeClass(f), a.removeClass(f)
  8033. if (n.onTheBus && r === n.destinationItem[0]) {
  8034. s.addClass(p)
  8035. a.addClass(p)
  8036. if (Date.now() - lastMoveScrollTime > 2000) {
  8037. //add 如果一段时间内用户不操作scrollbar,才focus回这个item
  8038. W.activate(r) // scrollbar slide to this
  8039. }
  8040. } else {
  8041. n.onTheBus && g && r === n.currentItem[0]
  8042. ? (s.addClass(p), a.addClass(p))
  8043. : (s.removeClass(p), a.removeClass(p))
  8044. }
  8045. }
  8046. } else for (r = 0; r < e.heroLocations.length; r += 1) (s = y.eq(r)), (a = I.eq(r)), s.removeClass('active recent'), a.removeClass('active recent')
  8047. o(t, i)
  8048. }),
  8049. document.addEventListener(
  8050. 'keydown',
  8051. function (n) {
  8052. switch ((J.updateInteraction(Se.InteractionKey), n.which)) {
  8053. case we.ZERO:
  8054. Q.debug && e.toggleAlpha()
  8055. break
  8056. case we.NINE:
  8057. Q.debug && se.toggle()
  8058. break
  8059. case we.ONE:
  8060. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA)
  8061. break
  8062. case we.TWO:
  8063. e.outsideAllowed() &&
  8064. !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) &&
  8065. t.changeMode(_e.DOLLHOUSE)
  8066. break
  8067. case we.THREE:
  8068. e.outsideAllowed() &&
  8069. !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) &&
  8070. t.changeMode(_e.FLOORPLAN)
  8071. break
  8072. case we.FOUR:
  8073. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR)
  8074. break
  8075. case we.SPACE:
  8076. je.tourControls.visible && ($('#playHead').hasClass('playing') || Ze('tour'))
  8077. break
  8078. case we.RETURN:
  8079. Q.debug && e.toggleExplodeUp()
  8080. break
  8081. case we.P:
  8082. k()
  8083. break
  8084. case we.U:
  8085. B()
  8086. break
  8087. case we.X:
  8088. Q.debug && e.toggleExplode()
  8089. break
  8090. case we.PLUSEQUALS:
  8091. t.player.activatePersistentZooming(!0), ie.hideUi()
  8092. break
  8093. case we.DASHUNDERSCORE:
  8094. t.player.activatePersistentZooming(!1), ie.hideUi()
  8095. break
  8096. case we.SEVEN:
  8097. De.info('Zoom level: ' + t.player.zoomLevel + ', FOV: ' + t.player.zoomFov)
  8098. break
  8099. case we.EIGHT:
  8100. t.player.decreaseZoomSpeed()
  8101. break
  8102. case we.NINE:
  8103. t.player.increaseZoomSpeed()
  8104. }
  8105. return i && i.reticule.hide(), !0
  8106. }.bind(this)
  8107. ),
  8108. document.addEventListener(
  8109. 'keyup',
  8110. function (e) {
  8111. switch (e.which) {
  8112. case we.PLUSEQUALS:
  8113. t.player.deactivatePersistentZooming()
  8114. break
  8115. case we.DASHUNDERSCORE:
  8116. t.player.deactivatePersistentZooming()
  8117. }
  8118. }.bind(this)
  8119. ),
  8120. F(e),
  8121. L(e, t.player),
  8122. M(i),
  8123. te.setAutoPlay(e.heroCount()),
  8124. he.init(i, a.mode),
  8125. he.on(ue.OPENED, Ze.bind(this, 'help')),
  8126. fe.init(),
  8127. fe.on(
  8128. ge.OPENED,
  8129. (function () {
  8130. var e = document.getElementById('terms-modal')
  8131. return function () {
  8132. Ze('terms'), le.open(e)
  8133. }
  8134. })()
  8135. ),
  8136. fe.on(ge.CLOSED, le.reset),
  8137. Q.quickstart.enabled ||
  8138. re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  8139. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  8140. Q.profiling.enabled && se.show(),
  8141. ve.init(t)
  8142. }
  8143. function M(e) {
  8144. var t = function (e, t) {
  8145. $(e)
  8146. .find('a')
  8147. .each(function (e, i) {
  8148. t
  8149. ? $(i).removeClass('buttonZoomDisabled').addClass('buttonZoomEnabled')
  8150. : $(i).addClass('buttonZoomDisabled').removeClass('buttonZoomEnabled'),
  8151. (i.style.pointerEvents = t ? 'auto' : 'none')
  8152. })
  8153. },
  8154. i = function () {
  8155. e.zoomLevel >= Q.zoom.max ? t('#gui-zoomin', !1) : t('#gui-zoomin', !0),
  8156. e.zoomLevel <= Q.zoom.min ? t('#gui-zoomout', !1) : t('#gui-zoomout', !0)
  8157. }
  8158. e.on(Ne.ZoomMax, function () {
  8159. t('#gui-zoomin', !1), t('#gui-zoomout', !0)
  8160. }),
  8161. e.on(Ne.ZoomMin, function () {
  8162. t('#gui-zoomin', !0), t('#gui-zoomout', !1)
  8163. }),
  8164. e.on(Ne.ZoomIn, function () {
  8165. t('#gui-zoomout', !0)
  8166. }),
  8167. e.on(Ne.ZoomOut, function () {
  8168. t('#gui-zoomin', !0)
  8169. }),
  8170. i()
  8171. }
  8172. function R(e) {
  8173. O(e)
  8174. }
  8175. function P(e) {
  8176. O(e)
  8177. }
  8178. function O(e) {
  8179. var t = e.waitQueue.length
  8180. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  8181. }
  8182. function L(e, t) {
  8183. He = {
  8184. gui: null,
  8185. visible: !1,
  8186. model: e,
  8187. player: t
  8188. }
  8189. }
  8190. function D(e, t) {
  8191. function i() {
  8192. var i = t.toJSON()
  8193. ;(n.linkToLocation =
  8194. window.location.protocol +
  8195. '//' +
  8196. window.location.host +
  8197. window.location.pathname +
  8198. '?m=' +
  8199. e.sid +
  8200. '&start=' +
  8201. be.serialize(i)),
  8202. t.tagManager.activeTag && (n.linkToLocation += '&tag=' + t.tagManager.activeTag.sid)
  8203. }
  8204. var n = {},
  8205. r = new Le.GUI({
  8206. autoPlace: !0,
  8207. width: '60%'
  8208. })
  8209. i(),
  8210. t.on(xe.ViewChanged, i),
  8211. r.add(n, 'linkToLocation').name(Re.LINK_TO_LOCATION).listen(),
  8212. (r.domElement.id = 'datLinks')
  8213. var o = [].slice.call(r.domElement.querySelectorAll('.property-name'))
  8214. return (
  8215. o.forEach(function (e) {
  8216. if (!K.detectSafari()) {
  8217. var t = document.createElement('button')
  8218. t.classList.add('btn-deep-link'),
  8219. (t.innerText = Re.MENU_COPY),
  8220. e.nextSibling.appendChild(t)
  8221. var i = function () {
  8222. alert(Re.LINK_ALERT_COPY), t.hide()
  8223. }
  8224. t.addEventListener('click', function (e) {
  8225. try {
  8226. var t = e.target.parentNode.childNodes[0]
  8227. t.select()
  8228. var n = document.execCommand('copy')
  8229. t.blur(), n || i()
  8230. } catch (e) {
  8231. i()
  8232. }
  8233. })
  8234. }
  8235. }),
  8236. $(r.__closeButton).hide(),
  8237. r
  8238. )
  8239. }
  8240. function N(e) {
  8241. He.gui || (He.gui = D(He.model, He.player)),
  8242. (He.visible = e),
  8243. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  8244. }
  8245. function B() {
  8246. N(!He.visible)
  8247. }
  8248. function F(e) {
  8249. ke = {
  8250. gui: null,
  8251. visible: !1,
  8252. model: e
  8253. }
  8254. }
  8255. function V(e) {
  8256. var t = new Le.GUI()
  8257. return (
  8258. t
  8259. .add(Q, 'showSweeps')
  8260. .name('Show sweeps')
  8261. .onFinishChange(function () {
  8262. e.setSweepVisibility(Q.showSweeps)
  8263. }),
  8264. t.add(Q, 'rotationAccelerationInside', 0.1, 10).name('Rotation speed').step(0.1),
  8265. t
  8266. .add(Q.transition, 'flyTime', 0, 5e3)
  8267. .name('Transition time')
  8268. .onFinishChange(function () {
  8269. ;(Q.transition.flySpeed = 0),
  8270. t.__controllers.forEach(function (e) {
  8271. e.updateDisplay()
  8272. })
  8273. }),
  8274. t.add(Q.path, 'opacity', 0, 1).name('Path opacity'),
  8275. $(t.__closeButton).hide(),
  8276. t
  8277. )
  8278. }
  8279. function U(e) {
  8280. ke.gui || (ke.gui = V(ke.model)),
  8281. (ke.visible = e),
  8282. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  8283. }
  8284. function k() {
  8285. U(!ke.visible)
  8286. }
  8287. function H() {
  8288. function e(e) {
  8289. e.target === t ||
  8290. $.contains(t, e.target) ||
  8291. e.target === i ||
  8292. $.contains(i, e.target) ||
  8293. e.target === n ||
  8294. $.contains(n, e.target) /* || e.preventDefault()*/
  8295. }
  8296. $('body').css('touch-action', 'none'),
  8297. $('#gui-parent')
  8298. .find('*:not(#tag-billboards)')
  8299. .on('touchmove', function (e) {
  8300. // e.preventDefault()
  8301. })
  8302. var t = document.getElementById('terms-text'),
  8303. i = document.getElementById('more-help-wrapper'),
  8304. n =
  8305. (document.getElementById('navigation-help-wrapper'),
  8306. document.getElementById('help-dialog'),
  8307. document.getElementById('tag-billboards'))
  8308. Q.useWheel &&
  8309. (document.body.addEventListener('mousewheel', e, { passive: false }),
  8310. document.body.addEventListener('DOMMouseScroll', e)),
  8311. $('#terms-text, #more-help-wrapper, #navigation-help-wrapper')
  8312. .off('touchmove')
  8313. .on('touchmove', function (e) {
  8314. e.stopPropagation()
  8315. })
  8316. }
  8317. function G(e, t) {
  8318. for (var i = []; e; ) i.push(e), (e = e.parentNode)
  8319. for (; t && i.indexOf(t) === -1; ) t = t.parentNode
  8320. return t
  8321. }
  8322. function z() {
  8323. var e,
  8324. t = function (t) {
  8325. e = 0 === t.button || 1 === t.which ? t.target : null
  8326. },
  8327. i = function (t) {
  8328. e !== t.target && (e = G(e, t.target))
  8329. var i = document.getElementById('gui-parent')
  8330. if ((G(i, e) !== i && (e = null), e)) {
  8331. var n
  8332. try {
  8333. n = new MouseEvent('click', t)
  8334. } catch (e) {
  8335. ;(n = document.createEvent('MouseEvents')),
  8336. n.initMouseEvent(
  8337. 'click',
  8338. t.bubbles,
  8339. t.cancelable,
  8340. t.view,
  8341. t.detail,
  8342. t.screenX,
  8343. t.screenY,
  8344. t.clientX,
  8345. t.clientY,
  8346. t.ctrlKey,
  8347. t.altKey,
  8348. t.shiftKey,
  8349. t.metaKey,
  8350. t.button,
  8351. t.relatedTarget
  8352. )
  8353. }
  8354. ;(n.syntheticClick = !0), e.dispatchEvent(n), (e = null)
  8355. }
  8356. }
  8357. document.body.addEventListener('mousedown', t, !0),
  8358. document.body.addEventListener('mouseup', i, !0),
  8359. document.getElementById('gui-parent').addEventListener(
  8360. 'click',
  8361. function (e) {
  8362. e.syntheticClick ||
  8363. (e.stopPropagation(), 'A' === e.target.nodeName && e.preventDefault())
  8364. },
  8365. !0
  8366. )
  8367. }
  8368. var lastMoveScrollTime = 0 //add
  8369. var W,
  8370. j,
  8371. Y,
  8372. X,
  8373. Z,
  8374. q,
  8375. K = (e('three'), e('../util/ajax'), e('../util/browser')),
  8376. Q = e('../settings'),
  8377. J = e('../analytics'),
  8378. ee = (e('../util/transitions'), e('../util/camera'), e('../util/logger')),
  8379. te = (e('../objects/Snapshot'), e('./helpManager')),
  8380. ie = e('./immersiveMode'),
  8381. ne = e('./loadingScreen'),
  8382. re = e('./landingScreen'),
  8383. oe = e('./playButton'),
  8384. ae = e('./populateModal'),
  8385. se = e('./memoryUsage'),
  8386. le = e('./closer/modalCloser'),
  8387. ce = e('./closer/ModalCloserEvent'),
  8388. he = e('./help/help'),
  8389. ue = e('./help/HelpEvent'),
  8390. de = e('./title/titleBar'),
  8391. pe = e('./title/TitleEvents'),
  8392. fe = e('./terms/terms'),
  8393. ge = e('./terms/TermsEvent'),
  8394. me = e('./title/tagToggle'),
  8395. ve = e('./tourInteraction'),
  8396. Ae = e('./vr/vrModal'),
  8397. ye = e('./vr/vrEvent'),
  8398. Ce = e('./sharing/modal'),
  8399. Ie = e('./webvr/webVRgui'),
  8400. Ee = e('./webvr/WebVrEvent'),
  8401. be = e('../controls/serializer'),
  8402. we = e('../enum/Keys'),
  8403. _e = e('../enum/Viewmode'),
  8404. Te = (e('../enum/BlackoutStyle'), e('../tag/Media/MediaEvent')),
  8405. xe =
  8406. (e('../enum/PathDiscardMode'),
  8407. e('../enum/PathDisplayMode'),
  8408. e('../enum/DirectorEvents'),
  8409. e('../enum/PlayerEvents')),
  8410. Se = e('../enum/ControlEvents'),
  8411. Me = e('./sharing/ShareEvents'),
  8412. Re = e('../localization/localize'),
  8413. Pe =
  8414. (e('../enum/Vectors'),
  8415. e('../enum/WarpStyle'),
  8416. e('../enum/AlignmentType'),
  8417. e('../enum/VROption')),
  8418. Oe = e('./konami'),
  8419. Le = e('../lib/dat.gui'),
  8420. De = new ee(i),
  8421. Ne = (e('../util/showcase'), e('../enum/ZoomEvents')),
  8422. Be = _e.DOLLHOUSE,
  8423. Fe = 0,
  8424. Ve = 0,
  8425. Ue = ['.hideTarget'],
  8426. ke = null,
  8427. He = null,
  8428. Ge = !1,
  8429. ze = !1,
  8430. We = !1,
  8431. je = {
  8432. coBrand: {
  8433. visible: !0,
  8434. elements: ['.co-brand', '#loaderCoBrand']
  8435. },
  8436. help: {
  8437. visible: !0,
  8438. elements: ['.nav-help', '#nav-help']
  8439. },
  8440. tourControls: {
  8441. visible: !0,
  8442. elements: ['.next', '.previous', '#play']
  8443. },
  8444. highlight: {
  8445. visible: !0,
  8446. elements: ['#drawer', '#pullTab']
  8447. },
  8448. share: {
  8449. visible: !0,
  8450. elements: ['.socialButton', '#share']
  8451. },
  8452. fullScreen: {
  8453. visible: !0,
  8454. elements: ['#gui-fullscreen']
  8455. },
  8456. floors: {
  8457. visible: !0,
  8458. elements: ['.gui-floor']
  8459. }
  8460. },
  8461. Ye = (function () {
  8462. var e = document.getElementById('drawer')
  8463. return function () {
  8464. $('#player').height() < 400 && e.classList.contains('open') && a()
  8465. }
  8466. })(),
  8467. Xe = (function () {
  8468. var e = document.getElementById('meta-info')
  8469. return function () {
  8470. $('#player').height() < 400 && e.classList.contains('expand') && de.toggleMeta(!0)
  8471. }
  8472. })(),
  8473. Ze = (function (e) {
  8474. function t() {
  8475. u.classList.contains('expand') && de.toggleMeta(!0)
  8476. }
  8477. function i() {
  8478. fe.hide()
  8479. }
  8480. function n() {
  8481. he.close()
  8482. }
  8483. function r() {
  8484. Ae.dismiss()
  8485. }
  8486. function o() {
  8487. p.hasClass('open') && a(!0)
  8488. }
  8489. function l() {
  8490. Ce.hide()
  8491. }
  8492. function c() {
  8493. f.hasClass('open') && f.removeClass('open')
  8494. }
  8495. function h() {
  8496. d.classList.contains('fadeIn') &&
  8497. (d.classList.contains('landing')
  8498. ? re.dismissModal()
  8499. : d.classList.contains('tour') && ve.dismissModal())
  8500. }
  8501. var u = document.getElementById('meta-info'),
  8502. d = document.getElementById('interaction-modal'),
  8503. p = $('#drawer').eq(0),
  8504. f = $('.gui-floor').eq(0),
  8505. g = $('.vr-popup').eq(0)
  8506. return function (e) {
  8507. switch (e) {
  8508. case 'info':
  8509. i(), n(), Ye(), l(), c(), r(), h()
  8510. break
  8511. case 'terms':
  8512. t(), n(), o(), l(), c(), r(), h()
  8513. break
  8514. case 'help':
  8515. t(), i(), l(), c(), r(), h()
  8516. break
  8517. case 'vr':
  8518. t(), i(), l(), c(), n(), h(), s(g) && o()
  8519. break
  8520. case 'highlights':
  8521. Xe(), i(), l(), c()
  8522. break
  8523. case 'share':
  8524. t(), i(), n(), c(), r(), h()
  8525. break
  8526. case 'floor':
  8527. i(), l(), r()
  8528. break
  8529. case 'view':
  8530. c(), l(), i(), r()
  8531. break
  8532. case 'tour':
  8533. i(), l(), c(), r()
  8534. break
  8535. case 'move':
  8536. i(), l(), c(), r()
  8537. break
  8538. case 'resize':
  8539. t(), Ye(), c()
  8540. break
  8541. case 'tag':
  8542. i(), n(), l(), c(), r()
  8543. }
  8544. }
  8545. })()
  8546. $(document).on(
  8547. 'fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange',
  8548. function (e) {
  8549. $('#gui-fullscreen').toggle(!K.isFullscreen()),
  8550. $('#gui-fullscreen-exit').toggle(!!K.isFullscreen()),
  8551. setTimeout(function () {
  8552. $('.icon:visible').hide().show(0)
  8553. }, 100)
  8554. }
  8555. ),
  8556. $('#gui-fullscreen')
  8557. .find('a')
  8558. .on('click', function (e) {
  8559. l(e),
  8560. K.requestFullscreen($('body')[0]),
  8561. J.track('showcase_gui', {
  8562. gui_action: 'click_enter_fullscreen',
  8563. interaction_source: 'gui'
  8564. })
  8565. //czj
  8566. //W.reload()
  8567. }),
  8568. $('#gui-fullscreen-exit')
  8569. .find('a')
  8570. .on('click', function (e) {
  8571. l(e),
  8572. K.exitFullscreen(),
  8573. J.track('showcase_gui', {
  8574. gui_action: 'click_exit_fullscreen',
  8575. interaction_source: 'gui'
  8576. })
  8577. })
  8578. $(window)
  8579. .on('resize', function (e) {
  8580. var t = e.target.innerHeight,
  8581. i = e.target.innerWidth
  8582. ;(t === X && i === Z) ||
  8583. (je.highlight.visible && w(),
  8584. Ze('resize'),
  8585. $('.pinTop.right').removeClass('hideUnderMeta'),
  8586. c(),
  8587. (X = t),
  8588. (Z = i))
  8589. })
  8590. .resize(),
  8591. K.supportsFullscreen() || $('#gui-fullscreen').hide(),
  8592. $('#pullTab').on('click', function (e) {
  8593. l(e),
  8594. $('#drawer').hasClass('open')
  8595. ? (J.trackAlways('showcase_gui', {
  8596. gui_action: 'hide_highlight_reel'
  8597. }),
  8598. $(this).addClass('open').children('img').attr('src', 'images/auto.png'))
  8599. : (J.trackAlways('showcase_gui', {
  8600. gui_action: 'show_highlight_reel'
  8601. }),
  8602. $(this)
  8603. .removeClass('open')
  8604. .children('img')
  8605. .attr('src', 'images/auto-suspend.png'))
  8606. a()
  8607. })
  8608. /***********************方奕卓 热点列表事件监听 ************************/
  8609. if (window.DATA.showHotListSta) {
  8610. $('#hotList').css('display', '')
  8611. $('#hotList').on('click', function (e) {
  8612. l(e)
  8613. var hotList = $('#hotListWrap')[0]
  8614. var isActive = hotList.classList.contains('hotListActive')
  8615. if (isActive) {
  8616. hotList.classList.remove('hotListActive')
  8617. this.classList.remove('active')
  8618. } else {
  8619. hotList.classList.add('hotListActive')
  8620. this.classList.add('active')
  8621. }
  8622. }),
  8623. $('#hotListContent ul').on('mouseover', function (e) {
  8624. l(e)
  8625. var target = e.target
  8626. var hotList = document.getElementById('hotListWrap')
  8627. if (target.tagName === 'SPAN') {
  8628. var targetParent = target.parentElement.parentElement
  8629. if (target.offsetWidth + 116 >= targetParent.clientWidth) {
  8630. hotList.style.width = target.offsetWidth + 116 + 'px'
  8631. } else {
  8632. hotList.style.width = ''
  8633. }
  8634. } else if (target.tagName === 'LI') {
  8635. var targetParent = target.parentElement
  8636. if (target.children[0].offsetWidth + 116 >= targetParent.clientWidth) {
  8637. hotList.style.width = target.children[0].offsetWidth + 116 + 'px'
  8638. } else {
  8639. hotList.style.width = ''
  8640. }
  8641. } else {
  8642. hotList.style.width = ''
  8643. }
  8644. })
  8645. $('#hotListContent ul').on('click', function (e) {
  8646. l(e)
  8647. this.preElem && this.preElem.classList.remove('active')
  8648. if (e.target.tagName === 'SPAN') {
  8649. e.target.parentElement.classList.add('active')
  8650. e.target.parentElement.hot &&
  8651. e.target.parentElement.hot.examine(window.player, true) // 打开热点
  8652. this.preElem = e.target.parentElement
  8653. } else {
  8654. e.target.classList.add('active')
  8655. e.target.hot && e.target.hot.examine(window.player, true) // 打开热点
  8656. this.preElem = e.target
  8657. }
  8658. })
  8659. $('#hotListClose').on('click', function (e) {
  8660. l(e)
  8661. var hotList = $('#hotListWrap')[0]
  8662. hotList.classList.remove('hotListActive')
  8663. $('#hotListContent ul .active').removeClass('active')
  8664. $('#hotList')[0].classList.remove('active')
  8665. })
  8666. }
  8667. /*****************************************************************/
  8668. $('#more-menu-button').on('click', function (e) {
  8669. l(e)
  8670. var t = $('#more-menu')
  8671. t.toggleClass('open')
  8672. }),
  8673. (t.exports.init = S),
  8674. (t.exports.startLoading = x),
  8675. (t.exports.endLoading = d),
  8676. (t.exports.onProgress = u)
  8677. }).call(this, '/js/gui/gui.js')
  8678. },
  8679. {
  8680. '../analytics': 4,
  8681. '../controls/serializer': 14,
  8682. '../enum/AlignmentType': 17,
  8683. '../enum/BlackoutStyle': 18,
  8684. '../enum/ControlEvents': 21,
  8685. '../enum/DirectorEvents': 23,
  8686. '../enum/Keys': 30,
  8687. '../enum/PathDiscardMode': 38,
  8688. '../enum/PathDisplayMode': 39,
  8689. '../enum/PlayerEvents': 40,
  8690. '../enum/VROption': 47,
  8691. '../enum/Vectors': 50,
  8692. '../enum/Viewmode': 51,
  8693. '../enum/WarpStyle': 52,
  8694. '../enum/ZoomEvents': 53,
  8695. '../lib/dat.gui': 93,
  8696. '../localization/localize': 108,
  8697. '../tag/Media/MediaEvent': 131,
  8698. '../objects/Snapshot': 153,
  8699. '../settings': 166,
  8700. '../util/ajax': 181,
  8701. '../util/browser': 182,
  8702. '../util/camera': 183,
  8703. '../util/logger': 189,
  8704. '../util/showcase': 193,
  8705. '../util/transitions': 195,
  8706. './closer/ModalCloserEvent': 61,
  8707. './closer/modalCloser': 62,
  8708. './help/HelpEvent': 66,
  8709. './help/help': 67,
  8710. './helpManager': 68,
  8711. './immersiveMode': 69,
  8712. './konami': 70,
  8713. './landingScreen': 71,
  8714. './loadingScreen': 72,
  8715. './memoryUsage': 73,
  8716. './playButton': 74,
  8717. './populateModal': 75,
  8718. './sharing/ShareEvents': 76,
  8719. './sharing/modal': 77,
  8720. './terms/TermsEvent': 78,
  8721. './terms/terms': 79,
  8722. './title/TitleEvents': 80,
  8723. './title/tagToggle': 81,
  8724. './title/titleBar': 82,
  8725. './tourInteraction': 84,
  8726. './vr/vrEvent': 85,
  8727. './vr/vrModal': 87,
  8728. './webvr/WebVrEvent': 88,
  8729. './webvr/webVRgui': 89,
  8730. three: 217
  8731. }
  8732. ],
  8733. 66: [
  8734. function (e, t, i) {
  8735. 'use strict'
  8736. t.exports = Object.freeze({
  8737. OPENED: 'help.opened',
  8738. CLOSED: 'help.closed'
  8739. })
  8740. },
  8741. {}
  8742. ],
  8743. 67: [
  8744. function (e, t, i) {
  8745. 'use strict'
  8746. function n() {
  8747. g.on('click', function (e) {
  8748. if (S && S !== l.TRANSITIONING) {
  8749. var t = window.getComputedStyle(y).getPropertyValue('opacity') > 0
  8750. t && !M ? R.close() : r()
  8751. }
  8752. }),
  8753. w.on('click', function (e) {
  8754. R.close()
  8755. }),
  8756. E.on('click', function (e) {
  8757. S && S !== l.TRANSITIONING && (s(), o())
  8758. }),
  8759. b.on('click', function (e) {
  8760. s(), a()
  8761. })
  8762. }
  8763. function r() {
  8764. S &&
  8765. S !== l.TRANSITIONING &&
  8766. ((M = !0),
  8767. setTimeout(function () {
  8768. M = !1
  8769. }, d.help.modalStayDuration),
  8770. R.emit(h.OPENED),
  8771. m.addClass('open ' + S),
  8772. g.addClass('open'),
  8773. s(),
  8774. o(),
  8775. y.style.removeProperty
  8776. ? y.style.removeProperty('display')
  8777. : y.style.removeAttribute('display'),
  8778. y.classList.add('fadeIn'))
  8779. }
  8780. function o() {
  8781. E.addClass('underline-tab'), u.fill(_, c.NAVIGATION, S), m.addClass(S)
  8782. }
  8783. function a() {
  8784. b.addClass('underline-tab'), u.fill(T, c.MORE_HELP), m.addClass('more-help')
  8785. }
  8786. function s(e, t) {
  8787. m.removeClass(
  8788. 'more-help ' + l.PANORAMA + ' ' + l.DOLLHOUSE + ' ' + l.FLOORPLAN + ' ' + l.OUTDOOR
  8789. ),
  8790. I.forEach(function (e) {
  8791. e.classList.remove('underline-tab')
  8792. })
  8793. }
  8794. var l = e('../../enum/Viewmode'),
  8795. c = e('../../enum/HelpModalType'),
  8796. h = e('./HelpEvent'),
  8797. u = (e('../helpManager'), e('./../populateModal')),
  8798. d = e('../../settings'),
  8799. p = e('../../util/common'),
  8800. f = e('events').EventEmitter,
  8801. g = $('.footer-help').eq(0),
  8802. m = $('#help-dialog').eq(0),
  8803. v = document.querySelector('#quick-logo'),
  8804. A = document.querySelector('#loaderCoBrand'),
  8805. y = document.querySelector('#help-dialog'),
  8806. C = document.querySelector('.footer'),
  8807. I = $('.help-tabs').children().toArray(),
  8808. E = $('.navigation-tab').eq(0),
  8809. b = $('.more-help-tab').eq(0),
  8810. w =
  8811. ($('#interaction-modal').eq(0).find('.interaction').toArray(), m.find('.close').eq(0)),
  8812. _ = m.find('.interactions').toArray(),
  8813. T = m.find('.ui-instructions').toArray(),
  8814. x = l.PANORAMA,
  8815. S = l.PANORAMA,
  8816. M = !1,
  8817. R = {
  8818. init: function (e, t) {
  8819. ;(S = t),
  8820. (x = t),
  8821. [y, A, v, C].forEach(function (e) {
  8822. e.classList.add(u.deviceType)
  8823. }),
  8824. n()
  8825. },
  8826. close: function () {
  8827. if (
  8828. m.hasClass('open') &&
  8829. (this.emit(h.CLOSED),
  8830. g.removeClass('open'),
  8831. m.removeClass('open'),
  8832. y.classList.contains('fadeIn'))
  8833. ) {
  8834. y.classList.remove('fadeIn')
  8835. var e = S === l.TRANSITIONING ? x : S
  8836. u.clear(_, c.NAVIGATION, e)
  8837. }
  8838. },
  8839. updateMode: function (e) {
  8840. ;(x = S), (S = e)
  8841. }
  8842. }
  8843. p.extendObject(R, f.prototype), (t.exports = R)
  8844. },
  8845. {
  8846. '../../enum/HelpModalType': 28,
  8847. '../../enum/Viewmode': 51,
  8848. '../../settings': 166,
  8849. '../../util/common': 185,
  8850. '../helpManager': 68,
  8851. './../populateModal': 75,
  8852. './HelpEvent': 66,
  8853. events: 202
  8854. }
  8855. ],
  8856. 68: [
  8857. function (e, t, i) {
  8858. ;(function (i) {
  8859. 'use strict'
  8860. var n = e('../util/browser'),
  8861. r = e('./../util/logger'),
  8862. o = e('./../settings'),
  8863. a = new r(i),
  8864. s = (function () {
  8865. var e
  8866. try {
  8867. return (
  8868. (e = window.localStorage.getItem('visitCount') || '0'),
  8869. (e = (parseFloat(e) + 1).toString()),
  8870. window.localStorage.setItem('visitCount', e),
  8871. a.debug('visitCount = ' + e),
  8872. e
  8873. )
  8874. } catch (t) {
  8875. ;(e = '1'), a.debug("couldn't set local storage")
  8876. }
  8877. })(),
  8878. l = !1
  8879. t.exports = {
  8880. isHelpDisabled: function () {
  8881. return '0' === n.valueFromHash('help', null) || l
  8882. },
  8883. isLargeHelpEnabled: function () {
  8884. return ('1' === s || '1' === n.valueFromHash('help', null)) && !this.isHelpDisabled()
  8885. },
  8886. isSmallHelpEnabled: function () {
  8887. return '2' === n.valueFromHash('help', null) && !this.isHelpDisabled()
  8888. },
  8889. isHelpEnabled: function () {
  8890. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  8891. },
  8892. setAutoPlay: function (e) {
  8893. l = o.warp.auto >= 0 && e > 1
  8894. }
  8895. }
  8896. }).call(this, '/js/gui/helpManager.js')
  8897. },
  8898. {
  8899. '../util/browser': 182,
  8900. './../settings': 166,
  8901. './../util/logger': 189
  8902. }
  8903. ],
  8904. 69: [
  8905. function (e, t, i) {
  8906. 'use strict'
  8907. function n(e, t, i, n) {
  8908. ;(F = n), r(e, t, i, F), o(), (N = t.mode)
  8909. }
  8910. function r(e, t, i, n) {
  8911. ;[C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function (t) {
  8912. e.controls[t].on(v.Move, a), e.controls[t].on(v.LongTap, c)
  8913. }),
  8914. M.on('mousewheel DOMMouseScroll', a),
  8915. i.on(m.TagActivated, a),
  8916. i.on(m.TagNavigation, a),
  8917. t.on(A.FlyingEnded, s),
  8918. t.on(A.ModeChanging, function (e, t) {
  8919. B = t !== C.PANORAMA && e !== C.PANORAMA
  8920. }),
  8921. t.on(A.ModeChanged, function (e, i) {
  8922. // 备注sg 漫游状态通信
  8923. if (window.threeReact.state3d) window.threeReact.state3d(t.mode)
  8924. ;(N = t.mode), i !== C.TRANSITIONING ? l() : a('modeChange')
  8925. }),
  8926. n.on(y.TourStart, function () {
  8927. ;(L = !0), a()
  8928. }),
  8929. n.on(y.TourEnd, function () {
  8930. ;(L = !1), l()
  8931. }),
  8932. n.on(y.ActionInterrupted, function () {
  8933. L = !1
  8934. }),
  8935. R.addEventListener(
  8936. 'touchend',
  8937. function () {
  8938. $('#pullTab').hasClass('opened') && !L && l()
  8939. },
  8940. !0
  8941. )
  8942. }
  8943. function o() {
  8944. p.isMobile()
  8945. ? (b.forEach(function (e) {
  8946. e.classList.add('mobile')
  8947. }),
  8948. w.click(l))
  8949. : (b.forEach(function (e) {
  8950. e.addEventListener(
  8951. 'mouseleave',
  8952. function () {
  8953. !M.is(':hover') && b[0].classList.contains('detectHover') && l()
  8954. },
  8955. !0
  8956. )
  8957. }),
  8958. M.mouseleave(function () {
  8959. b[0].classList.contains('detectHover') && l()
  8960. }))
  8961. }
  8962. function a(e) {
  8963. D ||
  8964. (d(e) && _.hasClass('playing')) ||
  8965. (clearTimeout(O),
  8966. (P = !0),
  8967. g.close(),
  8968. h(e),
  8969. N !== C.DOLLHOUSE &&
  8970. N !== C.FLOORPLAN &&
  8971. ((x.hasClass('expand') && !S.hasClass('closed')) || 2 === p.valueFromHash('title', 1),
  8972. _.hasClass('playing') ||
  8973. (b.forEach(function (e) {
  8974. e.classList.add('detectHover')
  8975. }),
  8976. (O = setTimeout(l, f.immersive.timeToShowAgain)))))
  8977. }
  8978. function s() {
  8979. _.hasClass('playing') ||
  8980. (clearTimeout(O), (O = setTimeout(l, f.immersive.timeToShowAgain)))
  8981. }
  8982. function l() {
  8983. clearTimeout(O),
  8984. (P = !1),
  8985. I.forEach(function (e) {
  8986. e.classList.remove('drawerOpen')
  8987. }),
  8988. L ||
  8989. E.forEach(function (e) {
  8990. e.classList.remove('duringTour')
  8991. }),
  8992. b.forEach(function (e) {
  8993. e.classList.remove('detectHover')
  8994. })
  8995. }
  8996. function c() {
  8997. P ? l() : a(),
  8998. (D = !0),
  8999. setTimeout(function () {
  9000. D = !1
  9001. }, f.immersive.uiStayDuration)
  9002. }
  9003. function h(e) {
  9004. !d(e) && L
  9005. ? E.forEach(function (e) {
  9006. e.classList.remove('drawerOpen'), e.classList.add('duringTour')
  9007. })
  9008. : _.hasClass('open')
  9009. ? E.forEach(function (e) {
  9010. e.classList.remove('duringTour'), e.classList.add('drawerOpen')
  9011. })
  9012. : B ||
  9013. N === C.FLOORPLAN ||
  9014. N === C.DOLLHOUSE ||
  9015. E.forEach(function (e) {
  9016. e.classList.add('fadeOut')
  9017. })
  9018. }
  9019. function u() {
  9020. T.hasClass('duringTour') || ((L = !1), a('gui'), l())
  9021. }
  9022. function d(e) {
  9023. return 'mouse' === e || 'touch' === e || 'key' === e || 'gui' === e
  9024. }
  9025. var p = e('../util/browser'),
  9026. f = e('../settings'),
  9027. g = e('./help/help'),
  9028. m = e('../enum/tagEvents'),
  9029. v = e('../enum/ControlEvents'),
  9030. A = e('../enum/PlayerEvents'),
  9031. y = e('../enum/DirectorEvents'),
  9032. A = e('../enum/PlayerEvents'),
  9033. C = e('../enum/Viewmode'),
  9034. I = $(
  9035. '.pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer'
  9036. ).toArray(),
  9037. E = $('.pinBottom-container, #drawer-container, .footer').toArray(),
  9038. b = $('#hover-bottom, #hover-top').toArray(),
  9039. w = ($('#pullTab').eq(0), $('#playHead').eq(0), $('.pinBottom-container').eq(0)),
  9040. _ = $('#drawer').eq(0),
  9041. T = $('#drawer-container').eq(0),
  9042. x = $('#meta-info').eq(0),
  9043. S = $('.pinTop.left').eq(0),
  9044. M = $('#player').eq(0),
  9045. R = document.getElementById('pullTab'),
  9046. P = !1,
  9047. O = null,
  9048. L = !1,
  9049. D = !1,
  9050. N = null,
  9051. B = !1,
  9052. F = null
  9053. ;(t.exports.init = n), (t.exports.hideUi = a), (t.exports.resetDrawer = u)
  9054. },
  9055. {
  9056. '../enum/ControlEvents': 21,
  9057. '../enum/DirectorEvents': 23,
  9058. '../enum/tagEvents': 32,
  9059. '../enum/PlayerEvents': 40,
  9060. '../enum/Viewmode': 51,
  9061. '../settings': 166,
  9062. '../util/browser': 182,
  9063. './help/help': 67
  9064. }
  9065. ],
  9066. 70: [
  9067. function (e, t, i) {
  9068. ;(function (i) {
  9069. 'use strict'
  9070. function n(e, t, i) {
  9071. l.debug('konami has the modelInstance')
  9072. var n = []
  9073. $(window).on('keydown', function (e) {
  9074. n.push(e.which),
  9075. n.length > o.secretPanelWord.length && n.shift(),
  9076. s.equalLists(n, o.secretPanelWord) &&
  9077. (l.debug('Developer mode active.'), (o.debug = !0))
  9078. }),
  9079. $(window).on('keydown', function n(r) {
  9080. o.debug &&
  9081. 72 === r.which &&
  9082. (e && i
  9083. ? (a.toggle(e, t, i), $(window).off('keydown', n))
  9084. : console.warn("sorry we're not ready yet"))
  9085. })
  9086. }
  9087. var r = e('./../util/logger'),
  9088. o = e('./../settings'),
  9089. a = e('./debug'),
  9090. s = e('./../util/common'),
  9091. l = (e('./gui'), new r(i))
  9092. o.console && $('body').append('<div id="debug-console"></div>'), (t.exports.init = n)
  9093. }).call(this, '/js/gui/konami.js')
  9094. },
  9095. {
  9096. './../settings': 166,
  9097. './../util/common': 185,
  9098. './../util/logger': 189,
  9099. './debug': 63,
  9100. './gui': 65
  9101. }
  9102. ],
  9103. 71: [
  9104. function (e, t, i) {
  9105. 'use strict'
  9106. function n(e, t) {
  9107. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  9108. }
  9109. function r(e) {
  9110. var t = $.Deferred()
  9111. e || t.resolve()
  9112. var i = c.startupFlyinDelay
  9113. return (
  9114. e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  9115. setTimeout(t.resolve.bind(t), i),
  9116. t
  9117. )
  9118. }
  9119. function o(e, t, i) {
  9120. var n = 0
  9121. c.quickstart.enabled &&
  9122. (a(i), (n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay))
  9123. var r = function () {
  9124. e.once(g.Move, l), t.once(f.TourStart, l)
  9125. }
  9126. s(n, r)
  9127. }
  9128. function a(e) {
  9129. return /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  9130. v.before(y),
  9131. A = $(".quick-brand").toArray()),*/
  9132. m.addClass('fadeOut'),
  9133. setTimeout(function () {
  9134. A.forEach(function (e) {
  9135. e.classList.add('fadeIn')
  9136. })
  9137. }, c.quickstart.showTextDelay),
  9138. setTimeout(function () {
  9139. A.forEach(function (e) {
  9140. e.classList.add('fadeOut')
  9141. })
  9142. }, c.quickstart.fadeOutDelay),
  9143. !0
  9144. }
  9145. function s(e, t) {
  9146. setTimeout(function () {
  9147. if (h.isHelpEnabled()) {
  9148. if (
  9149. (t(),
  9150. u.init(),
  9151. C.addClass('fadeIn landing ' + u.deviceType),
  9152. h.isSmallHelpEnabled())
  9153. )
  9154. return void C.addClass('small')
  9155. u.fill(I, d.LANDING[E]), C.addClass(E)
  9156. }
  9157. }, e)
  9158. //csz 用户引导界面
  9159. var helpData = {
  9160. pc: ['images/pc_step1.png', 'images/pc_step2.png', 'images/pc_step3.png'],
  9161. mobile: ['images/phone_step1.png', 'images/phone_step2.png', 'images/phone_step3.png']
  9162. }
  9163. var navIcon = $('.nav-icon .icon')
  9164. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent))
  9165. navIcon.attr('src', helpData.mobile[0])
  9166. function paging(id) {
  9167. id.on('click', function () {
  9168. var navPage = null
  9169. $(this).attr('data-id') == 'plus'
  9170. ? (navPage = +navIcon.attr('data-page') + 1)
  9171. : (navPage = +navIcon.attr('data-page') - 1)
  9172. if (navPage > helpData.length || navPage < 1) return false
  9173. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
  9174. navIcon.attr({ 'data-page': navPage, src: helpData.mobile[navPage - 1] })
  9175. } else {
  9176. navIcon.attr({ 'data-page': navPage, src: helpData.pc[navPage - 1] })
  9177. }
  9178. })
  9179. }
  9180. paging($('.next-button'))
  9181. paging($('.prev-button'))
  9182. }
  9183. function l() {
  9184. u.clear(I, d.LANDING[E]), C.removeClass('fadeIn')
  9185. }
  9186. var c = e('../settings'),
  9187. h = (e('./help/help'), e('./helpManager')),
  9188. u = e('./populateModal'),
  9189. d = e('../enum/HelpModalType'),
  9190. p = e('../enum/Viewmode'),
  9191. f = e('../enum/DirectorEvents'),
  9192. g = e('../enum/PlayerEvents'),
  9193. m = $('#quick-blackout').eq(0),
  9194. v = $('#quick-logo').eq(0),
  9195. A = $('.quick-brand').toArray(),
  9196. y = $('#loaderCoBrand').eq(0),
  9197. C = $('#interaction-modal').eq(0),
  9198. I = C.find('.interaction').toArray(),
  9199. E =
  9200. ($('#model-title, .pinBottom-container, #drawer-container, #drawer, .footer').toArray(),
  9201. '')
  9202. ;(t.exports.delayLanding = r),
  9203. (t.exports.showMessage = o),
  9204. (t.exports.init = n),
  9205. (t.exports.dismissModal = l)
  9206. },
  9207. {
  9208. '../enum/DirectorEvents': 23,
  9209. '../enum/HelpModalType': 28,
  9210. '../enum/PlayerEvents': 40,
  9211. '../enum/Viewmode': 51,
  9212. '../settings': 166,
  9213. './help/help': 67,
  9214. './helpManager': 68,
  9215. './populateModal': 75
  9216. }
  9217. ],
  9218. 72: [
  9219. function (e, t, i) {
  9220. 'use strict'
  9221. var n = e('./circleLoader').circleLoader
  9222. t.exports = {
  9223. element: $('#gui-loading'),
  9224. hide: function (e) {
  9225. n.done(), this.element.fadeOut(1500, e)
  9226. },
  9227. show: function (e) {
  9228. this.element.fadeIn(
  9229. 500,
  9230. function () {
  9231. this.element.css('display', 'table'), e && e()
  9232. }.bind(this)
  9233. )
  9234. },
  9235. progress: function (e) {
  9236. n.set(e)
  9237. }
  9238. }
  9239. },
  9240. {
  9241. './circleLoader': 60
  9242. }
  9243. ],
  9244. 73: [
  9245. function (e, t, i) {
  9246. 'use strict'
  9247. var n = e('../settings'),
  9248. r = $('#memory-info'),
  9249. o = r.find('#memory-gpu'),
  9250. a = !1
  9251. t.exports = {
  9252. show: function () {
  9253. n.profiling.enabled && (r.show(), (a = !0))
  9254. },
  9255. hide: function () {
  9256. r.hide(), (a = !1)
  9257. },
  9258. toggle: function () {
  9259. a ? this.hide() : this.show()
  9260. },
  9261. update: function (e) {
  9262. n.profiling.enabled && o.text(Math.floor(e / 1e6) + 'MB')
  9263. }
  9264. }
  9265. },
  9266. {
  9267. '../settings': 166
  9268. }
  9269. ],
  9270. 74: [
  9271. function (e, t, i) {
  9272. 'use strict'
  9273. var n = e('../util/browser'),
  9274. r = e('../analytics')
  9275. e('../settings')
  9276. t.exports = {
  9277. show: function (e, t) {
  9278. $('#gui-message').fadeOut(500, function () {
  9279. t()
  9280. })
  9281. }
  9282. }
  9283. },
  9284. {
  9285. '../analytics': 4,
  9286. '../settings': 166,
  9287. '../util/browser': 182
  9288. }
  9289. ],
  9290. 75: [
  9291. function (e, t, i) {
  9292. 'use strict'
  9293. function n(e, t, i, n) {
  9294. function r(e) {
  9295. return e.classList.contains(a)
  9296. }
  9297. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  9298. //for (var a in o) {
  9299. //var s = e.find(r);
  9300. //for (var l in o[a]) {
  9301. //var c = o[a][l];
  9302. //if ("top-info" === l || "bottom-info" === l) {
  9303. //var h = n ? c : "";
  9304. //czj 注释掉第一次打开的用户引导
  9305. //s.querySelector("." + l).textContent = h
  9306. //} else {
  9307. //var u = n ? c : "";
  9308. //, d = s.querySelector("." + l);
  9309. //d.src = u,
  9310. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  9311. //}
  9312. //}
  9313. //}
  9314. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  9315. // p.forEach(function(e) {
  9316. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  9317. // })
  9318. }
  9319. var r = e('../util/browser'),
  9320. o = e('../localization/localize'),
  9321. a = e('../enum/HelpModalType'),
  9322. s = (e('../enum/HelpModalSize'), e('../enum/Viewmode'))
  9323. t.exports = {
  9324. init: function () {
  9325. if (!this.hasInitialized) {
  9326. ;(this.hasInitialized = !0),
  9327. (this.deviceType = r.isMobile() ? 'mobile' : 'desktop'),
  9328. (this.assets = {}),
  9329. (this.assets[a.LANDING[s.PANORAMA]] = {
  9330. desktop: {
  9331. left: {
  9332. 'top-info': o.ROTATE,
  9333. 'big-image': 'images/nav_help_mouse_drag_left.png',
  9334. keyboard: 'images/nav_help_keyboard_left_right.png'
  9335. },
  9336. middle: {
  9337. 'top-info': o.MOVE,
  9338. 'big-image': 'images/nav_help_mouse_click.png',
  9339. keyboard: 'images/nav_help_keyboard_up_down.png'
  9340. },
  9341. right: {
  9342. 'top-info': o.ZOOM,
  9343. 'big-image': 'images/nav_help_mouse_zoom.png',
  9344. keyboard: 'images/nav_help_zoom_keys.png'
  9345. }
  9346. },
  9347. mobile: {
  9348. left: {
  9349. 'top-info': o.ROTATE,
  9350. 'big-image': 'images/nav_help_gesture_drag.png'
  9351. },
  9352. middle: {
  9353. 'top-info': o.MOVE,
  9354. 'big-image': 'images/nav_help_gesture_tap.png'
  9355. },
  9356. right: {
  9357. 'top-info': o.ZOOM,
  9358. 'big-image': 'images/nav_help_gesture_pinch.png'
  9359. }
  9360. }
  9361. }),
  9362. (this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(
  9363. JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])
  9364. )),
  9365. (this.assets[a.LANDING[s.DOLLHOUSE]] = {
  9366. desktop: {
  9367. left: {
  9368. 'top-info': o.ROTATE,
  9369. 'big-image': 'images/nav_help_mouse_drag_left.png',
  9370. keyboard: 'images/nav_help_keyboard_left_right.png'
  9371. },
  9372. middle: {
  9373. 'top-info': o.MOVE,
  9374. 'big-image': 'images/nav_help_mouse_position_right.png'
  9375. }
  9376. },
  9377. mobile: {
  9378. left: {
  9379. 'top-info': o.ROTATE,
  9380. 'big-image': 'images/nav_help_gesture_drag.png'
  9381. },
  9382. middle: {
  9383. 'top-info': o.MOVE,
  9384. 'big-image': 'images/nav_help_gesture_position_two_finger.png'
  9385. }
  9386. }
  9387. }),
  9388. (this.assets[a.LANDING[s.FLOORPLAN]] = {
  9389. desktop: {
  9390. left: {
  9391. 'top-info': o.MOVE,
  9392. 'big-image': 'images/nav_help_mouse_position_left.png'
  9393. },
  9394. middle: {
  9395. 'top-info': o.ROTATE,
  9396. 'big-image': 'images/nav_help_mouse_drag_right.png',
  9397. keyboard: 'images/nav_help_keyboard_left_right.png'
  9398. }
  9399. },
  9400. mobile: {
  9401. left: {
  9402. 'top-info': o.MOVE,
  9403. 'big-image': 'images/nav_help_gesture_position.png'
  9404. },
  9405. middle: {
  9406. 'top-info': o.ROTATE,
  9407. 'big-image': 'images/nav_help_gesture_drag_two_finger.png'
  9408. }
  9409. }
  9410. })
  9411. var e = {
  9412. 'top-info': o.INSIDE,
  9413. 'big-image': 'images/nav_help_click_inside.png',
  9414. keyboard: 'images/nav_help_inside_key.png'
  9415. }
  9416. ;(this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e),
  9417. (this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e),
  9418. (this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e)
  9419. var t = {
  9420. 'top-info': o.INSIDE,
  9421. 'big-image': 'images/nav_help_tap_inside.png'
  9422. }
  9423. ;(this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t),
  9424. (this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t),
  9425. (this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t),
  9426. (this.assets[a.NAVIGATION] = {}),
  9427. (this.assets[a.NAVIGATION][s.PANORAMA] = {
  9428. desktop: {
  9429. left: {
  9430. 'top-info': o.HELP_DESKTOP_PANORAMA_1A,
  9431. 'bottom-info': o.HELP_DESKTOP_PANORAMA_1B,
  9432. 'big-image': 'images/nav_help_mouse_drag_left.png',
  9433. keyboard: 'images/nav_help_keyboard_left_right.png'
  9434. },
  9435. middle: {
  9436. 'top-info': o.HELP_DESKTOP_PANORAMA_2A,
  9437. 'bottom-info': o.HELP_DESKTOP_PANORAMA_2B,
  9438. 'big-image': 'images/nav_help_mouse_click.png',
  9439. keyboard: 'images/nav_help_keyboard_up_down.png'
  9440. },
  9441. right: {
  9442. 'top-info': o.HELP_DESKTOP_PANORAMA_3A,
  9443. 'bottom-info': o.HELP_DESKTOP_PANORAMA_3B,
  9444. 'big-image': 'images/nav_help_mouse_zoom.png',
  9445. keyboard: 'images/nav_help_zoom_keys.png'
  9446. }
  9447. },
  9448. mobile: {
  9449. left: {
  9450. 'top-info': o.HELP_MOBILE_PANORAMA_1,
  9451. 'big-image': 'images/nav_help_gesture_drag.png'
  9452. },
  9453. middle: {
  9454. 'top-info': o.HELP_MOBILE_PANORAMA_2,
  9455. 'big-image': 'images/nav_help_gesture_tap.png'
  9456. },
  9457. right: {
  9458. 'top-info': o.HELP_MOBILE_3,
  9459. 'big-image': 'images/nav_help_gesture_pinch.png'
  9460. }
  9461. }
  9462. }),
  9463. (this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  9464. desktop: {
  9465. left: {
  9466. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_1A,
  9467. 'bottom-info': o.HELP_DESKTOP_DOLLHOUSE_1B,
  9468. 'big-image': 'images/nav_help_mouse_drag_left.png',
  9469. keyboard: 'images/nav_help_keyboard_all.png'
  9470. },
  9471. middle: {
  9472. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_2A,
  9473. 'big-image': 'images/nav_help_mouse_position_right.png'
  9474. },
  9475. right: {
  9476. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_3A,
  9477. 'big-image': 'images/nav_help_mouse_zoom.png'
  9478. }
  9479. },
  9480. mobile: {
  9481. left: {
  9482. 'top-info': o.HELP_MOBILE_DOLLHOUSE_1,
  9483. 'big-image': 'images/nav_help_gesture_drag.png'
  9484. },
  9485. middle: {
  9486. 'top-info': o.HELP_MOBILE_DOLLHOUSE_2,
  9487. 'big-image': 'images/nav_help_gesture_position_two_finger.png'
  9488. },
  9489. right: {
  9490. 'top-info': o.HELP_MOBILE_3,
  9491. 'big-image': 'images/nav_help_gesture_pinch.png'
  9492. }
  9493. }
  9494. }),
  9495. (this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  9496. desktop: {
  9497. left: {
  9498. 'top-info': o.HELP_DESKTOP_FLOORPLAN_1A,
  9499. 'big-image': 'images/nav_help_mouse_position_left.png'
  9500. },
  9501. middle: {
  9502. 'top-info': o.HELP_DESKTOP_FLOORPLAN_2A,
  9503. 'bottom-info': o.HELP_DESKTOP_FLOORPLAN_2B,
  9504. 'big-image': 'images/nav_help_mouse_drag_right.png',
  9505. keyboard: 'images/nav_help_keyboard_left_right.png'
  9506. },
  9507. right: {
  9508. 'top-info': o.HELP_DESKTOP_FLOORPLAN_3A,
  9509. 'bottom-info': o.HELP_DESKTOP_FLOORPLAN_3B,
  9510. 'big-image': 'images/nav_help_mouse_zoom.png',
  9511. keyboard: 'images/nav_help_keyboard_up_down.png'
  9512. }
  9513. },
  9514. mobile: {
  9515. left: {
  9516. 'top-info': o.HELP_MOBILE_FLOORPLAN_1,
  9517. 'big-image': 'images/nav_help_gesture_position.png'
  9518. },
  9519. middle: {
  9520. 'top-info': o.HELP_MOBILE_FLOORPLAN_2,
  9521. 'big-image': 'images/nav_help_gesture_drag_two_finger.png'
  9522. },
  9523. right: {
  9524. 'top-info': o.HELP_MOBILE_3,
  9525. 'big-image': 'images/nav_help_gesture_pinch.png'
  9526. }
  9527. }
  9528. }),
  9529. (this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(
  9530. JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])
  9531. )),
  9532. (this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  9533. 'top-info': o.HELP_DESKTOP_360_2A,
  9534. 'bottom-info': o.HELP_DESKTOP_360_2B,
  9535. 'big-image': 'images/nav_help_click_inside.png',
  9536. keyboard: 'images/nav_help_inside_key.png'
  9537. }),
  9538. (this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  9539. 'top-info': o.HELP_MOBILE_360_2,
  9540. 'big-image': 'images/nav_help_tap_inside.png'
  9541. }),
  9542. (this.assets[a.MORE_HELP] = {
  9543. desktop: {
  9544. 'more-help-hlr': {
  9545. 'top-info': o.HELP_MORE_HLR_A,
  9546. 'big-image': 'images/nav_help_expand.svg',
  9547. 'bottom-info': o.HELP_DESKTOP_MORE_HLR_B
  9548. },
  9549. 'more-help-dollhouse': {
  9550. 'top-info': o.HELP_MORE_DOLLHOUSE_A,
  9551. 'big-image': 'images/nav_help_dollhouse.svg',
  9552. 'bottom-info': o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  9553. },
  9554. 'more-help-floors': {
  9555. 'top-info': o.HELP_MORE_FLOORS_A,
  9556. 'big-image': 'images/nav_help_floor picker.svg',
  9557. 'bottom-info': o.HELP_DESKTOP_MORE_FLOORS_B
  9558. },
  9559. 'more-help-tag': {
  9560. 'top-info': o.HELP_MORE_TAG_A,
  9561. 'big-image': 'images/nav_help_tag.svg',
  9562. 'bottom-info': o.HELP_DESKTOP_MORE_TAG_B
  9563. },
  9564. 'more-help-zoom': {
  9565. 'top-info': o.HELP_MORE_ZOOM_A,
  9566. 'big-image': 'images/nav_help_zoom.svg',
  9567. 'bottom-info': o.HELP_DESKTOP_MORE_ZOOM_B
  9568. },
  9569. 'more-help-tour': {
  9570. 'top-info': o.HELP_MORE_TOUR_A,
  9571. 'big-image': 'images/nav_help_play.png',
  9572. 'bottom-info': o.HELP_DESKTOP_MORE_TOUR_B
  9573. },
  9574. 'more-help-inside': {
  9575. 'top-info': o.HELP_MORE_INSIDE_A,
  9576. 'big-image': 'images/nav_help_inside.svg',
  9577. 'bottom-info': o.HELP_DESKTOP_MORE_INSIDE_B
  9578. },
  9579. 'more-help-vr': {
  9580. 'top-info': o.HELP_MORE_VR_A,
  9581. 'big-image': 'images/nav_help_vr.svg',
  9582. 'bottom-info': o.HELP_DESKTOP_MORE_VR_B
  9583. },
  9584. 'more-help-360': {
  9585. 'top-info': o.HELP_MORE_360_A,
  9586. 'big-image': 'images/nav_help_360.svg',
  9587. 'bottom-info': o.HELP_DESKTOP_MORE_360_B
  9588. },
  9589. 'more-help-fullscreen': {
  9590. 'top-info': o.HELP_MORE_FULLSCREEN_A,
  9591. 'big-image': 'images/nav_help_fullscreen.svg',
  9592. 'bottom-info': o.HELP_DESKTOP_MORE_FULLSCREEN_B
  9593. }
  9594. },
  9595. mobile: {
  9596. 'more-help-hlr': {
  9597. 'top-info': o.HELP_MORE_HLR_A,
  9598. 'big-image': 'images/nav_help_expand.svg',
  9599. 'bottom-info': o.HELP_DESKTOP_MORE_HLR_B
  9600. },
  9601. 'more-help-dollhouse': {
  9602. 'top-info': o.HELP_MORE_DOLLHOUSE_A,
  9603. 'big-image': 'images/nav_help_dollhouse.svg',
  9604. 'bottom-info': o.HELP_MOBILE_MORE_DOLLHOUSE_B
  9605. },
  9606. 'more-help-floors': {
  9607. 'top-info': o.HELP_MORE_FLOORS_A,
  9608. 'big-image': 'images/nav_help_floor picker.svg',
  9609. 'bottom-info': o.HELP_DESKTOP_MORE_FLOORS_B
  9610. },
  9611. 'more-help-tag': {
  9612. 'top-info': o.HELP_MORE_TAG_A,
  9613. 'big-image': 'images/nav_help_tag.svg',
  9614. 'bottom-info': o.HELP_MOBILE_MORE_TAG_B
  9615. },
  9616. 'more-help-tour': {
  9617. 'top-info': o.HELP_MORE_TOUR_A,
  9618. 'big-image': 'images/nav_help_play.png',
  9619. 'bottom-info': o.HELP_DESKTOP_MORE_TOUR_B
  9620. },
  9621. 'more-help-inside': {
  9622. 'top-info': o.HELP_MORE_INSIDE_A,
  9623. 'big-image': 'images/nav_help_inside.svg',
  9624. 'bottom-info': o.HELP_MOBILE_MORE_INSIDE_B
  9625. },
  9626. 'more-help-vr': {
  9627. 'top-info': o.HELP_MORE_VR_A,
  9628. 'big-image': 'images/webvr.svg',
  9629. 'bottom-info': o.HELP_MOBILE_MORE_VR_B
  9630. },
  9631. 'more-help-360': {
  9632. 'top-info': o.HELP_MORE_360_A,
  9633. 'big-image': 'images/nav_help_360.svg',
  9634. 'bottom-info': o.HELP_MOBILE_MORE_360_B
  9635. }
  9636. }
  9637. }),
  9638. (this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  9639. desktop: {
  9640. left: {
  9641. 'top-info': o.ROTATE,
  9642. 'big-image': 'images/nav_help_mouse_drag_left.png',
  9643. keyboard: 'images/nav_help_keyboard_left_right.png'
  9644. },
  9645. middle: {
  9646. 'top-info': o.MOVE,
  9647. 'big-image': 'images/nav_help_mouse_click.png',
  9648. keyboard: 'images/nav_help_keyboard_up_down.png'
  9649. },
  9650. right: {
  9651. 'top-info': o.PLAY,
  9652. 'big-image': 'images/Desktop-help-play-button.svg',
  9653. keyboard: 'images/Desktop-help-spacebar-2.svg'
  9654. }
  9655. },
  9656. mobile: {
  9657. left: {
  9658. 'top-info': o.ROTATE,
  9659. 'big-image': 'images/nav_help_gesture_drag.png'
  9660. },
  9661. middle: {
  9662. 'top-info': o.MOVE,
  9663. 'big-image': 'images/nav_help_gesture_tap.png'
  9664. },
  9665. right: {
  9666. 'top-info': o.PLAY,
  9667. 'big-image': 'images/mobile-help-play-button.svg'
  9668. }
  9669. }
  9670. }),
  9671. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(
  9672. JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])
  9673. )),
  9674. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle =
  9675. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle),
  9676. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle =
  9677. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle),
  9678. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(
  9679. JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])
  9680. )),
  9681. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left =
  9682. this.assets[a.LANDING[s.FLOORPLAN]].desktop.left),
  9683. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left =
  9684. this.assets[a.LANDING[s.FLOORPLAN]].mobile.left)
  9685. }
  9686. },
  9687. fill: function (e, t, i) {
  9688. n.call(this, e, t, i, !0)
  9689. },
  9690. clear: function (e, t, i) {
  9691. n.call(this, e, t, i, !1)
  9692. }
  9693. }
  9694. },
  9695. {
  9696. '../enum/HelpModalSize': 27,
  9697. '../enum/HelpModalType': 28,
  9698. '../enum/Viewmode': 51,
  9699. '../localization/localize': 108,
  9700. '../util/browser': 182
  9701. }
  9702. ],
  9703. 76: [
  9704. function (e, t, i) {
  9705. 'use strict'
  9706. t.exports = Object.freeze({
  9707. OPENED: 'share.open',
  9708. CLOSED: 'share.closed',
  9709. LINK_CLICKED: 'share.linked'
  9710. })
  9711. },
  9712. {}
  9713. ],
  9714. 77: [
  9715. function (e, t, i) {
  9716. 'use strict'
  9717. function n(e) {
  9718. function t(t, i) {
  9719. var n = window.screenY + ($('#player').height() - i) / 2,
  9720. r = window.screenX + ($('#player').width() - t) / 2,
  9721. o = 'top=' + n + ',left=' + r + ',width=' + t + ',height=' + i
  9722. I.emit(l.LINK_CLICKED, {
  9723. channel: e
  9724. }),
  9725. window.open(C[e], 'shareWindow', o)
  9726. }
  9727. switch (e) {
  9728. case y.FACEBOOK:
  9729. t(580, 420)
  9730. break
  9731. case y.TWITTER:
  9732. t(550, 440)
  9733. break
  9734. case y.MAIL:
  9735. I.emit(l.LINK_CLICKED, {
  9736. channel: 'email'
  9737. }),
  9738. window.open(C[e], '_blank')
  9739. break
  9740. case y.LINKEDIN:
  9741. }
  9742. }
  9743. function r(e) {
  9744. I.emit(l.LINK_CLICKED, {
  9745. channel: 'copylink'
  9746. })
  9747. var t = document.createRange()
  9748. t.selectNodeContents(v)
  9749. var i = window.getSelection()
  9750. i.removeAllRanges(),
  9751. i.addRange(t),
  9752. document.execCommand('copy'),
  9753. A.classList.remove('hidden'),
  9754. v.classList.add('highlighted')
  9755. }
  9756. function o(e) {
  9757. ;(e && (e.stopPropagation(), e.target === v)) ||
  9758. (window.getSelection().removeAllRanges(),
  9759. v.classList.remove('highlighted'),
  9760. A.classList.add('hidden'))
  9761. }
  9762. var a = e('../../util/browser'),
  9763. s = e('../../localization/localize'),
  9764. l = e('./ShareEvents'),
  9765. c = e('../../util/common'),
  9766. h = e('events').EventEmitter,
  9767. u = document.getElementById('sharing'),
  9768. d = document.getElementById('share-modal'),
  9769. p = document.getElementById('share-close'),
  9770. f = document.getElementById('facebook-share'),
  9771. g = document.getElementById('twitter-share'),
  9772. m = document.getElementById('mail-share'),
  9773. v = document.getElementById('share-url-text'),
  9774. A = document.getElementById('copy-success'),
  9775. y = Object.freeze({
  9776. FACEBOOK: 'facebook',
  9777. TWITTER: 'twitter',
  9778. MAIL: 'mail',
  9779. LINKEDIN: 'linkedin'
  9780. }),
  9781. C = {}
  9782. ;(C[y.FACEBOOK] =
  9783. 'http://www.facebook.com/sharer.php?u=' +
  9784. encodeURIComponent(window.location.href + '&utm_source=1') +
  9785. '&t='),
  9786. (C[y.TWITTER] = 'http://twitter.com/intent/tweet?text='),
  9787. (C[y.MAIL] = 'mailto:?subject=')
  9788. var I = {
  9789. init: function (e) {
  9790. var t = encodeURIComponent(s.SHARE_EXPLORE + e + ' ' + s.SHARE_AT + ' ')
  9791. ;(C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + '&utm_source=1')),
  9792. (C[y.TWITTER] +=
  9793. t +
  9794. encodeURIComponent(
  9795. window.location.href + '&utm_source=2 ' + s.SHARE_WITH + ' #port'
  9796. )),
  9797. (C[y.MAIL] +=
  9798. encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) +
  9799. '&body=' +
  9800. t +
  9801. encodeURIComponent(window.location.href + '&utm_source=3')),
  9802. u.addEventListener('click', this.toggle.bind(this)),
  9803. p.addEventListener('click', this.hide.bind(this)),
  9804. v.addEventListener('click', r),
  9805. d.addEventListener('click', o),
  9806. f.addEventListener('click', n.bind(this, y.FACEBOOK)),
  9807. g.addEventListener('click', n.bind(this, y.TWITTER)),
  9808. m.addEventListener('click', n.bind(this, y.MAIL)),
  9809. (v.textContent = window.location.href + '&utm_source=4'),
  9810. d.classList.add(a.isMobile() ? 'mobile' : 'desktop'),
  9811. u.classList.remove('hidden')
  9812. },
  9813. show: function () {
  9814. this.emit(l.OPENED), d.classList.add('fadeIn')
  9815. },
  9816. hide: function () {
  9817. d.classList.contains('fadeIn') &&
  9818. (this.emit(l.CLOSED),
  9819. document.selection && document.selection.empty(),
  9820. window.getSelection().removeAllRanges(),
  9821. o(),
  9822. d.classList.remove('fadeIn'))
  9823. },
  9824. toggle: function () {
  9825. d.classList.contains('fadeIn') ? this.hide() : this.show()
  9826. }
  9827. }
  9828. c.extendObject(I, h.prototype), (t.exports = I)
  9829. },
  9830. {
  9831. '../../localization/localize': 108,
  9832. '../../util/browser': 182,
  9833. '../../util/common': 185,
  9834. './ShareEvents': 76,
  9835. events: 202
  9836. }
  9837. ],
  9838. 78: [
  9839. function (e, t, i) {
  9840. 'use strict'
  9841. t.exports = Object.freeze({
  9842. OPENED: 'terms.opened',
  9843. CLOSED: 'terms.closed'
  9844. })
  9845. },
  9846. {}
  9847. ],
  9848. 79: [
  9849. function (e, t, i) {
  9850. 'use strict'
  9851. var n = e('./TermsEvent'),
  9852. r = e('../../localization/localize'),
  9853. o = e('../../analytics'),
  9854. a = e('../../util/ajax'),
  9855. s = e('../../util/common'),
  9856. l = e('events').EventEmitter,
  9857. c = document.getElementById('terms-modal'),
  9858. h = {
  9859. init: function () {
  9860. $('.footer-terms').on(
  9861. 'click',
  9862. function (e) {
  9863. e.preventDefault(), this.show()
  9864. }.bind(this)
  9865. ),
  9866. $('#terms-modal .close').on('click', this.hide.bind(this))
  9867. },
  9868. show: function () {
  9869. this.emit(n.OPENED),
  9870. a
  9871. .get('static/' + r.TERMS_TEXT_FILE)
  9872. .done(function (e) {
  9873. var t = $('#terms-text').html(e)
  9874. o.track('showcase_gui', {
  9875. gui_action: 'click_terms_button',
  9876. interaction_source: 'gui'
  9877. }),
  9878. t.find('a').attr('target', '_blank')
  9879. })
  9880. .fail(function () {
  9881. $('#terms-text').html('<h1>' + r.TERMS_OF_USE + '</h1><p>' + r.TERMS_FAIL)
  9882. }),
  9883. c.classList.add('fadeIn')
  9884. },
  9885. hide: function (e) {
  9886. e && e.preventDefault(),
  9887. c.classList.contains('fadeIn') && this.emit(n.CLOSED),
  9888. c.classList.remove('fadeIn')
  9889. }
  9890. }
  9891. s.extendObject(h, l.prototype), (t.exports = h)
  9892. },
  9893. {
  9894. '../../analytics': 4,
  9895. '../../localization/localize': 108,
  9896. '../../util/ajax': 181,
  9897. '../../util/common': 185,
  9898. './TermsEvent': 78,
  9899. events: 202
  9900. }
  9901. ],
  9902. 80: [
  9903. function (e, t, i) {
  9904. 'use strict'
  9905. t.exports = Object.freeze({
  9906. OPEN_INFO: 'title.open.info',
  9907. CLOSE_INFO: 'title.close.info',
  9908. SHOW_INFO: 'title.show.info',
  9909. HIDE_INFO: 'title.hide.info',
  9910. LINK_CLICKED: 'title.link.click',
  9911. CONTACT_LINK_CLICKED: 'title.contact.click',
  9912. ORIGIN_LINK_CLICKED: 'title.origin.click'
  9913. })
  9914. },
  9915. {}
  9916. ],
  9917. 81: [
  9918. function (e, t, i) {
  9919. 'use strict'
  9920. function n(e, t) {
  9921. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  9922. }
  9923. function r(e, t) {
  9924. function i(i) {
  9925. ;(e.shouldShowtags = 'show' === this.value),
  9926. e.shouldShowtags
  9927. ? t.showAlltags(o.tags.startup.fadeInDuration)
  9928. : t.hideAlltags(o.tags.startup.fadeInDuration)
  9929. }
  9930. document.getElementById('tag-toggles').classList.remove('hidden'),
  9931. (document.getElementById('radio-tag-show').checked = !0)
  9932. for (
  9933. var n = document.getElementById('tag-inputs').querySelectorAll('input'), r = 0;
  9934. r < n.length;
  9935. r++
  9936. )
  9937. n[r].addEventListener('change', i)
  9938. }
  9939. var o = e('../../settings')
  9940. t.exports.init = n
  9941. },
  9942. {
  9943. '../../settings': 166
  9944. }
  9945. ],
  9946. 82: [
  9947. function (e, t, i) {
  9948. ;(function (i) {
  9949. 'use strict'
  9950. function n(e, t) {
  9951. return e && u.valueFromHash('title', 1) && 2 !== u.valueFromHash('mls', 0)
  9952. ? ((document.getElementsByClassName('titleText')[0].innerText = e),
  9953. (g_weixinObj.title = e),
  9954. e.length > g.minTooltipCharacters &&
  9955. I.parentElement.setAttribute('data-original-title', e),
  9956. t && 1 !== m.specialEdition && m.brand && !m.mls
  9957. ? (document.getElementById('cobrandTitle').innerText = t)
  9958. : (document.getElementsByClassName('co-brand')[0].classList.add('hidden'),
  9959. document.getElementById('gui-name').classList.add('noCoBrand'),
  9960. document.getElementById('cobrandTitle').classList.add('hidden')),
  9961. !0)
  9962. : (document.getElementById('model-title').classList.add('hidden'), !1)
  9963. }
  9964. function r(e) {
  9965. return e ? ((L = !0), void (_.innerHTML = e)) : void _.classList.add('hidden')
  9966. }
  9967. function o(e, t, i, n) {
  9968. if ((!e && !t && !i) || !m.brand || u.valueFromHash('mls', !1))
  9969. return void T.classList.add('hidden')
  9970. L = !0
  9971. var r = [],
  9972. o = c(r, '<br>')
  9973. if ((e && o('<span id="contactName">' + e + '</span>'), t)) {
  9974. var a = n || t,
  9975. s = u.isMobile()
  9976. ? '<a id="phone" href="callto:' + t + '">' + a + '</a>'
  9977. : '<span>' + a + '</span>'
  9978. o(s)
  9979. }
  9980. i && o('<a id="email" href="mailTo:' + i + '">' + i + '</a>'),
  9981. (r[0] = ''),
  9982. (x.innerHTML = r.join(''))
  9983. }
  9984. function a(e) {
  9985. if ('string' == typeof e)
  9986. try {
  9987. e = JSON.parse(e)
  9988. } catch (e) {
  9989. return (
  9990. y.warn('Unable to parse address data'),
  9991. void S.parentElement.classList.add('hidden')
  9992. )
  9993. }
  9994. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  9995. return void S.parentElement.classList.add('hidden')
  9996. L = !0
  9997. var t = [],
  9998. i = c(t, ' ')
  9999. e.address_1 && i(e.address_1),
  10000. e.address_2 && i(e.address_2),
  10001. e.city && i(e.city, ', '),
  10002. e.state && i(e.state, ', '),
  10003. e.zip && i(e.zip, e.state ? ' ' : ', '),
  10004. (t[0] = ''),
  10005. (S.innerText = t.join(''))
  10006. }
  10007. function s(e) {
  10008. var t = document.createElement('a')
  10009. return (
  10010. (t.id = 'url'),
  10011. (t.target = '_blank'),
  10012. (t.href = e),
  10013. (t.innerText = e),
  10014. t.addEventListener('click', N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  10015. t
  10016. )
  10017. }
  10018. function l(e) {
  10019. return (
  10020. !(!e || (u.inIframe() && document.referrer === e)) &&
  10021. (R.classList.remove('hidden'),
  10022. (P.innerHTML = f.WEBVR_LEARN_MORE + ': '),
  10023. P.appendChild(s(e)),
  10024. O.forEach(function (e) {
  10025. e.classList.add('share-link')
  10026. }),
  10027. !0)
  10028. )
  10029. }
  10030. function c(e, t) {
  10031. var i = e,
  10032. n = t
  10033. return function (e, t) {
  10034. i.push(t || n, e)
  10035. }
  10036. }
  10037. function h() {
  10038. document
  10039. .getElementById('title-toggle')
  10040. .addEventListener('click', N.toggleTitle.bind(N)),
  10041. L && I.addEventListener('click', N.toggleMeta.bind(N, !1))
  10042. var e = [].slice.call(_.querySelectorAll('a'))
  10043. e.forEach(function (e) {
  10044. e.addEventListener('click', N.emit.bind(N, v.LINK_CLICKED))
  10045. })
  10046. var t = [].slice.call(T.querySelectorAll('a'))
  10047. t.forEach(function (e) {
  10048. e.addEventListener(
  10049. 'click',
  10050. N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  10051. contact_type: e.getAttribute('id')
  10052. })
  10053. )
  10054. })
  10055. }
  10056. var u = e('../../util/browser'),
  10057. d = e('../../util/common'),
  10058. p = e('../../util/logger'),
  10059. f = e('../../localization/localize'),
  10060. g = e('./titleBarSettings'),
  10061. m = e('../../settings'),
  10062. v = e('./TitleEvents'),
  10063. A = e('events').EventEmitter,
  10064. y = new p(i),
  10065. C = document.querySelector('.pinTop.left'),
  10066. I = document.getElementsByClassName('title-container')[0],
  10067. E = document.getElementById('title-toggle').querySelector('i'),
  10068. b = document.getElementById('meta-info-wrapper'),
  10069. w = document.getElementById('meta-info'),
  10070. _ = document.getElementById('meta-description'),
  10071. T = document.getElementsByClassName('contact-info')[0],
  10072. x = document.getElementById('contact-data'),
  10073. S = document.getElementById('addressTxt'),
  10074. M = document.getElementById('tag-toggles'),
  10075. R = document.getElementById('share-origin'),
  10076. P = document.getElementById('share-link-wrapper'),
  10077. O = [w, b, I],
  10078. L = !1,
  10079. D = !1,
  10080. N = {
  10081. populate: function (e) {
  10082. if (n(window.DATA.name, e.coBrand)) {
  10083. if (
  10084. (r(e.description),
  10085. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  10086. a(e.address),
  10087. L)
  10088. ) {
  10089. var t = document.createElement('br')
  10090. M.insertBefore(t, M.firstElementChild)
  10091. }
  10092. e.socialSharing && m.share.enabled && (D = l(e.url))
  10093. }
  10094. },
  10095. finishSetup: function (e) {
  10096. ;(L = L || !!e),
  10097. h(),
  10098. L || (D ? I.classList.add('share-only') : I.classList.add('no-meta'))
  10099. },
  10100. toggleMeta: function (e, t) {
  10101. var title = document.getElementById('model-title')
  10102. t && t.preventDefault()
  10103. var i = w.classList.contains('expand')
  10104. ;(e && !i) ||
  10105. (i
  10106. ? (O.forEach(function (e) {
  10107. e.classList.remove('expand')
  10108. }),
  10109. this.emit(v.CLOSE_INFO),
  10110. title.classList.remove('expand'))
  10111. : (O.forEach(function (e) {
  10112. e.classList.add('expand')
  10113. }),
  10114. title.classList.add('expand'),
  10115. this.emit(v.OPEN_INFO)))
  10116. },
  10117. setupToggling: function () {
  10118. ;(b.style.height = w.offsetHeight + 'px'),
  10119. w.addEventListener('transitionend', function () {
  10120. b.style.height = w.offsetHeight + 'px'
  10121. })
  10122. },
  10123. toggleTitle: function (e) {
  10124. e && e.preventDefault(),
  10125. C.classList.contains('closed')
  10126. ? (C.classList.add('open'),
  10127. E.classList.remove('icon-dpad-right'),
  10128. E.classList.add('icon-dpad-left'),
  10129. this.emit(v.SHOW_INFO),
  10130. setTimeout(function () {
  10131. C.classList.remove('closed'), C.classList.remove('open')
  10132. }, g.removeAnimationClasses))
  10133. : (C.classList.add('closed'),
  10134. E.classList.remove('icon-dpad-left'),
  10135. E.classList.add('icon-dpad-right'),
  10136. this.emit(v.HIDE_INFO))
  10137. }
  10138. }
  10139. d.extendObject(N, A.prototype), (t.exports = N)
  10140. }).call(this, '/js/gui/title/titleBar.js')
  10141. },
  10142. {
  10143. '../../localization/localize': 108,
  10144. '../../settings': 166,
  10145. '../../util/browser': 182,
  10146. '../../util/common': 185,
  10147. '../../util/logger': 189,
  10148. './TitleEvents': 80,
  10149. './titleBarSettings': 83,
  10150. events: 202
  10151. }
  10152. ],
  10153. 83: [
  10154. function (e, t, i) {
  10155. 'use strict'
  10156. t.exports = Object.freeze({
  10157. minTooltipCharacters: 19,
  10158. removeAnimationClasses: 500
  10159. })
  10160. },
  10161. {}
  10162. ],
  10163. 84: [
  10164. function (e, t, i) {
  10165. 'use strict'
  10166. function n(e) {
  10167. ;(C = e),
  10168. P.forEach(function (e) {
  10169. b.addEventListener(e, u.bind(this, !1), !0),
  10170. w.addEventListener(e, u.bind(this, !0), !0),
  10171. E.addEventListener(e, stopTour2, !0)
  10172. S.forEach(function (t) {
  10173. //会触发导览停止
  10174. t.addEventListener(e, stopTour, !0)
  10175. })
  10176. $('#drawer img').on(e, stopTour)
  10177. })
  10178. document.addEventListener('keydown', u.bind(this, !1), !0)
  10179. C.on(v.TourStart, function () {
  10180. E.classList.add('playing')
  10181. })
  10182. }
  10183. function play() {
  10184. //r
  10185. // C.playTour(),
  10186. C.playTourNearBy(), I && clearTimeout(I), d(), _.removeClass('fadeIn')
  10187. }
  10188. function stopTour2() {
  10189. //o
  10190. E.classList.contains('playing') &&
  10191. (C.stopTour(),
  10192. _.addClass('fadeIn'),
  10193. setTimeout(function () {
  10194. _.removeClass('fadeIn')
  10195. }, p.tourInteraction.showPauseButton),
  10196. O || (clearTimeout(I), (I = setTimeout(h, p.tourInteraction.showModal))),
  10197. setTimeout(function () {
  10198. E.classList.remove('playing')
  10199. }, p.tourInteraction.allowNextClick))
  10200. }
  10201. function stopTour() {
  10202. //a
  10203. C.tourInProgress && (C.stopTour(), C.endTourProgress(), E.classList.remove('playing'))
  10204. }
  10205. function togglePlay() {
  10206. //s
  10207. T.is(':visible') ? play() : stopTour2()
  10208. }
  10209. function l() {
  10210. x.hasClass('playing') &&
  10211. (clearTimeout(I), C.atEndOfTour() ? c() : _.removeClass('fadeIn'))
  10212. }
  10213. function c() {
  10214. E.classList.remove('playing'), h()
  10215. }
  10216. function h() {
  10217. //去掉导览结束时的提示
  10218. /* if (!p.tourInteraction.disabled) {
  10219. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  10220. M.addClass("fadeIn tour " + m.deviceType);
  10221. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  10222. if (!p.tourInteraction.smallModal) {
  10223. var t;
  10224. t = C.player.mode === g.PANORAMA && !C.player.currentPano.isAligned() || C.player.mode === g.DOLLHOUSE ? g.OUTDOOR : C.player.mode === g.FLOORPLAN ? g.FLOORPLAN : g.PANORAMA,
  10225. m.fill(R, A.TOUR_INTERACTION[t]),
  10226. M.addClass(t)
  10227. }
  10228. M.addClass(e)
  10229. } */
  10230. }
  10231. function u(e, t) {
  10232. if (t) {
  10233. var i = 'keydown' === t.type,
  10234. n = t.which === f.SPACE || C.tourIsPlaying
  10235. ;(i && n) || e || (O = !0),
  10236. C.atEndOfTour() && d(),
  10237. !C.tourIsPlaying &&
  10238. C.tourInProgress &&
  10239. (_.removeClass('fadeIn'), d(), t.which !== f.SPACE && stopTour()),
  10240. i && n && togglePlay() //空格键播放或暂停
  10241. }
  10242. }
  10243. function d() {
  10244. M.removeClass('fadeIn')
  10245. }
  10246. var p = (e('../util/browser'), e('../settings')),
  10247. f = e('../enum/Keys'),
  10248. g = e('../enum/Viewmode'),
  10249. m = (e('./helpManager'), e('./populateModal')),
  10250. v = e('../enum/DirectorEvents'),
  10251. A = e('../enum/HelpModalType'),
  10252. y = e('../enum/HelpModalSize'),
  10253. C = null,
  10254. I = null,
  10255. E = document.getElementById('pause-overlay'),
  10256. b = document.getElementById('player'),
  10257. w = document.getElementById('gui'),
  10258. _ = $('#pause-icon').eq(0),
  10259. T = $('#play').eq(0),
  10260. x = $('#playHead').eq(0),
  10261. S = $(
  10262. '.rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan'
  10263. ).toArray(),
  10264. M = $('#interaction-modal').eq(0),
  10265. R = $('#interaction-modal .interaction').toArray(),
  10266. P = ['touchstart', 'mousedown', 'pointerdown'],
  10267. O = !1
  10268. ;(t.exports.init = n),
  10269. (t.exports.play = play),
  10270. (t.exports.pause = stopTour2),
  10271. (t.exports.pauseWithoutCTA = stopTour),
  10272. (t.exports.togglePlay = togglePlay),
  10273. (t.exports.stopTour = l),
  10274. (t.exports.dismissModal = d)
  10275. },
  10276. {
  10277. '../enum/DirectorEvents': 23,
  10278. '../enum/HelpModalSize': 27,
  10279. '../enum/HelpModalType': 28,
  10280. '../enum/Keys': 30,
  10281. '../enum/Viewmode': 51,
  10282. '../settings': 166,
  10283. '../util/browser': 182,
  10284. './helpManager': 68,
  10285. './populateModal': 75
  10286. }
  10287. ],
  10288. 85: [
  10289. function (e, t, i) {
  10290. 'use strict'
  10291. t.exports = Object.freeze({
  10292. OPENED: 'vr.modal.opened',
  10293. LAUNCH: 'vr.modal.launch',
  10294. CLOSED: 'vr.modal.closed',
  10295. NEXT: 'vr.modal.next',
  10296. PREV: 'vr.modal.prev',
  10297. STORE: 'vr.modal.store',
  10298. falseICECHOSEN: 'vr.modal.device'
  10299. })
  10300. },
  10301. {}
  10302. ],
  10303. 86: [
  10304. function (e, t, i) {
  10305. 'use strict'
  10306. function n(e, t, i) {
  10307. function n(e, t, n, r) {
  10308. function o() {
  10309. return p + '&m=' + t + '&display=' + e
  10310. }
  10311. function s() {
  10312. var e = '&utm_medium=' + (a.inIframe() ? 'embed' : 'direct'),
  10313. t = '&utm_source=' + u,
  10314. n = '&utm_showcase_session_id=' + i
  10315. return e + t + n
  10316. }
  10317. function l() {
  10318. return (
  10319. d +
  10320. '&sids=' +
  10321. t +
  10322. '&lsid=' +
  10323. t +
  10324. '&ln=' +
  10325. encodeURIComponent(n) +
  10326. '&ld=' +
  10327. encodeURIComponent(r) +
  10328. '&display=' +
  10329. e
  10330. )
  10331. }
  10332. return a.valueFromHash('vrcoll', !1) ? l() + s() : o() + s()
  10333. }
  10334. function r(e, t, i, r) {
  10335. var o = 'https://api.branch.io/v1/url',
  10336. a = n(e, t, i, r),
  10337. s = {
  10338. responseType: 'json',
  10339. data: {
  10340. branch_key: h.appConfig.branch_key,
  10341. data: {
  10342. m: t,
  10343. full_url: a,
  10344. $desktop_url: m,
  10345. $og_app_id: '331853976762864119',
  10346. $og_title: i,
  10347. $og_description: r,
  10348. $og_image_url: location.origin + '/api/v1/player/models/' + t + '/thumb',
  10349. $canonical_url: window.location.href
  10350. }
  10351. }
  10352. }
  10353. c.post(o, s)
  10354. .done(function (t) {
  10355. f[e] = t.url
  10356. })
  10357. .fail(
  10358. function (t) {
  10359. f[e] = t
  10360. }.bind(this, a)
  10361. )
  10362. }
  10363. function o(e, t, i) {
  10364. for (var r in s) {
  10365. var o = s[r],
  10366. a = n(o, e, t, i)
  10367. f[o] = a
  10368. }
  10369. }
  10370. var u = a.inIframe()
  10371. ? encodeURIComponent(document.referrer)
  10372. : encodeURIComponent(window.location.href),
  10373. d = g + '/vr/dlist/?ret=' + u,
  10374. p = g + '/vr/show/?ret=' + u,
  10375. m = ''
  10376. switch (e) {
  10377. case l.IOS:
  10378. r(s.CardboardIOS, t.sid, t.name, t.summary)
  10379. break
  10380. default:
  10381. o(t.sid, t.name, t.summary)
  10382. }
  10383. }
  10384. function r(e) {
  10385. var t = f[e]
  10386. window.open(t, '_blank')
  10387. }
  10388. function o(e) {
  10389. var t = u[e]
  10390. window.open(t, '_blank')
  10391. }
  10392. var a = e('../../util/browser'),
  10393. s = e('../../enum/VRApps'),
  10394. l = e('../../enum/VRPlatforms'),
  10395. c = e('../../util/ajax'),
  10396. h = e('../../settings'),
  10397. u = {}
  10398. ;(u[s.CardboardAndroid] =
  10399. 'https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri='),
  10400. (u[s.CardboardIOS] =
  10401. 'https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri='),
  10402. (u[s.GearVR] =
  10403. 'https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=')
  10404. for (var d in s) {
  10405. var p = s[d]
  10406. u[p] += encodeURIComponent(document.referrer + '&display=' + p)
  10407. }
  10408. var f = {},
  10409. g = (function () {
  10410. var e = window.location.host
  10411. return (
  10412. e.indexOf('.port.com') === -1 && e.indexOf('localhost') === -1 && (e = 'my.port.com'),
  10413. 'https://' + e
  10414. )
  10415. })()
  10416. ;(t.exports.init = n), (t.exports.launch = r), (t.exports.launchStore = o)
  10417. },
  10418. {
  10419. '../../enum/VRApps': 46,
  10420. '../../enum/VRPlatforms': 49,
  10421. '../../settings': 166,
  10422. '../../util/ajax': 181,
  10423. '../../util/browser': 182
  10424. }
  10425. ],
  10426. 87: [
  10427. function (e, t, i) {
  10428. 'use strict'
  10429. function n(e) {
  10430. var t
  10431. switch (e) {
  10432. case m.IOS:
  10433. return (t = p.iosVersion()), t.major > 9 || (9 === t.major && t.minor >= 1)
  10434. case m.Android:
  10435. return (
  10436. (t = p.androidVersion()),
  10437. t.major > 4 ||
  10438. (4 === t.major && t.minor > 4) ||
  10439. (4 === t.major && 4 === t.minor && t.patch >= 4)
  10440. )
  10441. }
  10442. return !1
  10443. }
  10444. function r(e, t) {
  10445. function i(e) {
  10446. K.emit(A.STORE, {
  10447. type: e
  10448. }),
  10449. f.launchStore(e)
  10450. }
  10451. function r(e) {
  10452. switch ((e !== _.pageCount && (a(e), N.text(e + 1 + ' / ' + _.pageCount)), e)) {
  10453. case _.Title:
  10454. O.css('display', 'none'), L.text(u[e]), o(s)
  10455. break
  10456. case _.Cardboard:
  10457. O.css('display', 'block'),
  10458. L.text(u[e]),
  10459. M.filter('.cardboard').off(),
  10460. M.filter('.gearvr').off(),
  10461. c(e, s),
  10462. h(H, X, Z)
  10463. break
  10464. case _.Gear:
  10465. L.text(u[e]), c(e, s), T.addClass('lastPage'), h(G, X, Z)
  10466. break
  10467. case _.pageCount:
  10468. T.removeClass('fadeIn'), K.emit(A.CLOSED)
  10469. }
  10470. B.filter("[src='']").hide()
  10471. }
  10472. var s = (function () {
  10473. return p.detectAndroid()
  10474. ? p.detectAndroidMobile() && n(m.Android)
  10475. ? (T.addClass('supported'), (w = '.show-supported'), m.Android)
  10476. : (T.addClass('unsupported'), (w = '.show-unsupported'), m.UnsupportedAndroid)
  10477. : p.detectIPhone() || p.detectIPod()
  10478. ? (T.addClass('ios'), (w = '.show-ios'), (_ = v.ios), m.IOS)
  10479. : (T.addClass('desktop'), (w = '.show-desktop'), m.Desktop)
  10480. })()
  10481. f.init(s, e, t), s !== m.Desktop && T.addClass('mobile')
  10482. var l = function (e) {
  10483. K.emit(A.LAUNCH, {
  10484. vr_platform: s,
  10485. vr_app: e
  10486. }),
  10487. f.launch(e)
  10488. }
  10489. ;(q.cardboardAndroid = l.bind(this, g.CardboardAndroid)),
  10490. (q.gear = l.bind(this, g.GearVR)),
  10491. (q.cardboardIOS = l.bind(this, g.CardboardIOS)),
  10492. d(),
  10493. $('.show-supported, .show-unsupported, .show-ios, .show-desktop').hide(),
  10494. $(w).show()
  10495. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS],
  10496. y = ['vr_modal_learn_more', 'vr_modal_next', 'vr_modal_done']
  10497. s === m.IOS && (u.splice(1, 1), y.splice(1, 1)),
  10498. $('#vr').on('click', function (e) {
  10499. e.preventDefault()
  10500. player.FlyToMode('panorama', () => {
  10501. if (!window.vrEnabled) {
  10502. // 开启VR
  10503. window.vrEnabled = true
  10504. this.classList.add('active')
  10505. $('#gui div').not('#vrOff').addClass('vrHide')
  10506. $('#vrOffImg').css({ display: 'inline-block' })
  10507. } else {
  10508. }
  10509. })
  10510. })
  10511. let exitVR = function () {
  10512. $('#gui div').not('#vrOff').removeClass('vrHide')
  10513. $('#vrOffImg').css({ display: 'none' })
  10514. $('#player canvas').css({ width: '', height: '' }) // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  10515. $('#vr').removeClass('active') // 清除vr按钮的激活样式
  10516. }
  10517. $('#vrOff').on('click', function () {
  10518. window.vrEnabled = false
  10519. exitVR()
  10520. })
  10521. window.bus.addEventListener('exitWebXR', e => {
  10522. exitVR()
  10523. })
  10524. var I = 'https://my.port.com/vr/show/?m=' + e.sid
  10525. s === m.IOS
  10526. ? $('.cardboardLink').on('click', i.bind(this, g.CardboardIOS))
  10527. : $('.cardboardLink').on('click', i.bind(this, g.CardboardAndroid)),
  10528. $('.gearLink').on('click', i.bind(this, g.GearVR)),
  10529. $('span.modelLink').text(I),
  10530. O.on('click', function (e) {
  10531. K.emit(A.PREV), b--, r(b)
  10532. }),
  10533. L.on('click', function (e) {
  10534. L.text()
  10535. K.emit(A.NEXT, {
  10536. nextAction: y[b]
  10537. }),
  10538. b++,
  10539. r(b)
  10540. }),
  10541. T.find('.close').on('click', K.dismiss)
  10542. }
  10543. function o(e) {
  10544. switch (e) {
  10545. case m.Android:
  10546. M.filter('.cardboard').off().on('click', q.cardboardAndroid),
  10547. M.filter('.gearvr').off().on('click', q.gear),
  10548. s(H, G, 'logo-button', 'same-line')
  10549. break
  10550. case m.UnsupportedAndroid:
  10551. s('', z, '', '')
  10552. break
  10553. case m.IOS:
  10554. M.filter('.cardboard').off().on('click', q.cardboardIOS), s(H, '', 'logo-button', '')
  10555. break
  10556. case m.Desktop:
  10557. M.filter('.cardboard').off().on('click', l.bind(this, null, F, U)),
  10558. M.filter('.gearvr').off().on('click', l.bind(this, G, V, null)),
  10559. s(H, G, 'logo-button', 'same-line'),
  10560. Q.cardboard()
  10561. }
  10562. }
  10563. function a(e) {
  10564. $('.p1, .p2, .p3').hide(),
  10565. x.insertAfter(S),
  10566. T.removeClass('front-page'),
  10567. T.removeClass('details-page'),
  10568. T.removeClass('lastPage'),
  10569. M.removeClass('logo-button'),
  10570. M.removeClass('same-line'),
  10571. S.removeClass('headsetOptions'),
  10572. R.attr('src', ''),
  10573. R.filter('.second').removeClass('gear'),
  10574. R.css('display', 'inline-block'),
  10575. R.off(),
  10576. P.filter('.second').css('display', ''),
  10577. D.css('display', 'none'),
  10578. $('.p' + (e + 1) + w).show(),
  10579. R.filter('.third').insertBefore(P.filter('.third'))
  10580. }
  10581. function s(e, t, i, n) {
  10582. T.addClass('front-page'),
  10583. R.filter('.first').attr('src', e),
  10584. R.filter('.second').attr('src', t),
  10585. M.filter('.first').addClass(i),
  10586. M.filter('.second').addClass(i),
  10587. M.addClass(n),
  10588. '.show-desktop' === w && S.insertAfter(x)
  10589. }
  10590. function l(e, t, i) {
  10591. S.addClass('headsetOptions'),
  10592. M.off(),
  10593. R.filter('.second').attr('src', t),
  10594. D.css('display', 'block'),
  10595. P.filter('.second').css('display', 'none'),
  10596. D.on('click', function () {
  10597. a(_.Title), o(m.Desktop)
  10598. }),
  10599. e &&
  10600. (K.emit(A.falseICECHOSEN, {
  10601. name: g.GearVR
  10602. }),
  10603. R.filter('.first').attr('src', e),
  10604. R.filter('.second').addClass('gear'),
  10605. R.filter('.second').on('click', f.launchStore.bind(this, g.GearVR)),
  10606. Q.gearvr()),
  10607. i &&
  10608. (K.emit(A.falseICECHOSEN, {
  10609. name: g.Cardboard
  10610. }),
  10611. R.filter('.third').attr('src', i),
  10612. R.filter('.third').show(),
  10613. R.filter('.third').insertAfter(R.filter('.second')),
  10614. R.filter('.third').addClass('link'),
  10615. R.filter('.second').addClass('link'),
  10616. R.filter('.second').on('click', f.launchStore.bind(this, g.CardboardIOS)),
  10617. R.filter('.third').on('click', f.launchStore.bind(this, g.CardboardAndroid)),
  10618. Q.cardboard())
  10619. }
  10620. function c(e, t) {
  10621. switch (t) {
  10622. case m.IOS:
  10623. ;(X = Y), (Z = j)
  10624. break
  10625. case m.Desktop:
  10626. e === _.Cardboard
  10627. ? ((X = F),
  10628. (Z = U),
  10629. R.filter('.second').on('click', f.launchStore.bind(this, g.CardboardIOS)),
  10630. R.filter('.third').on('click', f.launchStore.bind(this, g.CardboardAndroid)))
  10631. : ((X = V),
  10632. R.filter('.second').on('click', f.launchStore.bind(this, g.GearVR)),
  10633. (Z = ''))
  10634. break
  10635. default:
  10636. e === _.Cardboard ? ((X = z), (Z = j)) : ((X = k), (Z = W))
  10637. }
  10638. }
  10639. function h(e, t, i) {
  10640. T.find('.inner').addClass('details-page'),
  10641. T.addClass('details-page'),
  10642. R.filter('.first').attr('src', e),
  10643. R.filter('.second').attr('src', t),
  10644. R.filter('.third').attr('src', i)
  10645. }
  10646. function u() {
  10647. T.hasClass('fadeIn') && (T.removeClass('fadeIn'), K.emit(A.CLOSED))
  10648. }
  10649. function d() {
  10650. var e = p.aspectRatio() > 1 && p.isMobile()
  10651. T.toggleClass('landscape', e).toggleClass('portrait', !e),
  10652. T.toggleClass('tiny', $('#player').height() <= y.narrowLandscapeHeight),
  10653. T.toggleClass('tinier', $('#player').height() <= y.reallyNarrowLandscapeHeight)
  10654. }
  10655. var p = e('../../util/browser'),
  10656. f = e('./vrLink'),
  10657. g = e('../../enum/VRApps'),
  10658. m = e('../../enum/VRPlatforms'),
  10659. v = e('../../enum/VRPages'),
  10660. A = e('./vrEvent'),
  10661. y = (e('../../settings'), e('../../constants')),
  10662. C = e('../../localization/localize'),
  10663. I = e('../../util/common'),
  10664. E = e('events').EventEmitter,
  10665. b = 0,
  10666. w = null,
  10667. _ = v.standard,
  10668. T = $('.vr-popup'),
  10669. x = T.find('.vr-popup-body'),
  10670. S = T.find('.vr-images'),
  10671. M = T.find('.img-container'),
  10672. R = T.find('.vr-sm-image'),
  10673. P = M.find('.vr-img-caption'),
  10674. O = $('.vr-buttons').find('.prev-button'),
  10675. L = $('.vr-buttons').find('.next-button'),
  10676. D = S.find('.front-close'),
  10677. N = $('.vr-page'),
  10678. B = T.find('img'),
  10679. F = 'images/apple-store.png',
  10680. V = 'images/badge-oculus.png',
  10681. U = 'images/badge-cardboard.png',
  10682. k = 'images/logo-samsung.png',
  10683. H = 'images/headset-cardboard.png',
  10684. G = 'images/headset-gearvr.png',
  10685. z = 'images/ico-android-robot.png',
  10686. W = 'images/ico-gearvr.png',
  10687. j = 'images/ico-vr.png',
  10688. Y = 'images/apple-logo-white.svg',
  10689. X = null,
  10690. Z = null,
  10691. q = {},
  10692. K = {
  10693. init: r,
  10694. dismiss: u,
  10695. isDeviceSupported: n
  10696. }
  10697. I.extendObject(K, E.prototype), $(window).resize(d)
  10698. var Q = (function () {
  10699. var e = P.filter('.first').find('.cardboard'),
  10700. t = P.filter('.first').find('.gearvr')
  10701. return {
  10702. cardboard: function () {
  10703. t.addClass('hidden'), e.removeClass('hidden')
  10704. },
  10705. gearvr: function () {
  10706. e.addClass('hidden'), t.removeClass('hidden')
  10707. }
  10708. }
  10709. })()
  10710. t.exports = K
  10711. },
  10712. {
  10713. '../../constants': 8,
  10714. '../../enum/VRApps': 46,
  10715. '../../enum/VRPages': 48,
  10716. '../../enum/VRPlatforms': 49,
  10717. '../../localization/localize': 108,
  10718. '../../settings': 166,
  10719. '../../util/browser': 182,
  10720. '../../util/common': 185,
  10721. './vrEvent': 85,
  10722. './vrLink': 86,
  10723. events: 202
  10724. }
  10725. ],
  10726. 88: [
  10727. function (e, t, i) {
  10728. 'use strict'
  10729. t.exports = Object.freeze({
  10730. OPENED: 'webvr.modal.opened',
  10731. SHOW_TERMS: 'webvr.footer.show.terms'
  10732. })
  10733. },
  10734. {}
  10735. ],
  10736. 89: [
  10737. function (e, t, i) {
  10738. ;(function (i) {
  10739. 'use strict'
  10740. function n(e, t, i, n) {
  10741. function r(e) {
  10742. e.preventDefault(), a(e.currentTarget.id)
  10743. }
  10744. function a(e) {
  10745. ne[e](),
  10746. Object.keys(ne).map(function (t, i) {
  10747. $('#' + t).toggleClass('tabs-underlined', t === e)
  10748. })
  10749. }
  10750. ;(y = i), (v = t), w.init(E.Android, e, n), m()
  10751. var l = new RegExp('daydream', 'i'),
  10752. c = l.test(y.displayName)
  10753. c
  10754. ? (a('tabdaydream'),
  10755. B.filter('.device-headset-side').attr('src', H),
  10756. D.find('.title').text(x.localizeText('WEBVR_FOR_DAYDREAM')))
  10757. : (a('tabcardboard'),
  10758. B.filter('.device-headset-side').attr('src', Y),
  10759. D.find('.title').text(x.localizeText('WEBVR_FOR_CARDBOARD'))),
  10760. $('#vr').on('click', function (e) {
  10761. e.preventDefault(),
  10762. g('click_webvr_button'),
  10763. L.is(':hidden') && (ie.emit(_.OPENED), o())
  10764. }),
  10765. $('.webvr-popup .close').on('click', function (e) {
  10766. e.preventDefault(), D.hasClass('hidden') ? (g('webvr_help_close'), p()) : s()
  10767. }),
  10768. $('#tabcardboard').on('click', r),
  10769. $('#tabdaydream').on('click', r),
  10770. $('#tabnative').on('click', r),
  10771. $('.webvr-popup .open-with-app').on('click', function (e) {
  10772. e.preventDefault(), g('webvr_learn_more'), a('tabnative'), p()
  10773. }),
  10774. $('.webvr-popup .help').on('click', function (e) {
  10775. e.preventDefault(),
  10776. g(D.hasClass('hidden') ? 'webvr_help_close' : 'webvr_help_show'),
  10777. p()
  10778. }),
  10779. $('.webvr-popup .terms').on('click', function (e) {
  10780. e.preventDefault(), g('webvr_click_terms'), s(), ie.emit(_.SHOW_TERMS)
  10781. }),
  10782. F.on('click', function (e) {
  10783. e.preventDefault(), g(ee), window.open(J, '_blank')
  10784. }),
  10785. V.on('click', function (e) {
  10786. e.preventDefault(), g('webvr_phone_link'), window.open(te, '_blank')
  10787. }),
  10788. $('.webvr-popup .badge-cardboard').on('click', function (e) {
  10789. e.preventDefault(), g('webvr_cardboard_link'), w.launch(b.CardboardAndroid)
  10790. }),
  10791. $('.webvr-popup .badge-oculus').on('click', function (e) {
  10792. e.preventDefault(), g('webvr_oculus_link'), w.launch(b.GearVR)
  10793. })
  10794. }
  10795. function r() {
  10796. function e() {
  10797. y.isPresenting || (f(), window.removeEventListener('vrdisplaypresentchange', e))
  10798. }
  10799. R.info('Headset mounted'), v.suspend()
  10800. var t = document.createElement('canvas')
  10801. for (
  10802. t.getContext('webgl'),
  10803. t.className = 'webvr-canvas',
  10804. document.bgColor = '#000',
  10805. document.body.style.backgroundColor = '#000';
  10806. document.body.firstChild;
  10807. )
  10808. document.body.removeChild(document.body.firstChild)
  10809. document.body.appendChild(t),
  10810. g('webvr_enter_app'),
  10811. y
  10812. .requestPresent([
  10813. {
  10814. source: t,
  10815. predistorted: !0
  10816. }
  10817. ])
  10818. .catch(function (t) {
  10819. R.error('Failed to present: ' + t), g('webvr_exit_calibrate'), e()
  10820. }),
  10821. A.then(function () {
  10822. window.dispatchEvent(new Event('vrapp-start'))
  10823. }),
  10824. window.addEventListener('vrdisplaypresentchange', e)
  10825. }
  10826. function o() {
  10827. O.fadeOut(I.guiAnimationSpeed), L.fadeIn(I.guiAnimationSpeed), a()
  10828. }
  10829. function a() {
  10830. if (!A) {
  10831. var e = C.valueFromHash('webvr') || I.appConfig.webvr_version,
  10832. t = 'https://static.port.com/webvr/' + e + '/js/main.js'
  10833. A = new Promise(function (e, i) {
  10834. var n = document.createElement('script')
  10835. ;(n.type = 'text/javascript'),
  10836. (n.src = t),
  10837. (n.onload = e),
  10838. document.head.appendChild(n)
  10839. })
  10840. }
  10841. D.find('.enter-button').on('click', r)
  10842. }
  10843. function s() {
  10844. g('webvr_modal_close'),
  10845. D.find('.enter-button').off('click', r),
  10846. L.fadeOut(I.guiAnimationSpeed, function () {
  10847. D.toggleClass('hidden', !1), N.toggleClass('hidden', !0), C.exitFullscreen()
  10848. }),
  10849. O.fadeIn(I.guiAnimationSpeed)
  10850. }
  10851. function l() {
  10852. k.toggleClass('hidden', !1), U.toggleClass('hidden', !0)
  10853. }
  10854. function c() {
  10855. k.toggleClass('hidden', !0), U.toggleClass('hidden', !1)
  10856. }
  10857. function h() {
  10858. B.filter('.device-headset').attr('src', G),
  10859. B.filter('.device-phone').attr('src', z),
  10860. (J = Z),
  10861. (ee = K),
  10862. F.text(x.localizeText('WEBVR_DAYDREAM_VIEW')),
  10863. V.text(x.localizeText('VR_NEED_DAYDREAM_PHONE')),
  10864. $('.webvr-popup .detail.daydream-label').toggleClass('hidden', !1),
  10865. c()
  10866. }
  10867. function u() {
  10868. B.filter('.badge-cardboard').attr('src', j),
  10869. B.filter('.badge-oculus').attr('src', X),
  10870. l()
  10871. }
  10872. function d() {
  10873. B.filter('.device-headset').attr('src', Y),
  10874. B.filter('.device-phone').attr('src', W),
  10875. (J = q),
  10876. (ee = Q),
  10877. F.text(x.localizeText('VR_GOOGLE_CARDBOARD')),
  10878. V.text(x.localizeText('VR_COMPATIBLE_ANDROID_LONG')),
  10879. $('.webvr-popup .detail.daydream-label').toggleClass('hidden', !0),
  10880. c()
  10881. }
  10882. function p() {
  10883. D.toggleClass('hidden'), N.toggleClass('hidden')
  10884. }
  10885. function f() {
  10886. R.info('exiting webVR'),
  10887. g('webvr_exit_app'),
  10888. window.location.search.indexOf('&qs=1') === -1
  10889. ? (window.location = window.location + '&qs=1')
  10890. : (window.location = window.location)
  10891. }
  10892. function g(e) {
  10893. var t = C.isLandscape() ? 'landscape' : 'portrait'
  10894. T.trackAlways('showcase_gui', {
  10895. gui_action: e,
  10896. orientation: t
  10897. })
  10898. }
  10899. function m() {
  10900. var e = C.isLandscape()
  10901. L.toggleClass('landscape', e).toggleClass('portrait', !e)
  10902. }
  10903. var v,
  10904. A,
  10905. y,
  10906. C = e('../../util/browser'),
  10907. I = e('../../settings'),
  10908. E = (e('./../gui'), e('../../enum/VRPlatforms')),
  10909. b = e('../../enum/VRApps'),
  10910. w = e('./../vr/vrLink'),
  10911. _ = e('./WebVrEvent'),
  10912. T = e('../../analytics'),
  10913. x = (e('../../constants'), e('../../localization/localize')),
  10914. S = e('../../util/common'),
  10915. M = e('../../util/logger'),
  10916. R = new M(i),
  10917. P = e('events').EventEmitter,
  10918. O = $('#gui'),
  10919. L = $('.webvr-popup'),
  10920. D = $('.webvr-popup .page.p1'),
  10921. N = $('.webvr-popup .page.p2'),
  10922. B = L.find('.image'),
  10923. F = $('.webvr-popup .detail.headset'),
  10924. V = $('.webvr-popup .detail.phone'),
  10925. U = $('.webvr-popup .tab-content.webvr'),
  10926. k = $('.webvr-popup .tab-content.native'),
  10927. H = 'images/device-daydream-side.png',
  10928. G = 'images/device-daydream.png',
  10929. z = 'images/device-pixel.png',
  10930. W = 'images/ico-android-robot.png',
  10931. j = 'images/badge-cardboard.png',
  10932. Y = 'images/headset-cardboard.png',
  10933. X = 'images/badge-oculus.png',
  10934. Z = 'https://madeby.google.com/vr/',
  10935. q = 'https://vr.google.com/cardboard/get-cardboard/',
  10936. K = 'webvr_daydream_link',
  10937. Q = 'webvr_cardboard_link',
  10938. J = Z,
  10939. ee = K,
  10940. te = 'https://vr.google.com/daydream/phones/',
  10941. ie = {
  10942. init: n
  10943. },
  10944. ne = {
  10945. tabcardboard: d,
  10946. tabdaydream: h,
  10947. tabnative: u
  10948. }
  10949. S.extendObject(ie, P.prototype), $(window).resize(m), (t.exports = ie)
  10950. }).call(this, '/js/gui/webvr/webVRgui.js')
  10951. },
  10952. {
  10953. '../../analytics': 4,
  10954. '../../constants': 8,
  10955. '../../enum/VRApps': 46,
  10956. '../../enum/VRPlatforms': 49,
  10957. '../../localization/localize': 108,
  10958. '../../settings': 166,
  10959. '../../util/browser': 182,
  10960. '../../util/common': 185,
  10961. '../../util/logger': 189,
  10962. './../gui': 65,
  10963. './../vr/vrLink': 86,
  10964. './WebVrEvent': 88,
  10965. events: 202
  10966. }
  10967. ],
  10968. 90: [
  10969. function (e, t, i) {
  10970. 'use strict'
  10971. function n(e, t, i, n, o) {
  10972. n || 0 === n ? (this.floorId = n) : (this.floorId = -1),
  10973. (this.roomId = o || ''),
  10974. (this.labelId = e),
  10975. (this.position = new r.Vector3().copy(t)),
  10976. (this.text = i)
  10977. }
  10978. var r = e('three'),
  10979. o = e('../util/browser')
  10980. ;(n.prototype.build = function () {
  10981. var e = window.document.createElement('div')
  10982. o.isMobile()
  10983. ? e.setAttribute('class', 'gui-floorplan-label gui-floorplan-label-mobile')
  10984. : e.setAttribute('class', 'gui-floorplan-label')
  10985. var t = window.document.createElement('div')
  10986. t.setAttribute('class', 'gui-floorplan-label-text')
  10987. var i = window.document.createTextNode(this.text)
  10988. t.appendChild(i),
  10989. e.appendChild(t),
  10990. window.document.body.appendChild(e),
  10991. (this.labelGui = e),
  10992. (this.textBlock = t),
  10993. $(this.labelGui).hide()
  10994. var n = window.getComputedStyle(this.labelGui)
  10995. this.initialTransform = n.transform || n.webkitTransform
  10996. }),
  10997. (t.exports = n)
  10998. },
  10999. {
  11000. '../util/browser': 182,
  11001. three: 217
  11002. }
  11003. ],
  11004. 91: [
  11005. function (e, t, i) {
  11006. 'use strict'
  11007. function n() {
  11008. ;(this.player = null), (this.modelManager = null), (this.container = null)
  11009. }
  11010. var r = e('three'),
  11011. o = (e('../util/common'), e('../enum/PlayerEvents')),
  11012. a = (e('../enum/DirectorEvents'), e('../enum/ModelManagerEvents')),
  11013. s = e('../settings'),
  11014. l = e('../enum/Viewmode'),
  11015. c =
  11016. (e('../enum/WarpStyle'),
  11017. e('../util/transitions'),
  11018. e('../util/lerp'),
  11019. e('../util/browser'))
  11020. //场景初始化
  11021. ;(n.prototype.init = function (e, t, i) {
  11022. ;(this.player = e),
  11023. (this.modelManager = t),
  11024. (this.container = i),
  11025. this.updateModel(),
  11026. this.bindEvents()
  11027. }),
  11028. (n.prototype.bindEvents = function () {
  11029. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  11030. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  11031. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  11032. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  11033. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  11034. }),
  11035. (n.prototype.updateModel = function () {
  11036. this.model = this.modelManager.getActiveModel()
  11037. }),
  11038. (n.prototype.handlePlayerViewChanged = function () {
  11039. this.updateLabelVisibility(), this.updateLabelDisplay()
  11040. }),
  11041. (n.prototype.getLabelsForFloor = function (e, t) {
  11042. return (
  11043. (t = t || []),
  11044. (t.length = 0),
  11045. this.model.labels.forEach(
  11046. function (i) {
  11047. this.labelVisibleForFloor(i, e) && t.push(i)
  11048. }.bind(this)
  11049. ),
  11050. t
  11051. )
  11052. }),
  11053. (n.prototype.getLabelsForCurrentFloor = function (e) {
  11054. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  11055. }),
  11056. (n.prototype.labelVisibleForFloor = function (e, t) {
  11057. var i =
  11058. (c.isMobile() &&
  11059. this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile) ||
  11060. (!c.isMobile() &&
  11061. this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop)
  11062. if (!this.model.showingLabels || !e.labelGui || !i) return !1
  11063. var n = e.floorId === this.model.floors.size() - 1
  11064. return this.model.allFloorsVisible ? n : e.floorId === t
  11065. }),
  11066. (n.prototype.updateLabelVisibility = function (e) {
  11067. this.model.labels.forEach(
  11068. function (e) {
  11069. this.supportedMode() &&
  11070. this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex)
  11071. ? this.showLabel(e, s.labels.fadeInDelay, s.labels.fadeInDuration)
  11072. : this.hideLabel(e, s.labels.fadeOutDelay, s.labels.fadeOutDuration)
  11073. }.bind(this)
  11074. )
  11075. }),
  11076. (n.prototype.showAllLabels = function (e, t) {
  11077. this.model.labels.forEach(
  11078. function (i) {
  11079. this.showLabel(i, e, t)
  11080. }.bind(this)
  11081. )
  11082. }),
  11083. (n.prototype.hideAllLabels = function (e, t) {
  11084. this.model.labels.forEach(
  11085. function (i) {
  11086. this.hideLabel(i, e, t)
  11087. }.bind(this)
  11088. )
  11089. }),
  11090. (n.prototype.showLabel = function (e, t, i) {
  11091. this.model.showingLabels &&
  11092. (e.visible ||
  11093. ((e.visible = !0),
  11094. (e.labelGui.style.display = 'block'),
  11095. (e.labelGui.style.opacity = 0),
  11096. $(e.labelGui).delay(t).fadeTo(i, 1)))
  11097. }),
  11098. (n.prototype.hideLabel = function (e, t, i) {
  11099. e.visible &&
  11100. ((e.visible = !1),
  11101. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  11102. }),
  11103. (n.prototype.supportedMode = function () {
  11104. return this.player.mode === l.FLOORPLAN
  11105. }),
  11106. (n.prototype.updateLabelDisplay = (function () {
  11107. var e = (new r.Vector3(), new r.Vector3(), [])
  11108. return function () {
  11109. var t = this.player.getLabelScaleFactor(),
  11110. i = 0.6,
  11111. n = 1.2,
  11112. r = (1 - t) * n + i,
  11113. o = c.isMobile()
  11114. ? s.labels.zoomTruncateThreshhold.mobile
  11115. : s.labels.zoomTruncateThreshhold.desktop
  11116. this.getLabelsForCurrentFloor(e)
  11117. for (var a = 0; a < e.length; a++) {
  11118. var l = e[a]
  11119. this.supportedMode() &&
  11120. l.labelGui &&
  11121. (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  11122. t >= o && l.text.length >= s.labels.minLengthForTruncate
  11123. ? (l.textBlock.innerText =
  11124. l.text.substring(0, s.labels.truncateLength) + s.labels.truncateSuffix)
  11125. : (l.textBlock.innerText = l.text))
  11126. }
  11127. }
  11128. })()),
  11129. (n.prototype.updateProjectedGuiElement = (function () {
  11130. var e = new r.Vector3()
  11131. new r.Vector3()
  11132. return function (t, i, n, r, o) {
  11133. i.style.fontSize = 100 * o + '%'
  11134. var a = $('#player').width(),
  11135. s = $('#player').height(),
  11136. l = 0.5 * a,
  11137. c = 0.5 * s
  11138. e.copy(n), e.project(this.player.camera)
  11139. var h = e.x * l + l,
  11140. u = -(e.y * c) + c
  11141. ;(h -= t.offsetWidth / 2),
  11142. (u -= t.offsetHeight / 2),
  11143. (t.style.left = h + 'px'),
  11144. (t.style.top = u + 'px')
  11145. }
  11146. })()),
  11147. (n.prototype.handleStartInside = function (e) {
  11148. this.updateLabelVisibility()
  11149. }),
  11150. (n.prototype.handleStartOutside = function () {
  11151. this.updateLabelVisibility()
  11152. }),
  11153. (t.exports = n)
  11154. },
  11155. {
  11156. '../enum/DirectorEvents': 23,
  11157. '../enum/ModelManagerEvents': 33,
  11158. '../enum/PlayerEvents': 40,
  11159. '../enum/Viewmode': 51,
  11160. '../enum/WarpStyle': 52,
  11161. '../settings': 166,
  11162. '../util/browser': 182,
  11163. '../util/common': 185,
  11164. '../util/lerp': 188,
  11165. '../util/transitions': 195,
  11166. three: 217
  11167. }
  11168. ],
  11169. 92: [
  11170. function (e, t, i) {
  11171. 'use strict'
  11172. Array.prototype.findIndex ||
  11173. (Array.prototype.findIndex = function (e) {
  11174. if (null == this)
  11175. throw new TypeError('Array.prototype.findIndex called on null or undefined')
  11176. if ('function' != typeof e) throw new TypeError('predicate must be a function')
  11177. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  11178. if (((t = i[o]), e.call(r, t, o, i))) return o
  11179. return -1
  11180. }),
  11181. Array.prototype.find ||
  11182. Object.defineProperty(Array.prototype, 'find', {
  11183. value: function (e) {
  11184. if (null == this) throw new TypeError('"this" is null or not defined')
  11185. var t = Object(this),
  11186. i = t.length >>> 0
  11187. if ('function' != typeof e) throw new TypeError('predicate must be a function')
  11188. for (var n = arguments[1], r = 0; r < i; ) {
  11189. var o = t[r]
  11190. if (e.call(n, o, r, t)) return o
  11191. r++
  11192. }
  11193. }
  11194. })
  11195. },
  11196. {}
  11197. ],
  11198. 93: [
  11199. function (e, t, i) {
  11200. 'use strict'
  11201. var n = n || {}
  11202. ;(t.exports = n),
  11203. (n.gui = n.gui || {}),
  11204. (n.utils = n.utils || {}),
  11205. (n.controllers = n.controllers || {}),
  11206. (n.dom = n.dom || {}),
  11207. (n.color = n.color || {}),
  11208. (n.utils.css = (function () {
  11209. return {
  11210. load: function (e, t) {
  11211. t = t || document
  11212. var i = t.createElement('link')
  11213. ;(i.type = 'text/css'),
  11214. (i.rel = 'stylesheet'),
  11215. (i.href = e),
  11216. t.getElementsByTagName('head')[0].appendChild(i)
  11217. },
  11218. inject: function (e, t) {
  11219. t = t || document
  11220. var i = document.createElement('style')
  11221. ;(i.type = 'text/css'),
  11222. (i.innerHTML = e),
  11223. t.getElementsByTagName('head')[0].appendChild(i)
  11224. }
  11225. }
  11226. })()),
  11227. (n.utils.common = (function () {
  11228. var e = Array.prototype.forEach,
  11229. t = Array.prototype.slice
  11230. return {
  11231. BREAK: {},
  11232. extend: function (e) {
  11233. return (
  11234. this.each(
  11235. t.call(arguments, 1),
  11236. function (t) {
  11237. for (var i in t) this.isUndefined(t[i]) || (e[i] = t[i])
  11238. },
  11239. this
  11240. ),
  11241. e
  11242. )
  11243. },
  11244. defaults: function (e) {
  11245. return (
  11246. this.each(
  11247. t.call(arguments, 1),
  11248. function (t) {
  11249. for (var i in t) this.isUndefined(e[i]) && (e[i] = t[i])
  11250. },
  11251. this
  11252. ),
  11253. e
  11254. )
  11255. },
  11256. compose: function () {
  11257. var e = t.call(arguments)
  11258. return function () {
  11259. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  11260. i = [e[n].apply(this, i)]
  11261. return i[0]
  11262. }
  11263. },
  11264. each: function (t, i, n) {
  11265. if (t)
  11266. if (e && t.forEach && t.forEach === e) t.forEach(i, n)
  11267. else if (t.length === t.length + 0) {
  11268. for (var r = 0, o = t.length; r < o; r++)
  11269. if (r in t && i.call(n, t[r], r) === this.BREAK) return
  11270. } else for (var r in t) if (i.call(n, t[r], r) === this.BREAK) return
  11271. },
  11272. defer: function (e) {
  11273. setTimeout(e, 0)
  11274. },
  11275. toArray: function (e) {
  11276. return e.toArray ? e.toArray() : t.call(e)
  11277. },
  11278. isUndefined: function (e) {
  11279. return void 0 === e
  11280. },
  11281. isNull: function (e) {
  11282. return null === e
  11283. },
  11284. isNaN: function (e) {
  11285. return e !== e
  11286. },
  11287. isArray:
  11288. Array.isArray ||
  11289. function (e) {
  11290. return e.constructor === Array
  11291. },
  11292. isObject: function (e) {
  11293. return e === Object(e)
  11294. },
  11295. isNumber: function (e) {
  11296. return e === e + 0
  11297. },
  11298. isString: function (e) {
  11299. return e === e + ''
  11300. },
  11301. isBoolean: function (e) {
  11302. return e === !1 || e === !0
  11303. },
  11304. isFunction: function (e) {
  11305. return '[object Function]' === Object.prototype.toString.call(e)
  11306. }
  11307. }
  11308. })()),
  11309. (n.controllers.Controller = (function (e) {
  11310. var t = function (e, t) {
  11311. ;(this.initialValue = e[t]),
  11312. (this.domElement = document.createElement('div')),
  11313. (this.object = e),
  11314. (this.property = t),
  11315. (this.__onChange = void 0),
  11316. (this.__onFinishChange = void 0)
  11317. }
  11318. return (
  11319. e.extend(t.prototype, {
  11320. onChange: function (e) {
  11321. return (this.__onChange = e), this
  11322. },
  11323. onFinishChange: function (e) {
  11324. return (this.__onFinishChange = e), this
  11325. },
  11326. setValue: function (e) {
  11327. return (
  11328. (this.object[this.property] = e),
  11329. this.__onChange && this.__onChange.call(this, e),
  11330. this.updateDisplay(),
  11331. this
  11332. )
  11333. },
  11334. getValue: function () {
  11335. return this.object[this.property]
  11336. },
  11337. updateDisplay: function () {
  11338. return this
  11339. },
  11340. isModified: function () {
  11341. return this.initialValue !== this.getValue()
  11342. }
  11343. }),
  11344. t
  11345. )
  11346. })(n.utils.common)),
  11347. (n.dom.dom = (function (e) {
  11348. function t(t) {
  11349. if ('0' === t || e.isUndefined(t)) return 0
  11350. var i = t.match(r)
  11351. return e.isNull(i) ? 0 : parseFloat(i[1])
  11352. }
  11353. var i = {
  11354. HTMLEvents: ['change'],
  11355. MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'],
  11356. KeyboardEvents: ['keydown']
  11357. },
  11358. n = {}
  11359. e.each(i, function (t, i) {
  11360. e.each(t, function (e) {
  11361. n[e] = i
  11362. })
  11363. })
  11364. var r = /(\d+(\.\d+)?)px/,
  11365. o = {
  11366. makeSelectable: function (e, t) {
  11367. void 0 !== e &&
  11368. void 0 !== e.style &&
  11369. ((e.onselectstart = t
  11370. ? function () {
  11371. return !1
  11372. }
  11373. : function () {}),
  11374. (e.style.MozUserSelect = t ? 'auto' : 'none'),
  11375. (e.style.KhtmlUserSelect = t ? 'auto' : 'none'),
  11376. (e.unselectable = t ? 'on' : 'off'))
  11377. },
  11378. makeFullscreen: function (t, i, n) {
  11379. e.isUndefined(i) && (i = !0),
  11380. e.isUndefined(n) && (n = !0),
  11381. (t.style.position = 'absolute'),
  11382. i && ((t.style.left = 0), (t.style.right = 0)),
  11383. n && ((t.style.top = 0), (t.style.bottom = 0))
  11384. },
  11385. fakeEvent: function (t, i, r, o) {
  11386. r = r || {}
  11387. var a = n[i]
  11388. if (!a) throw new Error('Event type ' + i + ' not supported.')
  11389. var s = document.createEvent(a)
  11390. switch (a) {
  11391. case 'MouseEvents':
  11392. var l = r.x || r.clientX || 0,
  11393. c = r.y || r.clientY || 0
  11394. s.initMouseEvent(
  11395. i,
  11396. r.bubbles || !1,
  11397. r.cancelable || !0,
  11398. window,
  11399. r.clickCount || 1,
  11400. 0,
  11401. 0,
  11402. l,
  11403. c,
  11404. !1,
  11405. !1,
  11406. !1,
  11407. !1,
  11408. 0,
  11409. null
  11410. )
  11411. break
  11412. case 'KeyboardEvents':
  11413. var h = s.initKeyboardEvent || s.initKeyEvent
  11414. e.defaults(r, {
  11415. cancelable: !0,
  11416. ctrlKey: !1,
  11417. altKey: !1,
  11418. shiftKey: !1,
  11419. metaKey: !1,
  11420. keyCode: void 0,
  11421. charCode: void 0
  11422. }),
  11423. h(
  11424. i,
  11425. r.bubbles || !1,
  11426. r.cancelable,
  11427. window,
  11428. r.ctrlKey,
  11429. r.altKey,
  11430. r.shiftKey,
  11431. r.metaKey,
  11432. r.keyCode,
  11433. r.charCode
  11434. )
  11435. break
  11436. default:
  11437. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  11438. }
  11439. e.defaults(s, o), t.dispatchEvent(s)
  11440. },
  11441. bind: function (e, t, i, n) {
  11442. return (
  11443. (n = n || !1),
  11444. e.addEventListener
  11445. ? e.addEventListener(t, i, n)
  11446. : e.attachEvent && e.attachEvent('on' + t, i),
  11447. o
  11448. )
  11449. },
  11450. unbind: function (e, t, i, n) {
  11451. return (
  11452. (n = n || !1),
  11453. e.removeEventListener
  11454. ? e.removeEventListener(t, i, n)
  11455. : e.detachEvent && e.detachEvent('on' + t, i),
  11456. o
  11457. )
  11458. },
  11459. addClass: function (e, t) {
  11460. if (void 0 === e.className) e.className = t
  11461. else if (e.className !== t) {
  11462. var i = e.className.split(/ +/)
  11463. i.indexOf(t) == -1 &&
  11464. (i.push(t),
  11465. (e.className = i.join(' ').replace(/^\s+/, '').replace(/\s+$/, '')))
  11466. }
  11467. return o
  11468. },
  11469. removeClass: function (e, t) {
  11470. if (t)
  11471. if (void 0 === e.className);
  11472. else if (e.className === t) e.removeAttribute('class')
  11473. else {
  11474. var i = e.className.split(/ +/),
  11475. n = i.indexOf(t)
  11476. n != -1 && (i.splice(n, 1), (e.className = i.join(' ')))
  11477. }
  11478. else e.className = void 0
  11479. return o
  11480. },
  11481. hasClass: function (e, t) {
  11482. return new RegExp('(?:^|\\s+)' + t + '(?:\\s+|$)').test(e.className) || !1
  11483. },
  11484. getWidth: function (e) {
  11485. var i = getComputedStyle(e)
  11486. return (
  11487. t(i['border-left-width']) +
  11488. t(i['border-right-width']) +
  11489. t(i['padding-left']) +
  11490. t(i['padding-right']) +
  11491. t(i.width)
  11492. )
  11493. },
  11494. getHeight: function (e) {
  11495. var i = getComputedStyle(e)
  11496. return (
  11497. t(i['border-top-width']) +
  11498. t(i['border-bottom-width']) +
  11499. t(i['padding-top']) +
  11500. t(i['padding-bottom']) +
  11501. t(i.height)
  11502. )
  11503. },
  11504. getOffset: function (e) {
  11505. var t = {
  11506. left: 0,
  11507. top: 0
  11508. }
  11509. if (e.offsetParent)
  11510. do (t.left += e.offsetLeft), (t.top += e.offsetTop)
  11511. while ((e = e.offsetParent))
  11512. return t
  11513. },
  11514. isActive: function (e) {
  11515. return e === document.activeElement && (e.type || e.href)
  11516. }
  11517. }
  11518. return o
  11519. })(n.utils.common)),
  11520. (n.controllers.OptionController = (function (e, t, i) {
  11521. var n = function (e, r, o) {
  11522. n.superclass.call(this, e, r)
  11523. var a = this
  11524. if (((this.__select = document.createElement('select')), i.isArray(o))) {
  11525. var s = {}
  11526. i.each(o, function (e) {
  11527. s[e] = e
  11528. }),
  11529. (o = s)
  11530. }
  11531. i.each(o, function (e, t) {
  11532. var i = document.createElement('option')
  11533. ;(i.innerHTML = t), i.setAttribute('value', e), a.__select.appendChild(i)
  11534. }),
  11535. this.updateDisplay(),
  11536. t.bind(this.__select, 'change', function () {
  11537. var e = this.options[this.selectedIndex].value
  11538. a.setValue(e)
  11539. }),
  11540. this.domElement.appendChild(this.__select)
  11541. }
  11542. return (
  11543. (n.superclass = e),
  11544. i.extend(n.prototype, e.prototype, {
  11545. setValue: function (e) {
  11546. var t = n.superclass.prototype.setValue.call(this, e)
  11547. return (
  11548. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), t
  11549. )
  11550. },
  11551. updateDisplay: function () {
  11552. return (
  11553. (this.__select.value = this.getValue()),
  11554. n.superclass.prototype.updateDisplay.call(this)
  11555. )
  11556. }
  11557. }),
  11558. n
  11559. )
  11560. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  11561. (n.controllers.NumberController = (function (e, t) {
  11562. function i(e) {
  11563. return (e = e.toString()), e.indexOf('.') > -1 ? e.length - e.indexOf('.') - 1 : 0
  11564. }
  11565. var n = function (e, r, o) {
  11566. n.superclass.call(this, e, r),
  11567. (o = o || {}),
  11568. (this.__min = o.min),
  11569. (this.__max = o.max),
  11570. (this.__step = o.step),
  11571. t.isUndefined(this.__step)
  11572. ? 0 == this.initialValue
  11573. ? (this.__impliedStep = 1)
  11574. : (this.__impliedStep =
  11575. Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10)
  11576. : (this.__impliedStep = this.__step),
  11577. (this.__precision = i(this.__impliedStep))
  11578. }
  11579. return (
  11580. (n.superclass = e),
  11581. t.extend(n.prototype, e.prototype, {
  11582. setValue: function (e) {
  11583. return (
  11584. void 0 !== this.__min && e < this.__min
  11585. ? (e = this.__min)
  11586. : void 0 !== this.__max && e > this.__max && (e = this.__max),
  11587. void 0 !== this.__step &&
  11588. e % this.__step != 0 &&
  11589. (e = Math.round(e / this.__step) * this.__step),
  11590. n.superclass.prototype.setValue.call(this, e)
  11591. )
  11592. },
  11593. min: function (e) {
  11594. return (this.__min = e), this
  11595. },
  11596. max: function (e) {
  11597. return (this.__max = e), this
  11598. },
  11599. step: function (e) {
  11600. return (
  11601. (this.__step = e), (this.__impliedStep = e), (this.__precision = i(e)), this
  11602. )
  11603. }
  11604. }),
  11605. n
  11606. )
  11607. })(n.controllers.Controller, n.utils.common)),
  11608. (n.controllers.NumberControllerBox = (function (e, t, i) {
  11609. function n(e, t) {
  11610. var i = Math.pow(10, t)
  11611. return Math.round(e * i) / i
  11612. }
  11613. var r = function (e, n, o) {
  11614. function a() {
  11615. var e = parseFloat(d.__input.value)
  11616. i.isNaN(e) || d.setValue(e)
  11617. }
  11618. function s() {
  11619. a(), d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  11620. }
  11621. function l(e) {
  11622. t.bind(window, 'mousemove', c), t.bind(window, 'mouseup', h), (u = e.clientY)
  11623. }
  11624. function c(e) {
  11625. var t = u - e.clientY
  11626. d.setValue(d.getValue() + t * d.__impliedStep), (u = e.clientY)
  11627. }
  11628. function h() {
  11629. t.unbind(window, 'mousemove', c), t.unbind(window, 'mouseup', h)
  11630. }
  11631. ;(this.__truncationSuspended = !1), r.superclass.call(this, e, n, o)
  11632. var u,
  11633. d = this
  11634. ;(this.__input = document.createElement('input')),
  11635. this.__input.setAttribute('type', 'text'),
  11636. t.bind(this.__input, 'change', a),
  11637. t.bind(this.__input, 'blur', s),
  11638. t.bind(this.__input, 'mousedown', l),
  11639. t.bind(this.__input, 'keydown', function (e) {
  11640. 13 === e.keyCode &&
  11641. ((d.__truncationSuspended = !0), this.blur(), (d.__truncationSuspended = !1))
  11642. }),
  11643. this.updateDisplay(),
  11644. this.domElement.appendChild(this.__input)
  11645. }
  11646. return (
  11647. (r.superclass = e),
  11648. i.extend(r.prototype, e.prototype, {
  11649. updateDisplay: function () {
  11650. return (
  11651. (this.__input.value = this.__truncationSuspended
  11652. ? this.getValue()
  11653. : n(this.getValue(), this.__precision)),
  11654. r.superclass.prototype.updateDisplay.call(this)
  11655. )
  11656. }
  11657. }),
  11658. r
  11659. )
  11660. })(n.controllers.NumberController, n.dom.dom, n.utils.common)),
  11661. (n.controllers.NumberControllerSlider = (function (e, t, i, n, r) {
  11662. function o(e, t, i, n, r) {
  11663. return n + (r - n) * ((e - t) / (i - t))
  11664. }
  11665. var a = function (e, i, n, r, s) {
  11666. function l(e) {
  11667. t.bind(window, 'mousemove', c), t.bind(window, 'mouseup', h), c(e)
  11668. }
  11669. function c(e) {
  11670. e.preventDefault()
  11671. var i = t.getOffset(u.__background),
  11672. n = t.getWidth(u.__background)
  11673. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)), !1
  11674. }
  11675. function h() {
  11676. t.unbind(window, 'mousemove', c),
  11677. t.unbind(window, 'mouseup', h),
  11678. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  11679. }
  11680. a.superclass.call(this, e, i, {
  11681. min: n,
  11682. max: r,
  11683. step: s
  11684. })
  11685. var u = this
  11686. ;(this.__background = document.createElement('div')),
  11687. (this.__foreground = document.createElement('div')),
  11688. t.bind(this.__background, 'mousedown', l),
  11689. t.addClass(this.__background, 'slider'),
  11690. t.addClass(this.__foreground, 'slider-fg'),
  11691. this.updateDisplay(),
  11692. this.__background.appendChild(this.__foreground),
  11693. this.domElement.appendChild(this.__background)
  11694. }
  11695. return (
  11696. (a.superclass = e),
  11697. (a.useDefaultStyles = function () {
  11698. i.inject(r)
  11699. }),
  11700. n.extend(a.prototype, e.prototype, {
  11701. updateDisplay: function () {
  11702. var e = (this.getValue() - this.__min) / (this.__max - this.__min)
  11703. return (
  11704. (this.__foreground.style.width = 100 * e + '%'),
  11705. a.superclass.prototype.updateDisplay.call(this)
  11706. )
  11707. }
  11708. }),
  11709. a
  11710. )
  11711. })(
  11712. n.controllers.NumberController,
  11713. n.dom.dom,
  11714. n.utils.css,
  11715. n.utils.common,
  11716. '/**\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}'
  11717. )),
  11718. (n.controllers.FunctionController = (function (e, t, i) {
  11719. var n = function (e, i, r) {
  11720. n.superclass.call(this, e, i)
  11721. var o = this
  11722. ;(this.__button = document.createElement('div')),
  11723. (this.__button.innerHTML = void 0 === r ? 'Fire' : r),
  11724. t.bind(this.__button, 'click', function (e) {
  11725. return e.preventDefault(), o.fire(), !1
  11726. }),
  11727. t.addClass(this.__button, 'button'),
  11728. this.domElement.appendChild(this.__button)
  11729. }
  11730. return (
  11731. (n.superclass = e),
  11732. i.extend(n.prototype, e.prototype, {
  11733. fire: function () {
  11734. this.__onChange && this.__onChange.call(this),
  11735. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  11736. this.getValue().call(this.object)
  11737. }
  11738. }),
  11739. n
  11740. )
  11741. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  11742. (n.controllers.BooleanController = (function (e, t, i) {
  11743. var n = function (e, i) {
  11744. function r() {
  11745. o.setValue(!o.__prev)
  11746. }
  11747. n.superclass.call(this, e, i)
  11748. var o = this
  11749. ;(this.__prev = this.getValue()),
  11750. (this.__checkbox = document.createElement('input')),
  11751. this.__checkbox.setAttribute('type', 'checkbox'),
  11752. t.bind(this.__checkbox, 'change', r, !1),
  11753. this.domElement.appendChild(this.__checkbox),
  11754. this.updateDisplay()
  11755. }
  11756. return (
  11757. (n.superclass = e),
  11758. i.extend(n.prototype, e.prototype, {
  11759. setValue: function (e) {
  11760. var t = n.superclass.prototype.setValue.call(this, e)
  11761. return (
  11762. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  11763. (this.__prev = this.getValue()),
  11764. t
  11765. )
  11766. },
  11767. updateDisplay: function () {
  11768. return (
  11769. this.getValue() === !0
  11770. ? (this.__checkbox.setAttribute('checked', 'checked'),
  11771. (this.__checkbox.checked = !0))
  11772. : (this.__checkbox.checked = !1),
  11773. n.superclass.prototype.updateDisplay.call(this)
  11774. )
  11775. }
  11776. }),
  11777. n
  11778. )
  11779. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  11780. (n.color.toString = (function (e) {
  11781. return function (t) {
  11782. if (1 == t.a || e.isUndefined(t.a)) {
  11783. for (var i = t.hex.toString(16); i.length < 6; ) i = '0' + i
  11784. return '#' + i
  11785. }
  11786. return (
  11787. 'rgba(' +
  11788. Math.round(t.r) +
  11789. ',' +
  11790. Math.round(t.g) +
  11791. ',' +
  11792. Math.round(t.b) +
  11793. ',' +
  11794. t.a +
  11795. ')'
  11796. )
  11797. }
  11798. })(n.utils.common)),
  11799. (n.color.interpret = (function (e, t) {
  11800. var i,
  11801. n,
  11802. r = function () {
  11803. n = !1
  11804. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0]
  11805. return (
  11806. t.each(o, function (r) {
  11807. if (r.litmus(e))
  11808. return (
  11809. t.each(r.conversions, function (r, o) {
  11810. if (((i = r.read(e)), n === !1 && i !== !1))
  11811. return (n = i), (i.conversionName = o), (i.conversion = r), t.BREAK
  11812. }),
  11813. t.BREAK
  11814. )
  11815. }),
  11816. n
  11817. )
  11818. },
  11819. o = [
  11820. {
  11821. litmus: t.isString,
  11822. conversions: {
  11823. THREE_CHAR_HEX: {
  11824. read: function (e) {
  11825. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i)
  11826. return (
  11827. null !== t && {
  11828. space: 'HEX',
  11829. hex: parseInt(
  11830. '0x' +
  11831. t[1].toString() +
  11832. t[1].toString() +
  11833. t[2].toString() +
  11834. t[2].toString() +
  11835. t[3].toString() +
  11836. t[3].toString()
  11837. )
  11838. }
  11839. )
  11840. },
  11841. write: e
  11842. },
  11843. SIX_CHAR_HEX: {
  11844. read: function (e) {
  11845. var t = e.match(/^#([A-F0-9]{6})$/i)
  11846. return (
  11847. null !== t && {
  11848. space: 'HEX',
  11849. hex: parseInt('0x' + t[1].toString())
  11850. }
  11851. )
  11852. },
  11853. write: e
  11854. },
  11855. CSS_RGB: {
  11856. read: function (e) {
  11857. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/)
  11858. return (
  11859. null !== t && {
  11860. space: 'RGB',
  11861. r: parseFloat(t[1]),
  11862. g: parseFloat(t[2]),
  11863. b: parseFloat(t[3])
  11864. }
  11865. )
  11866. },
  11867. write: e
  11868. },
  11869. CSS_RGBA: {
  11870. read: function (e) {
  11871. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/)
  11872. return (
  11873. null !== t && {
  11874. space: 'RGB',
  11875. r: parseFloat(t[1]),
  11876. g: parseFloat(t[2]),
  11877. b: parseFloat(t[3]),
  11878. a: parseFloat(t[4])
  11879. }
  11880. )
  11881. },
  11882. write: e
  11883. }
  11884. }
  11885. },
  11886. {
  11887. litmus: t.isNumber,
  11888. conversions: {
  11889. HEX: {
  11890. read: function (e) {
  11891. return {
  11892. space: 'HEX',
  11893. hex: e,
  11894. conversionName: 'HEX'
  11895. }
  11896. },
  11897. write: function (e) {
  11898. return e.hex
  11899. }
  11900. }
  11901. }
  11902. },
  11903. {
  11904. litmus: t.isArray,
  11905. conversions: {
  11906. RGB_ARRAY: {
  11907. read: function (e) {
  11908. return (
  11909. 3 == e.length && {
  11910. space: 'RGB',
  11911. r: e[0],
  11912. g: e[1],
  11913. b: e[2]
  11914. }
  11915. )
  11916. },
  11917. write: function (e) {
  11918. return [e.r, e.g, e.b]
  11919. }
  11920. },
  11921. RGBA_ARRAY: {
  11922. read: function (e) {
  11923. return (
  11924. 4 == e.length && {
  11925. space: 'RGB',
  11926. r: e[0],
  11927. g: e[1],
  11928. b: e[2],
  11929. a: e[3]
  11930. }
  11931. )
  11932. },
  11933. write: function (e) {
  11934. return [e.r, e.g, e.b, e.a]
  11935. }
  11936. }
  11937. }
  11938. },
  11939. {
  11940. litmus: t.isObject,
  11941. conversions: {
  11942. RGBA_OBJ: {
  11943. read: function (e) {
  11944. return (
  11945. !!(
  11946. t.isNumber(e.r) &&
  11947. t.isNumber(e.g) &&
  11948. t.isNumber(e.b) &&
  11949. t.isNumber(e.a)
  11950. ) && {
  11951. space: 'RGB',
  11952. r: e.r,
  11953. g: e.g,
  11954. b: e.b,
  11955. a: e.a
  11956. }
  11957. )
  11958. },
  11959. write: function (e) {
  11960. return {
  11961. r: e.r,
  11962. g: e.g,
  11963. b: e.b,
  11964. a: e.a
  11965. }
  11966. }
  11967. },
  11968. RGB_OBJ: {
  11969. read: function (e) {
  11970. return (
  11971. !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  11972. space: 'RGB',
  11973. r: e.r,
  11974. g: e.g,
  11975. b: e.b
  11976. }
  11977. )
  11978. },
  11979. write: function (e) {
  11980. return {
  11981. r: e.r,
  11982. g: e.g,
  11983. b: e.b
  11984. }
  11985. }
  11986. },
  11987. HSVA_OBJ: {
  11988. read: function (e) {
  11989. return (
  11990. !!(
  11991. t.isNumber(e.h) &&
  11992. t.isNumber(e.s) &&
  11993. t.isNumber(e.v) &&
  11994. t.isNumber(e.a)
  11995. ) && {
  11996. space: 'HSV',
  11997. h: e.h,
  11998. s: e.s,
  11999. v: e.v,
  12000. a: e.a
  12001. }
  12002. )
  12003. },
  12004. write: function (e) {
  12005. return {
  12006. h: e.h,
  12007. s: e.s,
  12008. v: e.v,
  12009. a: e.a
  12010. }
  12011. }
  12012. },
  12013. HSV_OBJ: {
  12014. read: function (e) {
  12015. return (
  12016. !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  12017. space: 'HSV',
  12018. h: e.h,
  12019. s: e.s,
  12020. v: e.v
  12021. }
  12022. )
  12023. },
  12024. write: function (e) {
  12025. return {
  12026. h: e.h,
  12027. s: e.s,
  12028. v: e.v
  12029. }
  12030. }
  12031. }
  12032. }
  12033. }
  12034. ]
  12035. return r
  12036. })(n.color.toString, n.utils.common)),
  12037. (n.GUI = n.gui.GUI =
  12038. (function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  12039. function g(e, t, i, o) {
  12040. if (void 0 === t[i]) throw new Error('Object ' + t + ' has no property "' + i + '"')
  12041. var a
  12042. if (o.color) a = new h(t, i)
  12043. else {
  12044. var s = [t, i].concat(o.factoryArgs)
  12045. a = n.apply(e, s)
  12046. }
  12047. o.before instanceof r && (o.before = o.before.__li),
  12048. A(e, a),
  12049. p.addClass(a.domElement, 'c')
  12050. var l = document.createElement('span')
  12051. p.addClass(l, 'property-name'), (l.innerHTML = a.property)
  12052. var c = document.createElement('div')
  12053. c.appendChild(l), c.appendChild(a.domElement)
  12054. var u = m(e, c, o.before)
  12055. return (
  12056. p.addClass(u, V.CLASS_CONTROLLER_ROW),
  12057. p.addClass(u, typeof a.getValue()),
  12058. v(e, u, a),
  12059. e.__controllers.push(a),
  12060. a
  12061. )
  12062. }
  12063. function m(e, t, i) {
  12064. var n = document.createElement('li')
  12065. return (
  12066. t && n.appendChild(t),
  12067. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  12068. e.onResize(),
  12069. n
  12070. )
  12071. }
  12072. function v(e, t, i) {
  12073. if (
  12074. ((i.__li = t),
  12075. (i.__gui = e),
  12076. f.extend(i, {
  12077. options: function (t) {
  12078. return arguments.length > 1
  12079. ? (i.remove(),
  12080. g(e, i.object, i.property, {
  12081. before: i.__li.nextElementSibling,
  12082. factoryArgs: [f.toArray(arguments)]
  12083. }))
  12084. : f.isArray(t) || f.isObject(t)
  12085. ? (i.remove(),
  12086. g(e, i.object, i.property, {
  12087. before: i.__li.nextElementSibling,
  12088. factoryArgs: [t]
  12089. }))
  12090. : void 0
  12091. },
  12092. name: function (e) {
  12093. return (i.__li.firstElementChild.firstElementChild.innerHTML = e), i
  12094. },
  12095. listen: function () {
  12096. return i.__gui.listen(i), i
  12097. },
  12098. remove: function () {
  12099. return i.__gui.remove(i), i
  12100. }
  12101. }),
  12102. i instanceof l)
  12103. ) {
  12104. var n = new s(i.object, i.property, {
  12105. min: i.__min,
  12106. max: i.__max,
  12107. step: i.__step
  12108. })
  12109. f.each(['updateDisplay', 'onChange', 'onFinishChange'], function (e) {
  12110. var t = i[e],
  12111. r = n[e]
  12112. i[e] = n[e] = function () {
  12113. var e = Array.prototype.slice.call(arguments)
  12114. return t.apply(i, e), r.apply(n, e)
  12115. }
  12116. }),
  12117. p.addClass(t, 'has-slider'),
  12118. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  12119. } else if (i instanceof s) {
  12120. var r = function (t) {
  12121. return f.isNumber(i.__min) && f.isNumber(i.__max)
  12122. ? (i.remove(),
  12123. g(e, i.object, i.property, {
  12124. before: i.__li.nextElementSibling,
  12125. factoryArgs: [i.__min, i.__max, i.__step]
  12126. }))
  12127. : t
  12128. }
  12129. ;(i.min = f.compose(r, i.min)), (i.max = f.compose(r, i.max))
  12130. } else
  12131. i instanceof o
  12132. ? (p.bind(t, 'click', function () {
  12133. p.fakeEvent(i.__checkbox, 'click')
  12134. }),
  12135. p.bind(i.__checkbox, 'click', function (e) {
  12136. e.stopPropagation()
  12137. }))
  12138. : i instanceof a
  12139. ? (p.bind(t, 'click', function () {
  12140. p.fakeEvent(i.__button, 'click')
  12141. }),
  12142. p.bind(t, 'mouseover', function () {
  12143. p.addClass(i.__button, 'hover')
  12144. }),
  12145. p.bind(t, 'mouseout', function () {
  12146. p.removeClass(i.__button, 'hover')
  12147. }))
  12148. : i instanceof h &&
  12149. (p.addClass(t, 'color'),
  12150. (i.updateDisplay = f.compose(function (e) {
  12151. return (t.style.borderLeftColor = i.__color.toString()), e
  12152. }, i.updateDisplay)),
  12153. i.updateDisplay())
  12154. i.setValue = f.compose(function (t) {
  12155. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0), t
  12156. }, i.setValue)
  12157. }
  12158. function A(e, t) {
  12159. var i = e.getRoot(),
  12160. n = i.__rememberedObjects.indexOf(t.object)
  12161. if (n != -1) {
  12162. var r = i.__rememberedObjectIndecesToControllers[n]
  12163. if (
  12164. (void 0 === r && ((r = {}), (i.__rememberedObjectIndecesToControllers[n] = r)),
  12165. (r[t.property] = t),
  12166. i.load && i.load.remembered)
  12167. ) {
  12168. var o,
  12169. a = i.load.remembered
  12170. if (a[e.preset]) o = a[e.preset]
  12171. else {
  12172. if (!a[L]) return
  12173. o = a[L]
  12174. }
  12175. if (o[n] && void 0 !== o[n][t.property]) {
  12176. var s = o[n][t.property]
  12177. ;(t.initialValue = s), t.setValue(s)
  12178. }
  12179. }
  12180. }
  12181. }
  12182. function y(e, t) {
  12183. return document.location.href + '.' + t
  12184. }
  12185. function C(e) {
  12186. var t = (e.__save_row = document.createElement('li'))
  12187. p.addClass(e.domElement, 'has-save'),
  12188. e.__ul.insertBefore(t, e.__ul.firstChild),
  12189. p.addClass(t, 'save-row')
  12190. var i = document.createElement('span')
  12191. ;(i.innerHTML = '&nbsp;'), p.addClass(i, 'button gears')
  12192. var n = document.createElement('span')
  12193. ;(n.innerHTML = 'Save'), p.addClass(n, 'button'), p.addClass(n, 'save')
  12194. var r = document.createElement('span')
  12195. ;(r.innerHTML = 'New'), p.addClass(r, 'button'), p.addClass(r, 'save-as')
  12196. var o = document.createElement('span')
  12197. ;(o.innerHTML = 'Revert'), p.addClass(o, 'button'), p.addClass(o, 'revert')
  12198. var a = (e.__preset_select = document.createElement('select'))
  12199. if (
  12200. (e.load && e.load.remembered
  12201. ? f.each(e.load.remembered, function (t, i) {
  12202. w(e, i, i == e.preset)
  12203. })
  12204. : w(e, L, !1),
  12205. p.bind(a, 'change', function () {
  12206. for (var t = 0; t < e.__preset_select.length; t++)
  12207. e.__preset_select[t].innerHTML = e.__preset_select[t].value
  12208. e.preset = this.value
  12209. }),
  12210. t.appendChild(a),
  12211. t.appendChild(i),
  12212. t.appendChild(n),
  12213. t.appendChild(r),
  12214. t.appendChild(o),
  12215. D)
  12216. ) {
  12217. var s = document.getElementById('dg-save-locally'),
  12218. l = document.getElementById('dg-local-explain')
  12219. s.style.display = 'block'
  12220. var c = document.getElementById('dg-local-storage')
  12221. 'true' === localStorage.getItem(y(e, 'isLocal')) &&
  12222. c.setAttribute('checked', 'checked')
  12223. var h = function () {
  12224. l.style.display = e.useLocalStorage ? 'block' : 'none'
  12225. }
  12226. h(),
  12227. p.bind(c, 'change', function () {
  12228. ;(e.useLocalStorage = !e.useLocalStorage), h()
  12229. })
  12230. }
  12231. var u = document.getElementById('dg-new-constructor')
  12232. p.bind(u, 'keydown', function (e) {
  12233. !e.metaKey || (67 !== e.which && 67 != e.keyCode) || S.hide()
  12234. }),
  12235. p.bind(i, 'click', function () {
  12236. ;(u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2)),
  12237. S.show(),
  12238. u.focus(),
  12239. u.select()
  12240. }),
  12241. p.bind(n, 'click', function () {
  12242. e.save()
  12243. }),
  12244. p.bind(r, 'click', function () {
  12245. var t = prompt('Enter a new preset name.')
  12246. t && e.saveAs(t)
  12247. }),
  12248. p.bind(o, 'click', function () {
  12249. e.revert()
  12250. })
  12251. }
  12252. function I(e) {
  12253. function t(t) {
  12254. return (
  12255. t.preventDefault(),
  12256. (r = t.clientX),
  12257. p.addClass(e.__closeButton, V.CLASS_DRAG),
  12258. p.bind(window, 'mousemove', i),
  12259. p.bind(window, 'mouseup', n),
  12260. !1
  12261. )
  12262. }
  12263. function i(t) {
  12264. return (
  12265. t.preventDefault(),
  12266. (e.width += r - t.clientX),
  12267. e.onResize(),
  12268. (r = t.clientX),
  12269. !1
  12270. )
  12271. }
  12272. function n() {
  12273. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  12274. p.unbind(window, 'mousemove', i),
  12275. p.unbind(window, 'mouseup', n)
  12276. }
  12277. ;(e.__resize_handle = document.createElement('div')),
  12278. f.extend(e.__resize_handle.style, {
  12279. width: '6px',
  12280. marginLeft: '-3px',
  12281. height: '200px',
  12282. cursor: 'ew-resize',
  12283. position: 'absolute'
  12284. })
  12285. var r
  12286. p.bind(e.__resize_handle, 'mousedown', t),
  12287. p.bind(e.__closeButton, 'mousedown', t),
  12288. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  12289. }
  12290. function E(e, t) {
  12291. ;(e.domElement.style.width = t + 'px'),
  12292. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + 'px'),
  12293. e.__closeButton && (e.__closeButton.style.width = t + 'px')
  12294. }
  12295. function b(e, t) {
  12296. var i = {}
  12297. return (
  12298. f.each(e.__rememberedObjects, function (n, r) {
  12299. var o = {},
  12300. a = e.__rememberedObjectIndecesToControllers[r]
  12301. f.each(a, function (e, i) {
  12302. o[i] = t ? e.initialValue : e.getValue()
  12303. }),
  12304. (i[r] = o)
  12305. }),
  12306. i
  12307. )
  12308. }
  12309. function w(e, t, i) {
  12310. var n = document.createElement('option')
  12311. ;(n.innerHTML = t),
  12312. (n.value = t),
  12313. e.__preset_select.appendChild(n),
  12314. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  12315. }
  12316. function _(e) {
  12317. for (var t = 0; t < e.__preset_select.length; t++)
  12318. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  12319. }
  12320. function T(e, t) {
  12321. var i = e.__preset_select[e.__preset_select.selectedIndex]
  12322. t ? (i.innerHTML = i.value + '*') : (i.innerHTML = i.value)
  12323. }
  12324. function x(e) {
  12325. 0 != e.length &&
  12326. u(function () {
  12327. x(e)
  12328. }),
  12329. f.each(e, function (e) {
  12330. e.updateDisplay()
  12331. })
  12332. }
  12333. e.inject(i)
  12334. var S,
  12335. M,
  12336. R = 'dg',
  12337. P = 72,
  12338. O = 20,
  12339. L = 'Default',
  12340. D = (function () {
  12341. try {
  12342. return 'localStorage' in window && null !== window.localStorage
  12343. } catch (e) {
  12344. return !1
  12345. }
  12346. })(),
  12347. N = !0,
  12348. B = !1,
  12349. F = [],
  12350. V = function (e) {
  12351. function t() {
  12352. var e = i.getRoot()
  12353. ;(e.width += 1),
  12354. f.defer(function () {
  12355. e.width -= 1
  12356. })
  12357. }
  12358. var i = this
  12359. ;(this.domElement = document.createElement('div')),
  12360. (this.__ul = document.createElement('ul')),
  12361. this.domElement.appendChild(this.__ul),
  12362. p.addClass(this.domElement, R),
  12363. (this.__folders = {}),
  12364. (this.__controllers = []),
  12365. (this.__rememberedObjects = []),
  12366. (this.__rememberedObjectIndecesToControllers = []),
  12367. (this.__listening = []),
  12368. (e = e || {}),
  12369. (e = f.defaults(e, {
  12370. autoPlace: !0,
  12371. width: V.DEFAULT_WIDTH
  12372. })),
  12373. (e = f.defaults(e, {
  12374. resizable: e.autoPlace,
  12375. hideable: e.autoPlace
  12376. })),
  12377. f.isUndefined(e.load)
  12378. ? (e.load = {
  12379. preset: L
  12380. })
  12381. : e.preset && (e.load.preset = e.preset),
  12382. f.isUndefined(e.parent) && e.hideable && F.push(this),
  12383. (e.resizable = f.isUndefined(e.parent) && e.resizable),
  12384. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0)
  12385. var n,
  12386. r = D && 'true' === localStorage.getItem(y(this, 'isLocal'))
  12387. if (
  12388. (Object.defineProperties(this, {
  12389. parent: {
  12390. get: function () {
  12391. return e.parent
  12392. }
  12393. },
  12394. scrollable: {
  12395. get: function () {
  12396. return e.scrollable
  12397. }
  12398. },
  12399. autoPlace: {
  12400. get: function () {
  12401. return e.autoPlace
  12402. }
  12403. },
  12404. preset: {
  12405. get: function () {
  12406. return i.parent ? i.getRoot().preset : e.load.preset
  12407. },
  12408. set: function (t) {
  12409. i.parent ? (i.getRoot().preset = t) : (e.load.preset = t),
  12410. _(this),
  12411. i.revert()
  12412. }
  12413. },
  12414. width: {
  12415. get: function () {
  12416. return e.width
  12417. },
  12418. set: function (t) {
  12419. ;(e.width = t), E(i, t)
  12420. }
  12421. },
  12422. name: {
  12423. get: function () {
  12424. return e.name
  12425. },
  12426. set: function (t) {
  12427. ;(e.name = t), a && (a.innerHTML = e.name)
  12428. }
  12429. },
  12430. closed: {
  12431. get: function () {
  12432. return e.closed
  12433. },
  12434. set: function (t) {
  12435. ;(e.closed = t),
  12436. e.closed
  12437. ? p.addClass(i.__ul, V.CLASS_CLOSED)
  12438. : p.removeClass(i.__ul, V.CLASS_CLOSED),
  12439. this.onResize(),
  12440. i.__closeButton &&
  12441. (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  12442. }
  12443. },
  12444. load: {
  12445. get: function () {
  12446. return e.load
  12447. }
  12448. },
  12449. useLocalStorage: {
  12450. get: function () {
  12451. return r
  12452. },
  12453. set: function (e) {
  12454. D &&
  12455. ((r = e),
  12456. e ? p.bind(window, 'unload', n) : p.unbind(window, 'unload', n),
  12457. localStorage.setItem(y(i, 'isLocal'), e))
  12458. }
  12459. }
  12460. }),
  12461. f.isUndefined(e.parent))
  12462. ) {
  12463. if (
  12464. ((e.closed = !1),
  12465. p.addClass(this.domElement, V.CLASS_MAIN),
  12466. p.makeSelectable(this.domElement, !1),
  12467. D && r)
  12468. ) {
  12469. i.useLocalStorage = !0
  12470. var o = localStorage.getItem(y(this, 'gui'))
  12471. o && (e.load = JSON.parse(o))
  12472. }
  12473. ;(this.__closeButton = document.createElement('div')),
  12474. (this.__closeButton.innerHTML = V.TEXT_CLOSED),
  12475. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  12476. this.domElement.appendChild(this.__closeButton),
  12477. p.bind(this.__closeButton, 'click', function () {
  12478. i.closed = !i.closed
  12479. })
  12480. } else {
  12481. void 0 === e.closed && (e.closed = !0)
  12482. var a = document.createTextNode(e.name)
  12483. p.addClass(a, 'controller-name')
  12484. var s = m(i, a),
  12485. l = function (e) {
  12486. return e.preventDefault(), (i.closed = !i.closed), !1
  12487. }
  12488. p.addClass(this.__ul, V.CLASS_CLOSED),
  12489. p.addClass(s, 'title'),
  12490. p.bind(s, 'click', l),
  12491. e.closed || (this.closed = !1)
  12492. }
  12493. e.autoPlace &&
  12494. (f.isUndefined(e.parent) &&
  12495. (N &&
  12496. ((M = document.createElement('div')),
  12497. p.addClass(M, R),
  12498. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  12499. document.body.appendChild(M),
  12500. (N = !1)),
  12501. M.appendChild(this.domElement),
  12502. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  12503. this.parent || E(i, e.width)),
  12504. p.bind(window, 'resize', function () {
  12505. i.onResize()
  12506. }),
  12507. p.bind(this.__ul, 'webkitTransitionEnd', function () {
  12508. i.onResize()
  12509. }),
  12510. p.bind(this.__ul, 'transitionend', function () {
  12511. i.onResize()
  12512. }),
  12513. p.bind(this.__ul, 'oTransitionEnd', function () {
  12514. i.onResize()
  12515. }),
  12516. this.onResize(),
  12517. e.resizable && I(this),
  12518. (n = function () {
  12519. D &&
  12520. 'true' === localStorage.getItem(y(i, 'isLocal')) &&
  12521. localStorage.setItem(y(i, 'gui'), JSON.stringify(i.getSaveObject()))
  12522. }),
  12523. (this.saveToLocalStorageIfPossible = n)
  12524. i.getRoot()
  12525. e.parent || t()
  12526. }
  12527. return (
  12528. (V.toggleHide = function () {
  12529. ;(B = !B),
  12530. f.each(F, function (e) {
  12531. ;(e.domElement.style.zIndex = B ? -999 : 999),
  12532. (e.domElement.style.opacity = B ? 0 : 1)
  12533. })
  12534. }),
  12535. (V.CLASS_AUTO_PLACE = 'a'),
  12536. (V.CLASS_AUTO_PLACE_CONTAINER = 'ac'),
  12537. (V.CLASS_MAIN = 'main'),
  12538. (V.CLASS_CONTROLLER_ROW = 'cr'),
  12539. (V.CLASS_TOO_TALL = 'taller-than-window'),
  12540. (V.CLASS_CLOSED = 'closed'),
  12541. (V.CLASS_CLOSE_BUTTON = 'close-button'),
  12542. (V.CLASS_DRAG = 'drag'),
  12543. (V.DEFAULT_WIDTH = 245),
  12544. (V.TEXT_CLOSED = 'Close Controls'),
  12545. (V.TEXT_OPEN = 'Open Controls'),
  12546. p.bind(
  12547. window,
  12548. 'keydown',
  12549. function (e) {
  12550. 'text' === document.activeElement.type ||
  12551. (e.which !== P && e.keyCode != P) ||
  12552. V.toggleHide()
  12553. },
  12554. !1
  12555. ),
  12556. f.extend(V.prototype, {
  12557. add: function (e, t) {
  12558. return g(this, e, t, {
  12559. factoryArgs: Array.prototype.slice.call(arguments, 2)
  12560. })
  12561. },
  12562. addColor: function (e, t) {
  12563. return g(this, e, t, {
  12564. color: !0
  12565. })
  12566. },
  12567. remove: function (e) {
  12568. this.__ul.removeChild(e.__li),
  12569. this.__controllers.slice(this.__controllers.indexOf(e), 1)
  12570. var t = this
  12571. f.defer(function () {
  12572. t.onResize()
  12573. })
  12574. },
  12575. destroy: function () {
  12576. this.autoPlace && M.removeChild(this.domElement)
  12577. },
  12578. addFolder: function (e) {
  12579. if (void 0 !== this.__folders[e])
  12580. throw new Error(
  12581. 'You already have a folder in this GUI by the name "' + e + '"'
  12582. )
  12583. var t = {
  12584. name: e,
  12585. parent: this
  12586. }
  12587. ;(t.autoPlace = this.autoPlace),
  12588. this.load &&
  12589. this.load.folders &&
  12590. this.load.folders[e] &&
  12591. ((t.closed = this.load.folders[e].closed), (t.load = this.load.folders[e]))
  12592. var i = new V(t)
  12593. this.__folders[e] = i
  12594. var n = m(this, i.domElement)
  12595. return p.addClass(n, 'folder'), i
  12596. },
  12597. open: function () {
  12598. this.closed = !1
  12599. },
  12600. close: function () {
  12601. this.closed = !0
  12602. },
  12603. onResize: function () {
  12604. var e = this.getRoot()
  12605. if (e.scrollable) {
  12606. var t = p.getOffset(e.__ul).top,
  12607. i = 0
  12608. f.each(e.__ul.childNodes, function (t) {
  12609. ;(e.autoPlace && t === e.__save_row) || (i += p.getHeight(t))
  12610. }),
  12611. $('#player').height() - t - O < i
  12612. ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  12613. (e.__ul.style.height = $('#player').height() - t - O + 'px'))
  12614. : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  12615. (e.__ul.style.height = 'auto'))
  12616. }
  12617. e.__resize_handle &&
  12618. f.defer(function () {
  12619. e.__resize_handle.style.height = e.__ul.offsetHeight + 'px'
  12620. }),
  12621. e.__closeButton && (e.__closeButton.style.width = e.width + 'px')
  12622. },
  12623. remember: function () {
  12624. if (
  12625. (f.isUndefined(S) && ((S = new d()), (S.domElement.innerHTML = t)),
  12626. this.parent)
  12627. )
  12628. throw new Error('You can only call remember on a top level GUI.')
  12629. var e = this
  12630. f.each(Array.prototype.slice.call(arguments), function (t) {
  12631. 0 == e.__rememberedObjects.length && C(e),
  12632. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  12633. }),
  12634. this.autoPlace && E(this, this.width)
  12635. },
  12636. getRoot: function () {
  12637. for (var e = this; e.parent; ) e = e.parent
  12638. return e
  12639. },
  12640. getSaveObject: function () {
  12641. var e = this.load
  12642. return (
  12643. (e.closed = this.closed),
  12644. this.__rememberedObjects.length > 0 &&
  12645. ((e.preset = this.preset),
  12646. e.remembered || (e.remembered = {}),
  12647. (e.remembered[this.preset] = b(this))),
  12648. (e.folders = {}),
  12649. f.each(this.__folders, function (t, i) {
  12650. e.folders[i] = t.getSaveObject()
  12651. }),
  12652. e
  12653. )
  12654. },
  12655. save: function () {
  12656. this.load.remembered || (this.load.remembered = {}),
  12657. (this.load.remembered[this.preset] = b(this)),
  12658. T(this, !1),
  12659. this.saveToLocalStorageIfPossible()
  12660. },
  12661. saveAs: function (e) {
  12662. this.load.remembered ||
  12663. ((this.load.remembered = {}), (this.load.remembered[L] = b(this, !0))),
  12664. (this.load.remembered[e] = b(this)),
  12665. (this.preset = e),
  12666. w(this, e, !0),
  12667. this.saveToLocalStorageIfPossible()
  12668. },
  12669. revert: function (e) {
  12670. f.each(
  12671. this.__controllers,
  12672. function (t) {
  12673. this.getRoot().load.remembered
  12674. ? A(e || this.getRoot(), t)
  12675. : t.setValue(t.initialValue)
  12676. },
  12677. this
  12678. ),
  12679. f.each(this.__folders, function (e) {
  12680. e.revert(e)
  12681. }),
  12682. e || T(this.getRoot(), !1)
  12683. },
  12684. listen: function (e) {
  12685. var t = 0 == this.__listening.length
  12686. this.__listening.push(e), t && x(this.__listening)
  12687. }
  12688. }),
  12689. V
  12690. )
  12691. })(
  12692. n.utils.css,
  12693. '<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>',
  12694. ".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",
  12695. (n.controllers.factory = (function (e, t, i, n, r, o, a) {
  12696. return function (s, l) {
  12697. var c = s[l]
  12698. return a.isArray(arguments[2]) || a.isObject(arguments[2])
  12699. ? new e(s, l, arguments[2])
  12700. : a.isNumber(c)
  12701. ? a.isNumber(arguments[2]) && a.isNumber(arguments[3])
  12702. ? new i(s, l, arguments[2], arguments[3])
  12703. : new t(s, l, {
  12704. min: arguments[2],
  12705. max: arguments[3]
  12706. })
  12707. : a.isString(c)
  12708. ? new n(s, l)
  12709. : a.isFunction(c)
  12710. ? new r(s, l, '')
  12711. : a.isBoolean(c)
  12712. ? new o(s, l)
  12713. : void 0
  12714. }
  12715. })(
  12716. n.controllers.OptionController,
  12717. n.controllers.NumberControllerBox,
  12718. n.controllers.NumberControllerSlider,
  12719. (n.controllers.StringController = (function (e, t, i) {
  12720. var n = function (e, i) {
  12721. function r() {
  12722. a.setValue(a.__input.value)
  12723. }
  12724. function o() {
  12725. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  12726. }
  12727. n.superclass.call(this, e, i)
  12728. var a = this
  12729. ;(this.__input = document.createElement('input')),
  12730. this.__input.setAttribute('type', 'text'),
  12731. t.bind(this.__input, 'keyup', r),
  12732. t.bind(this.__input, 'change', r),
  12733. t.bind(this.__input, 'blur', o),
  12734. t.bind(this.__input, 'keydown', function (e) {
  12735. 13 === e.keyCode && this.blur()
  12736. }),
  12737. this.updateDisplay(),
  12738. this.domElement.appendChild(this.__input)
  12739. }
  12740. return (
  12741. (n.superclass = e),
  12742. i.extend(n.prototype, e.prototype, {
  12743. updateDisplay: function () {
  12744. return (
  12745. t.isActive(this.__input) || (this.__input.value = this.getValue()),
  12746. n.superclass.prototype.updateDisplay.call(this)
  12747. )
  12748. }
  12749. }),
  12750. n
  12751. )
  12752. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  12753. n.controllers.FunctionController,
  12754. n.controllers.BooleanController,
  12755. n.utils.common
  12756. )),
  12757. n.controllers.Controller,
  12758. n.controllers.BooleanController,
  12759. n.controllers.FunctionController,
  12760. n.controllers.NumberControllerBox,
  12761. n.controllers.NumberControllerSlider,
  12762. n.controllers.OptionController,
  12763. (n.controllers.ColorController = (function (e, t, i, n, r) {
  12764. function o(e, t, i, n) {
  12765. ;(e.style.background = ''),
  12766. r.each(l, function (r) {
  12767. e.style.cssText +=
  12768. 'background: ' +
  12769. r +
  12770. 'linear-gradient(' +
  12771. t +
  12772. ', ' +
  12773. i +
  12774. ' 0%, ' +
  12775. n +
  12776. ' 100%); '
  12777. })
  12778. }
  12779. function a(e) {
  12780. ;(e.style.background = ''),
  12781. (e.style.cssText +=
  12782. 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);'),
  12783. (e.style.cssText +=
  12784. 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  12785. (e.style.cssText +=
  12786. 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  12787. (e.style.cssText +=
  12788. 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  12789. (e.style.cssText +=
  12790. 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);')
  12791. }
  12792. var s = function (e, l) {
  12793. function c(e) {
  12794. p(e), t.bind(window, 'mousemove', p), t.bind(window, 'mouseup', h)
  12795. }
  12796. function h() {
  12797. t.unbind(window, 'mousemove', p), t.unbind(window, 'mouseup', h)
  12798. }
  12799. function u() {
  12800. var e = n(this.value)
  12801. e !== !1
  12802. ? ((g.__color.__state = e), g.setValue(g.__color.toOriginal()))
  12803. : (this.value = g.__color.toString())
  12804. }
  12805. function d() {
  12806. t.unbind(window, 'mousemove', f), t.unbind(window, 'mouseup', d)
  12807. }
  12808. function p(e) {
  12809. e.preventDefault()
  12810. var i = t.getWidth(g.__saturation_field),
  12811. n = t.getOffset(g.__saturation_field),
  12812. r = (e.clientX - n.left + document.body.scrollLeft) / i,
  12813. o = 1 - (e.clientY - n.top + document.body.scrollTop) / i
  12814. return (
  12815. o > 1 ? (o = 1) : o < 0 && (o = 0),
  12816. r > 1 ? (r = 1) : r < 0 && (r = 0),
  12817. (g.__color.v = o),
  12818. (g.__color.s = r),
  12819. g.setValue(g.__color.toOriginal()),
  12820. !1
  12821. )
  12822. }
  12823. function f(e) {
  12824. e.preventDefault()
  12825. var i = t.getHeight(g.__hue_field),
  12826. n = t.getOffset(g.__hue_field),
  12827. r = 1 - (e.clientY - n.top + document.body.scrollTop) / i
  12828. return (
  12829. r > 1 ? (r = 1) : r < 0 && (r = 0),
  12830. (g.__color.h = 360 * r),
  12831. g.setValue(g.__color.toOriginal()),
  12832. !1
  12833. )
  12834. }
  12835. s.superclass.call(this, e, l),
  12836. (this.__color = new i(this.getValue())),
  12837. (this.__temp = new i(0))
  12838. var g = this
  12839. ;(this.domElement = document.createElement('div')),
  12840. t.makeSelectable(this.domElement, !1),
  12841. (this.__selector = document.createElement('div')),
  12842. (this.__selector.className = 'selector'),
  12843. (this.__saturation_field = document.createElement('div')),
  12844. (this.__saturation_field.className = 'saturation-field'),
  12845. (this.__field_knob = document.createElement('div')),
  12846. (this.__field_knob.className = 'field-knob'),
  12847. (this.__field_knob_border = '2px solid '),
  12848. (this.__hue_knob = document.createElement('div')),
  12849. (this.__hue_knob.className = 'hue-knob'),
  12850. (this.__hue_field = document.createElement('div')),
  12851. (this.__hue_field.className = 'hue-field'),
  12852. (this.__input = document.createElement('input')),
  12853. (this.__input.type = 'text'),
  12854. (this.__input_textShadow = '0 1px 1px '),
  12855. t.bind(this.__input, 'keydown', function (e) {
  12856. 13 === e.keyCode && u.call(this)
  12857. }),
  12858. t.bind(this.__input, 'blur', u),
  12859. t.bind(this.__selector, 'mousedown', function (e) {
  12860. t.addClass(this, 'drag').bind(window, 'mouseup', function (e) {
  12861. t.removeClass(g.__selector, 'drag')
  12862. })
  12863. })
  12864. var m = document.createElement('div')
  12865. r.extend(this.__selector.style, {
  12866. width: '122px',
  12867. height: '102px',
  12868. padding: '3px',
  12869. backgroundColor: '#222',
  12870. boxShadow: '0px 1px 3px rgba(0,0,0,0.3)'
  12871. }),
  12872. r.extend(this.__field_knob.style, {
  12873. position: 'absolute',
  12874. width: '12px',
  12875. height: '12px',
  12876. border: this.__field_knob_border + (this.__color.v < 0.5 ? '#fff' : '#000'),
  12877. boxShadow: '0px 1px 3px rgba(0,0,0,0.5)',
  12878. borderRadius: '12px',
  12879. zIndex: 1
  12880. }),
  12881. r.extend(this.__hue_knob.style, {
  12882. position: 'absolute',
  12883. width: '15px',
  12884. height: '2px',
  12885. borderRight: '4px solid #fff',
  12886. zIndex: 1
  12887. }),
  12888. r.extend(this.__saturation_field.style, {
  12889. width: '100px',
  12890. height: '100px',
  12891. border: '1px solid #555',
  12892. marginRight: '3px',
  12893. display: 'inline-block',
  12894. cursor: 'pointer'
  12895. }),
  12896. r.extend(m.style, {
  12897. width: '100%',
  12898. height: '100%',
  12899. background: 'none'
  12900. }),
  12901. o(m, 'top', 'rgba(0,0,0,0)', '#000'),
  12902. r.extend(this.__hue_field.style, {
  12903. width: '15px',
  12904. height: '100px',
  12905. display: 'inline-block',
  12906. border: '1px solid #555',
  12907. cursor: 'ns-resize'
  12908. }),
  12909. a(this.__hue_field),
  12910. r.extend(this.__input.style, {
  12911. outline: 'none',
  12912. textAlign: 'center',
  12913. color: '#fff',
  12914. border: 0,
  12915. fontWeight: 'bold',
  12916. textShadow: this.__input_textShadow + 'rgba(0,0,0,0.7)'
  12917. }),
  12918. t.bind(this.__saturation_field, 'mousedown', c),
  12919. t.bind(this.__field_knob, 'mousedown', c),
  12920. t.bind(this.__hue_field, 'mousedown', function (e) {
  12921. f(e), t.bind(window, 'mousemove', f), t.bind(window, 'mouseup', d)
  12922. }),
  12923. this.__saturation_field.appendChild(m),
  12924. this.__selector.appendChild(this.__field_knob),
  12925. this.__selector.appendChild(this.__saturation_field),
  12926. this.__selector.appendChild(this.__hue_field),
  12927. this.__hue_field.appendChild(this.__hue_knob),
  12928. this.domElement.appendChild(this.__input),
  12929. this.domElement.appendChild(this.__selector),
  12930. this.updateDisplay()
  12931. }
  12932. ;(s.superclass = e),
  12933. r.extend(s.prototype, e.prototype, {
  12934. updateDisplay: function () {
  12935. var e = n(this.getValue())
  12936. if (e !== !1) {
  12937. var t = !1
  12938. r.each(
  12939. i.COMPONENTS,
  12940. function (i) {
  12941. if (
  12942. !r.isUndefined(e[i]) &&
  12943. !r.isUndefined(this.__color.__state[i]) &&
  12944. e[i] !== this.__color.__state[i]
  12945. )
  12946. return (t = !0), {}
  12947. },
  12948. this
  12949. ),
  12950. t && r.extend(this.__color.__state, e)
  12951. }
  12952. r.extend(this.__temp.__state, this.__color.__state), (this.__temp.a = 1)
  12953. var a = this.__color.v < 0.5 || this.__color.s > 0.5 ? 255 : 0,
  12954. s = 255 - a
  12955. r.extend(this.__field_knob.style, {
  12956. marginLeft: 100 * this.__color.s - 7 + 'px',
  12957. marginTop: 100 * (1 - this.__color.v) - 7 + 'px',
  12958. backgroundColor: this.__temp.toString(),
  12959. border: this.__field_knob_border + 'rgb(' + a + ',' + a + ',' + a + ')'
  12960. }),
  12961. (this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + 'px'),
  12962. (this.__temp.s = 1),
  12963. (this.__temp.v = 1),
  12964. o(this.__saturation_field, 'left', '#fff', this.__temp.toString()),
  12965. r.extend(this.__input.style, {
  12966. backgroundColor: (this.__input.value = this.__color.toString()),
  12967. color: 'rgb(' + a + ',' + a + ',' + a + ')',
  12968. textShadow:
  12969. this.__input_textShadow + 'rgba(' + s + ',' + s + ',' + s + ',.7)'
  12970. })
  12971. }
  12972. })
  12973. var l = ['-moz-', '-o-', '-webkit-', '-ms-', '']
  12974. return s
  12975. })(
  12976. n.controllers.Controller,
  12977. n.dom.dom,
  12978. (n.color.Color = (function (e, t, i, n) {
  12979. function r(e, t, i) {
  12980. Object.defineProperty(e, t, {
  12981. get: function () {
  12982. return 'RGB' === this.__state.space
  12983. ? this.__state[t]
  12984. : (a(this, t, i), this.__state[t])
  12985. },
  12986. set: function (e) {
  12987. 'RGB' !== this.__state.space &&
  12988. (a(this, t, i), (this.__state.space = 'RGB')),
  12989. (this.__state[t] = e)
  12990. }
  12991. })
  12992. }
  12993. function o(e, t) {
  12994. Object.defineProperty(e, t, {
  12995. get: function () {
  12996. return 'HSV' === this.__state.space
  12997. ? this.__state[t]
  12998. : (s(this), this.__state[t])
  12999. },
  13000. set: function (e) {
  13001. 'HSV' !== this.__state.space && (s(this), (this.__state.space = 'HSV')),
  13002. (this.__state[t] = e)
  13003. }
  13004. })
  13005. }
  13006. function a(e, i, r) {
  13007. if ('HEX' === e.__state.space)
  13008. e.__state[i] = t.component_from_hex(e.__state.hex, r)
  13009. else {
  13010. if ('HSV' !== e.__state.space) throw 'Corrupted color state'
  13011. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  13012. }
  13013. }
  13014. function s(e) {
  13015. var i = t.rgb_to_hsv(e.r, e.g, e.b)
  13016. n.extend(e.__state, {
  13017. s: i.s,
  13018. v: i.v
  13019. }),
  13020. n.isNaN(i.h)
  13021. ? n.isUndefined(e.__state.h) && (e.__state.h = 0)
  13022. : (e.__state.h = i.h)
  13023. }
  13024. var l = function () {
  13025. if (((this.__state = e.apply(this, arguments)), this.__state === !1))
  13026. throw 'Failed to interpret color arguments'
  13027. this.__state.a = this.__state.a || 1
  13028. }
  13029. return (
  13030. (l.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a']),
  13031. n.extend(l.prototype, {
  13032. toString: function () {
  13033. return i(this)
  13034. },
  13035. toOriginal: function () {
  13036. return this.__state.conversion.write(this)
  13037. }
  13038. }),
  13039. r(l.prototype, 'r', 2),
  13040. r(l.prototype, 'g', 1),
  13041. r(l.prototype, 'b', 0),
  13042. o(l.prototype, 'h'),
  13043. o(l.prototype, 's'),
  13044. o(l.prototype, 'v'),
  13045. Object.defineProperty(l.prototype, 'a', {
  13046. get: function () {
  13047. return this.__state.a
  13048. },
  13049. set: function (e) {
  13050. this.__state.a = e
  13051. }
  13052. }),
  13053. Object.defineProperty(l.prototype, 'hex', {
  13054. get: function () {
  13055. return (
  13056. 'HEX' !== !this.__state.space &&
  13057. (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  13058. this.__state.hex
  13059. )
  13060. },
  13061. set: function (e) {
  13062. ;(this.__state.space = 'HEX'), (this.__state.hex = e)
  13063. }
  13064. }),
  13065. l
  13066. )
  13067. })(
  13068. n.color.interpret,
  13069. (n.color.math = (function () {
  13070. var e
  13071. return {
  13072. hsv_to_rgb: function (e, t, i) {
  13073. var n = Math.floor(e / 60) % 6,
  13074. r = e / 60 - Math.floor(e / 60),
  13075. o = i * (1 - t),
  13076. a = i * (1 - r * t),
  13077. s = i * (1 - (1 - r) * t),
  13078. l = [
  13079. [i, s, o],
  13080. [a, i, o],
  13081. [o, i, s],
  13082. [o, a, i],
  13083. [s, o, i],
  13084. [i, o, a]
  13085. ][n]
  13086. return {
  13087. r: 255 * l[0],
  13088. g: 255 * l[1],
  13089. b: 255 * l[2]
  13090. }
  13091. },
  13092. rgb_to_hsv: function (e, t, i) {
  13093. var n,
  13094. r,
  13095. o = Math.min(e, t, i),
  13096. a = Math.max(e, t, i),
  13097. s = a - o
  13098. return 0 == a
  13099. ? {
  13100. h: NaN,
  13101. s: 0,
  13102. v: 0
  13103. }
  13104. : ((r = s / a),
  13105. (n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s),
  13106. (n /= 6),
  13107. n < 0 && (n += 1),
  13108. {
  13109. h: 360 * n,
  13110. s: r,
  13111. v: a / 255
  13112. })
  13113. },
  13114. rgb_to_hex: function (e, t, i) {
  13115. var n = this.hex_with_component(0, 2, e)
  13116. return (
  13117. (n = this.hex_with_component(n, 1, t)),
  13118. (n = this.hex_with_component(n, 0, i))
  13119. )
  13120. },
  13121. component_from_hex: function (e, t) {
  13122. return (e >> (8 * t)) & 255
  13123. },
  13124. hex_with_component: function (t, i, n) {
  13125. return (n << (e = 8 * i)) | (t & ~(255 << e))
  13126. }
  13127. }
  13128. })()),
  13129. n.color.toString,
  13130. n.utils.common
  13131. )),
  13132. n.color.interpret,
  13133. n.utils.common
  13134. )),
  13135. (n.utils.requestAnimationFrame = (function () {
  13136. return (
  13137. window.requestAnimationFrame ||
  13138. window.webkitRequestAnimationFrame ||
  13139. window.mozRequestAnimationFrame ||
  13140. window.oRequestAnimationFrame ||
  13141. window.msRequestAnimationFrame ||
  13142. function (e, t) {
  13143. window.setTimeout(e, 1e3 / 60)
  13144. }
  13145. )
  13146. })()),
  13147. (n.dom.CenteredDiv = (function (e, t) {
  13148. var i = function () {
  13149. ;(this.backgroundElement = document.createElement('div')),
  13150. t.extend(this.backgroundElement.style, {
  13151. backgroundColor: 'rgba(0,0,0,0.8)',
  13152. top: 0,
  13153. left: 0,
  13154. display: 'none',
  13155. zIndex: '1000',
  13156. opacity: 0,
  13157. WebkitTransition: 'opacity 0.2s linear'
  13158. }),
  13159. e.makeFullscreen(this.backgroundElement),
  13160. (this.backgroundElement.style.position = 'fixed'),
  13161. (this.domElement = document.createElement('div')),
  13162. t.extend(this.domElement.style, {
  13163. position: 'fixed',
  13164. display: 'none',
  13165. zIndex: '1001',
  13166. opacity: 0,
  13167. WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear'
  13168. }),
  13169. document.body.appendChild(this.backgroundElement),
  13170. document.body.appendChild(this.domElement)
  13171. var i = this
  13172. e.bind(this.backgroundElement, 'click', function () {
  13173. i.hide()
  13174. })
  13175. }
  13176. return (
  13177. (i.prototype.show = function () {
  13178. var e = this
  13179. ;(this.backgroundElement.style.display = 'block'),
  13180. (this.domElement.style.display = 'block'),
  13181. (this.domElement.style.opacity = 0),
  13182. (this.domElement.style.webkitTransform = 'scale(1.1)'),
  13183. this.layout(),
  13184. t.defer(function () {
  13185. ;(e.backgroundElement.style.opacity = 1),
  13186. (e.domElement.style.opacity = 1),
  13187. (e.domElement.style.webkitTransform = 'scale(1)')
  13188. })
  13189. }),
  13190. (i.prototype.hide = function () {
  13191. var t = this,
  13192. i = function () {
  13193. ;(t.domElement.style.display = 'none'),
  13194. (t.backgroundElement.style.display = 'none'),
  13195. e.unbind(t.domElement, 'webkitTransitionEnd', i),
  13196. e.unbind(t.domElement, 'transitionend', i),
  13197. e.unbind(t.domElement, 'oTransitionEnd', i)
  13198. }
  13199. e.bind(this.domElement, 'webkitTransitionEnd', i),
  13200. e.bind(this.domElement, 'transitionend', i),
  13201. e.bind(this.domElement, 'oTransitionEnd', i),
  13202. (this.backgroundElement.style.opacity = 0),
  13203. (this.domElement.style.opacity = 0),
  13204. (this.domElement.style.webkitTransform = 'scale(1.1)')
  13205. }),
  13206. (i.prototype.layout = function () {
  13207. ;(this.domElement.style.left =
  13208. $('#player').width() / 2 - e.getWidth(this.domElement) / 2 + 'px'),
  13209. (this.domElement.style.top =
  13210. $('#player').height() / 2 - e.getHeight(this.domElement) / 2 + 'px')
  13211. }),
  13212. i
  13213. )
  13214. })(n.dom.dom, n.utils.common)),
  13215. n.dom.dom,
  13216. n.utils.common
  13217. ))
  13218. },
  13219. {}
  13220. ],
  13221. 94: [
  13222. function (e, t, i) {
  13223. ;(function (e) {
  13224. 'use strict'
  13225. function i(t) {
  13226. function i(e) {
  13227. for (
  13228. var t = [
  13229. 16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24,
  13230. 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103,
  13231. 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72,
  13232. 92, 95, 98, 112, 100, 103, 99
  13233. ],
  13234. i = 0;
  13235. i < 64;
  13236. i++
  13237. ) {
  13238. var n = _((t[i] * e + 50) / 100)
  13239. n < 1 ? (n = 1) : n > 255 && (n = 255), (T[G[i]] = n)
  13240. }
  13241. for (
  13242. var r = [
  13243. 17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99,
  13244. 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
  13245. 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
  13246. 99, 99, 99, 99
  13247. ],
  13248. o = 0;
  13249. o < 64;
  13250. o++
  13251. ) {
  13252. var a = _((r[o] * e + 50) / 100)
  13253. a < 1 ? (a = 1) : a > 255 && (a = 255), (x[G[o]] = a)
  13254. }
  13255. for (
  13256. var s = [
  13257. 1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961, 0.275899379
  13258. ],
  13259. l = 0,
  13260. c = 0;
  13261. c < 8;
  13262. c++
  13263. )
  13264. for (var h = 0; h < 8; h++)
  13265. (S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8)),
  13266. (M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8)),
  13267. l++
  13268. }
  13269. function n(e, t) {
  13270. for (var i = 0, n = 0, r = new Array(), o = 1; o <= 16; o++) {
  13271. for (var a = 1; a <= e[o]; a++)
  13272. (r[t[n]] = []), (r[t[n]][0] = i), (r[t[n]][1] = o), n++, i++
  13273. i *= 2
  13274. }
  13275. return r
  13276. }
  13277. function r() {
  13278. ;(C = n(z, W)), (I = n(X, Z)), (E = n(j, Y)), (b = n(q, K))
  13279. }
  13280. function o() {
  13281. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  13282. for (var n = e; n < t; n++)
  13283. (P[32767 + n] = i),
  13284. (R[32767 + n] = []),
  13285. (R[32767 + n][1] = i),
  13286. (R[32767 + n][0] = n)
  13287. for (var r = -(t - 1); r <= -e; r++)
  13288. (P[32767 + r] = i),
  13289. (R[32767 + r] = []),
  13290. (R[32767 + r][1] = i),
  13291. (R[32767 + r][0] = t - 1 + r)
  13292. ;(e <<= 1), (t <<= 1)
  13293. }
  13294. }
  13295. function a() {
  13296. for (var e = 0; e < 256; e++)
  13297. (H[e] = 19595 * e),
  13298. (H[(e + 256) >> 0] = 38470 * e),
  13299. (H[(e + 512) >> 0] = 7471 * e + 32768),
  13300. (H[(e + 768) >> 0] = -11059 * e),
  13301. (H[(e + 1024) >> 0] = -21709 * e),
  13302. (H[(e + 1280) >> 0] = 32768 * e + 8421375),
  13303. (H[(e + 1536) >> 0] = -27439 * e),
  13304. (H[(e + 1792) >> 0] = -5329 * e)
  13305. }
  13306. function s(e) {
  13307. for (var t = e[0], i = e[1] - 1; i >= 0; )
  13308. t & (1 << i) && (N |= 1 << B),
  13309. i--,
  13310. B--,
  13311. B < 0 && (255 == N ? (l(255), l(0)) : l(N), (B = 7), (N = 0))
  13312. }
  13313. function l(e) {
  13314. D.push(e)
  13315. }
  13316. function c(e) {
  13317. l((e >> 8) & 255), l(255 & e)
  13318. }
  13319. function h(e, t) {
  13320. var i,
  13321. n,
  13322. r,
  13323. o,
  13324. a,
  13325. s,
  13326. l,
  13327. c,
  13328. h,
  13329. u = 0,
  13330. d = 8,
  13331. p = 64
  13332. for (h = 0; h < d; ++h) {
  13333. ;(i = e[u]),
  13334. (n = e[u + 1]),
  13335. (r = e[u + 2]),
  13336. (o = e[u + 3]),
  13337. (a = e[u + 4]),
  13338. (s = e[u + 5]),
  13339. (l = e[u + 6]),
  13340. (c = e[u + 7])
  13341. var f = i + c,
  13342. g = i - c,
  13343. m = n + l,
  13344. v = n - l,
  13345. A = r + s,
  13346. y = r - s,
  13347. C = o + a,
  13348. I = o - a,
  13349. E = f + C,
  13350. b = f - C,
  13351. w = m + A,
  13352. _ = m - A
  13353. ;(e[u] = E + w), (e[u + 4] = E - w)
  13354. var T = 0.707106781 * (_ + b)
  13355. ;(e[u + 2] = b + T), (e[u + 6] = b - T), (E = I + y), (w = y + v), (_ = v + g)
  13356. var x = 0.382683433 * (E - _),
  13357. S = 0.5411961 * E + x,
  13358. M = 1.306562965 * _ + x,
  13359. R = 0.707106781 * w,
  13360. P = g + R,
  13361. L = g - R
  13362. ;(e[u + 5] = L + S),
  13363. (e[u + 3] = L - S),
  13364. (e[u + 1] = P + M),
  13365. (e[u + 7] = P - M),
  13366. (u += 8)
  13367. }
  13368. for (u = 0, h = 0; h < d; ++h) {
  13369. ;(i = e[u]),
  13370. (n = e[u + 8]),
  13371. (r = e[u + 16]),
  13372. (o = e[u + 24]),
  13373. (a = e[u + 32]),
  13374. (s = e[u + 40]),
  13375. (l = e[u + 48]),
  13376. (c = e[u + 56])
  13377. var D = i + c,
  13378. N = i - c,
  13379. B = n + l,
  13380. F = n - l,
  13381. V = r + s,
  13382. U = r - s,
  13383. k = o + a,
  13384. H = o - a,
  13385. G = D + k,
  13386. z = D - k,
  13387. W = B + V,
  13388. j = B - V
  13389. ;(e[u] = G + W), (e[u + 32] = G - W)
  13390. var Y = 0.707106781 * (j + z)
  13391. ;(e[u + 16] = z + Y), (e[u + 48] = z - Y), (G = H + U), (W = U + F), (j = F + N)
  13392. var X = 0.382683433 * (G - j),
  13393. Z = 0.5411961 * G + X,
  13394. q = 1.306562965 * j + X,
  13395. K = 0.707106781 * W,
  13396. Q = N + K,
  13397. J = N - K
  13398. ;(e[u + 40] = J + Z),
  13399. (e[u + 24] = J - Z),
  13400. (e[u + 8] = Q + q),
  13401. (e[u + 56] = Q - q),
  13402. u++
  13403. }
  13404. var $
  13405. for (h = 0; h < p; ++h)
  13406. ($ = e[h] * t[h]), (O[h] = $ > 0 ? ($ + 0.5) | 0 : ($ - 0.5) | 0)
  13407. return O
  13408. }
  13409. function u() {
  13410. c(65504),
  13411. c(16),
  13412. l(74),
  13413. l(70),
  13414. l(73),
  13415. l(70),
  13416. l(0),
  13417. l(1),
  13418. l(1),
  13419. l(0),
  13420. c(1),
  13421. c(1),
  13422. l(0),
  13423. l(0)
  13424. }
  13425. function d(e, t) {
  13426. c(65472),
  13427. c(17),
  13428. l(8),
  13429. c(t),
  13430. c(e),
  13431. l(3),
  13432. l(1),
  13433. l(17),
  13434. l(0),
  13435. l(2),
  13436. l(17),
  13437. l(1),
  13438. l(3),
  13439. l(17),
  13440. l(1)
  13441. }
  13442. function p() {
  13443. c(65499), c(132), l(0)
  13444. for (var e = 0; e < 64; e++) l(T[e])
  13445. l(1)
  13446. for (var t = 0; t < 64; t++) l(x[t])
  13447. }
  13448. function f() {
  13449. c(65476), c(418), l(0)
  13450. for (var e = 0; e < 16; e++) l(z[e + 1])
  13451. for (var t = 0; t <= 11; t++) l(W[t])
  13452. l(16)
  13453. for (var i = 0; i < 16; i++) l(j[i + 1])
  13454. for (var n = 0; n <= 161; n++) l(Y[n])
  13455. l(1)
  13456. for (var r = 0; r < 16; r++) l(X[r + 1])
  13457. for (var o = 0; o <= 11; o++) l(Z[o])
  13458. l(17)
  13459. for (var a = 0; a < 16; a++) l(q[a + 1])
  13460. for (var s = 0; s <= 161; s++) l(K[s])
  13461. }
  13462. function g() {
  13463. c(65498), c(12), l(3), l(1), l(0), l(2), l(17), l(3), l(17), l(0), l(63), l(0)
  13464. }
  13465. function m(e, t, i, n, r) {
  13466. for (
  13467. var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0;
  13468. f < d;
  13469. ++f
  13470. )
  13471. L[G[f]] = p[f]
  13472. var g = L[0] - i
  13473. ;(i = L[0]), 0 == g ? s(n[0]) : ((o = 32767 + g), s(n[P[o]]), s(R[o]))
  13474. for (var m = 63; m > 0 && 0 == L[m]; m--);
  13475. if (0 == m) return s(a), i
  13476. for (var v, A = 1; A <= m; ) {
  13477. for (var y = A; 0 == L[A] && A <= m; ++A);
  13478. var C = A - y
  13479. if (C >= c) {
  13480. v = C >> 4
  13481. for (var I = 1; I <= v; ++I) s(l)
  13482. C &= 15
  13483. }
  13484. ;(o = 32767 + L[A]), s(r[(C << 4) + P[o]]), s(R[o]), A++
  13485. }
  13486. return m != u && s(a), i
  13487. }
  13488. function v() {
  13489. for (var e = String.fromCharCode, t = 0; t < 256; t++) k[t] = e(t)
  13490. }
  13491. function A(e) {
  13492. if ((e <= 0 && (e = 1), e > 100 && (e = 100), w != e)) {
  13493. var t = 0
  13494. ;(t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)), i(t), (w = e)
  13495. }
  13496. }
  13497. function y() {
  13498. var e = new Date().getTime()
  13499. t || (t = 50), v(), r(), o(), a(), A(t)
  13500. new Date().getTime() - e
  13501. }
  13502. var C,
  13503. I,
  13504. E,
  13505. b,
  13506. w,
  13507. _ = (Math.round, Math.floor),
  13508. T = new Array(64),
  13509. x = new Array(64),
  13510. S = new Array(64),
  13511. M = new Array(64),
  13512. R = new Array(65535),
  13513. P = new Array(65535),
  13514. O = new Array(64),
  13515. L = new Array(64),
  13516. D = [],
  13517. N = 0,
  13518. B = 7,
  13519. F = new Array(64),
  13520. V = new Array(64),
  13521. U = new Array(64),
  13522. k = new Array(256),
  13523. H = new Array(2048),
  13524. G = [
  13525. 0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41,
  13526. 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38,
  13527. 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63
  13528. ],
  13529. z = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
  13530. W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  13531. j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125],
  13532. Y = [
  13533. 1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145,
  13534. 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24,
  13535. 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72,
  13536. 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115,
  13537. 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147,
  13538. 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178,
  13539. 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202,
  13540. 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232,
  13541. 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250
  13542. ],
  13543. X = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
  13544. Z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  13545. q = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119],
  13546. K = [
  13547. 0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66,
  13548. 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37,
  13549. 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71,
  13550. 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106,
  13551. 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138,
  13552. 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169,
  13553. 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200,
  13554. 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231,
  13555. 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250
  13556. ]
  13557. ;(this.encode = function (t, i) {
  13558. var n = (new Date().getTime(), i.quality)
  13559. n && A(n),
  13560. (D = new Array()),
  13561. (N = 0),
  13562. (B = 7),
  13563. c(65496),
  13564. u(),
  13565. p(),
  13566. d(t.width, t.height),
  13567. f(),
  13568. g()
  13569. var r = 0,
  13570. o = 0,
  13571. a = 0
  13572. ;(N = 0), (B = 7), (this.encode.displayName = '_encode_')
  13573. for (
  13574. var l,
  13575. h,
  13576. v,
  13577. y,
  13578. w,
  13579. _,
  13580. T,
  13581. x,
  13582. R,
  13583. P = t.data,
  13584. O = t.width,
  13585. L = t.height,
  13586. k = i.flipY,
  13587. G = 4 * O,
  13588. z = k ? L : 0,
  13589. W = k ? -8 : 8;
  13590. (k && z > 0) || (!k && z < L);
  13591. ) {
  13592. for (l = 0; l < G; ) {
  13593. for (w = G * z + l, _ = w, T = -1, x = 0, R = 0; R < 64; R++)
  13594. (x = (k ? 63 - R : R) >> 3),
  13595. (T = 4 * (7 & R)),
  13596. (_ = w + x * G + T),
  13597. z + x >= L && (_ -= G * (z + 1 + x - L)),
  13598. l + T >= G && (_ -= l + T - G + 4),
  13599. (h = P[_++]),
  13600. (v = P[_++]),
  13601. (y = P[_++]),
  13602. (F[R] = ((H[h] + H[(v + 256) >> 0] + H[(y + 512) >> 0]) >> 16) - 128),
  13603. (V[R] =
  13604. ((H[(h + 768) >> 0] + H[(v + 1024) >> 0] + H[(y + 1280) >> 0]) >> 16) -
  13605. 128),
  13606. (U[R] =
  13607. ((H[(h + 1280) >> 0] + H[(v + 1536) >> 0] + H[(y + 1792) >> 0]) >> 16) -
  13608. 128)
  13609. ;(r = m(F, S, r, C, E)), (o = m(V, M, o, I, b)), (a = m(U, M, a, I, b)), (l += 32)
  13610. }
  13611. z += W
  13612. }
  13613. if (B >= 0) {
  13614. var j = []
  13615. ;(j[1] = B + 1), (j[0] = (1 << (B + 1)) - 1), s(j)
  13616. }
  13617. return c(65497), new e(D)
  13618. }),
  13619. y()
  13620. }
  13621. function n(e, t) {
  13622. ;(t = t || {}), (t.quality = t.quality || 50)
  13623. var n = t.quality,
  13624. r = new i(n),
  13625. o = r.encode(e, t)
  13626. return {
  13627. data: o,
  13628. width: e.width,
  13629. height: e.height
  13630. }
  13631. }
  13632. t.exports.encode = n
  13633. }).call(this, e('buffer').Buffer)
  13634. },
  13635. {
  13636. buffer: 198
  13637. }
  13638. ],
  13639. 95: [
  13640. function (e, t, i) {
  13641. 'use strict'
  13642. !(function () {
  13643. if (
  13644. ('performance' in window == !1 && (window.performance = {}),
  13645. (Date.now =
  13646. Date.now ||
  13647. function () {
  13648. return new Date().getTime()
  13649. }),
  13650. 'now' in window.performance == !1)
  13651. ) {
  13652. var e = Date.now()
  13653. performance.timing &&
  13654. performance.timing.navigationStart &&
  13655. (e = performance.timing.navigationStart),
  13656. (window.performance.now = function () {
  13657. return Date.now() - e
  13658. })
  13659. }
  13660. })()
  13661. },
  13662. {}
  13663. ],
  13664. 96: [
  13665. function (e, t, i) {
  13666. 'use strict'
  13667. var n = e('three')
  13668. ;(n.EffectComposer = function (e, t) {
  13669. if (((this.renderer = e), void 0 === t)) {
  13670. var i = {
  13671. minFilter: n.LinearFilter,
  13672. magFilter: n.LinearFilter,
  13673. format: n.RGBAFormat,
  13674. stencilBuffer: !1
  13675. },
  13676. r = e.getSize()
  13677. t = new n.WebGLRenderTarget(r.width, r.height, i)
  13678. }
  13679. ;(this.renderTarget1 = t),
  13680. (this.renderTarget2 = t.clone()),
  13681. (this.writeBuffer = this.renderTarget1),
  13682. (this.readBuffer = this.renderTarget2),
  13683. (this.passes = []),
  13684. void 0 === n.CopyShader &&
  13685. console.error('THREE.EffectComposer relies on THREE.CopyShader'),
  13686. (this.copyPass = new n.ShaderPass(n.CopyShader))
  13687. }),
  13688. (n.EffectComposer.prototype = {
  13689. swapBuffers: function () {
  13690. var e = this.readBuffer
  13691. ;(this.readBuffer = this.writeBuffer), (this.writeBuffer = e)
  13692. },
  13693. addPass: function (e) {
  13694. this.passes.push(e)
  13695. },
  13696. insertPass: function (e, t) {
  13697. this.passes.splice(t, 0, e)
  13698. },
  13699. render: function (e) {
  13700. ;(this.writeBuffer = this.renderTarget1), (this.readBuffer = this.renderTarget2)
  13701. var t,
  13702. i,
  13703. r = !1,
  13704. o = this.passes.length
  13705. for (i = 0; i < o; i++)
  13706. if (((t = this.passes[i]), t.enabled)) {
  13707. if (
  13708. (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r), t.needsSwap)
  13709. ) {
  13710. if (r) {
  13711. var a = this.renderer.context
  13712. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  13713. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  13714. a.stencilFunc(a.EQUAL, 1, 4294967295)
  13715. }
  13716. this.swapBuffers()
  13717. }
  13718. t instanceof n.MaskPass ? (r = !0) : t instanceof n.ClearMaskPass && (r = !1)
  13719. }
  13720. },
  13721. reset: function (e) {
  13722. if (void 0 === e) {
  13723. var t = this.renderer.getSize()
  13724. ;(e = this.renderTarget1.clone()), e.setSize(t.width, t.height)
  13725. }
  13726. this.renderTarget1.dispose(),
  13727. this.renderTarget2.dispose(),
  13728. (this.renderTarget1 = e),
  13729. (this.renderTarget2 = e.clone()),
  13730. (this.writeBuffer = this.renderTarget1),
  13731. (this.readBuffer = this.renderTarget2)
  13732. },
  13733. setSize: function (e, t) {
  13734. this.renderTarget1.setSize(e, t), this.renderTarget2.setSize(e, t)
  13735. this.passes.forEach(a => {
  13736. //add for TransitionPass
  13737. a.setSize && a.setSize(e, t)
  13738. })
  13739. }
  13740. })
  13741. },
  13742. {
  13743. three: 217
  13744. }
  13745. ],
  13746. 97: [
  13747. function (e, t, i) {
  13748. 'use strict'
  13749. var n = e('three')
  13750. ;(n.MaskPass = function (e, t) {
  13751. ;(this.scene = e),
  13752. (this.camera = t),
  13753. (this.enabled = !0),
  13754. (this.clear = !0),
  13755. (this.needsSwap = !1),
  13756. (this.inverse = !1)
  13757. }),
  13758. (n.MaskPass.prototype = {
  13759. render: function (e, t, i, n) {
  13760. var r = e.context
  13761. r.colorMask(!1, !1, !1, !1), r.depthMask(!1)
  13762. var o, a
  13763. this.inverse ? ((o = 0), (a = 1)) : ((o = 1), (a = 0)),
  13764. r.enable(r.STENCIL_TEST),
  13765. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  13766. r.stencilFunc(r.ALWAYS, o, 4294967295),
  13767. r.clearStencil(a),
  13768. e.render(this.scene, this.camera, i, this.clear),
  13769. e.render(this.scene, this.camera, t, this.clear),
  13770. r.colorMask(!0, !0, !0, !0),
  13771. r.depthMask(!0),
  13772. r.stencilFunc(r.EQUAL, 1, 4294967295),
  13773. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  13774. }
  13775. }),
  13776. (n.ClearMaskPass = function () {
  13777. this.enabled = !0
  13778. }),
  13779. (n.ClearMaskPass.prototype = {
  13780. render: function (e, t, i, n) {
  13781. var r = e.context
  13782. r.disable(r.STENCIL_TEST)
  13783. }
  13784. })
  13785. },
  13786. {
  13787. three: 217
  13788. }
  13789. ],
  13790. 98: [
  13791. function (e, t, i) {
  13792. 'use strict'
  13793. var n = e('three')
  13794. ;(n.RenderPass = function (e, t, i, r, o) {
  13795. ;(this.scene = e),
  13796. (this.camera = t),
  13797. (this.overrideMaterial = i),
  13798. (this.clearColor = r),
  13799. (this.clearAlpha = void 0 !== o ? o : 1),
  13800. (this.oldClearColor = new n.Color()),
  13801. (this.oldClearAlpha = 1),
  13802. (this.enabled = !0),
  13803. (this.clear = !0),
  13804. (this.needsSwap = !1)
  13805. }),
  13806. (n.RenderPass.prototype = {
  13807. render: function (e, t, i, n) {
  13808. ;(this.scene.overrideMaterial = this.overrideMaterial),
  13809. this.clearColor &&
  13810. (this.oldClearColor.copy(e.getClearColor()),
  13811. (this.oldClearAlpha = e.getClearAlpha()),
  13812. e.setClearColor(this.clearColor, this.clearAlpha)),
  13813. e.render(this.scene, this.camera, i, this.clear),
  13814. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  13815. (this.scene.overrideMaterial = null)
  13816. }
  13817. })
  13818. },
  13819. {
  13820. three: 217
  13821. }
  13822. ],
  13823. 99: [
  13824. function (e, t, i) {
  13825. 'use strict'
  13826. var n = e('three')
  13827. ;(n.ShaderPass = function (e, t) {
  13828. ;(this.textureID = void 0 !== t ? t : 'tDiffuse'),
  13829. e instanceof n.ShaderMaterial
  13830. ? ((this.uniforms = e.uniforms), (this.material = e))
  13831. : e &&
  13832. ((this.uniforms = n.UniformsUtils.clone(e.uniforms)),
  13833. (this.material = new n.ShaderMaterial({
  13834. defines: e.defines || {},
  13835. uniforms: this.uniforms,
  13836. vertexShader: e.vertexShader,
  13837. fragmentShader: e.fragmentShader
  13838. }))),
  13839. (this.renderToScreen = !1),
  13840. (this.enabled = !0),
  13841. (this.needsSwap = !0),
  13842. (this.clear = !1),
  13843. (this.camera = new n.OrthographicCamera(-1, 1, 1, -1, 0, 1)),
  13844. (this.scene = new n.Scene()),
  13845. (this.quad = new n.Mesh(new n.PlaneBufferGeometry(2, 2), null)),
  13846. this.scene.add(this.quad)
  13847. }),
  13848. (n.ShaderPass.prototype = {
  13849. render: function (e, t, i, n) {
  13850. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  13851. (this.quad.material = this.material),
  13852. this.renderToScreen
  13853. ? e.render(this.scene, this.camera)
  13854. : e.render(this.scene, this.camera, t, this.clear)
  13855. }
  13856. })
  13857. },
  13858. {
  13859. three: 217
  13860. }
  13861. ],
  13862. 100: [
  13863. function (e, t, i) {
  13864. 'use strict'
  13865. var n = e('three')
  13866. n.CopyShader = {
  13867. uniforms: {
  13868. tDiffuse: {
  13869. type: 't',
  13870. value: null
  13871. },
  13872. opacity: {
  13873. type: 'f',
  13874. value: 1
  13875. }
  13876. },
  13877. vertexShader: [
  13878. 'varying vec2 vUv;',
  13879. 'void main() {',
  13880. 'vUv = uv;',
  13881. 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
  13882. '}'
  13883. ].join('\n'),
  13884. fragmentShader: [
  13885. 'uniform float opacity;',
  13886. 'uniform sampler2D tDiffuse;',
  13887. 'varying vec2 vUv;',
  13888. 'void main() {',
  13889. 'vec4 texel = texture2D( tDiffuse, vUv );',
  13890. 'gl_FragColor = opacity * texel;',
  13891. '}'
  13892. ].join('\n')
  13893. }
  13894. },
  13895. {
  13896. three: 217
  13897. }
  13898. ],
  13899. 101: [
  13900. function (e, t, i) {
  13901. 'use strict'
  13902. var n = e('three')
  13903. n.HorizontalBlurShader = {
  13904. uniforms: {
  13905. tDiffuse: {
  13906. type: 't',
  13907. value: null
  13908. },
  13909. h: {
  13910. type: 'f',
  13911. value: 1 / 512
  13912. }
  13913. },
  13914. vertexShader: [
  13915. 'varying vec2 vUv;',
  13916. 'void main() {',
  13917. 'vUv = uv;',
  13918. 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
  13919. '}'
  13920. ].join('\n'),
  13921. fragmentShader: [
  13922. 'uniform sampler2D tDiffuse;',
  13923. 'uniform float h;',
  13924. 'varying vec2 vUv;',
  13925. 'void main() {',
  13926. 'vec4 sum = vec4( 0.0 );',
  13927. 'sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;',
  13928. 'sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;',
  13929. 'sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;',
  13930. 'sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;',
  13931. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;',
  13932. 'sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;',
  13933. 'sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;',
  13934. 'sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;',
  13935. 'sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;',
  13936. 'gl_FragColor = sum;',
  13937. '}'
  13938. ].join('\n')
  13939. }
  13940. },
  13941. {
  13942. three: 217
  13943. }
  13944. ],
  13945. 102: [
  13946. function (e, t, i) {
  13947. 'use strict'
  13948. var n = e('three')
  13949. n.VerticalBlurShader = {
  13950. uniforms: {
  13951. tDiffuse: {
  13952. type: 't',
  13953. value: null
  13954. },
  13955. v: {
  13956. type: 'f',
  13957. value: 1 / 512
  13958. }
  13959. },
  13960. vertexShader: [
  13961. 'varying vec2 vUv;',
  13962. 'void main() {',
  13963. 'vUv = uv;',
  13964. 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',
  13965. '}'
  13966. ].join('\n'),
  13967. fragmentShader: [
  13968. 'uniform sampler2D tDiffuse;',
  13969. 'uniform float v;',
  13970. 'varying vec2 vUv;',
  13971. 'void main() {',
  13972. 'vec4 sum = vec4( 0.0 );',
  13973. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;',
  13974. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;',
  13975. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;',
  13976. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;',
  13977. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;',
  13978. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;',
  13979. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;',
  13980. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;',
  13981. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;',
  13982. 'gl_FragColor = sum;',
  13983. '}'
  13984. ].join('\n')
  13985. }
  13986. },
  13987. {
  13988. three: 217
  13989. }
  13990. ],
  13991. 103: [
  13992. function (e, t, i) {
  13993. 'use strict'
  13994. var n = e('three')
  13995. !(function () {
  13996. if (
  13997. ('performance' in window == 0 && (window.performance = {}),
  13998. 'now' in window.performance == 0)
  13999. ) {
  14000. var e = Date.now()
  14001. performance.timing &&
  14002. performance.timing.navigationStart &&
  14003. (e = performance.timing.navigationStart),
  14004. (window.performance.now = function () {
  14005. return Date.now() - e
  14006. })
  14007. }
  14008. })(),
  14009. (n.WebGLRenderer.prototype.paramThreeToGL = function (e) {
  14010. var t,
  14011. i = this.extensions,
  14012. r = this.context
  14013. if (e === n.RepeatWrapping) return r.REPEAT
  14014. if (e === n.ClampToEdgeWrapping) return r.CLAMP_TO_EDGE
  14015. if (e === n.MirroredRepeatWrapping) return r.MIRRORED_REPEAT
  14016. if (e === n.NearestFilter) return r.NEAREST
  14017. if (e === n.NearestMipMapNearestFilter) return r.NEAREST_MIPMAP_NEAREST
  14018. if (e === n.NearestMipMapLinearFilter) return r.NEAREST_MIPMAP_LINEAR
  14019. if (e === n.LinearFilter) return r.LINEAR
  14020. if (e === n.LinearMipMapNearestFilter) return r.LINEAR_MIPMAP_NEAREST
  14021. if (e === n.LinearMipMapLinearFilter) return r.LINEAR_MIPMAP_LINEAR
  14022. if (e === n.UnsignedByteType) return r.UNSIGNED_BYTE
  14023. if (e === n.UnsignedShort4444Type) return r.UNSIGNED_SHORT_4_4_4_4
  14024. if (e === n.UnsignedShort5551Type) return r.UNSIGNED_SHORT_5_5_5_1
  14025. if (e === n.UnsignedShort565Type) return r.UNSIGNED_SHORT_5_6_5
  14026. if (e === n.ByteType) return r.BYTE
  14027. if (e === n.ShortType) return r.SHORT
  14028. if (e === n.UnsignedShortType) return r.UNSIGNED_SHORT
  14029. if (e === n.IntType) return r.INT
  14030. if (e === n.UnsignedIntType) return r.UNSIGNED_INT
  14031. if (e === n.FloatType) return r.FLOAT
  14032. if (((t = i.get('OES_texture_half_float')), null !== t && e === n.HalfFloatType))
  14033. return t.HALF_FLOAT_OES
  14034. if (e === n.AlphaFormat) return r.ALPHA
  14035. if (e === n.RGBFormat) return r.RGB
  14036. if (e === n.RGBAFormat) return r.RGBA
  14037. if (e === n.LuminanceFormat) return r.LUMINANCE
  14038. if (e === n.LuminanceAlphaFormat) return r.LUMINANCE_ALPHA
  14039. if (e === n.AddEquation) return r.FUNC_ADD
  14040. if (e === n.SubtractEquation) return r.FUNC_SUBTRACT
  14041. if (e === n.ReverseSubtractEquation) return r.FUNC_REVERSE_SUBTRACT
  14042. if (e === n.ZeroFactor) return r.ZERO
  14043. if (e === n.OneFactor) return r.ONE
  14044. if (e === n.SrcColorFactor) return r.SRC_COLOR
  14045. if (e === n.OneMinusSrcColorFactor) return r.ONE_MINUS_SRC_COLOR
  14046. if (e === n.SrcAlphaFactor) return r.SRC_ALPHA
  14047. if (e === n.OneMinusSrcAlphaFactor) return r.ONE_MINUS_SRC_ALPHA
  14048. if (e === n.DstAlphaFactor) return r.DST_ALPHA
  14049. if (e === n.OneMinusDstAlphaFactor) return r.ONE_MINUS_DST_ALPHA
  14050. if (e === n.DstColorFactor) return r.DST_COLOR
  14051. if (e === n.OneMinusDstColorFactor) return r.ONE_MINUS_DST_COLOR
  14052. if (e === n.SrcAlphaSaturateFactor) return r.SRC_ALPHA_SATURATE
  14053. if (((t = i.get('WEBGL_compressed_texture_s3tc')), null !== t)) {
  14054. if (e === n.RGB_S3TC_DXT1_Format) return t.COMPRESSED_RGB_S3TC_DXT1_EXT
  14055. if (e === n.RGBA_S3TC_DXT1_Format) return t.COMPRESSED_RGBA_S3TC_DXT1_EXT
  14056. if (e === n.RGBA_S3TC_DXT3_Format) return t.COMPRESSED_RGBA_S3TC_DXT3_EXT
  14057. if (e === n.RGBA_S3TC_DXT5_Format) return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  14058. }
  14059. if (((t = i.get('WEBGL_compressed_texture_pvrtc')), null !== t)) {
  14060. if (e === n.RGB_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG
  14061. if (e === n.RGB_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG
  14062. if (e === n.RGBA_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
  14063. if (e === n.RGBA_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  14064. }
  14065. if (
  14066. ((t = i.get('WEBGL_compressed_texture_etc1')), null !== t && e === n.RGB_ETC1_Format)
  14067. )
  14068. return t.COMPRESSED_RGB_ETC1_WEBGL
  14069. if (((t = i.get('EXT_blend_minmax')), null !== t)) {
  14070. if (e === n.MinEquation) return t.MIN_EXT
  14071. if (e === n.MaxEquation) return t.MAX_EXT
  14072. }
  14073. return 0
  14074. }),
  14075. (n.WebGLState = function (e, t, i) {
  14076. var r = this,
  14077. o = new n.Vector4(),
  14078. a = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  14079. s = new Uint8Array(a),
  14080. l = new Uint8Array(a),
  14081. c = new Uint8Array(a),
  14082. h = {},
  14083. u = null,
  14084. d = null,
  14085. p = null,
  14086. f = null,
  14087. g = null,
  14088. m = null,
  14089. v = null,
  14090. A = null,
  14091. y = !1,
  14092. C = null,
  14093. I = null,
  14094. E = null,
  14095. b = null,
  14096. w = null,
  14097. _ = null,
  14098. T = null,
  14099. x = null,
  14100. S = null,
  14101. M = null,
  14102. R = null,
  14103. P = null,
  14104. O = null,
  14105. L = null,
  14106. D = null,
  14107. N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  14108. B = void 0,
  14109. F = {},
  14110. V = new n.Vector4(),
  14111. U = null,
  14112. k = null,
  14113. H = new n.Vector4(),
  14114. G = new n.Vector4()
  14115. ;(this.init = function () {
  14116. this.clearColor(0, 0, 0, 1),
  14117. this.clearDepth(1),
  14118. this.clearStencil(0),
  14119. this.enable(e.DEPTH_TEST),
  14120. e.depthFunc(e.LEQUAL),
  14121. e.frontFace(e.CCW),
  14122. e.cullFace(e.BACK),
  14123. this.enable(e.CULL_FACE),
  14124. this.enable(e.BLEND),
  14125. e.blendEquation(e.FUNC_ADD),
  14126. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  14127. }),
  14128. (this.initAttributes = function () {
  14129. for (var e = 0, t = s.length; e < t; e++) s[e] = 0
  14130. }),
  14131. (this.enableAttribute = function (i) {
  14132. if (
  14133. ((s[i] = 1), 0 === l[i] && (e.enableVertexAttribArray(i), (l[i] = 1)), 0 !== c[i])
  14134. ) {
  14135. var n = t.get('ANGLE_instanced_arrays')
  14136. n.vertexAttribDivisorANGLE(i, 0), (c[i] = 0)
  14137. }
  14138. }),
  14139. (this.enableAttributeAndDivisor = function (t, i, n) {
  14140. ;(s[t] = 1),
  14141. 0 === l[t] && (e.enableVertexAttribArray(t), (l[t] = 1)),
  14142. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i), (c[t] = i))
  14143. }),
  14144. (this.disableUnusedAttributes = function () {
  14145. for (var t = 0, i = l.length; t < i; t++)
  14146. l[t] !== s[t] && (e.disableVertexAttribArray(t), (l[t] = 0))
  14147. }),
  14148. (this.enable = function (t) {
  14149. h[t] !== !0 && (e.enable(t), (h[t] = !0))
  14150. }),
  14151. (this.disable = function (t) {
  14152. h[t] !== !1 && (e.disable(t), (h[t] = !1))
  14153. }),
  14154. (this.getCompressedTextureFormats = function () {
  14155. if (
  14156. null === u &&
  14157. ((u = []),
  14158. t.get('WEBGL_compressed_texture_pvrtc') ||
  14159. t.get('WEBGL_compressed_texture_s3tc') ||
  14160. t.get('WEBGL_compressed_texture_etc1'))
  14161. )
  14162. for (
  14163. var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0;
  14164. n < i.length;
  14165. n++
  14166. )
  14167. u.push(i[n])
  14168. return u
  14169. }),
  14170. (this.setBlending = function (t, r, o, a, s, l, c, h) {
  14171. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  14172. (t === d && h === y) ||
  14173. (t === n.AdditiveBlending
  14174. ? h
  14175. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  14176. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE))
  14177. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.SRC_ALPHA, e.ONE))
  14178. : t === n.SubtractiveBlending
  14179. ? h
  14180. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  14181. e.blendFuncSeparate(
  14182. e.ZERO,
  14183. e.ZERO,
  14184. e.ONE_MINUS_SRC_COLOR,
  14185. e.ONE_MINUS_SRC_ALPHA
  14186. ))
  14187. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR))
  14188. : t === n.MultiplyBlending
  14189. ? h
  14190. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  14191. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA))
  14192. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.SRC_COLOR))
  14193. : h
  14194. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  14195. e.blendFuncSeparate(
  14196. e.ONE,
  14197. e.ONE_MINUS_SRC_ALPHA,
  14198. e.ONE,
  14199. e.ONE_MINUS_SRC_ALPHA
  14200. ))
  14201. : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  14202. e.blendFuncSeparate(
  14203. e.SRC_ALPHA,
  14204. e.ONE_MINUS_SRC_ALPHA,
  14205. e.ONE,
  14206. e.ONE_MINUS_SRC_ALPHA
  14207. )),
  14208. (d = t),
  14209. (y = h)),
  14210. t === n.CustomBlending
  14211. ? ((s = s || r),
  14212. (l = l || o),
  14213. (c = c || a),
  14214. (r === p && s === m) ||
  14215. (e.blendEquationSeparate(i(r), i(s)), (p = r), (m = s)),
  14216. (o === f && a === g && l === v && c === A) ||
  14217. (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  14218. (f = o),
  14219. (g = a),
  14220. (v = l),
  14221. (A = c)))
  14222. : ((p = null), (f = null), (g = null), (m = null), (v = null), (A = null))
  14223. }),
  14224. (this.setDepthFunc = function (t) {
  14225. if (C !== t) {
  14226. if (t)
  14227. switch (t) {
  14228. case n.NeverDepth:
  14229. e.depthFunc(e.NEVER)
  14230. break
  14231. case n.AlwaysDepth:
  14232. e.depthFunc(e.ALWAYS)
  14233. break
  14234. case n.LessDepth:
  14235. e.depthFunc(e.LESS)
  14236. break
  14237. case n.LessEqualDepth:
  14238. e.depthFunc(e.LEQUAL)
  14239. break
  14240. case n.EqualDepth:
  14241. e.depthFunc(e.EQUAL)
  14242. break
  14243. case n.GreaterEqualDepth:
  14244. e.depthFunc(e.GEQUAL)
  14245. break
  14246. case n.GreaterDepth:
  14247. e.depthFunc(e.GREATER)
  14248. break
  14249. case n.NotEqualDepth:
  14250. e.depthFunc(e.NOTEQUAL)
  14251. break
  14252. default:
  14253. e.depthFunc(e.LEQUAL)
  14254. }
  14255. else e.depthFunc(e.LEQUAL)
  14256. C = t
  14257. }
  14258. }),
  14259. (this.setDepthTest = function (t) {
  14260. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  14261. }),
  14262. (this.setDepthWrite = function (t) {
  14263. I !== t && (e.depthMask(t), (I = t))
  14264. }),
  14265. (this.setColorWrite = function (t) {
  14266. E !== t && (e.colorMask(t, t, t, t), (E = t))
  14267. }),
  14268. (this.setStencilFunc = function (t, i, n) {
  14269. ;(w === t && _ === i && T === n) ||
  14270. (e.stencilFunc(t, i, n), (w = t), (_ = i), (T = n))
  14271. }),
  14272. (this.setStencilOp = function (t, i, n) {
  14273. ;(x === t && S === i && M === n) ||
  14274. (e.stencilOp(t, i, n), (x = t), (S = i), (M = n))
  14275. }),
  14276. (this.setStencilTest = function (t) {
  14277. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  14278. }),
  14279. (this.setStencilWrite = function (t) {
  14280. b !== t && (e.stencilMask(t), (b = t))
  14281. }),
  14282. (this.setFlipSided = function (t) {
  14283. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), (R = t))
  14284. }),
  14285. (this.setLineWidth = function (t) {
  14286. t !== P && (e.lineWidth(t), (P = t))
  14287. }),
  14288. (this.setPolygonOffset = function (t, i, n) {
  14289. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  14290. !t || (O === i && L === n) || (e.polygonOffset(i, n), (O = i), (L = n))
  14291. }),
  14292. (this.getScissorTest = function () {
  14293. return D
  14294. }),
  14295. (this.setScissorTest = function (t) {
  14296. ;(D = t), t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  14297. }),
  14298. (this.activeTexture = function (t) {
  14299. void 0 === t && (t = e.TEXTURE0 + N - 1), B !== t && (e.activeTexture(t), (B = t))
  14300. }),
  14301. (this.bindTexture = function (t, i) {
  14302. void 0 === B && r.activeTexture()
  14303. var n = F[B]
  14304. void 0 === n &&
  14305. ((n = {
  14306. type: void 0,
  14307. texture: void 0
  14308. }),
  14309. (F[B] = n)),
  14310. (n.type === t && n.texture === i) ||
  14311. (e.bindTexture(t, i), (n.type = t), (n.texture = i))
  14312. }),
  14313. (this.compressedTexImage2D = function () {
  14314. try {
  14315. e.compressedTexImage2D.apply(e, arguments)
  14316. } catch (e) {
  14317. console.error(e)
  14318. }
  14319. }),
  14320. (this.texImage2D = function () {
  14321. try {
  14322. e.texImage2D.apply(e, arguments)
  14323. } catch (e) {
  14324. console.error(e)
  14325. }
  14326. }),
  14327. (this.clearColor = function (t, i, n, r) {
  14328. o.set(t, i, n, r), V.equals(o) === !1 && (e.clearColor(t, i, n, r), V.copy(o))
  14329. }),
  14330. (this.clearDepth = function (t) {
  14331. U !== t && (e.clearDepth(t), (U = t))
  14332. }),
  14333. (this.clearStencil = function (t) {
  14334. k !== t && (e.clearStencil(t), (k = t))
  14335. }),
  14336. (this.scissor = function (t) {
  14337. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), H.copy(t))
  14338. }),
  14339. (this.viewport = function (t) {
  14340. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), G.copy(t))
  14341. }),
  14342. (this.reset = function () {
  14343. for (var t = 0; t < l.length; t++)
  14344. 1 === l[t] && (e.disableVertexAttribArray(t), (l[t] = 0))
  14345. ;(h = {}),
  14346. (u = null),
  14347. (B = void 0),
  14348. (F = {}),
  14349. (d = null),
  14350. (E = null),
  14351. (I = null),
  14352. (b = null),
  14353. (R = null)
  14354. })
  14355. })
  14356. },
  14357. {
  14358. three: 217
  14359. }
  14360. ],
  14361. 104: [
  14362. function (e, t, i) {
  14363. ;(function (i, n) {
  14364. 'use strict'
  14365. function r(e) {
  14366. this.urls = e
  14367. var t = i(
  14368. 'bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==',
  14369. 'base64'
  14370. )
  14371. ;(this.builder = a.loadProto(t)), (this.decoder = this.builder.build('binary_mesh'))
  14372. }
  14373. var o = e('three'),
  14374. a = e('protobufjs'),
  14375. s = e('../util/logger'),
  14376. l = (e('../util/common'), e('../util/ajax')),
  14377. c = e('../objects/Chunk'),
  14378. h = new s(n)
  14379. ;(r.prototype = {
  14380. constructor: r,
  14381. load: function (e, t, i, n) {
  14382. return (
  14383. h.time('download'),
  14384. l
  14385. .get(e, {
  14386. responseType: 'arraybuffer'
  14387. })
  14388. .done(
  14389. function (r) {
  14390. h.timeEnd('download'), this.parse(r, e, t, i, n)
  14391. }.bind(this)
  14392. )
  14393. .fail(n)
  14394. )
  14395. },
  14396. parse: function (e, t, i, n, r) {
  14397. var o = this.readProtobuf(e)
  14398. if (!o) return r()
  14399. try {
  14400. h.time('convert to webgl'),
  14401. this.convertProtobufToSceneObject(o, t, i, n, r),
  14402. h.timeEnd('convert to webgl')
  14403. } catch (e) {
  14404. return h.error('failed parsing .dam'), h.error(e.message), r()
  14405. }
  14406. },
  14407. readProtobuf: function (e) {
  14408. var t
  14409. try {
  14410. h.time('parse proto'), (t = this.decoder.decode(e)), h.timeEnd('parse proto')
  14411. } catch (e) {
  14412. return h.error('failed parsing proto for .dam'), h.error(e.message), null
  14413. }
  14414. return t
  14415. },
  14416. convertProtobufToSceneObject: function (e, t, i, n, r) {
  14417. function a(e) {
  14418. var i = new o.BufferGeometry()
  14419. return (
  14420. i.addAttribute(
  14421. 'position',
  14422. new o.BufferAttribute(new Float32Array(e.vertices.xyz, 0, 3), 3)
  14423. ),
  14424. e.vertices.uv.length > 0 &&
  14425. i.addAttribute(
  14426. 'uv',
  14427. new o.BufferAttribute(new Float32Array(e.vertices.uv, 0, 2), 2)
  14428. ),
  14429. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces, 0, 1), 1)),
  14430. i.applyMatrix(s),
  14431. i.computeBoundingBox(),
  14432. new c({
  14433. geometry: i,
  14434. textureName: e.material_name,
  14435. name: e.chunk_name,
  14436. meshUrl: t
  14437. })
  14438. )
  14439. }
  14440. if (0 === e.chunk.length) return h.warn('No chunks in damfile...'), i([])
  14441. var s = new o.Matrix4()
  14442. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1)
  14443. var l = e.chunk.map(a)
  14444. return l ? i(l) : (h.error('.dam protobuf came out with no chunks...'), r())
  14445. }
  14446. }),
  14447. (t.exports = r)
  14448. }).call(this, e('buffer').Buffer, '/js/loaders/DamLoader.js')
  14449. },
  14450. {
  14451. '../objects/Chunk': 144,
  14452. '../util/ajax': 181,
  14453. '../util/common': 185,
  14454. '../util/logger': 189,
  14455. buffer: 198,
  14456. protobufjs: 214,
  14457. three: 217
  14458. }
  14459. ],
  14460. 105: [
  14461. function (e, t, i) {
  14462. ;(function (i) {
  14463. 'use strict'
  14464. var n = (e('three'), e('../settings'), e('../util/browser'), e('./DamLoader')),
  14465. r = e('../util/logger'),
  14466. o = (e('../ab'), new r(i))
  14467. t.exports = {
  14468. getLoaders: function () {
  14469. return [
  14470. ['_50k', '.dam', n],
  14471. ['', '.dam', n]
  14472. ]
  14473. },
  14474. load: function (e, t, i, n, r, a) {
  14475. var s = this.getLoaders()
  14476. a = a || 0
  14477. var l = s[a]
  14478. if (!l) return void (r && r('No suitable model file found...'))
  14479. var c = l[0],
  14480. h = l[1],
  14481. u = new l[2](t),
  14482. d = t.get(e + c + h)
  14483. d
  14484. ? (o.debug('Trying ' + c + h),
  14485. u.load(
  14486. d,
  14487. i,
  14488. n,
  14489. function () {
  14490. this.load(e, t, i, n, r, ++a)
  14491. }.bind(this)
  14492. ))
  14493. : (o.debug('Skipping ' + h + ', not available'), this.load(e, t, i, n, r, ++a))
  14494. }
  14495. }
  14496. }).call(this, '/js/loaders/ModelLoader.js')
  14497. },
  14498. {
  14499. '../ab': 3,
  14500. '../settings': 166,
  14501. '../util/browser': 182,
  14502. '../util/logger': 189,
  14503. './DamLoader': 104,
  14504. three: 217
  14505. }
  14506. ],
  14507. 106: [
  14508. function (e, t, i) {
  14509. ;(function (i) {
  14510. 'use strict'
  14511. var n = e('../util/common'),
  14512. r = e('../util/texture'),
  14513. o = e('../util/browser'),
  14514. a = e('../util/logger'),
  14515. s = e('../settings'),
  14516. l = new a(i)
  14517. t.exports = {
  14518. load: function (e, t) {
  14519. function i(e, i) {
  14520. e || (t.push(i), p++, d.notify(p, a), p === a && d.resolve())
  14521. }
  14522. if (!e.chunks[0] || !e.chunks[0].meshUrl) return $.when()
  14523. var a = n.countUnique(
  14524. e.chunks.map(function (e) {
  14525. return e.textureName
  14526. })
  14527. ),
  14528. c = e.chunks[0].meshUrl.indexOf('_50k') !== -1 ? '_50k' : '',
  14529. h = '_50k' === c ? 'high' : 'low'
  14530. s.minimalMemoryMode &&
  14531. 'high' === h &&
  14532. (o.detectSamsungS6()
  14533. ? (l.warn('Galaxy S6 cannot handle large textures, turning down quality.'),
  14534. (h = 'low'))
  14535. : a > s.maxMobileTextures &&
  14536. (l.warn('Model probably too large for mobile, turning down quality.'),
  14537. (h = 'low')))
  14538. var u = e.data.job.uuid + c + '_texture_jpg_' + h + '/',
  14539. d = $.Deferred(),
  14540. p = 0
  14541. return (
  14542. e.chunks.forEach(function (t) {
  14543. if (!t.material.map && t.textureName) {
  14544. var n = e.urls.get(u + t.textureName)
  14545. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  14546. }
  14547. }),
  14548. d.promise()
  14549. )
  14550. }
  14551. }
  14552. }).call(this, '/js/loaders/ModelTextureLoader.js')
  14553. },
  14554. {
  14555. '../settings': 166,
  14556. '../util/browser': 182,
  14557. '../util/common': 185,
  14558. '../util/logger': 189,
  14559. '../util/texture': 194
  14560. }
  14561. ],
  14562. 107: [
  14563. function (e, t, i) {
  14564. ;(function (i, n) {
  14565. 'use strict'
  14566. function r(e) {
  14567. ;(this.model = e),
  14568. (this.modelDataPath =
  14569. this.model.urls.get('vision.modeldata') + '?m=' + new Date().getTime()),
  14570. (this.sweepLocationsPath = this.model.urls.get('sweep_locations.csv'))
  14571. var t = i(
  14572. 'Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K',
  14573. 'base64'
  14574. ),
  14575. n = o.loadProto(t)
  14576. this.decoder = n.build('VisionModeldata')
  14577. }
  14578. var o = e('protobufjs'),
  14579. a = e('../util/ajax'),
  14580. s = (e('../util/common'), e('../util/math')),
  14581. l = e('../util/logger'),
  14582. c = new l(n)
  14583. ;(r.prototype.load = function () {
  14584. return this.modelDataPath
  14585. ? (c.info('Using vision.modeldata'), this.loadVisionModelData())
  14586. : this.sweepLocationsPath
  14587. ? (c.warn('Using sweep_locations.csv'), this.loadSweepLocationsCSV())
  14588. : (c.warn('No sweep file found'), $.when([]))
  14589. }),
  14590. (r.prototype.loadVisionModelData = function () {
  14591. return a
  14592. .get(this.modelDataPath, {
  14593. responseType: 'arraybuffer'
  14594. })
  14595. .then(
  14596. function (e) {
  14597. var t
  14598. try {
  14599. t = this.decoder.decode(e)
  14600. } catch (e) {
  14601. return (
  14602. c.warn('Could not decode vision.modeldata, trying sweep_locations.csv'),
  14603. this.loadSweepLocationsCSV()
  14604. )
  14605. }
  14606. var i = t.sweepLocations
  14607. .map(function (e) {
  14608. return {
  14609. uuid: e.uuid.toUTF8().replace(/-/g, ''),
  14610. position: {
  14611. x: e.pose.translation.x,
  14612. y: e.pose.translation.y,
  14613. z: e.pose.translation.z
  14614. },
  14615. quaternion: {
  14616. x: e.pose.rotation.x,
  14617. y: e.pose.rotation.y,
  14618. z: e.pose.rotation.z,
  14619. w: e.pose.rotation.w
  14620. },
  14621. puck: {
  14622. x: e.puck.x,
  14623. y: e.puck.y,
  14624. z: e.puck.z
  14625. },
  14626. floor: window.sceneFrom == 'kankan' ? e.subgroup : e.group,
  14627. neighbours: e.visibles,
  14628. alignmentType: e.alignment_type
  14629. }
  14630. })
  14631. .map(function (e) {
  14632. return (
  14633. (e.position = s.convertVisionVector(e.position)),
  14634. (e.quaternion = s.convertVisionQuaternion(e.quaternion)),
  14635. (e.puck = s.convertVisionVector(e.puck)),
  14636. e
  14637. )
  14638. })
  14639. return (
  14640. i.forEach(function (e) {
  14641. e.neighbours = e.neighbours.map(function (e) {
  14642. return i[e].uuid
  14643. })
  14644. }),
  14645. i
  14646. )
  14647. }.bind(this),
  14648. function () {
  14649. return (
  14650. c.warn('Could not load vision.modeldata, trying sweep_locations.csv'),
  14651. this.loadSweepLocationsCSV()
  14652. )
  14653. }.bind(this)
  14654. )
  14655. }),
  14656. (r.prototype.loadSweepLocationsCSV = function () {
  14657. return a
  14658. .get(this.sweepLocationsPath)
  14659. .then(function (e) {
  14660. var t = e
  14661. .split('\n')
  14662. .map(function (e) {
  14663. return e.split(', ')
  14664. })
  14665. .filter(function (e) {
  14666. return e.length > 1
  14667. })
  14668. .map(function (e) {
  14669. return {
  14670. uuid: e[0],
  14671. position: {
  14672. x: parseFloat(e[1]),
  14673. y: parseFloat(e[2]),
  14674. z: parseFloat(e[3])
  14675. },
  14676. quaternion: {
  14677. x: parseFloat(e[4]),
  14678. y: parseFloat(e[5]),
  14679. z: parseFloat(e[6]),
  14680. w: parseFloat(e[7])
  14681. }
  14682. }
  14683. })
  14684. .map(function (e) {
  14685. return (
  14686. (e.position = s.convertVisionVector(e.position)),
  14687. (e.quaternion = s.convertVisionQuaternion(e.quaternion)),
  14688. e
  14689. )
  14690. })
  14691. return t
  14692. })
  14693. .fail(function () {
  14694. c.warn('Could not load sweep_locations.csv, no sweeps loaded.')
  14695. })
  14696. }),
  14697. (t.exports = r)
  14698. }).call(this, e('buffer').Buffer, '/js/loaders/SweepDataLoader.js')
  14699. },
  14700. {
  14701. '../util/ajax': 181,
  14702. '../util/common': 185,
  14703. '../util/logger': 189,
  14704. '../util/math': 190,
  14705. buffer: 198,
  14706. protobufjs: 214
  14707. }
  14708. ],
  14709. 108: [
  14710. function (e, t, i) {
  14711. ;(function (i) {
  14712. 'use strict'
  14713. function n() {
  14714. this.locale = null
  14715. }
  14716. var r = e('../settings'),
  14717. o = e('../util/common'),
  14718. a = e('../util/logger'),
  14719. s = e('../enum/Locale'),
  14720. l = new a(i)
  14721. ;(n.prototype.init = function () {
  14722. var t
  14723. switch (r.languageTag) {
  14724. case null:
  14725. case 'en':
  14726. case s.EN_US:
  14727. ;(this.locale = s.EN_US), (t = e('./strings-en-US'))
  14728. break
  14729. case 'es':
  14730. case s.ES_MX:
  14731. ;(this.locale = s.ES_MX), (t = e('./strings-es-MX'))
  14732. break
  14733. case 'fr':
  14734. case s.FR_FR:
  14735. ;(this.locale = s.FR_FR), (t = e('./strings-fr-FR'))
  14736. break
  14737. case 'de':
  14738. case s.DE_DE:
  14739. ;(this.locale = s.DE_DE), (t = e('./strings-de-DE'))
  14740. break
  14741. case 'ru':
  14742. case s.RU_RU:
  14743. ;(this.locale = s.RU_RU), (t = e('./strings-ru-RU'))
  14744. break
  14745. case 'cn':
  14746. case s.CN_CN:
  14747. ;(this.locale = s.CN_CN), (t = e('./strings-cn-CN'))
  14748. break
  14749. case 'jp':
  14750. case s.JP_JP:
  14751. ;(this.locale = s.JP_JP), (t = e('./strings-jp-JP'))
  14752. break
  14753. default:
  14754. l.info("Unsupported language tag, defaulting to 'en-US'"),
  14755. (this.locale = s.EN_US),
  14756. (t = e('./strings-en-US'))
  14757. }
  14758. l.info("Using locale '" + this.locale + "'"), o.extendObject(this, t)
  14759. }),
  14760. (n.prototype.localizeGUI = function () {
  14761. var e = document.querySelector('#gui-parent')
  14762. this.localizeTree(e), this.localizeLoadingText()
  14763. }),
  14764. (n.prototype.localizeLoadingText = function () {
  14765. // var e = document.querySelector("#loader-cont")
  14766. // , t = e.getAttribute("title");
  14767. // e.removeAttribute("title"),
  14768. // e.setAttribute("data-status", t),
  14769. // e.classList.add(this.locale),
  14770. document.querySelector('#help-dialog').classList.add(this.locale),
  14771. document.querySelector('#interaction-modal').classList.add(this.locale),
  14772. document.querySelector('#gui').classList.add(this.locale)
  14773. }),
  14774. (n.prototype.localizeTree = function (e) {
  14775. var t,
  14776. i,
  14777. n = /{\[{ ?(\w+) ?}\]}/
  14778. if (e.nodeType === Node.TEXT_NODE)
  14779. (t = e.data.match(n)), t && ((i = t[1]), (e.data = this.localizeText(i) || i))
  14780. else if (e.nodeType === Node.ELEMENT_NODE) {
  14781. var r = e.getAttribute('title')
  14782. r &&
  14783. ((t = r.match(n)),
  14784. t && ((i = t[1]), e.setAttribute('title', this.localizeText(i) || i)))
  14785. }
  14786. for (e = e.firstChild; e; ) this.localizeTree(e), (e = e.nextSibling)
  14787. }),
  14788. (n.prototype.localizeText = function (t) {
  14789. var i = this[t]
  14790. return (
  14791. i ||
  14792. this.locale === s.EN_US ||
  14793. (l.warn(
  14794. "Localization key '" +
  14795. t +
  14796. "' not available for locale '" +
  14797. this.locale +
  14798. "', defaulting to English."
  14799. ),
  14800. (i = e('./strings-en-US')[t])),
  14801. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  14802. i
  14803. )
  14804. }),
  14805. (t.exports = new n())
  14806. }).call(this, '/js/localization/localize.js')
  14807. },
  14808. {
  14809. '../enum/Locale': 31,
  14810. '../settings': 166,
  14811. '../util/common': 185,
  14812. '../util/logger': 189,
  14813. './strings-cn-CN': 109,
  14814. './strings-de-DE': 110,
  14815. './strings-en-US': 111,
  14816. './strings-es-MX': 112,
  14817. './strings-fr-FR': 113,
  14818. './strings-jp-JP': 114,
  14819. './strings-ru-RU': 115
  14820. }
  14821. ],
  14822. 109: [
  14823. function (e, t, i) {
  14824. 'use strict'
  14825. t.exports = {
  14826. PAGE_TITLE: '',
  14827. LOADING: '正在加载',
  14828. PRESENTED_BY_CAPS: '呈现者:',
  14829. POWERED_BY: '技术支持:',
  14830. POWERED_BY_CAPS: '技术支持:',
  14831. DESKTOP_SHORT_CTA: '点击一次以探索这个 3D 空间。',
  14832. MOBILE_SHORT_CTA: '点击一次以探索这个 3D 空间。',
  14833. PRESENTED_BY: '呈现者:',
  14834. MORE: '更多 ',
  14835. LESS: '更少 ',
  14836. TAG_CONTENT: 'tag™ 内容',
  14837. SHOW: '显示',
  14838. HIDE: '隐藏',
  14839. DOLLHOUSE: '场景屋',
  14840. FLOOR_PLAN: '楼层平面图',
  14841. OPEN_HIGHLIGHTS: '打开精彩片段',
  14842. CLOSE_HIGHLIGHTS: '关闭',
  14843. PREVIOUS: '上一个',
  14844. PLAY: '播放',
  14845. PAUSE: '暂停',
  14846. NEXT: '下一个',
  14847. EXPLORE_3D_SPACE: '探索 3D 空间',
  14848. VIEW_DOLLHOUSE: '观看场景屋',
  14849. SOCIAL_SHARING: '分享这个空间',
  14850. VIEW_IN_VR: '以 VR 观看',
  14851. VIEW_FULLSCREEN: '全屏观看',
  14852. EXIT_FULLSCREEN: ' 退出全屏',
  14853. ZOOM_IN: '放大',
  14854. ZOOM_OUT: '缩小',
  14855. FLOOR_NAME: '楼层',
  14856. FLOOR_ALL: 'ALL',
  14857. FLOOR_Lang: ['Floor', ''],
  14858. TERMS: '条款',
  14859. PORT_TERMS: 'port 条款',
  14860. TERMS_OF_USE: '使用条款',
  14861. CLOSE_TERMS: '关闭',
  14862. TERMS_TEXT_FILE: 'terms-cn-CN.html',
  14863. TERMS_FAIL: '无法获取条款。请确保您有互联网连接以查看使用条款。',
  14864. WEBVR_FOR_DAYDREAM: '用于 Daydream 视图',
  14865. WEBVR_ENTER_WEBVR: '进入 VR',
  14866. WEBVR_DIFFERENT_HEADSET: '有其他耳机吗?',
  14867. WEBVR_LEARN_MORE: '了解更多',
  14868. WEBVR_VIEW_SPACE: '在 VR 中观看空间',
  14869. WEBVR_DAYDREAM_VIEW: 'Daydream 视图',
  14870. WEBVR_DAYDREAM_PHONE: '支持 Daydream 的手机',
  14871. WEBVR_FOR_CARDBOARD: '用于 Google Cardboard',
  14872. WEBVR_VIEW_CARDBOARD: '或在 Google Cardboard 上观看',
  14873. VR_VIEW_SPACE: '在虚拟现实中观看空间',
  14874. VR_LEARN_MORE_CAPS: '了解更多',
  14875. VR_PREVIOUS_CAPS: '上一个’,',
  14876. VR_NEXT_CAPS: '下一个',
  14877. VR_GOT_IT_CAPS: '明白了',
  14878. VR_SHOW_SUPPORTED: '点击以使用 VR 观看空间',
  14879. VR_SHOW_UNSUPPORTED: '很遗憾,您的设备不符合在 VR 中观看空间的最低要求。',
  14880. VR_SHOW_IOS_1: '点击以使用 VR 观看空间',
  14881. VR_SHOW_IOS_2: '需要有 port VR 应用程序和兼容的 iPhone 才能观看',
  14882. VR_WHAT_YOU_NEED: '关于...您需要什么',
  14883. VR_NEED_CARDBOARD: '您使用 Google Cardboard 时需要什么',
  14884. VR_NEED_SAMSUNG: '您使用 Samsung Gear VR 时需要什么',
  14885. VR_NEED_DAYDREAM: '需要事先与 DAYDREAM VIEW 配对',
  14886. VR_NEED_DAYDREAM_PHONE: '支持 Daydream 的手机',
  14887. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  14888. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  14889. VR_APP: 'port VR 应用程序',
  14890. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  14891. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  14892. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本',
  14893. VR_COMPATIBLE_IPHONES_3: '兼容的 iPhone',
  14894. VR_COMPATIBLE_ANDROID: '兼容的 Android 设备',
  14895. VR_COMPATIBLE_ANDROID_LONG:
  14896. '4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏',
  14897. VR_ANDROID_DETAIL: '4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏',
  14898. VR_ANDROID_DVICES: 'Android 设备',
  14899. VR_COMPATIBLE_SAMSUNG: '兼容的 Samsung 设备',
  14900. VR_SAMSUNG_DETAIL: 'Galaxy S6 和更高版本',
  14901. VR_APP_FOR_CARDBOARD: '用于 Google Cardboard 的 port VR 应用程序',
  14902. VR_APP_FOR_SAMSUNG: '用于 Gear VR 的 port VR 应用程序',
  14903. VR_APP_FOR_ANDROID: '用于 Android 手机的 port VR 应用程序',
  14904. VR_APP_OPEN: '请使用 port VR 应用程序打开',
  14905. VR_DOWNLOAD_HERE: '在此下载',
  14906. VR_REQUIRE_HEADSET: '需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序',
  14907. VR_REDIRECT_TO_STORE: '如果未安装应用程序,您将跳转到应用程序商店。',
  14908. VR_IMPROPER_EMBED: 'port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。',
  14909. VR_OPEN_ANDROID_LINK: '在您的手机上打开链接',
  14910. VR_ANDROID_OPTIONS: '可用的 VR 耳机选项',
  14911. SHARE_TO: '分享到',
  14912. SHARE_LINK: '直接链接',
  14913. SHARE_EXPLORE: '探索',
  14914. SHARE_AT: '在',
  14915. SHARE_WITH: '使用',
  14916. SHARE_3D: '以 3D',
  14917. SHARE_COPIED: '已复制!',
  14918. ERROR_BROWSER_SOLUTION: '安装更新的浏览器以探索 3D。',
  14919. ERROR_BROWSER_EXPLANATION: 'WebGL 需要现代的浏览器。',
  14920. ERROR_GENERIC_PROBLEM: '糟糕,出现问题。',
  14921. ERROR_GENERIC_SOLUTION: '重新启动您的浏览器。',
  14922. ERROR_GENERIC_ACTIONS_1: '如果问题仍然存在,',
  14923. ERROR_GENERIC_ACTIONS_2: '请安装支持的浏览器',
  14924. ERROR_GENERIC_ACTIONS_3: ' 或',
  14925. ERROR_GENERIC_ACTIONS_4: '查看我们的故障排除指南',
  14926. ERROR_WEBGL_UNSUPPORTED_PROBLEM: '浏览器不受支持。',
  14927. ERROR_WEBGL_IOS_PROBLEM: 'iOS 版本不受支持。',
  14928. ERROR_WEBGL_IOS_SOLUTION: '升级到 iOS 8 或更高版本以在 3D 中探索。',
  14929. ERROR_WEBGL_IOS_ACTIONS_1: '点击 ',
  14930. ERROR_WEBGL_IOS_ACTIONS_2: '设置 > 通用 > 软件更新',
  14931. ERROR_WEBGL_SAFARI_PROBLEM: '启用 WebGL 以在 3D 中探索。',
  14932. ERROR_WEBGL_SAFARI_ACTIONS_1: '单击',
  14933. ERROR_WEBGL_SAFARI_ACTIONS_2: '菜单栏中的首选项 > 高级 > 显示开发菜单',
  14934. ERROR_WEBGL_SAFARI_ACTIONS_3: '然后单击',
  14935. ERROR_WEBGL_SAFARI_ACTIONS_4: '开发 > 启用 WebGL',
  14936. ERROR_MISSING_URLS_PROBLEM: '糟糕,没有此模型的全景。',
  14937. ERROR_MISSING_URLS_EXPLANATION: '这是较早的模型。网站所有者可能正在开发一种新模型。',
  14938. ERROR_LOADING_FAILED_PROBLEM: '糟糕,模式不可用。',
  14939. ERROR_LOADING_FAILED_ACTIONS_1: '如果问题仍然存在,',
  14940. ERROR_LOADING_FAILED_ACTIONS_2: '查看我们的故障排除指南',
  14941. ERROR_MAINTENANCE_PROBLEM: '正在进行维护',
  14942. ERROR_MAINTENANCE_SOLUTION: '请过几分钟再来。',
  14943. LINK_TO_LOCATION: '地点链接',
  14944. MENU_COPY: '复制',
  14945. LINK_ALERT_COPY: '请使用 CTRL/CMD + C 复制。',
  14946. ROTATE: '旋转',
  14947. MOVE: '移动',
  14948. INSIDE: '内部',
  14949. ZOOM: '缩放',
  14950. HELP: '小帮手',
  14951. HELP_NAVIGATION_TAB: '导航',
  14952. HELP_MORE_HELP_TAB: '更多帮助',
  14953. HELP_DESKTOP_PANORAMA_1A: '单击并拖动以环顾空间。',
  14954. HELP_DESKTOP_PANORAMA_2A: '单击整个空间内的圆环以四处移动。',
  14955. HELP_DESKTOP_PANORAMA_3A: '使用鼠标滚轮来放大和缩小。',
  14956. HELP_DESKTOP_PANORAMA_1B: '或者,使用箭头键向左向右转。',
  14957. HELP_DESKTOP_PANORAMA_2B: '或者,使用箭头键向前移动和向后移动。',
  14958. HELP_DESKTOP_PANORAMA_3B: '或者,使用加号和减号键来放大和缩小。',
  14959. HELP_DESKTOP_360_2A: '单击内部视图图标以进入空间。',
  14960. HELP_DESKTOP_360_2B: '或者,按 1 号键进入内部视图。 ',
  14961. HELP_DESKTOP_DOLLHOUSE_1A: '左键单击并向左、向右、向上和向下拖动以旋转场景屋。',
  14962. HELP_DESKTOP_DOLLHOUSE_2A:
  14963. '右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。',
  14964. HELP_DESKTOP_DOLLHOUSE_3A: '使用鼠标滚轮来放大和缩小。',
  14965. HELP_DESKTOP_DOLLHOUSE_1B: '或者,使用箭头键来旋转场景屋。',
  14966. HELP_DESKTOP_FLOORPLAN_1A:
  14967. '左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。',
  14968. HELP_DESKTOP_FLOORPLAN_2A: '右键单击并向左或向右拖动以旋转楼层平面图。',
  14969. HELP_DESKTOP_FLOORPLAN_3A: '使用鼠标滚轮来放大和缩小。',
  14970. HELP_DESKTOP_FLOORPLAN_2B: '或者,使用箭头键以向左或向右旋转。',
  14971. HELP_DESKTOP_FLOORPLAN_3B: '或者,使用箭头键来放大和缩小。',
  14972. HELP_MOBILE_PANORAMA_1: '触摸并拖动以环顾空间。',
  14973. HELP_MOBILE_PANORAMA_2: '点击整个空间内的圆环以四处移动。',
  14974. HELP_MOBILE_3: '使用捏合手势来放大和缩小。',
  14975. HELP_MOBILE_360_2: '点击内部视图图标以进入空间。',
  14976. HELP_MOBILE_DOLLHOUSE_1: '触摸并向上、向下、向左和向右拖动以旋转场景屋。',
  14977. HELP_MOBILE_DOLLHOUSE_2: '用两指触摸并拖动以定位场景屋。',
  14978. HELP_MOBILE_FLOORPLAN_1: '触摸并拖动以定位楼层平面图。',
  14979. HELP_MOBILE_FLOORPLAN_2: '用两指触摸并拖动以旋转楼层平面图。',
  14980. HELP_MORE_HLR_A: '精彩片段集锦',
  14981. HELP_DESKTOP_MORE_HLR_B: '打开以使用缩略图图像在空间中流览。',
  14982. HELP_MORE_DOLLHOUSE_A: '场景屋',
  14983. HELP_DESKTOP_MORE_DOLLHOUSE_B: '单击以查看和旋转 3D 内整个空间的俯视图。',
  14984. HELP_MOBILE_MORE_DOLLHOUSE_B: '点击以查看和旋转 3D 内整个空间的俯视图。',
  14985. HELP_MORE_FLOORS_A: '楼层选择器',
  14986. HELP_DESKTOP_MORE_FLOORS_B: '在空间中的楼层之间切换。',
  14987. HELP_MORE_TAG_A: 'tag™ 贴文',
  14988. HELP_DESKTOP_MORE_TAG_B: '单击或悬停鼠标以查看空间中的功能信息。',
  14989. HELP_MOBILE_MORE_TAG_B: '点击以查看空间中的功能信息。',
  14990. HELP_MORE_ZOOM_A: '缩放控件',
  14991. HELP_DESKTOP_MORE_ZOOM_B: '使用这些控件来放大和缩小或使用滚轮。',
  14992. HELP_MORE_TOUR_A: '导览控件',
  14993. HELP_DESKTOP_MORE_TOUR_B: '通过导览播放、暂停以及向前和向后流览。',
  14994. HELP_MORE_INSIDE_A: '内部视图',
  14995. HELP_DESKTOP_MORE_INSIDE_B: '单击以探索空间内部。',
  14996. HELP_MOBILE_MORE_INSIDE_B: '点击以探索空间内部。',
  14997. HELP_MORE_VR_A: 'VR 模式',
  14998. HELP_DESKTOP_MORE_VR_B: '单击以在虚拟现实中启动空间。',
  14999. HELP_MOBILE_MORE_VR_B: '点击以在虚拟现实中启动空间。',
  15000. HELP_MORE_360_A: '360° 视图',
  15001. HELP_DESKTOP_MORE_360_B: '单击精彩片段集锦中的 360 视图中以观看室外场景。',
  15002. HELP_MOBILE_MORE_360_B: '点击精彩片段集锦中的 360 视图中以观看室外场景。',
  15003. HELP_MORE_FULLSCREEN_A: '全屏',
  15004. HELP_DESKTOP_MORE_FULLSCREEN_B: '将 3D Showcase 扩展到全屏。',
  15005. CLOSE: '关闭'
  15006. }
  15007. },
  15008. {}
  15009. ],
  15010. 110: [
  15011. function (e, t, i) {
  15012. 'use strict'
  15013. t.exports = {
  15014. PAGE_TITLE: '',
  15015. LOADING: 'Lädt',
  15016. PRESENTED_BY_CAPS: 'PRÄSENTIERT VON',
  15017. POWERED_BY: 'Angetrieben von',
  15018. POWERED_BY_CAPS: 'ANGETRIEBEN VON',
  15019. DESKTOP_SHORT_CTA: 'Sehen sie sich in diesem 3D Raum um.',
  15020. MOBILE_SHORT_CTA: 'Sehen sie sich in diesem 3D Raum um.',
  15021. PRESENTED_BY: 'Präsentiert von ',
  15022. MORE: 'Mehr ',
  15023. LESS: 'Weniger ',
  15024. TAG_CONTENT: 'tag™ Inhalt',
  15025. SHOW: 'Anzeigen',
  15026. HIDE: 'Verbergen',
  15027. DOLLHOUSE: 'Puppenhaus',
  15028. FLOOR_PLAN: 'Grundriss',
  15029. OPEN_HIGHLIGHTS: 'Highlights anzeigen',
  15030. CLOSE_HIGHLIGHTS: 'Schließen',
  15031. PREVIOUS: 'Vorheriges',
  15032. PLAY: 'Abspielen',
  15033. PAUSE: 'Pausieren',
  15034. NEXT: 'Nächstes',
  15035. EXPLORE_3D_SPACE: 'Innenraum betreten',
  15036. VIEW_DOLLHOUSE: 'Puppenhaus ansehen',
  15037. SOCIAL_SHARING: 'Teilen Sie diesen Raum',
  15038. VIEW_IN_VR: 'In VR ansehen',
  15039. VIEW_FULLSCREEN: 'Ansicht im Vollbildmodus',
  15040. EXIT_FULLSCREEN: 'Beenden des Vollbildmodus',
  15041. ZOOM_IN: 'Vergrößern',
  15042. ZOOM_OUT: 'Verkleinern',
  15043. FLOOR_NAME: 'Etage ',
  15044. FLOOR_ALL: 'Alle',
  15045. TERMS: 'Bedingungen',
  15046. PORT_TERMS: 'port Bedingungen',
  15047. TERMS_OF_USE: 'Nutzungsbedingungen',
  15048. TERMS_TEXT_FILE: 'terms-de-DE.html',
  15049. CLOSE_TERMS: 'Schließen',
  15050. TERMS_FAIL:
  15051. 'Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.',
  15052. HELP: 'Hilfe',
  15053. HELP_NAVIGATION_TAB: 'Navigation',
  15054. HELP_MORE_HELP_TAB: 'Hilfe-Details',
  15055. CLOSE: 'Schließen',
  15056. HELP_DESKTOP_PANORAMA_1A: 'Klicken und ziehen Sie um sich im Raum umzusehen.',
  15057. HELP_DESKTOP_PANORAMA_2A: 'Klicken Sie auf die Ringe im Raum um sich zu bewegen.',
  15058. HELP_DESKTOP_PANORAMA_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  15059. HELP_DESKTOP_PANORAMA_1B:
  15060. 'Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.',
  15061. HELP_DESKTOP_PANORAMA_2B:
  15062. 'Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.',
  15063. HELP_DESKTOP_PANORAMA_3B:
  15064. 'Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.',
  15065. HELP_DESKTOP_360_2A: 'Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .',
  15066. HELP_DESKTOP_360_2B: 'Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.',
  15067. HELP_DESKTOP_DOLLHOUSE_1A:
  15068. 'Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.',
  15069. HELP_DESKTOP_DOLLHOUSE_2A:
  15070. 'Klicken mit der rechten Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Puppenhauses zu ändern.',
  15071. HELP_DESKTOP_DOLLHOUSE_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  15072. HELP_DESKTOP_DOLLHOUSE_1B:
  15073. 'Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.',
  15074. HELP_DESKTOP_FLOORPLAN_1A:
  15075. 'Klicken mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um die Position des Grundrisses auf zu ändern.',
  15076. HELP_DESKTOP_FLOORPLAN_2A:
  15077. 'Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.',
  15078. HELP_DESKTOP_FLOORPLAN_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  15079. HELP_DESKTOP_FLOORPLAN_2B:
  15080. 'Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.',
  15081. HELP_DESKTOP_FLOORPLAN_3B:
  15082. 'Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.',
  15083. HELP_MOBILE_PANORAMA_1: 'Berühren und ziehen an dem Raum um sich umzusehen.',
  15084. HELP_MOBILE_PANORAMA_2: 'Klicken Sie auf die Ringe im Raum, um sich zu bewegen.',
  15085. HELP_MOBILE_3: 'Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.',
  15086. HELP_MOBILE_360_2: 'Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.',
  15087. HELP_MOBILE_DOLLHOUSE_1:
  15088. 'Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.',
  15089. HELP_MOBILE_DOLLHOUSE_2:
  15090. 'Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.',
  15091. HELP_MOBILE_FLOORPLAN_1: 'Berühren und ziehen, um den Grundriss zu positionieren.',
  15092. HELP_MOBILE_FLOORPLAN_2:
  15093. 'Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.',
  15094. HELP_MORE_HLR_A: 'Liste das Highlight',
  15095. HELP_DESKTOP_MORE_HLR_B: 'Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.',
  15096. HELP_MORE_DOLLHOUSE_A: 'Puppenhaus Ansicht',
  15097. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  15098. 'Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.',
  15099. HELP_MOBILE_MORE_DOLLHOUSE_B:
  15100. 'Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.',
  15101. HELP_MORE_FLOORS_A: 'Etage auswählen',
  15102. HELP_DESKTOP_MORE_FLOORS_B: 'Zwischen den Etagen im Raum wechseln.',
  15103. HELP_MORE_TAG_A: 'tag™ Posts',
  15104. HELP_DESKTOP_MORE_TAG_B:
  15105. 'Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.',
  15106. HELP_MOBILE_MORE_TAG_B: 'Tippen Sie für Informationen über die Funktionen im Raum.',
  15107. HELP_MORE_ZOOM_A: 'Zoom Steuerung',
  15108. HELP_DESKTOP_MORE_ZOOM_B:
  15109. 'Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.',
  15110. HELP_MORE_TOUR_A: 'Tour Steuerung',
  15111. HELP_DESKTOP_MORE_TOUR_B:
  15112. 'Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.',
  15113. HELP_MORE_INSIDE_A: 'Innenansicht',
  15114. HELP_DESKTOP_MORE_INSIDE_B: 'Klicken Sie hier um sich im Raum umzusehen.',
  15115. HELP_MOBILE_MORE_INSIDE_B: 'Sehen Sie sich in diesen 3D Raum um.',
  15116. HELP_MORE_VR_A: 'VR Modus',
  15117. HELP_DESKTOP_MORE_VR_B:
  15118. 'Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.',
  15119. HELP_MOBILE_MORE_VR_B: 'Tippen Sie um den Raum in der virtuellen Realität zu starten.',
  15120. HELP_MORE_360_A: '360° Views Ansicht ',
  15121. HELP_DESKTOP_MORE_360_B:
  15122. 'Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.',
  15123. HELP_MOBILE_MORE_360_B:
  15124. 'Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.',
  15125. HELP_MORE_FULLSCREEN_A: 'Vollbild',
  15126. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Erweitern Sie 3D Showcase im Vollbildmodus.',
  15127. WEBVR_FOR_CARDBOARD: 'Für Google Cardboard',
  15128. WEBVR_FOR_DAYDREAM: 'Für Daydream View',
  15129. WEBVR_ENTER_WEBVR: 'Starten Sie VR',
  15130. WEBVR_DIFFERENT_HEADSET: 'Haben Sie anderes Headset?',
  15131. WEBVR_LEARN_MORE: 'Mehr Infos',
  15132. WEBVR_VIEW_SPACE: 'Ansicht des Raumes in VR',
  15133. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  15134. WEBVR_DAYDREAM_PHONE: 'Daydream-fähiges Handy',
  15135. WEBVR_VIEW_CARDBOARD: 'Oder mit Google Cardboard ansehen',
  15136. VR_WHAT_YOU_NEED: 'Was Sie dafür brauchen...',
  15137. VR_NEED_DAYDREAM_PHONE: 'Daydream-fähiges Handy',
  15138. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  15139. VR_APP: 'port VR App',
  15140. VR_APP_OPEN: 'Oder öffnen Sie die port VR App',
  15141. VR_COMPATIBLE_ANDROID_LONG:
  15142. 'Kompatibles Android Gerät mit Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer',
  15143. VR_SAMSUNG_DETAIL: 'Galaxy S6 und neuer',
  15144. VR_APP_FOR_ANDROID: 'port VR app für Android',
  15145. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  15146. VR_VIEW_SPACE: 'Ansicht des Raumes in VR',
  15147. VR_LEARN_MORE_CAPS: 'MEHR INFOS',
  15148. VR_PREVIOUS_CAPS: 'ZURÜCK',
  15149. VR_NEXT_CAPS: 'WEITER',
  15150. VR_GOT_IT_CAPS: 'VERSTANDEN',
  15151. VR_SHOW_SUPPORTED: 'Tippen Sie um den Raum in VR zu sehen',
  15152. VR_SHOW_UNSUPPORTED:
  15153. 'Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.',
  15154. VR_SHOW_IOS_1: 'Tippen Sie um den Raum in VR zu sehen',
  15155. VR_SHOW_IOS_2:
  15156. 'port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen',
  15157. VR_NEED_CARDBOARD: 'Was Sie dafür brauchen ist Google Cardboard',
  15158. VR_NEED_SAMSUNG: 'Was Sie dafür brauchen ist Samsung Gear VR',
  15159. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  15160. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  15161. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  15162. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s oder neuer, mit iOS 9.1 und später',
  15163. VR_COMPATIBLE_IPHONES_3: 'Kompatibles iPhones',
  15164. VR_COMPATIBLE_ANDROID: 'Kompatibles Android Gerät',
  15165. VR_ANDROID_DETAIL:
  15166. 'Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer',
  15167. VR_ANDROID_DVICES: 'Android Geräte',
  15168. VR_COMPATIBLE_SAMSUNG: 'Kompatible Samsung Geräte',
  15169. VR_APP_FOR_CARDBOARD: 'port VR App für Google Cardboard',
  15170. VR_APP_FOR_SAMSUNG: 'port VR App für Gear VR',
  15171. VR_DOWNLOAD_HERE: 'Hier runterladen',
  15172. VR_REQUIRE_HEADSET:
  15173. 'Benötigt das ein VR-Headset und port VR App für Android installiert wird',
  15174. VR_REDIRECT_TO_STORE:
  15175. 'Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.',
  15176. VR_IMPROPER_EMBED:
  15177. 'Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.',
  15178. VR_OPEN_ANDROID_LINK: 'Öffnen Sie den Link auf Ihrem Handy',
  15179. VR_ANDROID_OPTIONS: 'VR Headset Optionen',
  15180. SHARE_TO: 'Teilen auf',
  15181. SHARE_LINK: 'Direkter Link',
  15182. SHARE_EXPLORE: 'Umsehen',
  15183. SHARE_AT: 'auf',
  15184. SHARE_WITH: 'mit',
  15185. SHARE_3D: 'in 3D',
  15186. SHARE_COPIED: 'Kopiert!',
  15187. ERROR_BROWSER_SOLUTION: 'Installieren Sie einen neueren Browser um sich in 3D umzusehen.',
  15188. ERROR_BROWSER_EXPLANATION: 'WebGL benötigt einen modernen Browser.',
  15189. ERROR_GENERIC_PROBLEM: 'Huch, etwas ist schief gelaufen.',
  15190. ERROR_GENERIC_SOLUTION: 'Starten Sie Ihren Browser neu.',
  15191. ERROR_GENERIC_ACTIONS_1: 'Wenn das Problem weiterhin besteht, ',
  15192. ERROR_GENERIC_ACTIONS_2: 'Installieren Sie einen unterstützten Browser',
  15193. ERROR_GENERIC_ACTIONS_3: ' oder ',
  15194. ERROR_GENERIC_ACTIONS_4: 'Sehen Sie unseren Leitfaden zur Fehlerbehebung',
  15195. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Browser wird nicht unterstützt.',
  15196. ERROR_WEBGL_IOS_PROBLEM: 'iOS-Version wird nicht unterstützt.',
  15197. ERROR_WEBGL_IOS_SOLUTION:
  15198. 'Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.',
  15199. ERROR_WEBGL_IOS_ACTIONS_1: 'Tippen ',
  15200. ERROR_WEBGL_IOS_ACTIONS_2: 'Einstellungen > Allgemein > Softwareaktualisierung',
  15201. ERROR_WEBGL_SAFARI_PROBLEM: 'Aktivieren Sie WebVR um sich in 3D umzusehen.',
  15202. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Klicken ',
  15203. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen',
  15204. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Klicken Sie dann ',
  15205. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Entwickler > WebGL Aktivieren',
  15206. ERROR_MISSING_URLS_PROBLEM: 'Huch, es gibt keine Panoramen für dieses Modell .',
  15207. ERROR_MISSING_URLS_EXPLANATION:
  15208. 'Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.',
  15209. ERROR_LOADING_FAILED_PROBLEM: 'Huch, das Modell ist nicht verfügbar.',
  15210. ERROR_LOADING_FAILED_ACTIONS_1: 'Wenn das Problem weiterhin besteht, ',
  15211. ERROR_LOADING_FAILED_ACTIONS_2: 'sehen Sie unseren Leitfaden zur Fehlerbehebung',
  15212. ERROR_MAINTENANCE_PROBLEM: 'Wartung im Gange.',
  15213. ERROR_MAINTENANCE_SOLUTION: 'Bitte versuchen Sie es in ein paar Minuten nochmal.',
  15214. LINK_TO_LOCATION: 'Link zu',
  15215. MENU_COPY: 'Kopieren',
  15216. LINK_ALERT_COPY: 'Bitte benutzen Sie CTRL/CMD + C zum kopieren.',
  15217. ROTATE: 'Drehen',
  15218. INSIDE: 'Drinnen',
  15219. MOVE: 'Bewegen',
  15220. ZOOM: 'Vergrößern'
  15221. }
  15222. },
  15223. {}
  15224. ],
  15225. 111: [
  15226. function (e, t, i) {
  15227. 'use strict'
  15228. t.exports = {
  15229. PAGE_TITLE: '',
  15230. LOADING: 'Loading',
  15231. PRESENTED_BY_CAPS: 'PRESENTED BY',
  15232. POWERED_BY: 'powered by ',
  15233. POWERED_BY_CAPS: 'POWERED BY',
  15234. DESKTOP_SHORT_CTA: 'Click to explore this 3D space.',
  15235. MOBILE_SHORT_CTA: 'Tap to explore this 3D space.',
  15236. PRESENTED_BY: 'Presented by ',
  15237. MORE: 'More ',
  15238. LESS: 'Less ',
  15239. TAG_CONTENT: 'tag™ Content',
  15240. SHOW: 'Show',
  15241. HIDE: 'Hide',
  15242. DOLLHOUSE: 'Dollhouse',
  15243. FLOOR_PLAN: 'Floor plan',
  15244. OPEN_HIGHLIGHTS: 'Open Highlights',
  15245. CLOSE_HIGHLIGHTS: 'Close',
  15246. PREVIOUS: 'Previous',
  15247. PLAY: 'Play',
  15248. PAUSE: 'Pause',
  15249. NEXT: 'Next',
  15250. EXPLORE_3D_SPACE: 'Explore 3D Space',
  15251. VIEW_DOLLHOUSE: 'View dollhouse',
  15252. SOCIAL_SHARING: 'Share this Space',
  15253. VIEW_IN_VR: 'View in VR',
  15254. VIEW_FULLSCREEN: '全屏',
  15255. EXIT_FULLSCREEN: '退出全屏',
  15256. ZOOM_IN: 'Zoom in',
  15257. ZOOM_OUT: 'Zoom out',
  15258. FLOOR_NAME: 'Floor ',
  15259. FLOOR_ALL: '全部',
  15260. TERMS: 'Terms',
  15261. PORT_TERMS: 'port terms',
  15262. TERMS_OF_USE: 'Terms of Use',
  15263. TERMS_TEXT_FILE: 'terms-en-US.html',
  15264. CLOSE_TERMS: 'Close',
  15265. TERMS_FAIL:
  15266. 'Could not fetch terms. Please make sure you have an internet connection to view the terms of use.',
  15267. HELP: 'Help',
  15268. HELP_NAVIGATION_TAB: 'Navigation',
  15269. HELP_MORE_HELP_TAB: 'More Help',
  15270. CLOSE: 'Close',
  15271. HELP_DESKTOP_PANORAMA_1A: 'Click and Drag to look around the Space.',
  15272. HELP_DESKTOP_PANORAMA_2A: 'Click on the rings throughout the space to move around.',
  15273. HELP_DESKTOP_PANORAMA_3A: 'Use the scroll wheel to zoom in and out.',
  15274. HELP_DESKTOP_PANORAMA_1B: 'Or, use the arrow keys to turn left and right.',
  15275. HELP_DESKTOP_PANORAMA_2B: 'Or, use the arrow keys to move forward and back.',
  15276. HELP_DESKTOP_PANORAMA_3B: 'Or, use the plus and minus keys to zoom in and out.',
  15277. HELP_DESKTOP_360_2A: 'Click the Inside View icon to enter the Space.',
  15278. HELP_DESKTOP_360_2B: 'Or, press the number 1 key to enter Inside View.',
  15279. HELP_DESKTOP_DOLLHOUSE_1A:
  15280. 'Left click and drag left, right, up, and down to rotate the Dollhouse.',
  15281. HELP_DESKTOP_DOLLHOUSE_2A:
  15282. 'Right click and drag left, right, up, and down to change the Dollhouse position on screen.',
  15283. HELP_DESKTOP_DOLLHOUSE_3A: 'Use the scroll wheel to zoom in and out.',
  15284. HELP_DESKTOP_DOLLHOUSE_1B: 'Or, use the arrow keys to rotate the Dollhouse.',
  15285. HELP_DESKTOP_FLOORPLAN_1A:
  15286. 'Left click and drag left, right, up, and down to change the Floorplan position on screen.',
  15287. HELP_DESKTOP_FLOORPLAN_2A: 'Right click and drag left or right to rotate the Floorplan.',
  15288. HELP_DESKTOP_FLOORPLAN_3A: 'Use the scroll wheel to zoom in and out.',
  15289. HELP_DESKTOP_FLOORPLAN_2B: 'Or, use the arrow keys to rotate left or right.',
  15290. HELP_DESKTOP_FLOORPLAN_3B: 'Or, use the arrow keys to zoom in and out.',
  15291. HELP_MOBILE_PANORAMA_1: 'Touch and Drag to look around the Space.',
  15292. HELP_MOBILE_PANORAMA_2: 'Tap on the rings throughout the Space to move around.',
  15293. HELP_MOBILE_3: 'Use a pinch gesture to zoom in and out.',
  15294. HELP_MOBILE_360_2: 'Tap the Inside View icon to enter the Space.',
  15295. HELP_MOBILE_DOLLHOUSE_1:
  15296. 'Touch and drag up, down, left, and right to rotate the Dollhouse.',
  15297. HELP_MOBILE_DOLLHOUSE_2: 'Touch and drag with two fingers to position the Dollhouse.',
  15298. HELP_MOBILE_FLOORPLAN_1: 'Touch and drag to position the Floorplan.',
  15299. HELP_MOBILE_FLOORPLAN_2: 'Touch and drag with two fingers to rotate the Floorplan.',
  15300. HELP_MORE_HLR_A: 'Highlight Reel',
  15301. HELP_DESKTOP_MORE_HLR_B: 'Open to navigate through the Space using thumbnail images.',
  15302. HELP_MORE_DOLLHOUSE_A: 'Dollhouse View',
  15303. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  15304. 'Click to view and rotate a top-down view of the entire Space in 3D.',
  15305. HELP_MOBILE_MORE_DOLLHOUSE_B:
  15306. 'Tap to view and rotate a top-down view of the entire Space in 3D.',
  15307. HELP_MORE_FLOORS_A: 'Floor Selector',
  15308. HELP_DESKTOP_MORE_FLOORS_B: 'Switch between floors in the Space.',
  15309. HELP_MORE_TAG_A: 'tag™ Posts',
  15310. HELP_DESKTOP_MORE_TAG_B:
  15311. 'Click or hover over for information about features in the Space.',
  15312. HELP_MOBILE_MORE_TAG_B: 'Tap for information about features in the Space.',
  15313. HELP_MORE_ZOOM_A: 'Zoom Controls',
  15314. HELP_DESKTOP_MORE_ZOOM_B:
  15315. 'Use these controls to zoom in and out or use the scroll wheel.',
  15316. HELP_MORE_TOUR_A: 'Tour Controls',
  15317. HELP_DESKTOP_MORE_TOUR_B:
  15318. 'Play, pause, and navigate forward and backward through a Guided Tour.',
  15319. HELP_MORE_INSIDE_A: 'Inside View',
  15320. HELP_DESKTOP_MORE_INSIDE_B: 'Click to explore inside the Space.',
  15321. HELP_MOBILE_MORE_INSIDE_B: 'Tap to explore inside the Space.',
  15322. HELP_MORE_VR_A: 'VR Mode',
  15323. HELP_DESKTOP_MORE_VR_B: 'Click to launch the Space in virtual reality.',
  15324. HELP_MOBILE_MORE_VR_B: 'Tap to launch the Space in virtual reality.',
  15325. HELP_MORE_360_A: '360° Views',
  15326. HELP_DESKTOP_MORE_360_B: 'Click 360 Views in the Highlight Reel to view outdoor scenes.',
  15327. HELP_MOBILE_MORE_360_B: 'Tap 360 Views in the Highlight Reel to view outdoor scenes.',
  15328. HELP_MORE_FULLSCREEN_A: 'Full screen',
  15329. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Expand 3D Showcase to full screen.',
  15330. WEBVR_FOR_CARDBOARD: 'For Google Cardboard',
  15331. WEBVR_VIEW_CARDBOARD: 'Or View on Google Cardboard',
  15332. WEBVR_FOR_DAYDREAM: 'For Daydream View',
  15333. WEBVR_ENTER_WEBVR: 'ENTER VR',
  15334. WEBVR_DIFFERENT_HEADSET: 'Have a different headset?',
  15335. WEBVR_LEARN_MORE: 'Learn more',
  15336. WEBVR_VIEW_SPACE: 'View Space in VR',
  15337. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  15338. WEBVR_DAYDREAM_PHONE: 'Daydream-ready phone',
  15339. VR_VIEW_SPACE: 'View Space in Virtual Reality',
  15340. VR_LEARN_MORE_CAPS: 'LEARN MORE',
  15341. VR_PREVIOUS_CAPS: 'PREVIOUS',
  15342. VR_NEXT_CAPS: 'NEXT',
  15343. VR_GOT_IT_CAPS: 'GOT IT',
  15344. VR_SHOW_SUPPORTED: 'Tap to view the Space in VR with',
  15345. VR_SHOW_UNSUPPORTED:
  15346. "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  15347. VR_SHOW_IOS_1: 'Tap to view the space in VR',
  15348. VR_SHOW_IOS_2: 'Requires port VR app and compatible iPhone to view',
  15349. VR_WHAT_YOU_NEED: "What You'll Need For...",
  15350. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  15351. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  15352. VR_NEED_DAYDREAM: 'NEEDS PRIOR PAIRING WITH DAYDREAM VIEW',
  15353. VR_NEED_DAYDREAM_PHONE: 'Daydream-ready phone',
  15354. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  15355. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  15356. VR_APP: 'port VR App',
  15357. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  15358. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  15359. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s and newer, running iOS 9.1 and higher',
  15360. VR_COMPATIBLE_IPHONES_3: 'Compatible iPhones',
  15361. VR_COMPATIBLE_ANDROID: 'Compatible Android Devices',
  15362. VR_COMPATIBLE_ANDROID_LONG:
  15363. 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  15364. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  15365. VR_ANDROID_DVICES: 'Android Devices',
  15366. VR_COMPATIBLE_SAMSUNG: 'Compatible Samsung Devices',
  15367. VR_SAMSUNG_DETAIL: 'Galaxy S6 and Above',
  15368. VR_APP_FOR_CARDBOARD: 'port VR app for Google Cardboard',
  15369. VR_APP_FOR_SAMSUNG: 'port VR app for Gear VR',
  15370. VR_APP_FOR_ANDROID: 'port VR app for Android Phones',
  15371. VR_APP_OPEN: 'Open with the port VR app instead',
  15372. VR_DOWNLOAD_HERE: 'Download here',
  15373. VR_REQUIRE_HEADSET: 'Requires a VR headset and port VR app for Android to be installed',
  15374. VR_REDIRECT_TO_STORE: 'If app is not installed, you will be redirected to the app store.',
  15375. VR_IMPROPER_EMBED:
  15376. 'The port Space is not embedded properly to support VR in your web browser.',
  15377. VR_OPEN_ANDROID_LINK: 'Open the Link on Your Mobile Phone',
  15378. VR_ANDROID_OPTIONS: 'Available VR Headset Options',
  15379. SHARE_TO: 'Share to',
  15380. SHARE_LINK: 'Direct Link',
  15381. SHARE_EXPLORE: 'Explore ',
  15382. SHARE_AT: 'at',
  15383. SHARE_WITH: 'with',
  15384. SHARE_3D: ' in 3D',
  15385. SHARE_COPIED: 'Copied!',
  15386. ERROR_BROWSER_SOLUTION: 'Install a new browser to explore in 3D.',
  15387. ERROR_BROWSER_EXPLANATION: 'WebGL requires a modern browser.',
  15388. ERROR_GENERIC_PROBLEM: 'Oops, something went wrong.',
  15389. ERROR_GENERIC_SOLUTION: 'Restart your browser.',
  15390. ERROR_GENERIC_ACTIONS_1: 'If the problem persists, ',
  15391. ERROR_GENERIC_ACTIONS_2: 'install a supported browser',
  15392. ERROR_GENERIC_ACTIONS_3: ' or ',
  15393. ERROR_GENERIC_ACTIONS_4: 'see our troubleshooting guide',
  15394. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Browser not supported.',
  15395. ERROR_WEBGL_IOS_PROBLEM: 'iOS version not supported.',
  15396. ERROR_WEBGL_IOS_SOLUTION: 'Upgrade to iOS 8 or higher to explore in 3D.',
  15397. ERROR_WEBGL_IOS_ACTIONS_1: 'Tap ',
  15398. ERROR_WEBGL_IOS_ACTIONS_2: 'Settings > General > Software Update',
  15399. ERROR_WEBGL_SAFARI_PROBLEM: 'Enable WebGL to explore in 3D.',
  15400. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Click ',
  15401. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Preferences > Advanced > Show Develop menu',
  15402. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Then click ',
  15403. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Develop > Enable WebGL',
  15404. ERROR_MISSING_URLS_PROBLEM: 'Oops, there are no panoramas for this model.',
  15405. ERROR_MISSING_URLS_EXPLANATION:
  15406. 'This is an older model. The website owner may have a new model on the way.',
  15407. ERROR_LOADING_FAILED_PROBLEM: '模型不可用.',
  15408. ERROR_LOADING_FAILED_ACTIONS_1: 'If the problem persists, ',
  15409. ERROR_LOADING_FAILED_ACTIONS_2: 'see our troubleshooting guide',
  15410. ERROR_MAINTENANCE_PROBLEM: 'Maintenance in progress.',
  15411. ERROR_MAINTENANCE_SOLUTION: 'Please come back in a few minutes.',
  15412. LINK_TO_LOCATION: 'Link to location',
  15413. MENU_COPY: 'Copy',
  15414. LINK_ALERT_COPY: 'Please use CTRL/CMD + C to copy.',
  15415. ROTATE: 'Rotate',
  15416. INSIDE: 'Inside',
  15417. MOVE: 'Move',
  15418. ZOOM: 'Zoom'
  15419. }
  15420. },
  15421. {}
  15422. ],
  15423. 112: [
  15424. function (e, t, i) {
  15425. 'use strict'
  15426. t.exports = {
  15427. PAGE_TITLE: '',
  15428. LOADING: 'Cargando',
  15429. PRESENTED_BY_CAPS: 'PRESENTADO POR',
  15430. POWERED_BY: 'potenciando por ',
  15431. POWERED_BY_CAPS: 'POTENCIADO POR ',
  15432. DESKTOP_SHORT_CTA: 'Haga clic para explorar este Espacio 3D.',
  15433. MOBILE_SHORT_CTA: 'Pulse para explorar este Espacio 3D.',
  15434. PRESENTED_BY: 'Presentado por ',
  15435. MORE: 'Más ',
  15436. LESS: 'Menos ',
  15437. TAG_CONTENT: 'Contenido de tag™',
  15438. SHOW: 'Mostrar',
  15439. HIDE: 'Ocultar',
  15440. DOLLHOUSE: 'Dollhouse',
  15441. FLOOR_PLAN: 'Planos',
  15442. OPEN_HIGHLIGHTS: 'Aspectos Destacados',
  15443. CLOSE_HIGHLIGHTS: 'Cerrar',
  15444. PREVIOUS: 'Anterior',
  15445. PLAY: 'Play',
  15446. PAUSE: 'Pausa',
  15447. NEXT: 'Siguiente',
  15448. EXPLORE_3D_SPACE: 'Explorar el Espacio 3D',
  15449. VIEW_DOLLHOUSE: 'Ver dollhouse',
  15450. SOCIAL_SHARING: 'Compartir este espacio',
  15451. VIEW_IN_VR: 'Ver en realidad virtual',
  15452. VIEW_FULLSCREEN: 'Ver en pantalla completa',
  15453. EXIT_FULLSCREEN: 'Salir de pantalla completa',
  15454. ZOOM_IN: 'Acercar',
  15455. ZOOM_OUT: 'Alejar',
  15456. FLOOR_NAME: 'Piso ',
  15457. FLOOR_ALL: 'Todas',
  15458. TERMS: 'Condiciones',
  15459. PORT_TERMS: 'port términos de uso',
  15460. TERMS_OF_USE: 'Términos de uso',
  15461. TERMS_TEXT_FILE: 'terms-es-MX.html',
  15462. CLOSE_TERMS: 'Cerrar',
  15463. TERMS_FAIL:
  15464. 'No se han podido obtener las condiciones. Asegúrese de tener una conexión a Internet para ver los términos de uso.',
  15465. HELP: 'Ayuda',
  15466. HELP_NAVIGATION_TAB: 'Navegación',
  15467. HELP_MORE_HELP_TAB: 'Más Ayuda',
  15468. CLOSE: 'Cerrar',
  15469. HELP_DESKTOP_PANORAMA_1A: 'Haga clic y arrastre para mirar alrededor del espacio.',
  15470. HELP_DESKTOP_PANORAMA_2A: 'Haga clic en los aros a lo largo del espacio para moverse.',
  15471. HELP_DESKTOP_PANORAMA_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  15472. HELP_DESKTOP_PANORAMA_1B:
  15473. 'O use las teclas de flecha para girar a la izquierda y a la derecha.',
  15474. HELP_DESKTOP_PANORAMA_2B: 'O use las teclas de dirección para adelantar o retroceder.',
  15475. HELP_DESKTOP_PANORAMA_3B: 'O use la tecla más para acercar y la tecla menos para alejar.',
  15476. HELP_DESKTOP_360_2A: 'Haga clic en el icono Vista Interior para ingresar al Espacio.',
  15477. HELP_DESKTOP_360_2B:
  15478. 'O bien, presione la tecla numero 1 para entrar en la Vista Interior.',
  15479. HELP_DESKTOP_DOLLHOUSE_1A:
  15480. 'Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.',
  15481. HELP_DESKTOP_DOLLHOUSE_2A:
  15482. 'Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.',
  15483. HELP_DESKTOP_DOLLHOUSE_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  15484. HELP_DESKTOP_DOLLHOUSE_1B: 'O use las teclas de dirección para girar la Dollhouse.',
  15485. HELP_DESKTOP_FLOORPLAN_1A:
  15486. 'Haga clic con izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición de la planta.',
  15487. HELP_DESKTOP_FLOORPLAN_2A:
  15488. 'Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.',
  15489. HELP_DESKTOP_FLOORPLAN_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  15490. HELP_DESKTOP_FLOORPLAN_2B: 'O use las teclas para girar hacia la izquierda o derecha.',
  15491. HELP_DESKTOP_FLOORPLAN_3B: 'O use las teclas de dirección para acercar o alejar.',
  15492. HELP_MOBILE_PANORAMA_1: 'Toque y arrastre para mirar alrededor del espacio.',
  15493. HELP_MOBILE_PANORAMA_2: 'Toque en los aros a lo largo del espacio para moverse.',
  15494. HELP_MOBILE_3: 'Use el gesto de pellizcar para acercar o alejar.',
  15495. HELP_MOBILE_360_2: 'Toque el ícono Vista Interior para entrar en el Espacio.',
  15496. HELP_MOBILE_DOLLHOUSE_1:
  15497. 'Toque y arrastre con dos dedos para cambiar la posición della dollhouse.',
  15498. HELP_MOBILE_DOLLHOUSE_2:
  15499. 'Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.',
  15500. HELP_MOBILE_FLOORPLAN_1: 'Toque y arrastre para cambiar la posición de la planta.',
  15501. HELP_MOBILE_FLOORPLAN_2: 'Toque y arrastre con dos dedos para girar la planta.',
  15502. HELP_MORE_HLR_A: 'Galería destacada',
  15503. HELP_DESKTOP_MORE_HLR_B:
  15504. 'Abra para navegar a través del espacio utilizando imágenes en miniatura.',
  15505. HELP_MORE_DOLLHOUSE_A: 'Vista aérea por pisos',
  15506. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  15507. 'Haga clic para ver y girar la Dollhouse del espacio completo en 3D.',
  15508. HELP_MOBILE_MORE_DOLLHOUSE_B:
  15509. 'Toque para ver y girar la vista Dollhouse del espacio completo en 3D.',
  15510. HELP_MORE_FLOORS_A: 'Seleccionador de plantas',
  15511. HELP_DESKTOP_MORE_FLOORS_B: 'Cambie de una planta a otra en el espacio.',
  15512. HELP_MORE_TAG_A: 'tag™ Posts',
  15513. HELP_DESKTOP_MORE_TAG_B:
  15514. 'Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.',
  15515. HELP_MOBILE_MORE_TAG_B:
  15516. 'Toque para obtener más información acerca de las características del espacio.',
  15517. HELP_MORE_ZOOM_A: 'Controles de zoom',
  15518. HELP_DESKTOP_MORE_ZOOM_B:
  15519. 'Use estos controles o la rueda de desplazamiento para acercar o alejar.',
  15520. HELP_MORE_TOUR_A: 'Controles de recorrido',
  15521. HELP_DESKTOP_MORE_TOUR_B:
  15522. 'Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.',
  15523. HELP_MORE_INSIDE_A: 'Vista interior',
  15524. HELP_DESKTOP_MORE_INSIDE_B: 'Haga clic para explorar el interior del espacio.',
  15525. HELP_MOBILE_MORE_INSIDE_B: 'Toque para explorar el interior del espacio.',
  15526. HELP_MORE_VR_A: 'Modo de realidad virtual',
  15527. HELP_DESKTOP_MORE_VR_B: 'Toque para ver el espacio en realidad virtual.',
  15528. HELP_MOBILE_MORE_VR_B: 'Toque para ver el espacio en realidad virtual.',
  15529. HELP_MORE_360_A: '360° Views',
  15530. HELP_DESKTOP_MORE_360_B:
  15531. 'Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.',
  15532. HELP_MOBILE_MORE_360_B:
  15533. 'Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.',
  15534. HELP_MORE_FULLSCREEN_A: 'Pantalla completa',
  15535. HELP_DESKTOP_MORE_FULLSCREEN_B:
  15536. 'Expanda el escenario 3D para verlo en pantalla completa.',
  15537. WEBVR_FOR_CARDBOARD: 'Para Google Cardboard',
  15538. WEBVR_FOR_DAYDREAM: 'Para Daydream View',
  15539. WEBVR_ENTER_WEBVR: 'ENTRAR VR',
  15540. WEBVR_DIFFERENT_HEADSET: '¿Tiene un auricular diferente?',
  15541. WEBVR_LEARN_MORE: 'Más información',
  15542. WEBVR_VIEW_SPACE: 'Ver Espacio en VR',
  15543. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  15544. WEBVR_DAYDREAM_PHONE: 'Daydream Teléfono listos',
  15545. WEBVR_VIEW_CARDBOARD: 'O Ver en Google Cardboard',
  15546. VR_NEED_DAYDREAM: 'Necesidades antes de acoplarse con Daydream View',
  15547. VR_NEED_DAYDREAM_PHONE: 'Teléfono listo para Daydream',
  15548. VR_GOOGLE_DAYDREAM: 'Daydream de Google',
  15549. VR_APP: 'port VR App',
  15550. VR_COMPATIBLE_ANDROID_LONG:
  15551. 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  15552. VR_APP_FOR_ANDROID: 'Aplicación port VR para Teléfonos Android',
  15553. VR_APP_OPEN: 'Abrir con la aplicación port VR en su lugar',
  15554. VR_VIEW_SPACE: 'Ver Espacio en realidad virtual',
  15555. VR_LEARN_MORE_CAPS: 'SABER MÁS',
  15556. VR_PREVIOUS_CAPS: 'ANTERIOR',
  15557. VR_NEXT_CAPS: 'SIGUIENTE',
  15558. VR_GOT_IT_CAPS: 'COMPRENDIDO',
  15559. VR_SHOW_SUPPORTED: 'Pulse para ver el Espacio en realidad virtual con',
  15560. VR_SHOW_UNSUPPORTED:
  15561. 'Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.',
  15562. VR_SHOW_IOS_1: 'Pulse para ver el Espacio en realidad virtual',
  15563. VR_SHOW_IOS_2: 'Necesita la aplicación port VR y un iPhone compatible para ver',
  15564. VR_WHAT_YOU_NEED: 'Lo que necesitaras...',
  15565. VR_NEED_CARDBOARD: 'Lo que necesitaras con Google Cardboard',
  15566. VR_NEED_SAMSUNG: 'Lo que necesitaras con el Samsung Gear VR',
  15567. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  15568. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  15569. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  15570. VR_COMPATIBLE_IPHONES_2: 'Compatible con iPhone 6S o superior y con iOS 9.1 en adelante',
  15571. VR_COMPATIBLE_IPHONES_3: 'iPhones compatibles',
  15572. VR_COMPATIBLE_ANDROID: 'Dispositivos Android compatibles',
  15573. VR_ANDROID_DETAIL: 'Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante',
  15574. VR_ANDROID_DVICES: 'Dispositivos Android',
  15575. VR_COMPATIBLE_SAMSUNG: 'Dispositivos compatibles del Samsung',
  15576. VR_SAMSUNG_DETAIL: 'Galaxy S5 en adelante',
  15577. VR_APP_FOR_CARDBOARD: 'Aplicación port VR para Google Cardboard',
  15578. VR_APP_FOR_SAMSUNG: 'Aplicación port VR para Gear VR',
  15579. VR_DOWNLOAD_HERE: 'Descargar aquí',
  15580. VR_REQUIRE_HEADSET:
  15581. 'Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android',
  15582. VR_REDIRECT_TO_STORE:
  15583. 'Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.',
  15584. VR_IMPROPER_EMBED:
  15585. 'El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.',
  15586. VR_OPEN_ANDROID_LINK: 'Abre el enlace en tu teléfono móvil',
  15587. VR_ANDROID_OPTIONS: 'Opciones de auriculares en RV disponibles',
  15588. SHARE_TO: 'Compartir en',
  15589. SHARE_LINK: 'Enlace directo',
  15590. SHARE_EXPLORE: 'Explorar ',
  15591. SHARE_AT: 'en',
  15592. SHARE_WITH: 'con',
  15593. SHARE_3D: ' en 3D',
  15594. SHARE_COPIED: '¡Copiado!',
  15595. ERROR_BROWSER_SOLUTION: 'Instale un nuevo navegador para explorar en 3D.',
  15596. ERROR_BROWSER_EXPLANATION: 'WebGL requiere un navegador moderno.',
  15597. ERROR_GENERIC_PROBLEM: 'Vaya, algo ha ido mal.',
  15598. ERROR_GENERIC_SOLUTION: 'Reinicie su navegador.',
  15599. ERROR_GENERIC_ACTIONS_1: 'Si el problema persiste, ',
  15600. ERROR_GENERIC_ACTIONS_2: 'instale un navegador compatible',
  15601. ERROR_GENERIC_ACTIONS_3: ' o ',
  15602. ERROR_GENERIC_ACTIONS_4: 'consulte nuestra guía de solución de problemas',
  15603. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Navegador no compatible.',
  15604. ERROR_WEBGL_IOS_PROBLEM: 'Versión de iOS no compatible.',
  15605. ERROR_WEBGL_IOS_SOLUTION: 'Actualice a iOS 8 o superior para explorar en 3D.',
  15606. ERROR_WEBGL_IOS_ACTIONS_1: 'Pulse ',
  15607. ERROR_WEBGL_IOS_ACTIONS_2: 'Ajustes > General > Actualización de software',
  15608. ERROR_WEBGL_SAFARI_PROBLEM: 'Habilite WebGL para explorar en 3D.',
  15609. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Haga clic en ',
  15610. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Preferencias > Avanzado > Mostrar el menú Desarrollar',
  15611. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Después, haga clic en ',
  15612. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Desarrollar > Habilitar WebGL',
  15613. ERROR_MISSING_URLS_PROBLEM: 'Vaya, no hay panoramas para este modelo.',
  15614. ERROR_MISSING_URLS_EXPLANATION:
  15615. 'Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.',
  15616. ERROR_LOADING_FAILED_PROBLEM: 'Vaya, modelo no disponible.',
  15617. ERROR_LOADING_FAILED_ACTIONS_1: 'Si el problema persiste, ',
  15618. ERROR_LOADING_FAILED_ACTIONS_2: 'consulte nuestra guía de solución de problemas',
  15619. ERROR_MAINTENANCE_PROBLEM: 'Mantenimiento en progreso.',
  15620. ERROR_MAINTENANCE_SOLUTION: 'Regrese en unos minutos.',
  15621. LINK_TO_LOCATION: 'Enlace a la ubicación',
  15622. MENU_COPY: 'Copiar',
  15623. LINK_ALERT_COPY: 'Utilice CTRL/CMD + C para copiar.',
  15624. ROTATE: 'Girar',
  15625. INSIDE: 'Interior',
  15626. MOVE: 'Moverse',
  15627. ZOOM: 'Acercar o alejar'
  15628. }
  15629. },
  15630. {}
  15631. ],
  15632. 113: [
  15633. function (e, t, i) {
  15634. 'use strict'
  15635. t.exports = {
  15636. PAGE_TITLE: '',
  15637. LOADING: 'Chargement',
  15638. PRESENTED_BY_CAPS: 'PRÉSENTÉ PAR',
  15639. POWERED_BY: 'alimenté par ',
  15640. POWERED_BY_CAPS: 'ALIMENTÉ PAR',
  15641. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  15642. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  15643. PRESENTED_BY: 'Présenté par ',
  15644. MORE: 'Plus ',
  15645. LESS: 'Moins ',
  15646. TAG_CONTENT: 'Contenu tag™',
  15647. SHOW: 'Montrer',
  15648. HIDE: 'Cacher',
  15649. DOLLHOUSE: 'Dollhouse',
  15650. FLOOR_PLAN: 'Plan de sol',
  15651. OPEN_HIGHLIGHTS: 'Ouvrir les faits saillants',
  15652. CLOSE_HIGHLIGHTS: 'Fermer',
  15653. PREVIOUS: 'Précédent',
  15654. PLAY: 'Lecture',
  15655. PAUSE: 'Pause',
  15656. NEXT: 'Suivant',
  15657. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  15658. VIEW_DOLLHOUSE: 'Voir dollhouse',
  15659. SOCIAL_SHARING: 'Partager cet espace',
  15660. VIEW_IN_VR: 'Voir en VR',
  15661. VIEW_FULLSCREEN: 'Plein écran',
  15662. EXIT_FULLSCREEN: 'Fermer plein écran',
  15663. ZOOM_IN: 'Zoom avant',
  15664. ZOOM_OUT: 'Zoom arrière',
  15665. FLOOR_NAME: 'Étage ',
  15666. FLOOR_ALL: 'Tous',
  15667. TERMS: 'Mentions légales',
  15668. PORT_TERMS: 'port mentions légales',
  15669. TERMS_OF_USE: "Conditions d'utilisation",
  15670. TERMS_TEXT_FILE: 'terms-fr-FR.html',
  15671. CLOSE_TERMS: 'Fermer',
  15672. TERMS_FAIL:
  15673. "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  15674. HELP: 'Aide',
  15675. HELP_NAVIGATION_TAB: 'Navigation',
  15676. HELP_MORE_HELP_TAB: 'Aide',
  15677. CLOSE: 'Fermer',
  15678. HELP_DESKTOP_PANORAMA_1A: 'Cliquez et faites glisser pour regarder autour de l’espace.',
  15679. HELP_DESKTOP_PANORAMA_2A: 'Cliquez sur les anneaux pour vous déplacer.',
  15680. HELP_DESKTOP_PANORAMA_3A: 'Utilisez la molette de votre souris pour zoomer.',
  15681. HELP_DESKTOP_PANORAMA_1B: 'Ou utilisez les touches pour tourner.',
  15682. HELP_DESKTOP_PANORAMA_2B: 'Ou utilisez les touches pour avancer et reculer.',
  15683. HELP_DESKTOP_PANORAMA_3B: 'Ou utilisez les touches plus et moins pour zoomer.',
  15684. HELP_DESKTOP_360_2A: 'Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.',
  15685. HELP_DESKTOP_360_2B:
  15686. 'Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.',
  15687. HELP_DESKTOP_DOLLHOUSE_1A:
  15688. 'Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.',
  15689. HELP_DESKTOP_DOLLHOUSE_2A:
  15690. 'Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.',
  15691. HELP_DESKTOP_DOLLHOUSE_3A: 'Utilisez la molette de votre souris pour zoomer.',
  15692. HELP_DESKTOP_DOLLHOUSE_1B: 'Ou utilisez les touches pour faire pivoter la vue Dollhouse.',
  15693. HELP_DESKTOP_FLOORPLAN_1A:
  15694. 'Faites un clic droit pour changer la position du plan sur l’écran.',
  15695. HELP_DESKTOP_FLOORPLAN_2A:
  15696. 'Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.',
  15697. HELP_DESKTOP_FLOORPLAN_3A: 'Utilisez la molette de votre souris pour zoomer.',
  15698. HELP_DESKTOP_FLOORPLAN_2B:
  15699. 'Ou utilisez les touches pour faire pivoter à gauche ou à droite.',
  15700. HELP_DESKTOP_FLOORPLAN_3B:
  15701. 'Ou utilisez les touches pour effectuer un zoom avant ou arrière.',
  15702. HELP_MOBILE_PANORAMA_1: 'Touchez et faites glisser pour regarder autour de l’espace.',
  15703. HELP_MOBILE_PANORAMA_2: 'Tapez sur les anneaux dans tout l’espace pour vous déplacer.',
  15704. HELP_MOBILE_3: 'Utilisez un geste de pincement pour zoomer avant/arrière.',
  15705. HELP_MOBILE_360_2: 'Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.',
  15706. HELP_MOBILE_DOLLHOUSE_1:
  15707. 'Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.',
  15708. HELP_MOBILE_DOLLHOUSE_2:
  15709. 'Touchez et faites glisser avec deux doigts pour positionner vue en coupe.',
  15710. HELP_MOBILE_FLOORPLAN_1: 'Touchez et faites glisser pour positionner le plan.',
  15711. HELP_MOBILE_FLOORPLAN_2:
  15712. 'Touchez et faites glisser avec deux doigts pour faire pivoter le plan.',
  15713. HELP_MORE_HLR_A: 'Carrousel',
  15714. HELP_DESKTOP_MORE_HLR_B: 'Ouvrez pour naviguer dans l’espace en utilisant les vignettes.',
  15715. HELP_MORE_DOLLHOUSE_A: 'Vue en coupe',
  15716. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  15717. 'Cliquez pour afficher et faire pivoter l’espace entier en 3D.',
  15718. HELP_MOBILE_MORE_DOLLHOUSE_B:
  15719. 'Tapez pour afficher et faire pivoter l’espace entier en 3D.',
  15720. HELP_MORE_FLOORS_A: 'Sélecteur d’étage',
  15721. HELP_DESKTOP_MORE_FLOORS_B: 'Basculer entre les étages dans l’espace.',
  15722. HELP_MORE_TAG_A: 'tag™ Posts',
  15723. HELP_DESKTOP_MORE_TAG_B:
  15724. 'Cliquez ou survolez pour obtenir des informations sur l’espace.',
  15725. HELP_MOBILE_MORE_TAG_B: 'Tapez pour obtenir des informations sur l’espace.',
  15726. HELP_MORE_ZOOM_A: 'Commandes de zoom',
  15727. HELP_DESKTOP_MORE_ZOOM_B:
  15728. 'Utilisez votre clavier ou la molette de votre souris pour zoomer.',
  15729. HELP_MORE_TOUR_A: 'Commandes de la visite',
  15730. HELP_DESKTOP_MORE_TOUR_B:
  15731. "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  15732. HELP_MORE_INSIDE_A: 'Vue intérieure',
  15733. HELP_DESKTOP_MORE_INSIDE_B: 'Cliquez pour explorer l’intérieur de l’espace.',
  15734. HELP_MOBILE_MORE_INSIDE_B: 'Tapez pour explorer l’intérieur de l’espace.',
  15735. HELP_MORE_VR_A: 'Mode RV',
  15736. HELP_DESKTOP_MORE_VR_B: 'Cliquez pour lancer l’espace en réalité virtuelle.',
  15737. HELP_MOBILE_MORE_VR_B: 'Tapez pour lancer l’espace en réalité virtuelle.',
  15738. HELP_MORE_360_A: 'Vues 360°',
  15739. HELP_DESKTOP_MORE_360_B:
  15740. 'Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.',
  15741. HELP_MOBILE_MORE_360_B:
  15742. 'Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.',
  15743. HELP_MORE_FULLSCREEN_A: 'Plein écran',
  15744. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Voir 3D Showcase en plein écran.',
  15745. WEBVR_FOR_CARDBOARD: 'Pour Google Cardboard',
  15746. WEBVR_FOR_DAYDREAM: 'Pour Daydream View',
  15747. WEBVR_ENTER_WEBVR: 'ENTRER VR',
  15748. WEBVR_DIFFERENT_HEADSET: 'Avez-vous un casque différent?',
  15749. WEBVR_LEARN_MORE: 'En savoir plus',
  15750. WEBVR_VIEW_SPACE: 'Voir Espace en VR',
  15751. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  15752. WEBVR_DAYDREAM_PHONE: 'Téléphone compatibles Daydream',
  15753. WEBVR_VIEW_CARDBOARD: 'Ou Afficher sur Google Cardboard',
  15754. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  15755. VR_LEARN_MORE_CAPS: 'EN SAVOIR PLUS',
  15756. VR_PREVIOUS_CAPS: 'PRÉCÉDENT',
  15757. VR_NEXT_CAPS: 'SUIVANT',
  15758. VR_GOT_IT_CAPS: 'BIEN COMPRIS',
  15759. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  15760. VR_SHOW_UNSUPPORTED:
  15761. 'Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.',
  15762. VR_SHOW_IOS_1: 'Taper pour voir l’Espace en Realité Virtuelle',
  15763. VR_SHOW_IOS_2: 'Nécessite l’application port VR et un iPhone compatible pour voir',
  15764. VR_WHAT_YOU_NEED: 'Ce dont vous aurez besoin pour...',
  15765. VR_NEED_CARDBOARD: 'Ce dont vous aurez besoin avec Google Cardboard',
  15766. VR_NEED_SAMSUNG: 'Ce dont vous aurez besoin avec Samsung Gear VR',
  15767. VR_NEED_DAYDREAM: 'BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW',
  15768. VR_NEED_DAYDREAM_PHONE: 'Téléphone compatible avec Daydream',
  15769. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  15770. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  15771. VR_APP: 'port VR App',
  15772. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  15773. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  15774. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s et plus récent, avec iOS 9.1 et plus récent',
  15775. VR_COMPATIBLE_IPHONES_3: 'iPhones compatibles',
  15776. VR_COMPATIBLE_ANDROID: 'Appareils Android compatibles',
  15777. VR_COMPATIBLE_ANDROID_LONG:
  15778. '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',
  15779. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  15780. VR_ANDROID_DVICES: 'Appareils Android',
  15781. VR_COMPATIBLE_SAMSUNG: 'Appareils Samsung Compatibles',
  15782. VR_SAMSUNG_DETAIL: 'Galaxy S6 et plus récents',
  15783. VR_APP_FOR_CARDBOARD: 'Application port VR pour Google Cardboard',
  15784. VR_APP_FOR_SAMSUNG: 'Application port VR pour Gear VR',
  15785. VR_APP_FOR_ANDROID: 'Application port VR pour téléphones Android',
  15786. VR_APP_OPEN: 'Ouvrir plutôt avec l’application port VR',
  15787. VR_DOWNLOAD_HERE: 'Télécharger ici',
  15788. VR_REQUIRE_HEADSET:
  15789. "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  15790. VR_REDIRECT_TO_STORE:
  15791. "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  15792. VR_IMPROPER_EMBED:
  15793. "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  15794. VR_OPEN_ANDROID_LINK: 'Ouvrez ce lien avec votre appareil mobile',
  15795. VR_ANDROID_OPTIONS: 'Options disponibles pour casque VR sous',
  15796. SHARE_TO: 'Partager sur',
  15797. SHARE_LINK: 'Lien direct',
  15798. SHARE_EXPLORE: 'Explorer ',
  15799. SHARE_AT: 'à',
  15800. SHARE_WITH: 'avec',
  15801. SHARE_3D: ' en 3D',
  15802. SHARE_COPIED: 'Copié!',
  15803. ERROR_BROWSER_SOLUTION: 'Installer un nouveau navigateur pour explorer en 3D.',
  15804. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  15805. ERROR_GENERIC_PROBLEM: 'Il y eu un problème.',
  15806. ERROR_GENERIC_SOLUTION: 'Redémarrer votre navigateur.',
  15807. ERROR_GENERIC_ACTIONS_1: 'Si le problème persiste, ',
  15808. ERROR_GENERIC_ACTIONS_2: 'installez un navigateur plus récent',
  15809. ERROR_GENERIC_ACTIONS_3: ' ou ',
  15810. ERROR_GENERIC_ACTIONS_4: 'voir notre guide de dépannage',
  15811. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Navigateur non-supporté.',
  15812. ERROR_WEBGL_IOS_PROBLEM: 'Version iOS non-supportée.',
  15813. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  15814. ERROR_WEBGL_IOS_ACTIONS_1: 'Tapez ',
  15815. ERROR_WEBGL_IOS_ACTIONS_2: 'Paramètres > Général > Mise à jour Software',
  15816. ERROR_WEBGL_SAFARI_PROBLEM: 'Activez WegGL pour explorer en 3D.',
  15817. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Cliquez ',
  15818. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Préferences > Avancés > Voir menu développeur',
  15819. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Puis cliquez ',
  15820. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Développe > Activé WebGL',
  15821. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  15822. ERROR_MISSING_URLS_EXPLANATION:
  15823. 'Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.',
  15824. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  15825. ERROR_LOADING_FAILED_ACTIONS_1: 'Si le problème persiste, ',
  15826. ERROR_LOADING_FAILED_ACTIONS_2: 'voir notre guide de dépannage',
  15827. ERROR_MAINTENANCE_PROBLEM: 'Maintenance en cours.',
  15828. ERROR_MAINTENANCE_SOLUTION: 'Revenez dans quelques instants.',
  15829. LINK_TO_LOCATION: "Lien vers l'emplacement",
  15830. MENU_COPY: 'Copie',
  15831. LINK_ALERT_COPY: 'Utiliser CTRL+CMD C pour copier.',
  15832. ROTATE: 'Faire pivoter',
  15833. INSIDE: 'Intérieure',
  15834. MOVE: 'Se déplacer',
  15835. ZOOM: 'Zoom'
  15836. }
  15837. },
  15838. {}
  15839. ],
  15840. 114: [
  15841. function (e, t, i) {
  15842. 'use strict'
  15843. t.exports = {
  15844. PAGE_TITLE: '',
  15845. LOADING: '読み込み中',
  15846. PRESENTED_BY_CAPS: 'PRESENTED BY',
  15847. POWERED_BY: 'powered by',
  15848. POWERED_BY_CAPS: 'POWERED BY',
  15849. DESKTOP_SHORT_CTA: 'クリックしてこの3D Spaceを探索',
  15850. MOBILE_SHORT_CTA: 'タップしてこの3D Spaceを探索',
  15851. PRESENTED_BY: 'Presented by ',
  15852. MORE: '全て表示 ',
  15853. LESS: '閉じる ',
  15854. TAG_CONTENT: 'tag™コンテンツ ',
  15855. SHOW: '表示',
  15856. HIDE: '非表示',
  15857. DOLLHOUSE: 'ドールハウス',
  15858. FLOOR_PLAN: 'フロアプラン',
  15859. OPEN_HIGHLIGHTS: 'ハイライトを開く',
  15860. CLOSE_HIGHLIGHTS: '閉じる',
  15861. PREVIOUS: '前へ',
  15862. PLAY: '再生',
  15863. PAUSE: '一時停止',
  15864. NEXT: '次へ',
  15865. EXPLORE_3D_SPACE: '3DSpaceの探索',
  15866. VIEW_DOLLHOUSE: 'ドールハウスの表示',
  15867. SOCIAL_SHARING: 'このSpaceを共有する',
  15868. VIEW_IN_VR: 'VRで表示',
  15869. VIEW_FULLSCREEN: 'フルスクリーン表示',
  15870. EXIT_FULLSCREEN: 'フルスクリーン表示を終了',
  15871. ZOOM_IN: 'ズームイン',
  15872. ZOOM_OUT: 'ズームアウト',
  15873. FLOOR_NAME: 'フロア ',
  15874. FLOOR_ALL: 'すべて',
  15875. TERMS: '規約',
  15876. PORT_TERMS: 'port規約',
  15877. TERMS_OF_USE: '利用規約',
  15878. CLOSE_TERMS: '閉じる',
  15879. TERMS_TEXT_FILE: 'terms-jp-JP.html',
  15880. TERMS_FAIL:
  15881. '規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。',
  15882. WEBVR_FOR_DAYDREAM: 'Daydream View用',
  15883. WEBVR_ENTER_WEBVR: 'VRに入る',
  15884. WEBVR_DIFFERENT_HEADSET: '別のヘッドセットをお持ちですか?',
  15885. WEBVR_LEARN_MORE: 'もっと詳しく',
  15886. WEBVR_VIEW_SPACE: 'VRでSpaceを表示',
  15887. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  15888. WEBVR_DAYDREAM_PHONE: 'Daydream対応スマホ',
  15889. WEBVR_FOR_CARDBOARD: 'Google Cardboard用',
  15890. WEBVR_VIEW_CARDBOARD: 'またはGoogle Cardboardで表示',
  15891. VR_VIEW_SPACE: 'バーチャルリアリティでSpaceを表示',
  15892. VR_LEARN_MORE_CAPS: 'もっと詳しく',
  15893. VR_PREVIOUS_CAPS: '前へ',
  15894. VR_NEXT_CAPS: '次へ',
  15895. VR_GOT_IT_CAPS: '了解',
  15896. VR_SHOW_SUPPORTED: 'タップして次を使用してVRでSpaceを表示: ',
  15897. VR_SHOW_UNSUPPORTED: 'お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません',
  15898. VR_SHOW_IOS_1: 'タップしてVRでSpaceを表示',
  15899. VR_SHOW_IOS_2: '表示するにはport VRアプリと互換性のあるiPhoneが必要です',
  15900. VR_WHAT_YOU_NEED: '必要なもの',
  15901. VR_NEED_CARDBOARD: 'Google Cardboardに必要なもの',
  15902. VR_NEED_SAMSUNG: 'Samsung Gear VRに必要なもの',
  15903. VR_NEED_DAYDREAM: '事前にDaydream Viewとのペアリングが必要です',
  15904. VR_NEED_DAYDREAM_PHONE: 'Daydream対応スマホ',
  15905. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  15906. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  15907. VR_APP: 'port VRアプリ',
  15908. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  15909. VR_COMPATIBLE_IPHONES_1: 'iPhone',
  15910. VR_COMPATIBLE_IPHONES_2: 'iOS 9.1以降で動作するiPhone 5s以降のモデル',
  15911. VR_COMPATIBLE_IPHONES_3: '互換性のあるiPhone',
  15912. VR_COMPATIBLE_ANDROID: '互換性のあるAndroidデバイス',
  15913. VR_COMPATIBLE_ANDROID_LONG:
  15914. 'Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ',
  15915. VR_ANDROID_DETAIL: 'Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ',
  15916. VR_ANDROID_DVICES: 'Androidデバイス',
  15917. VR_COMPATIBLE_SAMSUNG: '互換性のあるSamsungデバイス',
  15918. VR_SAMSUNG_DETAIL: 'Galaxy S5以降のモデル',
  15919. VR_APP_FOR_CARDBOARD: 'Google Cardboard用のport VRアプリ',
  15920. VR_APP_FOR_SAMSUNG: 'Gear VR 用のport VRアプリ',
  15921. VR_APP_FOR_ANDROID: 'Androidフォン用のport VRアプリ',
  15922. VR_APP_OPEN: 'port VRアプリで開く',
  15923. VR_DOWNLOAD_HERE: 'ここからダウンロード',
  15924. VR_REQUIRE_HEADSET:
  15925. 'Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります',
  15926. VR_REDIRECT_TO_STORE:
  15927. 'アプリがインストールされていない場合、App Storeにリダイレクトされます',
  15928. VR_IMPROPER_EMBED:
  15929. 'お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。',
  15930. VR_OPEN_ANDROID_LINK: 'お使いの携帯電話でリンクを開いてください',
  15931. VR_ANDROID_OPTIONS: '利用可能なVRヘッドセットオプション',
  15932. SHARE_TO: '共有先',
  15933. SHARE_LINK: 'ダイレクトリンク',
  15934. SHARE_EXPLORE: '探索',
  15935. SHARE_AT: '場所',
  15936. SHARE_WITH: '使用アプリ',
  15937. SHARE_3D: '3Dで',
  15938. SHARE_COPIED: 'コピーされました!',
  15939. ERROR_BROWSER_SOLUTION:
  15940. '3D探索するには、新しいバージョンのブラウザをインストールしてください',
  15941. ERROR_BROWSER_EXPLANATION: 'WebGLにはモダンブラウザが必要です。',
  15942. ERROR_GENERIC_PROBLEM: '問題が発生しました。',
  15943. ERROR_GENERIC_SOLUTION: 'ブラウザを再起動してください。',
  15944. ERROR_GENERIC_ACTIONS_1: '問題が解決しない場合は、',
  15945. ERROR_GENERIC_ACTIONS_2: 'サポートされているブラウザをインストールしてください',
  15946. ERROR_GENERIC_ACTIONS_3: 'または',
  15947. ERROR_GENERIC_ACTIONS_4: 'トラブルシューティングガイドを参照してください',
  15948. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'ブラウザがサポートされていません。',
  15949. ERROR_WEBGL_IOS_PROBLEM: 'サポートされていないiOSバージョンです。',
  15950. ERROR_WEBGL_IOS_SOLUTION: '3D探索するには、iOS 8以降にアップグレードしてください。',
  15951. ERROR_WEBGL_IOS_ACTIONS_1: '以下の順にタップします:',
  15952. ERROR_WEBGL_IOS_ACTIONS_2: '設定 > 全般 > ソフトウェアの更新',
  15953. ERROR_WEBGL_SAFARI_PROBLEM: 'WebGLを有効にして3Dで探索します。',
  15954. ERROR_WEBGL_SAFARI_ACTIONS_1: '以下の順にクリックします:',
  15955. ERROR_WEBGL_SAFARI_ACTIONS_2: '環境設定 > 詳細 > メニューバーに開発メニューを表示',
  15956. ERROR_WEBGL_SAFARI_ACTIONS_3: 'その後、以下の順にクリックします:',
  15957. ERROR_WEBGL_SAFARI_ACTIONS_4: '開発 > WebGLを有効にする',
  15958. ERROR_MISSING_URLS_PROBLEM: 'このモデルではパノラマを使用できません。',
  15959. ERROR_MISSING_URLS_EXPLANATION:
  15960. 'これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。',
  15961. ERROR_LOADING_FAILED_PROBLEM: 'モデルは利用できません。',
  15962. ERROR_LOADING_FAILED_ACTIONS_1: '問題が解決しない場合は、',
  15963. ERROR_LOADING_FAILED_ACTIONS_2: 'トラブルシューティングガイドを参照してください',
  15964. ERROR_MAINTENANCE_PROBLEM: 'メンテナンスは進行中です。',
  15965. ERROR_MAINTENANCE_SOLUTION: 'しばらくしてからやり直し てください。',
  15966. LINK_TO_LOCATION: 'ロケーションへのリンク',
  15967. MENU_COPY: 'コピー',
  15968. LINK_ALERT_COPY: 'コピーするにはCTRL/CMD + Cを使用してください。',
  15969. ROTATE: '回転',
  15970. MOVE: '移動',
  15971. INSIDE: '内側',
  15972. ZOOM: 'ズーム',
  15973. HELP: 'ヘルプ',
  15974. HELP_NAVIGATION_TAB: 'ナビゲーション',
  15975. HELP_MORE_HELP_TAB: 'その他のヘルプ',
  15976. HELP_DESKTOP_PANORAMA_1A: 'Spaceを見回すには、クリックしてドラッグします。',
  15977. HELP_DESKTOP_PANORAMA_2A: '移動するには、Space全体にあるリングをクリックします。',
  15978. HELP_DESKTOP_PANORAMA_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  15979. HELP_DESKTOP_PANORAMA_1B: 'または、矢印キーを使用して左右に向きを変えます。',
  15980. HELP_DESKTOP_PANORAMA_2B: 'または、矢印キーを使用して前後に向きを変えます。',
  15981. HELP_DESKTOP_PANORAMA_3B:
  15982. 'あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。',
  15983. HELP_DESKTOP_360_2A: '内側ビューアイコンをクリックしてSpaceに入ります。',
  15984. HELP_DESKTOP_360_2B: 'または、数字キー1を押して内側ビューに入ります。',
  15985. HELP_DESKTOP_DOLLHOUSE_1A: '左クリックと左右、上下のドラッグでドールハウスを回転します。',
  15986. HELP_DESKTOP_DOLLHOUSE_2A:
  15987. '右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。',
  15988. HELP_DESKTOP_DOLLHOUSE_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  15989. HELP_DESKTOP_DOLLHOUSE_1B: 'または、矢印キーを使用してドールハウスを回転します。',
  15990. HELP_DESKTOP_FLOORPLAN_1A:
  15991. '左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。',
  15992. HELP_DESKTOP_FLOORPLAN_2A:
  15993. '右ボタンを押しながら左右にドラッグして、フロアプランを回転します。',
  15994. HELP_DESKTOP_FLOORPLAN_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  15995. HELP_DESKTOP_FLOORPLAN_2B: 'または、矢印キーを使用して左右に回転します。',
  15996. HELP_DESKTOP_FLOORPLAN_3B: 'または、矢印キーを使用して、ズームイン、ズームアウトします。',
  15997. HELP_MOBILE_PANORAMA_1: 'Spaceを見回すには、タッチしてドラッグします。',
  15998. HELP_MOBILE_PANORAMA_2: '移動するには、Space全体にあるリングをタップします。',
  15999. HELP_MOBILE_3: 'ピンチジェスチャーを使用してズームイン、ズームアウトします。',
  16000. HELP_MOBILE_360_2: '内側ビューアイコンをタップしてSpaceに入ります。',
  16001. HELP_MOBILE_DOLLHOUSE_1: 'タッチして上下左右にドラッグしてドールハウスを回転します。',
  16002. HELP_MOBILE_DOLLHOUSE_2: 'タッチして、2本指でドラッグしてドールハウスを配置します。',
  16003. HELP_MOBILE_FLOORPLAN_1: 'タッチ&ドラッグしてフロアプランを配置します。',
  16004. HELP_MOBILE_FLOORPLAN_2: 'タッチして、2本指でドラッグしてフロアプランを回転します。',
  16005. HELP_MORE_HLR_A: 'ハイライト',
  16006. HELP_DESKTOP_MORE_HLR_B: 'サムネイル画像を使用してSpaceを移動するために開きます。',
  16007. HELP_MORE_DOLLHOUSE_A: 'ドールハウス',
  16008. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  16009. 'クリックして3DでSpace全体のトップダウンビューを表示して回転します。',
  16010. HELP_MOBILE_MORE_DOLLHOUSE_B:
  16011. 'タップして3DでSpace全体のトップダウンビューを表示して回転します。',
  16012. HELP_MORE_FLOORS_A: 'フロアセレクター',
  16013. HELP_DESKTOP_MORE_FLOORS_B: 'Space内のフロアを切り替えます。',
  16014. HELP_MORE_TAG_A: 'tag™ Posts',
  16015. HELP_DESKTOP_MORE_TAG_B:
  16016. 'クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。',
  16017. HELP_MOBILE_MORE_TAG_B: 'タップするとSpace内の機能についての説明が表示されます。',
  16018. HELP_MORE_ZOOM_A: 'ズームコントロール',
  16019. HELP_DESKTOP_MORE_ZOOM_B:
  16020. 'これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。',
  16021. HELP_MORE_TOUR_A: 'ツアーコントロール',
  16022. HELP_DESKTOP_MORE_TOUR_B: 'ガイド付きツアー中に再生、一時停止、前方・後方に移動します。',
  16023. HELP_MORE_INSIDE_A: '内側ビュー',
  16024. HELP_DESKTOP_MORE_INSIDE_B: 'クリックしてSpace内を探索します。',
  16025. HELP_MOBILE_MORE_INSIDE_B: 'タップしてSpace内を探索します。',
  16026. HELP_MORE_VR_A: 'VRモード',
  16027. HELP_DESKTOP_MORE_VR_B: 'クリックしてバーチャルリアリティでSpaceを起動します。',
  16028. HELP_MOBILE_MORE_VR_B: 'タップしてバーチャルリアリティでSpaceを起動します。',
  16029. HELP_MORE_360_A: '360° Views',
  16030. HELP_DESKTOP_MORE_360_B:
  16031. 'Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。',
  16032. HELP_MOBILE_MORE_360_B: 'Highlight Reelの360° Viewsをタップして屋外シーンを表示します。',
  16033. HELP_MORE_FULLSCREEN_A: 'フルスクリーン',
  16034. HELP_DESKTOP_MORE_FULLSCREEN_B: '3D Showcaseをフルスクリーン表示にします。',
  16035. CLOSE: '閉じる'
  16036. }
  16037. },
  16038. {}
  16039. ],
  16040. 115: [
  16041. function (e, t, i) {
  16042. 'use strict'
  16043. t.exports = {
  16044. PAGE_TITLE: '',
  16045. LOADING: 'Загрузка',
  16046. PRESENTED_BY_CAPS: 'ПРЕДСТАВЛЕНО',
  16047. POWERED_BY: 'разработано на платформе ',
  16048. POWERED_BY_CAPS: 'РАЗРАБОТАНО НА ПЛАТФОРМЕ',
  16049. DESKTOP_SHORT_CTA: 'Нажмите для просмотра.',
  16050. MOBILE_SHORT_CTA: 'Нажмите для просмотра.',
  16051. PRESENTED_BY: 'Представлено ',
  16052. MORE: 'Больше ',
  16053. LESS: 'Меньше ',
  16054. TAG_CONTENT: 'tag™ Контент',
  16055. SHOW: 'Показать',
  16056. HIDE: 'Скрыть',
  16057. DOLLHOUSE: 'Dollhouse',
  16058. FLOOR_PLAN: 'Планировка',
  16059. OPEN_HIGHLIGHTS: 'Открыть Фотоколлаж',
  16060. CLOSE_HIGHLIGHTS: 'Закрыть',
  16061. PREVIOUS: 'Предыдущий',
  16062. PLAY: 'Воспроизвести',
  16063. PAUSE: 'Пауза',
  16064. NEXT: 'Следующий',
  16065. EXPLORE_3D_SPACE: 'Просмотреть 3D модель',
  16066. VIEW_DOLLHOUSE: 'Посмотреть Dollhouse',
  16067. SOCIAL_SHARING: 'Поделиться этой моделью',
  16068. VIEW_IN_VR: 'Посмотреть в VR',
  16069. VIEW_FULLSCREEN: 'Полный экран',
  16070. EXIT_FULLSCREEN: 'Выйти из полноэкранного режима',
  16071. ZOOM_IN: 'Увеличить',
  16072. ZOOM_OUT: 'Уменьшить',
  16073. FLOOR_NAME: 'Этаж ',
  16074. FLOOR_ALL: 'Все',
  16075. TERMS: 'Условия',
  16076. PORT_TERMS: 'Правила пользования',
  16077. TERMS_OF_USE: 'Условия использования',
  16078. TERMS_TEXT_FILE: 'terms-ru-RU.html',
  16079. CLOSE_TERMS: 'Закрыть',
  16080. TERMS_FAIL:
  16081. 'Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.',
  16082. HELP: 'Помощь',
  16083. HELP_NAVIGATION_TAB: 'Навигация',
  16084. HELP_MORE_HELP_TAB: 'Доп. Помощь',
  16085. CLOSE: 'Закрыть',
  16086. HELP_DESKTOP_PANORAMA_1A: 'Нажмите и перетащите, чтобы осмотреть пространство вокруг.',
  16087. HELP_DESKTOP_PANORAMA_2A: 'Для передвижения по модели нажимайте на круги .',
  16088. HELP_DESKTOP_PANORAMA_3A: 'Используйте колесо прокрутки для увеличения и уменьшения.',
  16089. HELP_DESKTOP_PANORAMA_1B:
  16090. 'Или используйте клавиши со стрелками для поворота влево и вправо.',
  16091. HELP_DESKTOP_PANORAMA_2B: 'Или используйте стрелки для перемещения вперед и назад.',
  16092. HELP_DESKTOP_PANORAMA_3B:
  16093. 'Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.',
  16094. HELP_DESKTOP_360_2A:
  16095. 'Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.',
  16096. HELP_DESKTOP_360_2B: 'или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.',
  16097. HELP_DESKTOP_DOLLHOUSE_1A:
  16098. 'Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.',
  16099. HELP_DESKTOP_DOLLHOUSE_2A:
  16100. 'Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.',
  16101. HELP_DESKTOP_DOLLHOUSE_3A: 'Используйте колесо прокрутки чтобы увеличить и уменьшить.',
  16102. HELP_DESKTOP_DOLLHOUSE_1B:
  16103. 'Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.',
  16104. HELP_DESKTOP_FLOORPLAN_1A:
  16105. 'Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.',
  16106. HELP_DESKTOP_FLOORPLAN_2A:
  16107. 'Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.',
  16108. HELP_DESKTOP_FLOORPLAN_3A: 'Используйте колесо прокрутки чтобы увеличить и уменьшить.',
  16109. HELP_DESKTOP_FLOORPLAN_2B:
  16110. 'Или используйте клавиши со стрелками для поворота влево или вправо.',
  16111. HELP_DESKTOP_FLOORPLAN_3B: 'Или используйте стрелки для увеличения и уменьшения.',
  16112. HELP_MOBILE_PANORAMA_1: 'Нажмите и перетащите, чтобы осмотреть модель.',
  16113. HELP_MOBILE_PANORAMA_2: 'Для передвижения по модели нажимайте на круги.',
  16114. HELP_MOBILE_3:
  16115. 'Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.',
  16116. HELP_MOBILE_360_2: 'Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.',
  16117. HELP_MOBILE_DOLLHOUSE_1:
  16118. 'Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.',
  16119. HELP_MOBILE_DOLLHOUSE_2: 'Нажмите и перетащите, чтобы расположить Dollhouse.',
  16120. HELP_MOBILE_FLOORPLAN_1: 'Нажмите и перетащите, чтобы расположить план здания.',
  16121. HELP_MOBILE_FLOORPLAN_2:
  16122. 'Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.',
  16123. HELP_MORE_HLR_A: 'Фотоколлаж',
  16124. HELP_DESKTOP_MORE_HLR_B:
  16125. 'Откройте для перемещения по модели, используя иконки изображений.',
  16126. HELP_MORE_DOLLHOUSE_A: 'Dollhouse',
  16127. HELP_DESKTOP_MORE_DOLLHOUSE_B:
  16128. 'Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.',
  16129. HELP_MOBILE_MORE_DOLLHOUSE_B:
  16130. 'Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.',
  16131. HELP_MORE_FLOORS_A: 'Выбор Этажа',
  16132. HELP_DESKTOP_MORE_FLOORS_B: 'Переключение между этажами.',
  16133. HELP_MORE_TAG_A: 'tag™ Posts',
  16134. HELP_DESKTOP_MORE_TAG_B:
  16135. 'Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.',
  16136. HELP_MOBILE_MORE_TAG_B: 'Нажмите для получения информации о функциях.',
  16137. HELP_MORE_ZOOM_A: 'Масштаб',
  16138. HELP_DESKTOP_MORE_ZOOM_B:
  16139. 'Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.',
  16140. HELP_MORE_TOUR_A: 'Управление Туром',
  16141. HELP_DESKTOP_MORE_TOUR_B:
  16142. 'Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.',
  16143. HELP_MORE_INSIDE_A: 'Вид Изнутри',
  16144. HELP_DESKTOP_MORE_INSIDE_B: 'Нажмите, чтобы просмотреть модель изнутри.',
  16145. HELP_MOBILE_MORE_INSIDE_B: 'Нажмите, чтобы просмотреть модель изнутри.',
  16146. HELP_MORE_VR_A: 'Режим VR',
  16147. HELP_DESKTOP_MORE_VR_B: 'Нажмите, чтобы запустить модель в виртуальной реальности.',
  16148. HELP_MOBILE_MORE_VR_B: 'Нажмите, чтобы запустить модель в виртуальной реальности.',
  16149. HELP_MORE_360_A: '360° Views',
  16150. HELP_DESKTOP_MORE_360_B:
  16151. 'Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.',
  16152. HELP_MOBILE_MORE_360_B:
  16153. 'Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.',
  16154. HELP_MORE_FULLSCREEN_A: 'Полный экран',
  16155. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Развернуть 3D Showcase во весь экран.',
  16156. WEBVR_FOR_CARDBOARD: 'Для Google Cardboard',
  16157. WEBVR_FOR_DAYDREAM: 'Для просмотра в Daydream',
  16158. WEBVR_ENTER_WEBVR: 'ВОЙТИ В VR ',
  16159. WEBVR_DIFFERENT_HEADSET: 'Есть другой VR-шлем?',
  16160. WEBVR_LEARN_MORE: 'Узнать больше',
  16161. WEBVR_VIEW_SPACE: 'Запустить модель в VR',
  16162. WEBVR_DAYDREAM_VIEW: 'Посмотреть в Daydream',
  16163. WEBVR_DAYDREAM_PHONE: 'Daydream-готовый телефон',
  16164. WEBVR_VIEW_CARDBOARD: 'Или просмотреть в Google Cardboard',
  16165. VR_WHAT_YOU_NEED: 'Что Вам потребуется...',
  16166. VR_NEED_DAYDREAM_PHONE: 'Daydream-готовый телефон',
  16167. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  16168. VR_APP: 'port VR App',
  16169. VR_APP_OPEN: 'Или открыть через приложение port VR',
  16170. VR_COMPATIBLE_ANDROID_LONG:
  16171. 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  16172. VR_SAMSUNG_DETAIL: 'Galaxy S6 и выше',
  16173. VR_APP_FOR_ANDROID: 'Приложение port VR для Android',
  16174. VR_NEED_DAYDREAM: 'Необходимо для соединением с Daydream',
  16175. VR_VIEW_SPACE: 'Запустить модель в VR',
  16176. VR_LEARN_MORE_CAPS: 'УЗНАТЬ БОЛЬШЕ',
  16177. VR_PREVIOUS_CAPS: 'ПРЕДЫДУЩИЙ',
  16178. VR_NEXT_CAPS: 'СЛЕДУЮЩИЙ',
  16179. VR_GOT_IT_CAPS: 'ЯСНО',
  16180. VR_SHOW_SUPPORTED: 'Нажмите, чтобы просмотреть модель в VR с помощью',
  16181. VR_SHOW_UNSUPPORTED:
  16182. 'Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.',
  16183. VR_SHOW_IOS_1: 'Нажмите, чтобы просмотреть модель в VR',
  16184. VR_SHOW_IOS_2: 'Для просмотра требуется приложение port VR и совместимый iPhone',
  16185. VR_NEED_CARDBOARD: 'Что Вам потребуется для Google Cardboard',
  16186. VR_NEED_SAMSUNG: 'Что Вам потребуется для Samsung Gear VR',
  16187. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  16188. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  16189. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  16190. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s или новее с iOS 9.1 и выше',
  16191. VR_COMPATIBLE_IPHONES_3: 'Совместимые модели iPhone',
  16192. VR_COMPATIBLE_ANDROID: 'Совместимые Android устройства',
  16193. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  16194. VR_ANDROID_DVICES: 'Android устройства',
  16195. VR_COMPATIBLE_SAMSUNG: 'Совместимые Samsung устройства',
  16196. VR_APP_FOR_CARDBOARD: 'Приложение port VR для Google Cardboard',
  16197. VR_APP_FOR_SAMSUNG: 'Приложение port VR для Gear VR',
  16198. VR_DOWNLOAD_HERE: 'Скачать здесь',
  16199. VR_REQUIRE_HEADSET: 'Требуется VR-шлем и установленное приложение port VR для Android',
  16200. VR_REDIRECT_TO_STORE:
  16201. 'Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.',
  16202. VR_IMPROPER_EMBED:
  16203. 'port модель не встроена должным образом для поддержки VR в вашем веб-браузере.',
  16204. VR_OPEN_ANDROID_LINK: 'Откройте ссылку на Вашем мобильном телефоне',
  16205. VR_ANDROID_OPTIONS: 'Доступные опции VR-шлемов',
  16206. SHARE_TO: 'Поделиться',
  16207. SHARE_LINK: 'Прямая ссылка',
  16208. SHARE_EXPLORE: 'просмотреть',
  16209. SHARE_AT: 'на',
  16210. SHARE_WITH: 'с',
  16211. SHARE_3D: 'в 3D',
  16212. SHARE_COPIED: 'Скопировано!',
  16213. ERROR_BROWSER_SOLUTION: 'установите новый браузер, чтобы просмотреть 3D пространство.',
  16214. ERROR_BROWSER_EXPLANATION: 'WebGL требует современный браузер.',
  16215. ERROR_GENERIC_PROBLEM: 'Ой, что-то пошло не так.',
  16216. ERROR_GENERIC_SOLUTION: 'Перезапустите браузер.',
  16217. ERROR_GENERIC_ACTIONS_1: 'Если проблема не устранена, ',
  16218. ERROR_GENERIC_ACTIONS_2: 'установите поддерживаемый браузер',
  16219. ERROR_GENERIC_ACTIONS_3: ' или ',
  16220. ERROR_GENERIC_ACTIONS_4: 'смотрите наше руководство по устранению неполадок',
  16221. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Браузер не поддерживается.',
  16222. ERROR_WEBGL_IOS_PROBLEM: 'iOS-версия не поддерживается.',
  16223. ERROR_WEBGL_IOS_SOLUTION:
  16224. 'Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.',
  16225. ERROR_WEBGL_IOS_ACTIONS_1: 'Нажмите ',
  16226. ERROR_WEBGL_IOS_ACTIONS_2: 'Настройки > Общие > Обновление ПО',
  16227. ERROR_WEBGL_SAFARI_PROBLEM: 'Включите WebGL для 3D-просмотра.',
  16228. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Нажмите ',
  16229. ERROR_WEBGL_SAFARI_ACTIONS_2:
  16230. 'Настойки > Дополнения > Показывать меню “Разработка” в строке меню',
  16231. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Затем нажмите ',
  16232. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Разработка > Разрешить WebGL',
  16233. ERROR_MISSING_URLS_PROBLEM: 'Ой, для этой модели нет панорамы.',
  16234. ERROR_MISSING_URLS_EXPLANATION:
  16235. 'Эта модель устарела. У владельца веб-сайта может быть новая модель.',
  16236. ERROR_LOADING_FAILED_PROBLEM: 'Ой, модель недоступна.',
  16237. ERROR_LOADING_FAILED_ACTIONS_1: 'Если проблема не устранена, ',
  16238. ERROR_LOADING_FAILED_ACTIONS_2: 'посмотрите наше руководство по устранению неполадок',
  16239. ERROR_MAINTENANCE_PROBLEM: 'Выполняется техническое обслуживание.',
  16240. ERROR_MAINTENANCE_SOLUTION: 'Пожалуйста, попробуйте снова через несколько минут.',
  16241. LINK_TO_LOCATION: 'Ссылка на местоположение',
  16242. MENU_COPY: 'Копировать',
  16243. LINK_ALERT_COPY: 'Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.',
  16244. ROTATE: 'Вращать',
  16245. MOVE: 'Передвигаться',
  16246. INSIDE: 'Вид изнутри',
  16247. ZOOM: 'Масштаб'
  16248. }
  16249. },
  16250. {}
  16251. ],
  16252. 116: [
  16253. function (e, t, i) {
  16254. //main.js
  16255. ;(function (t) {
  16256. 'use strict'
  16257. var modelProgressBase = 0.4
  16258. var progressUpdate = function (e) {
  16259. // 0 <= e <= 1
  16260. console.log('e1:' + e)
  16261. e = Math.round(modelProgressBase * e * 100)
  16262. console.log('e2:' + e)
  16263. var t = $('.progressbar')
  16264. t.find('.bar').css('width', e + '%')
  16265. t.find('.label').css('left', (t.width() * e) / 100 - 15 + 'px') //上面跟着的字的百分比
  16266. t.find('.perc').text(e + '%') //具体数字的百分比
  16267. }
  16268. $('#gui-loading').fadeIn(200)
  16269. progressUpdate(0.1)
  16270. var fileName = g_version ? 'modeldata.js' : 'someData.json'
  16271. $.ajax(
  16272. g_Prefix + 'data/' + window.number + '/' + fileName + '?' + randomTime().getTime(),
  16273. { dataType: 'json' }
  16274. )
  16275. .done(function (e) {
  16276. //改
  16277. var data = matcher(e)
  16278. data.files.templates[0] =
  16279. g_Prefix + e.files.templates[0].replace('{{number}}', window.number)
  16280. data.user = {
  16281. is_authenticated: false,
  16282. flags: [
  16283. 'payment_show_past_due',
  16284. 'sc_imgopt_100',
  16285. 'mattertags',
  16286. 'labels',
  16287. 'fastly_v2_urls',
  16288. 'vr',
  16289. 'uhql',
  16290. 'sc_segment_100',
  16291. 'show_segment_metrics',
  16292. 'content_distribution',
  16293. 'workshop_webgl',
  16294. 'show360views',
  16295. 'showcase_vr',
  16296. 'ws_zooming',
  16297. 'model_settings',
  16298. 'ws_360snapshots',
  16299. 'img_multi_dl',
  16300. 'vrworkshop',
  16301. 'tag_links',
  16302. 'ws_img_multi_dl',
  16303. 'mattertag_links',
  16304. 'billing_tab_hidden',
  16305. 'static_cloud_ui',
  16306. 'metrics',
  16307. 'mattertag_media',
  16308. 'img_size_download',
  16309. 'show_360snapshots',
  16310. 'floorplan',
  16311. 'sc_tilegen_0',
  16312. 'showcase_webvr',
  16313. 'sc_mixpanel_0',
  16314. 'show_clickbait',
  16315. 'zooming',
  16316. 'showcase_tiling',
  16317. 'list_signed_urls_default_3',
  16318. 'fastly_image_opto'
  16319. ]
  16320. }
  16321. try {
  16322. //处理一下导览数据
  16323. data.model.images = data.model.images.filter(e => {
  16324. if (!e.locations && !e.thumbnail_signed_src) return //旧的曾有导览数据是错误的,将它删除
  16325. if (e.locations && e.locations.length == 0) return
  16326. return e
  16327. })
  16328. } catch (e) {
  16329. console.log(e)
  16330. }
  16331. window.DATA = data
  16332. data.model.summary = data.summary
  16333. data.model.name = data.name
  16334. for (let i in data) {
  16335. data[i] == 'false' && (data[i] = false)
  16336. }
  16337. progressUpdate(0.7)
  16338. StartLoad() //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  16339. if (data.weixinDesc) {
  16340. g_weixinObj.desc = data.weixinDesc
  16341. }
  16342. if (data.shareImgUrl) {
  16343. g_weixinObj.imgUrl = data.shareImgUrl
  16344. }
  16345. window.wx && manage.weixinShare()
  16346. //初始画面
  16347. data.camera_start &&
  16348. data.camera_start.thumbImg &&
  16349. E(manage.dealURL(data.camera_start.thumbImg))
  16350. function E(e) {
  16351. $('<img/>')
  16352. .attr('src', e)
  16353. .on('load', function () {
  16354. $('#gui-thumb')
  16355. .css('backgroundImage', 'url(' + e + ')')
  16356. .fadeIn(500),
  16357. $(this).remove()
  16358. })
  16359. }
  16360. //背景
  16361. ;(settings.transparentBg = settings.transparentBg || data.transparentBg || false),
  16362. (settings.bgImg = settings.bgImg || data.bgImg || null)
  16363. if (settings.bgImg) {
  16364. $('#player').css({
  16365. 'background-image': 'url(' + settings.bgImg + ')',
  16366. 'background-position': 'center center'
  16367. })
  16368. }
  16369. {
  16370. //初始化导览时间
  16371. if (DATA.tourBlackSpeed == void 0) DATA.tourBlackSpeed = 100
  16372. window._settings.warp.teleportTime =
  16373. (settings.teleportTime / DATA.tourBlackSpeed) * 100
  16374. if (DATA.tourWalkSpeed == void 0) DATA.tourWalkSpeed = 100
  16375. if (DATA.tourRotTime == '' || DATA.tourRotTime == void 0) {
  16376. DATA.tourRotTime = settings.tourRotTime //默认停留2秒
  16377. }
  16378. }
  16379. {
  16380. //其他
  16381. _settings.floorPlanAngle = DATA.floorPlanAngle || 0
  16382. }
  16383. })
  16384. .fail(e => {
  16385. alert('缺少someData文件,请检查场景码是否正确。')
  16386. })
  16387. function StartLoad() {
  16388. //当加载完data后
  16389. function i() {
  16390. var e = window.number //Y.getModelIDFromQueryString();
  16391. if (!e) return b(null, 'loading-failed')
  16392. var t = Y.parseSidUrl(e),
  16393. i = l(),
  16394. a = c(),
  16395. s = o(),
  16396. u = V.quickstart.enabled,
  16397. g = null,
  16398. m = null,
  16399. v = null,
  16400. w = null,
  16401. T = null,
  16402. x = null,
  16403. S = null,
  16404. M = null,
  16405. R = null,
  16406. P = null,
  16407. O = null,
  16408. L = null,
  16409. N = new ue()
  16410. r(s)
  16411. h({
  16412. //MP开头写法
  16413. urlBase: t.urlBase
  16414. })
  16415. .then(function () {
  16416. return re.init(), d(t, e) //getModel and load
  16417. })
  16418. .then(function (e) {
  16419. progressUpdate(0.9)
  16420. return (
  16421. (P = e),
  16422. p(
  16423. P,
  16424. V.appConfig.segment_key,
  16425. V.appConfig.keen_write_key,
  16426. V.appConfig.keen_project_id,
  16427. {
  16428. startSource: i,
  16429. autoplay: V.autoplay,
  16430. quickstart: u
  16431. }
  16432. ),
  16433. P.urls.init()
  16434. )
  16435. })
  16436. .then(function () {
  16437. return P.loadPanos()
  16438. })
  16439. .then(function () {
  16440. ;(m = X.getStartCameraOptions(P, P.panos)),
  16441. (S = A(P)),
  16442. (O = y(u, m.mode)),
  16443. (v = O.controls),
  16444. (w = O.player),
  16445. (T = O.director),
  16446. (x = O.tagManager),
  16447. (M = O.tileDownloader),
  16448. (R = O.qualityManager),
  16449. (L = O.panoRenderer),
  16450. C(P, S, O, s),
  16451. (w.director = T), //xzw add
  16452. P.supportsTiles && M.start(),
  16453. !u ||
  16454. (m.mode === D.PANORAMA && m.pano) ||
  16455. (de.warn(
  16456. 'Tried to quickstart, but failed as we are not starting in inside mode.'
  16457. ),
  16458. (u = !1))
  16459. var e = null
  16460. if (u) {
  16461. de.warn('Quickstart engaged. Hold on to your knickers.')
  16462. var t = v.controls[D.PANORAMA]
  16463. ;(g = new ie(R, S.scene, S.camera, t, s)),
  16464. _(S, s, P),
  16465. (e = g.load(m).then(function () {
  16466. S.addComponent(g),
  16467. S.once(le.AfterRender, function () {
  16468. de.warn('First render after quickstart load finished.')
  16469. })
  16470. }))
  16471. }
  16472. window.flyToFirst = function () {
  16473. //xzw add
  16474. var pano = w.model.panos.get('8d778e19657f433fb9cf8947d823bb70')
  16475. var q = new _x.Quaternion(
  16476. 0.7099827027821568,
  16477. -0.07708150183830938,
  16478. 0.6958985789714591,
  16479. 0.07555241737970636
  16480. )
  16481. var lookAtPoint = new _x.Vector3(0, 0, -1).applyQuaternion(q).add(pano.position)
  16482. w.flyToPano({ pano: pano, lookAtPoint: lookAtPoint })
  16483. }
  16484. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  16485. })
  16486. .then(function () {
  16487. return f(P, U.onProgress, i, !u, a)
  16488. })
  16489. .then(function () {
  16490. if (
  16491. ((m.quickstart = u),
  16492. I(P, S, O, s),
  16493. S.started || _(S, s, P),
  16494. H.modelLoaded(P, w, v, V.autoplay),
  16495. E(w, P, m, V.autoplay).done(function () {
  16496. T.autoTour()
  16497. }),
  16498. !P.supportsTiles)
  16499. ) {
  16500. var e = new Z(P, w)
  16501. e.start()
  16502. }
  16503. u && (S.removeComponent(g), g.destroy(), m.pano.enter()),
  16504. U.init(P, T, w, v, S, m, H.getSessionId()),
  16505. U.endLoading(P, T, x),
  16506. S.once(le.AfterRender, function () {
  16507. N.setAppReadyTime()
  16508. var e = N.calcFullLoadingTime()
  16509. de.warn('Total load time: ' + e / 1e3),
  16510. H.loadComplete(e),
  16511. de.warn('First render after model load finished.')
  16512. try {
  16513. window.evt && window.dispatchEvent(window.evt)
  16514. parent.postMessage(
  16515. {
  16516. cmd: 'loaded'
  16517. },
  16518. '*'
  16519. )
  16520. } catch (err) {}
  16521. }),
  16522. S.on(le.MemoryUsageUpdated, n)
  16523. })
  16524. .fail(b.bind(this, e))
  16525. }
  16526. function n(e) {
  16527. ce.update(e)
  16528. }
  16529. function r(e) {
  16530. de.info('Version', '2.25.6-0-gd87e5b1'), (q.defaultMaxListeners = 1e3), a(e), s()
  16531. }
  16532. function o() {
  16533. return document.getElementById('player')
  16534. }
  16535. function a(e) {
  16536. e.addEventListener('dragenter', T, !1), e.addEventListener('dragover', T, !1)
  16537. }
  16538. function s() {
  16539. F.valueFromHash('title', !0) ||
  16540. $(document).ready(function () {
  16541. var e = $('.model-title')
  16542. e.hide()
  16543. })
  16544. }
  16545. function l() {
  16546. return F.valueFromHash('play', !1) ? 'autoplay' : F.inIframe() ? 'click' : 'fullpage'
  16547. }
  16548. function c() {
  16549. return {
  16550. panoElementsToLoad: 6,
  16551. modelElementsToLoad: 0,
  16552. totalElementsLoaded: 0,
  16553. totalElementsToLoad: 0,
  16554. totalPercentageLoaded: 0,
  16555. progressCallback: null
  16556. }
  16557. }
  16558. function h(e) {
  16559. return K.loadFeatureFlags(e).done(function (e) {
  16560. K.updateDependentSettings(e, V)
  16561. })
  16562. }
  16563. // function u(e) {
  16564. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  16565. // responseType: "json",
  16566. // prefetchFrom: "config"
  16567. // }).then(function(e) {
  16568. // return e ? void j.extendObject(V.appConfig, e) : {}
  16569. // }, function(e) {
  16570. // return de.warn("Failed loading runtime config, using defaults."),
  16571. // $.when({})
  16572. // })
  16573. // }
  16574. function d(e, t) {
  16575. var i = B.getModel({
  16576. url: t,
  16577. floors: F.valueFromHash('f', !0),
  16578. autoload: !1
  16579. })
  16580. return $.when(i, n).then(null, function (e) {
  16581. return this
  16582. })
  16583. }
  16584. function p(e, t, i, n, r) {
  16585. de.info('Model data loaded'),
  16586. de.debug('UUID: ' + e.data.job.uuid),
  16587. J.init(K.getFlags()),
  16588. i &&
  16589. H.initKeen({
  16590. token: i,
  16591. appId: n
  16592. }),
  16593. H.initSegment({
  16594. model: e.sid,
  16595. version: '2.25.6-0-gd87e5b1',
  16596. startSource: r.startSource,
  16597. token: t,
  16598. autoplay: r.autoplay,
  16599. quickstart: r.quickstart
  16600. })
  16601. }
  16602. function f(e, t, i, n, r) {
  16603. return (r.progressCallback = t), H.sessionStart(), e.load(n).progress(g.bind(this, r))
  16604. }
  16605. function g(e, t) {
  16606. ;(e.modelElementsToLoad = t[1]), v(e), m(e)
  16607. }
  16608. function m(e) {
  16609. e.totalElementsLoaded++,
  16610. (e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad),
  16611. //----许钟文-----------------模型进度条向后调整
  16612. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0)
  16613. e.totalPercentageLoaded =
  16614. modelProgressBase + (1 - modelProgressBase) * e.totalPercentageLoaded
  16615. //console.log('pro:'+e.totalPercentageLoaded)
  16616. //---------------------------
  16617. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  16618. }
  16619. function v(e) {
  16620. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  16621. }
  16622. function A(e) {
  16623. var t = new x.PerspectiveCamera()
  16624. t.layers.enable(he.PANOMARKERS), t.layers.enable(he.RETICULE), t.layers.enable(he.TAG)
  16625. var i = new x.Scene(),
  16626. n = new x.AmbientLight(16777215)
  16627. i.add(n),
  16628. (i.plane = new x.Mesh(
  16629. new x.PlaneBufferGeometry(1e5, 1e5),
  16630. new x.RawShaderMaterial({
  16631. side: x.DoubleSide
  16632. })
  16633. )),
  16634. (i.plane.position.y = 0),
  16635. i.plane.rotateX(-Math.PI / 2),
  16636. (i.plane.material.visible = !1),
  16637. i.add(i.plane),
  16638. i.updateMatrixWorld(),
  16639. V.showScreenshotLocations &&
  16640. e.data.images.forEach(function (e) {
  16641. if (e.metadata && e.metadata.camera_position) {
  16642. var t = e.metadata.camera_position,
  16643. n = new x.Mesh(new x.BoxGeometry(0.3, 0.3, 0.3))
  16644. ;(n.position = t.clone()), i.add(n)
  16645. var r = e.metadata.camera_quaternion,
  16646. o = new x.Vector3(0, 0, -1).applyQuaternion(r)
  16647. i.add(new x.ArrowHelper(o, t.clone(), 1, 16711680))
  16648. }
  16649. }),
  16650. V.showAxis &&
  16651. (i.add(new x.ArrowHelper(new x.Vector3(0, 1, 0), new x.Vector3(0, 0, 0), 1, 255)),
  16652. i.add(
  16653. new x.ArrowHelper(new x.Vector3(0, 0, 1), new x.Vector3(0, 0, 0), 1, 16711680)
  16654. ),
  16655. i.add(
  16656. new x.ArrowHelper(new x.Vector3(1, 0, 0), new x.Vector3(0, 0, 0), 1, 65280)
  16657. ))
  16658. //背景
  16659. if (!settings.transparentBg && !settings.bgImg) {
  16660. i.skybox = new W()
  16661. i.add(i.skybox)
  16662. }
  16663. var r = new te(i, t, z)
  16664. return r
  16665. }
  16666. function y(e, t) {
  16667. var i = e ? 1 : 1e3,
  16668. n = J.tilegen || J.imgopt ? 6 : 2
  16669. n = F.valueFromHash('tileconc', n)
  16670. var r = new ne(),
  16671. o = new ae({
  16672. concurrentDownloads: n
  16673. }),
  16674. a = new se(),
  16675. s = new P(),
  16676. l = new M(),
  16677. c = new S(t),
  16678. h = new R(),
  16679. u = new O(i),
  16680. d = new L(),
  16681. p = new oe()
  16682. return {
  16683. qualityManager: r,
  16684. panoRenderer: a,
  16685. tileDownloader: o,
  16686. player: c,
  16687. director: l,
  16688. modelManager: s,
  16689. tagManager: p,
  16690. displayController: u,
  16691. labelDisplayController: d,
  16692. controls: h
  16693. }
  16694. }
  16695. function C(e, t, i, n) {
  16696. var r = i.controls,
  16697. o = i.qualityManager,
  16698. a = i.panoRenderer,
  16699. s = i.tileDownloader,
  16700. l = i.modelManager
  16701. r.init(n, l),
  16702. ee.init(i.director, r, i.player, l, t),
  16703. o.init(l),
  16704. s.init(o),
  16705. a.init(t, s, o),
  16706. l.init(s, a, o),
  16707. l.addModel(e),
  16708. t.addComponent(G)
  16709. }
  16710. function I(e, t, i, n) {
  16711. var r = i.qualityManager,
  16712. o = i.panoRenderer,
  16713. a = i.tileDownloader,
  16714. s = i.modelManager,
  16715. l = i.player,
  16716. c = i.director,
  16717. h = i.tagManager,
  16718. u = i.displayController,
  16719. d = i.labelDisplayController,
  16720. p = i.controls
  16721. t.scene.add(e), (t.qualityManager = r)
  16722. var f = {
  16723. camera: t.camera,
  16724. director: c,
  16725. modelManager: s,
  16726. tileDownloader: a,
  16727. panoRenderer: o,
  16728. qualityManager: r,
  16729. tagManager: h,
  16730. container: n,
  16731. controls: p
  16732. }
  16733. l.init(f),
  16734. l.setScene(t.scene),
  16735. h.init(s, l),
  16736. c.init(l, s),
  16737. u.init(c, l, s, h, n),
  16738. d.init(l, s, n),
  16739. z.bindEvents(l),
  16740. t.addComponent(h),
  16741. t.addComponent(l),
  16742. t.addComponent(o),
  16743. (l.sceneRenderer = t) //xzw add 方便resize
  16744. }
  16745. function E(e, t, i, n) {
  16746. return (
  16747. de.info('Starting player in ' + i.mode),
  16748. H.report(t.sid, 'started-playing', n, i.quickstart),
  16749. e.start(i)
  16750. )
  16751. }
  16752. function b(e, t) {
  16753. de.error(t), k.error(t), H.report(e, 'error-' + t)
  16754. }
  16755. function w(e) {
  16756. var t = F.details()
  16757. t && 'Safari' === t.name && t.version > 500 && t.version < 600
  16758. ? (k.error('webgl-safari'), H.report(e, 'error-webgl-safari'))
  16759. : (k.error('webgl-generic'), H.report(e, 'error-webgl-generic'))
  16760. }
  16761. function _(e, t, i) {
  16762. try {
  16763. e.start(t)
  16764. } catch (e) {
  16765. throw (de.warn(e.message), w(i.sid), e)
  16766. }
  16767. }
  16768. function T(e) {
  16769. e.stopPropagation(), e.preventDefault()
  16770. }
  16771. //czj 判断someData 有没有hoticon字段 修改热点的样式
  16772. if (window.DATA.hoticon) {
  16773. g_HotImage = {
  16774. point:
  16775. window.DATA.hoticon.default || 'https://super.4dage.com/images/4dagePoint2.png',
  16776. point2: window.DATA.hoticon.higt || 'https://super.4dage.com/images/4dagePoint.png'
  16777. }
  16778. }
  16779. //czj 判断someData 有没有backgroundMusic 添加音乐
  16780. if (window.DATA.backgroundMusic) {
  16781. if (window.isLocal) {
  16782. SoundManager.setSrc('bgm', manage.dealURL(window.DATA.backgroundMusic))
  16783. } else {
  16784. SoundManager.setSrc('bgm', window.DATA.backgroundMusic)
  16785. }
  16786. $('#volume').show()
  16787. } else if (g_version === 'one') {
  16788. SoundManager.setSrc(
  16789. 'bgm',
  16790. manage.dealURL(g_Prefix + '/audio/' + 'audio' + window.number + '/background.mp3')
  16791. )
  16792. $('#volume').show()
  16793. }
  16794. //隐藏公司logo
  16795. if (window.DATA.loadlogo) {
  16796. showLogo()
  16797. }
  16798. e('./lib/three75-shim'),
  16799. e('./lib/array-polyfill'),
  16800. e('./lib/performance-polyfill'),
  16801. e('./lib/shaders/CopyShader.js'),
  16802. e('./lib/shaders/HorizontalBlurShader.js'),
  16803. e('./lib/shaders/VerticalBlurShader.js'),
  16804. e('./lib/postprocessing/EffectComposer.js'),
  16805. e('./lib/postprocessing/RenderPass.js'),
  16806. e('./lib/postprocessing/MaskPass.js'),
  16807. e('./lib/postprocessing/ShaderPass.js'),
  16808. window.Promise || (window.Promise = e('promise-polyfill'))
  16809. var x = e('three'),
  16810. _x = e('three'),
  16811. S = (e('./util/sentry'), e('./player')),
  16812. M = e('./director'),
  16813. R = e('./controls/CameraControls'),
  16814. P = e('./model/ModelManager'),
  16815. O = e('./DisplayController'),
  16816. L = e('./label/LabelDisplayController'),
  16817. D = e('./enum/Viewmode'),
  16818. N = e('./util/logger'),
  16819. B = e('./showcase'),
  16820. F = e('./util/browser'),
  16821. V = e('./settings'),
  16822. U = e('./gui/gui'),
  16823. k = e('./gui/error'),
  16824. H = e('./analytics'),
  16825. G = e('./util/transitions'),
  16826. z = e('./effects'),
  16827. W = e('./objects/Skybox'),
  16828. j = e('./util/common'),
  16829. Y = (e('./util/PanoramaCollection'), e('./util/math'), e('./util/showcase')),
  16830. X = e('./util/camera'),
  16831. Z = (e('./objects/Panorama'), e('./cameras/PanoramaCamera'), e('./preloaders')),
  16832. q = e('events').EventEmitter,
  16833. K = e('./featureflags'),
  16834. Q = (e('./util/lerp'), e('./util/ajax')),
  16835. J = e('./ab'),
  16836. ee = e('./sdk/automation.js'),
  16837. te = e('./scene/SceneRenderer'),
  16838. ie = e('./scene/QuickstartManager'),
  16839. ne = e('./tile/QualityManager.js'),
  16840. re = e('./localization/localize'),
  16841. oe = e('./tag/tagManager'),
  16842. ae = e('./tile/TileDownloader'),
  16843. se = e('./tile/PanoRenderer'),
  16844. le =
  16845. (e('./enum/PanoSizeClass'),
  16846. e('./enum/PanoramaEvents'),
  16847. e('./enum/SceneRendererEvents')),
  16848. ce = e('./gui/memoryUsage'),
  16849. he = e('./enum/RenderLayers'),
  16850. ue = e('./TimingData'),
  16851. de = new N(t)
  16852. ;(N.level = V.logLevel), (N.consoleEnabled = V.console), i()
  16853. }
  16854. }).call(this, '/js/main.js')
  16855. },
  16856. {
  16857. './DisplayController': 1,
  16858. './TimingData': 2,
  16859. './ab': 3,
  16860. './analytics': 4,
  16861. './cameras/PanoramaCamera': 7,
  16862. './controls/CameraControls': 9,
  16863. './director': 15,
  16864. './effects': 16,
  16865. './enum/PanoSizeClass': 36,
  16866. './enum/PanoramaEvents': 37,
  16867. './enum/RenderLayers': 41,
  16868. './enum/SceneRendererEvents': 43,
  16869. './enum/Viewmode': 51,
  16870. './featureflags': 59,
  16871. './gui/error': 64,
  16872. './gui/gui': 65,
  16873. './gui/memoryUsage': 73,
  16874. './label/LabelDisplayController': 91,
  16875. './lib/array-polyfill': 92,
  16876. './lib/performance-polyfill': 95,
  16877. './lib/postprocessing/EffectComposer.js': 96,
  16878. './lib/postprocessing/MaskPass.js': 97,
  16879. './lib/postprocessing/RenderPass.js': 98,
  16880. './lib/postprocessing/ShaderPass.js': 99,
  16881. './lib/shaders/CopyShader.js': 100,
  16882. './lib/shaders/HorizontalBlurShader.js': 101,
  16883. './lib/shaders/VerticalBlurShader.js': 102,
  16884. './lib/three75-shim': 103,
  16885. './localization/localize': 108,
  16886. './tag/tagManager': 124,
  16887. './model/ModelManager': 140,
  16888. './objects/Panorama': 148,
  16889. './objects/Skybox': 152,
  16890. './player': 155,
  16891. './preloaders': 156,
  16892. './scene/QuickstartManager': 157,
  16893. './scene/SceneRenderer': 158,
  16894. './sdk/automation.js': 164,
  16895. './settings': 166,
  16896. './showcase': 168,
  16897. './tile/PanoRenderer': 169,
  16898. './tile/QualityManager.js': 170,
  16899. './tile/TileDownloader': 171,
  16900. './util/PanoramaCollection': 178,
  16901. './util/ajax': 181,
  16902. './util/browser': 182,
  16903. './util/camera': 183,
  16904. './util/common': 185,
  16905. './util/lerp': 188,
  16906. './util/logger': 189,
  16907. './util/math': 190,
  16908. './util/sentry': 192,
  16909. './util/showcase': 193,
  16910. './util/transitions': 195,
  16911. events: 202,
  16912. 'promise-polyfill': 213,
  16913. three: 217
  16914. }
  16915. ],
  16916. 117: [
  16917. function (e, t, i) {
  16918. 'use strict'
  16919. function n(e) {
  16920. e = e || {}
  16921. r.RawShaderMaterial.call(
  16922. this,
  16923. a.extendObject(
  16924. {
  16925. fragmentShader: o.cube.fragmentShader,
  16926. vertexShader: o.cube.vertexShader,
  16927. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  16928. name: 'CubemapMaterial'
  16929. },
  16930. e
  16931. )
  16932. )
  16933. }
  16934. var r = e('three'),
  16935. o = e('../shaders'),
  16936. a = e('../util/common')
  16937. ;(n.prototype = Object.create(r.RawShaderMaterial.prototype)),
  16938. (n.prototype.constructor = n),
  16939. (t.exports = n)
  16940. },
  16941. {
  16942. '../shaders': 167,
  16943. '../util/common': 185,
  16944. three: 217
  16945. }
  16946. ],
  16947. 118: [
  16948. function (e, t, i) {
  16949. 'use strict'
  16950. function n(e) {
  16951. e = e || {}
  16952. r.RawShaderMaterial.call(
  16953. this,
  16954. a.extendObject(
  16955. {
  16956. fragmentShader: o.model.fragmentShader,
  16957. vertexShader: o.model.vertexShader,
  16958. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  16959. name: 'ModelTextureMaterial'
  16960. },
  16961. e
  16962. )
  16963. )
  16964. }
  16965. var r = e('three'),
  16966. o = e('../shaders'),
  16967. a = e('../util/common')
  16968. ;(n.prototype = Object.create(r.RawShaderMaterial.prototype)),
  16969. (n.prototype.constructor = n),
  16970. (n.prototype.setProjectedPanos = function (e, t, i) {
  16971. i && (this.uniforms.progress.value = 0),
  16972. e.ensureSkyboxReadyForRender(),
  16973. (this.uniforms.pano0Map.value = e.getSkyboxTexture()),
  16974. this.uniforms.pano0Position.value.copy(e.position),
  16975. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  16976. t.ensureSkyboxReadyForRender(),
  16977. (this.uniforms.pano1Map.value = t.getSkyboxTexture()),
  16978. this.uniforms.pano1Position.value.copy(t.position),
  16979. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  16980. }),
  16981. /* n.prototype.setEyeDir = function(dir, pos) {//加
  16982. this.uniforms.eyeDir.value.copy(dir)
  16983. this.uniforms.eyePos.value.copy(pos)
  16984. }
  16985. n.prototype.setBendCameraQua = function(matrix) {//加
  16986. this.uniforms.cameraDeltaMatrix.value.copy(matrix)
  16987. } */
  16988. (t.exports = n)
  16989. },
  16990. {
  16991. '../shaders': 167,
  16992. '../util/common': 185,
  16993. three: 217
  16994. }
  16995. ],
  16996. 119: [
  16997. function (e, t, i) {
  16998. ;(function (i) {
  16999. 'use strict'
  17000. function n(e, t, i, n) {
  17001. ;(this.div = null),
  17002. (this.body = null),
  17003. (this.label = e),
  17004. (this.description = t),
  17005. (this.parsedDescription = []),
  17006. (this.media = i || {
  17007. type: null
  17008. }),
  17009. (this.loadingSpinner = null),
  17010. (this.parser = new r({
  17011. supportLinks: !u.valueFromHash('mls'),
  17012. keepLinkLabels: !0
  17013. })),
  17014. (this.state = I.CLOSED),
  17015. (this.orientation = ''),
  17016. (this.initialTransform = ''),
  17017. (this.hovering = !1),
  17018. (this.openTransition = null),
  17019. (this.closeTransition = null),
  17020. (this.openPromise = null),
  17021. (this.closePromise = null),
  17022. (this.animationTransition = null),
  17023. (this.animationScale = 0)
  17024. }
  17025. var r = e('../Parser/DescriptionParser'),
  17026. o = e('../Media/Link'),
  17027. a = e('../Media/Image'),
  17028. s = e('../Media/EmbedlyPlayer'),
  17029. l = e('../Media/EmbedlyEmbed'),
  17030. c = e('../../util/transitions'),
  17031. h = e('../../util/lerp'),
  17032. u = e('../../util/browser'),
  17033. d = e('./BillboardEvent'),
  17034. p = e('../Media/MediaEvent'),
  17035. f = e('../Parser/DescriptionChunkType'),
  17036. g = e('events').EventEmitter,
  17037. m = e('./billboardSettings'),
  17038. v = e('./overlaySettings'),
  17039. A = e('../../util/logger'),
  17040. y = new A(i),
  17041. C = document.getElementById('tag-billboards')
  17042. C.addEventListener('touchend', function (e) {
  17043. C.style.pointerEvents = 'none'
  17044. }),
  17045. C.addEventListener('touchcancel', function (e) {
  17046. C.style.pointerEvents = 'none'
  17047. })
  17048. var I = {
  17049. CLOSED: 'closed',
  17050. OPENING: 'opening',
  17051. OPEN: 'open',
  17052. CLOSING: 'closing',
  17053. ACTIVE: 'active'
  17054. }
  17055. ;(n.prototype = Object.create(g.prototype)),
  17056. (n.prototype.build = function (e) {
  17057. this.parsedDescription = this.parser.parse(this.description)
  17058. var t = document.createElement('div')
  17059. ;(t.className = 'tag-container has-hotzone'),
  17060. (this.div = t),
  17061. (this.body = document.createElement('div')),
  17062. (this.body.className = 'tag-body')
  17063. var i = document.createElement('div')
  17064. i.classList.add('tag-content')
  17065. var n = document.createElement('div')
  17066. n.classList.add('tag-text-content')
  17067. var r = document.createElement('div')
  17068. ;(r.className = 'tag-label'), (r.textContent = this.label), n.appendChild(r)
  17069. var o = document.createElement('div')
  17070. ;(o.className = 'tag-desc'),
  17071. n.appendChild(o),
  17072. i.appendChild(n),
  17073. this.body.appendChild(i),
  17074. this.appendDescriptionElements(this.parsedDescription, o),
  17075. this.appendMedia(),
  17076. t.appendChild(this.body),
  17077. C.appendChild(t),
  17078. this.bindEvents(t, this.body)
  17079. }),
  17080. (n.prototype.bindEvents = function (e, t) {
  17081. var i = function (e) {
  17082. return function (t) {
  17083. if (!this.div.classList.contains('overlay')) {
  17084. var i,
  17085. n = document.getElementById('player')
  17086. try {
  17087. i = new MouseEvent(e, t)
  17088. } catch (n) {
  17089. ;(i = document.createEvent('MouseEvents')),
  17090. i.initMouseEvent(
  17091. e,
  17092. t.bubbles,
  17093. t.cancelable,
  17094. t.view,
  17095. t.detail,
  17096. t.screenX,
  17097. t.screenY,
  17098. t.clientX,
  17099. t.clientY,
  17100. t.ctrlKey,
  17101. t.altKey,
  17102. t.shiftKey,
  17103. t.metaKey,
  17104. t.button,
  17105. t.relatedTarget
  17106. )
  17107. }
  17108. n.dispatchEvent(i)
  17109. }
  17110. }
  17111. }
  17112. t.addEventListener('mousedown', function (e) {
  17113. e.stopPropagation()
  17114. }),
  17115. t.addEventListener('mouseup', function (e) {
  17116. e.stopPropagation()
  17117. }),
  17118. e.addEventListener('touchstart', function (e) {
  17119. C.style.pointerEvents = 'auto'
  17120. }),
  17121. e.addEventListener('mousedown', i('mousedown').bind(this)),
  17122. e.addEventListener('mouseup', i('mouseup').bind(this)),
  17123. t.addEventListener(
  17124. 'mouseover',
  17125. function (t) {
  17126. this.state === I.OPEN && e.classList.remove('has-hotzone')
  17127. }.bind(this)
  17128. ),
  17129. e.addEventListener(
  17130. 'mouseenter',
  17131. function (e) {
  17132. this.state !== I.CLOSING && ((this.hovering = !0), this.emit(d.ENTER))
  17133. }.bind(this)
  17134. ),
  17135. e.addEventListener(
  17136. 'mouseleave',
  17137. function (e) {
  17138. ;(this.hovering = !1), this.emit(d.LEAVE)
  17139. }.bind(this)
  17140. ),
  17141. e.addEventListener('gesturestart', function (e) {
  17142. e.preventDefault()
  17143. })
  17144. var n = e.querySelector('.tag-text-content'),
  17145. r = 0
  17146. n.addEventListener('touchstart', function (e) {
  17147. r = e.changedTouches[0].clientY
  17148. }),
  17149. n.addEventListener('touchmove', function (t) {
  17150. function i(e) {
  17151. e &&
  17152. ((0 === e.scrollTop && t.changedTouches[0].clientY > r) ||
  17153. (e.scrollTop + e.clientHeight - e.scrollHeight === 0 &&
  17154. t.changedTouches[0].clientY < r)) &&
  17155. t.preventDefault()
  17156. }
  17157. return e.classList.contains('overlay')
  17158. ? i(this.querySelector('.tag-desc'))
  17159. : void i(this)
  17160. }),
  17161. e.addEventListener('touchmove', function (e) {
  17162. 0 ===
  17163. (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) &&
  17164. e.preventDefault()
  17165. })
  17166. }),
  17167. (n.prototype.appendDescriptionElements = function (e, t) {
  17168. e.length > 0 && this.div.classList.add('has-text'),
  17169. e.forEach(
  17170. function (e, i) {
  17171. switch (e.type) {
  17172. case f.TEXT:
  17173. t.appendChild(this.createTextElement(e.text))
  17174. break
  17175. case f.LINK:
  17176. t.appendChild(this.createLinkElement(e.link))
  17177. }
  17178. }.bind(this)
  17179. )
  17180. }),
  17181. (n.prototype.appendLoadingSpinner = function () {
  17182. ;(this.loadingSpinner = document.createElement('div')),
  17183. this.loadingSpinner.classList.add('loading-spinner')
  17184. var e = document.createElement('div')
  17185. e.classList.add('gui-spinner-icon'),
  17186. this.loadingSpinner.appendChild(e),
  17187. this.body.appendChild(this.loadingSpinner)
  17188. }),
  17189. (n.prototype.onMediaLoadFinished = function () {
  17190. this.loadingSpinner &&
  17191. (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  17192. this.applyOrientation(this.orientation),
  17193. (this.loadingSpinner = null))
  17194. }),
  17195. (n.prototype.appendMedia = function () {
  17196. if (
  17197. this.media &&
  17198. this.media.type &&
  17199. 'error' !== this.media.type &&
  17200. (!u.valueFromHash('mls', 0) || this.media.type === f.IMAGE)
  17201. ) {
  17202. this.appendLoadingSpinner()
  17203. var e = document.createElement('div')
  17204. e.classList.add('tag-media-content')
  17205. var t = document.createElement('i')
  17206. switch (
  17207. (['icon', 'icon-close-thin', 'close'].forEach(function (e) {
  17208. t.classList.add(e)
  17209. }),
  17210. this.body.appendChild(t),
  17211. this.body.appendChild(e),
  17212. this.media.type)
  17213. ) {
  17214. case f.IMAGE:
  17215. e.appendChild(this.createImageElement(this.media, this.body))
  17216. break
  17217. case f.VIDEO:
  17218. e.appendChild(this.createVideoElement(this.media, this.body))
  17219. break
  17220. case f.RICH:
  17221. e.appendChild(this.createEmbedElement(this.media, this.body))
  17222. }
  17223. }
  17224. }),
  17225. (n.prototype.createTextElement = function (e) {
  17226. var t = document.createElement('span')
  17227. return (t.textContent = e), t
  17228. })
  17229. ;(n.prototype.createLinkElement = function (e) {
  17230. var t = new o(e)
  17231. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)), t.createDomElement()
  17232. }),
  17233. (n.prototype.createImageElement = function (e, t) {
  17234. function i() {
  17235. function e() {
  17236. m ||
  17237. (r.classList.remove('view-image'),
  17238. c.classList.add('overlay'),
  17239. i(),
  17240. window.addEventListener('resize', b),
  17241. c.addEventListener('click', a),
  17242. g.addEventListener('click', l),
  17243. f.addEventListener('click', s),
  17244. (m = !0),
  17245. o.emit(p.IMAGE_OPENED))
  17246. }
  17247. function i() {
  17248. t.classList.add('show-info'),
  17249. h.classList.remove('collapsible'),
  17250. (h.style.height = '')
  17251. var e = parseFloat(getComputedStyle(I).lineHeight),
  17252. i = y + e,
  17253. r = c.clientWidth - 2 * v.boundaryWidth - C,
  17254. a = c.clientHeight - 2 * v.boundaryHeight - C - i,
  17255. s = a,
  17256. l = s * n.aspect
  17257. l > r && ((l = r), (s = l / n.aspect)),
  17258. s > a && ((s = a), (l = s * n.aspect)),
  17259. (l += C),
  17260. (s += C + i),
  17261. (t.style.width = l + 'px'),
  17262. (t.style.height = s + 'px'),
  17263. (u.style.paddingTop = e + C + 'px'),
  17264. o.description.length > 0 &&
  17265. (h.classList.add('collapsible'),
  17266. (h.style.height = h.clientHeight + 12 + 'px'),
  17267. (E.style.height = 'calc(100% - ' + I.clientHeight + 'px)'))
  17268. }
  17269. function a(e) {
  17270. e.target === c && s()
  17271. }
  17272. function s() {
  17273. m &&
  17274. ((m = !1),
  17275. r.classList.add('view-image'),
  17276. c.classList.remove('overlay'),
  17277. (h.style.height = ''),
  17278. (u.style.paddingTop = ''),
  17279. (t.style.width = ''),
  17280. (t.style.height = ''),
  17281. window.removeEventListener('resize', b),
  17282. c.removeEventListener('click', a),
  17283. g.removeEventListener('click', l),
  17284. f.removeEventListener('click', s),
  17285. o.emit(p.IMAGE_CLOSED),
  17286. o.close(!0))
  17287. }
  17288. function l(e) {
  17289. t.classList.toggle('show-info')
  17290. }
  17291. var c = o.div,
  17292. h = c.getElementsByClassName('tag-content')[0],
  17293. u = c.getElementsByClassName('tag-media-content')[0],
  17294. f = t.getElementsByClassName('close')[0],
  17295. g = h.getElementsByClassName('tag-label')[0]
  17296. c.classList.add('has-image'),
  17297. r.classList.add('view-image'),
  17298. c.classList.add(n.aspect >= 1 ? 'image-landscape' : 'image-portrait'),
  17299. o.applyOrientation(o.orientation)
  17300. var m = !1,
  17301. A = getComputedStyle(h),
  17302. y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom),
  17303. C = 2 * parseFloat(getComputedStyle(u).paddingLeft),
  17304. I = h.querySelector('.tag-label'),
  17305. E = h.querySelector('.tag-desc'),
  17306. b = (function () {
  17307. var e,
  17308. t,
  17309. n = 0
  17310. return function () {
  17311. clearInterval(e),
  17312. clearTimeout(t),
  17313. (e = setInterval(function () {
  17314. var e = c.clientHeight
  17315. n !== e && (i(), (n = e))
  17316. }, 100)),
  17317. (t = setTimeout(clearInterval.bind(this, e), 1e3))
  17318. }
  17319. })()
  17320. n.on(p.IMAGE_OPENING, e),
  17321. o.on(d.ACTIVATE, e),
  17322. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  17323. o.on(d.CLOSING, s)
  17324. }
  17325. var n = new a(),
  17326. r = n.createDomElement()
  17327. this.once(d.OPENED, function () {
  17328. n.load(e.src)
  17329. .then(i)
  17330. .catch(function (t) {
  17331. y.warn('Failed to load image:', e.src), y.warn('with error:', t)
  17332. })
  17333. .then(this.onMediaLoadFinished.bind(this))
  17334. })
  17335. var o = this
  17336. return r
  17337. }),
  17338. (n.prototype.createVideoElement = function (e, t) {
  17339. var i = new s({
  17340. autoPlay: !0,
  17341. autoResume: !0,
  17342. startMuted: !1,
  17343. loop: !1
  17344. }),
  17345. n = i.createDomElement()
  17346. return (
  17347. this.once(
  17348. d.OPENED,
  17349. function () {
  17350. i.load(e.src)
  17351. .then(
  17352. function () {
  17353. this.div.classList.add('has-video'),
  17354. (this.state !== I.OPEN && this.state !== I.ACTIVE) ||
  17355. (i.show(), i.play()),
  17356. this.on(d.OPENING, i.show.bind(i)),
  17357. this.on(d.OPENED, i.play.bind(i)),
  17358. this.on(d.CLOSING, i.pause.bind(i)),
  17359. this.on(d.CLOSED, i.hide.bind(i))
  17360. }.bind(this)
  17361. )
  17362. .catch(function (t) {
  17363. y.warn('Failed to embed video:', e.src), y.warn('with error:', t)
  17364. })
  17365. .then(this.onMediaLoadFinished.bind(this))
  17366. }.bind(this)
  17367. ),
  17368. n
  17369. )
  17370. }),
  17371. (n.prototype.createEmbedElement = function (e, t) {
  17372. var i = new l(),
  17373. n = i.createDomElement()
  17374. return (
  17375. this.once(
  17376. d.OPENED,
  17377. function () {
  17378. i.load(e.src)
  17379. .then(
  17380. function () {
  17381. this.div.classList.add('has-embed'),
  17382. (this.state !== I.OPEN && this.state !== I.ACTIVE) || i.show(),
  17383. this.applyOrientation(this.orientation),
  17384. this.on(d.OPENING, i.show.bind(i)),
  17385. this.on(d.CLOSED, i.hide.bind(i))
  17386. }.bind(this)
  17387. )
  17388. .catch(function (t) {
  17389. y.warn('Failed to embed:', e.src), y.warn('with error:', t)
  17390. })
  17391. .then(this.onMediaLoadFinished.bind(this))
  17392. }.bind(this)
  17393. ),
  17394. n
  17395. )
  17396. }),
  17397. (n.prototype.open = function (e) {
  17398. return (
  17399. (this.openPromise = $.Deferred()),
  17400. this.state === I.ACTIVE
  17401. ? this.openPromise.resolve().promise()
  17402. : (this.hovering || this.div.classList.add('has-hotzone'),
  17403. this.openTransition
  17404. ? e && this.setActiveState()
  17405. : (this.openTransition = c.setTimeout(
  17406. function () {
  17407. this.state !== I.OPEN &&
  17408. (this.emit(d.OPENING),
  17409. e && this.emit(d.ACTIVATING),
  17410. (this.state = I.OPENING),
  17411. this.animateOpen(
  17412. function () {
  17413. e && this.setActiveState(), this.openPromise.resolve()
  17414. }.bind(this)
  17415. ))
  17416. }.bind(this),
  17417. m.animation.openDelay
  17418. )),
  17419. c.cancel(this.closeTransition),
  17420. this.closePromise && this.closePromise.reject(),
  17421. (this.closeTransition = void 0),
  17422. this.openPromise.promise())
  17423. )
  17424. }),
  17425. (n.prototype.close = function (e) {
  17426. return (
  17427. (this.closePromise = $.Deferred()),
  17428. !e && this.hovering
  17429. ? this.closePromise.reject().promise()
  17430. : (this.closeTransition ||
  17431. (this.closeTransition = c.setTimeout(
  17432. function () {
  17433. this.state !== I.CLOSED &&
  17434. (this.emit(d.CLOSING), (this.state = I.CLOSING), this.animateClose())
  17435. }.bind(this),
  17436. m.animation.closeDelay
  17437. )),
  17438. c.cancel(this.openTransition),
  17439. this.openPromise && this.openPromise.reject(),
  17440. (this.openTransition = void 0),
  17441. this.closePromise.resolve(),
  17442. this.closePromise.promise())
  17443. )
  17444. }),
  17445. (n.prototype.setActiveState = function () {
  17446. this.state !== I.CLOSED &&
  17447. ((this.state = I.ACTIVE),
  17448. this.emit(d.ACTIVATE),
  17449. this.div.classList.remove('has-hotzone'))
  17450. }),
  17451. (n.prototype.animateOpen = function (e) {
  17452. if (this.state === I.OPENING) {
  17453. if ((c.cancel(this.animationTransition), u.detectSamsungNative()))
  17454. return (
  17455. (this.boardOrientation = null),
  17456. (this.div.style.visibility = 'visible'),
  17457. this.emit(d.OPENED),
  17458. (this.state = I.OPEN),
  17459. void (e && e())
  17460. )
  17461. ;(this.div.style.webkitTransform = 'scale(0)'),
  17462. (this.div.style.transform = 'scale(0)'),
  17463. (this.div.style.visibility = 'visible'),
  17464. (this.animationTransition = c.start(
  17465. h.property(this, 'animationScale', 1),
  17466. m.animation.openDuration,
  17467. function () {
  17468. this.emit(d.OPENED), (this.state = I.OPEN), e && e()
  17469. }.bind(this)
  17470. ))
  17471. }
  17472. }),
  17473. (n.prototype.animateClose = function (e) {
  17474. this.state === I.CLOSING &&
  17475. (c.cancel(this.animationTransition),
  17476. (this.animationTransition = c.start(
  17477. h.property(this, 'animationScale', 0),
  17478. m.animation.closeDuration,
  17479. function () {
  17480. this.emit(d.CLOSED),
  17481. (this.state = I.CLOSED),
  17482. (this.div.style.visibility = 'hidden'),
  17483. this.div.classList.contains('has-hotzone') ||
  17484. this.div.classList.add('has-hotzone'),
  17485. e && e()
  17486. }.bind(this)
  17487. )))
  17488. }),
  17489. (n.prototype.needsUpdate = function () {
  17490. return this.state !== I.CLOSED
  17491. }),
  17492. (n.prototype.update = function (e, t) {
  17493. if (this.needsUpdate()) {
  17494. var i = (this.updateOrientation(e), this.calcScale(t)),
  17495. n = {
  17496. x: ((e.x + 1) * $('#player').width()) / 2,
  17497. y: ((e.y + 1) * $('#player').height()) / 2
  17498. }
  17499. ;(this.div.screenTransform =
  17500. this.initialTransform +
  17501. ' translate(' +
  17502. n.x +
  17503. 'px, ' +
  17504. n.y +
  17505. 'px) scale(' +
  17506. i * this.animationScale +
  17507. ')'),
  17508. (this.div.style.webkitTransform = this.div.screenTransform),
  17509. (this.div.style.transform = this.div.screenTransform)
  17510. }
  17511. }),
  17512. (n.prototype.getDimensions = function () {
  17513. return this.div.getBoundingClientRect()
  17514. }),
  17515. (n.prototype.calcScale = function (e) {
  17516. return Math.sqrt(e / 40) * m.boardToDiscRatio
  17517. }),
  17518. (n.prototype.updateOrientation = function (e) {
  17519. if (this.state !== I.ACTIVE) {
  17520. var t = 1 / 3,
  17521. i = e.y < -t ? 0 : e.y < t ? 1 : 2,
  17522. n = e.x < -t ? 0 : e.x < t ? 1 : 2,
  17523. r = ''
  17524. ;(r += 0 === n ? 'right' : 2 === n ? 'left' : ''),
  17525. (r += 0 === i ? '-down' : 2 === i ? '-up' : ''),
  17526. 1 === n &&
  17527. ((r = 0 === i ? 'bottom' : 2 === i ? 'top' : ''),
  17528. 1 === i &&
  17529. (r =
  17530. $('#player').width() > $('#player').height()
  17531. ? e.x < 0
  17532. ? 'right'
  17533. : 'left'
  17534. : e.y < 0
  17535. ? 'bottom'
  17536. : 'top')),
  17537. (1 === n && 1 === i && r === this.orientation) || this.applyOrientation(r)
  17538. }
  17539. }),
  17540. (n.prototype.applyOrientation = function (e) {
  17541. ;(this.div.style.transform = this.div.style.webkitTransform = ''),
  17542. this.div.classList.remove('tag-container-' + this.orientation),
  17543. this.div.classList.add('tag-container-' + e)
  17544. var t = window.getComputedStyle(this.div)
  17545. ;(this.initialTransform = t.transform || t.webkitTransform),
  17546. 'none' === this.initialTransform && (this.initialTransform = '')
  17547. var i = t.transform.slice(7, -1).split(','),
  17548. n = -i[4],
  17549. r = -i[5]
  17550. ;(this.div.style.webkitTransformOrigin = n + 'px ' + r + 'px'),
  17551. (this.div.style.transformOrigin = n + 'px ' + r + 'px'),
  17552. (this.orientation = e)
  17553. }),
  17554. (t.exports = n)
  17555. }).call(this, '/js/tag/Billboard/Billboard.js')
  17556. },
  17557. {
  17558. '../../util/browser': 182,
  17559. '../../util/lerp': 188,
  17560. '../../util/logger': 189,
  17561. '../../util/transitions': 195,
  17562. '../Media/EmbedlyEmbed': 125,
  17563. '../Media/EmbedlyPlayer': 126,
  17564. '../Media/Image': 128,
  17565. '../Media/Link': 129,
  17566. '../Media/MediaEvent': 131,
  17567. '../Parser/DescriptionChunkType': 133,
  17568. '../Parser/DescriptionParser': 134,
  17569. './BillboardEvent': 120,
  17570. './billboardSettings': 121,
  17571. './overlaySettings': 122,
  17572. events: 202
  17573. }
  17574. ],
  17575. 120: [
  17576. function (e, t, i) {
  17577. 'use strict'
  17578. t.exports = Object.freeze({
  17579. ENTER: 'billboard.enter',
  17580. LEAVE: 'billboard.leave',
  17581. OPENING: 'billboard.opening',
  17582. OPENED: 'billboard.open',
  17583. CLOSING: 'billboard.closing',
  17584. CLOSED: 'billboard.closed',
  17585. ACTIVATING: 'billboard.activating',
  17586. ACTIVATE: 'billboard.activate'
  17587. })
  17588. },
  17589. {}
  17590. ],
  17591. 121: [
  17592. function (e, t, i) {
  17593. 'use strict'
  17594. t.exports = Object.freeze({
  17595. animation: Object.freeze({
  17596. hoverOnClosing: !1,
  17597. openDelay: 100,
  17598. closeDelay: 50,
  17599. openDuration: 200,
  17600. closeDuration: 100
  17601. }),
  17602. boardToDiscRatio: 1.2
  17603. })
  17604. },
  17605. {}
  17606. ],
  17607. 122: [
  17608. function (e, t, i) {
  17609. 'use strict'
  17610. t.exports = Object.freeze({
  17611. boundaryWidth: 30,
  17612. boundaryHeight: 0
  17613. })
  17614. },
  17615. {}
  17616. ],
  17617. 123: [
  17618. function (e, t, i) {
  17619. //tag
  17620. ;(function (i) {
  17621. 'use strict'
  17622. function n(e, t, i) {
  17623. var n = i.version || '0'
  17624. '0' !== n && I.info('tag defined using version ' + n),
  17625. (this.model = e),
  17626. (this.sid = t),
  17627. (this.color = new r.Color().set(i.color || l.tagDefault)),
  17628. (this.hoverColor = l._darken(this.color, 0.2)),
  17629. (this.floor = null),
  17630. (this.floorIndex = i.floor),
  17631. (this.mode = s.PANORAMA),
  17632. i.preferred_camera &&
  17633. i.preferred_camera.mode &&
  17634. (this.mode = i.preferred_camera.mode),
  17635. (this.obj3d = null),
  17636. (this.disc = null),
  17637. (this.materials = {
  17638. disc: null,
  17639. pole: null
  17640. }),
  17641. (this.position = new r.Vector3().copy(i.position)),
  17642. (this.discPosition = new r.Vector3().copy(i.stem.direction)),
  17643. (this.discWorldPosition = null),
  17644. (this.discScale = 0.05),
  17645. (this.poleEnabled = i.stem.enabled),
  17646. (this.billboard = new o(i.label, i.description, i.media, this)),
  17647. (this.visibleTransition = null),
  17648. (this.hoveringDisc = !1)
  17649. }
  17650. var r = e('three'),
  17651. o = e('./Billboard/Billboard'),
  17652. a = e('../settings'),
  17653. s = e('../enum/Viewmode'),
  17654. l = e('../enum/Colors'),
  17655. c = e('../enum/RenderLayers'),
  17656. h = e('../enum/RenderOrder'),
  17657. u = (e('../util/common'), e('../util/math')),
  17658. d = e('../util/texture'),
  17659. p = e('../objects/Panorama'),
  17660. f = e('../shaders'),
  17661. g = e('../util/transitions'),
  17662. m = e('../util/lerp'),
  17663. v = e('../util/easing'),
  17664. A = e('./Billboard/BillboardEvent'),
  17665. y = e('events').EventEmitter,
  17666. C = e('../util/logger'),
  17667. I = new C(i),
  17668. E = d.loadBase64(
  17669. '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=='
  17670. ),
  17671. b = d.loadBase64(
  17672. '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'
  17673. ),
  17674. w = new r.PlaneBufferGeometry(1, 1)
  17675. ;(n.prototype = Object.create(y.prototype)),
  17676. (n.raycaster = new r.Raycaster()),
  17677. (n.prototype.bindEvents = function () {
  17678. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  17679. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  17680. }),
  17681. (n.prototype.build = function () {
  17682. return (
  17683. (this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first()),
  17684. this.floor &&
  17685. (this.billboard.build(this.model.sid),
  17686. (this.obj3d = this.buildObject3D()),
  17687. this.floor.add(this.obj3d)),
  17688. this
  17689. )
  17690. }),
  17691. (n.prototype.buildObject3D = function () {
  17692. var e = new r.Object3D()
  17693. e.position.copy(this.position)
  17694. var t = r.UniformsUtils.clone(f.tagDisc.uniforms)
  17695. ;(t.bg.value = b),
  17696. (t.mask.value = E),
  17697. t.color.value.copy(this.color),
  17698. (this.materials.disc = new r.RawShaderMaterial({
  17699. transparent: !0,
  17700. vertexShader: f.tagDisc.vertexShader,
  17701. fragmentShader: f.tagDisc.fragmentShader,
  17702. uniforms: t
  17703. })),
  17704. (this.disc = new r.Mesh(w, this.materials.disc)),
  17705. this.disc.layers.set(c.TAG),
  17706. this.disc.position.copy(this.discPosition),
  17707. (this.disc.renderOrder = h.tagDisc),
  17708. (this.disc.tag = this)
  17709. var i = this.buildPole()
  17710. return (
  17711. i.layers.set(c.TAG),
  17712. (i.renderOrder = h.tagStem),
  17713. e.add(i),
  17714. e.layers.set(c.TAG),
  17715. e.add(this.disc)
  17716. )
  17717. }),
  17718. (n.prototype.buildPole = function () {
  17719. var e = new r.BufferGeometry(),
  17720. t = new Float32Array(6)
  17721. return (
  17722. (t[0] = t[1] = t[2] = 0),
  17723. (t[3] = this.discPosition.x),
  17724. (t[4] = this.discPosition.y),
  17725. (t[5] = this.discPosition.z),
  17726. e.addAttribute('position', new r.BufferAttribute(t, 3)),
  17727. (this.materials.pole = new r.LineBasicMaterial({
  17728. linewidth: a.tags.pole.width,
  17729. color: a.tags.pole.color,
  17730. opacity: 0,
  17731. visible: this.poleEnabled,
  17732. transparent: !0,
  17733. depthWrite: !1
  17734. })),
  17735. new r.Line(e, this.materials.pole)
  17736. )
  17737. }),
  17738. (n.prototype.setFreeState = function (e) {
  17739. ;(!e && this.hoveringDisc) ||
  17740. this.billboard.close(e).then(
  17741. function () {
  17742. this.materials.disc.uniforms.color.value = this.color
  17743. }.bind(this)
  17744. )
  17745. }),
  17746. (n.prototype.setHoverState = function (e) {
  17747. this.billboard.open(e), (this.materials.disc.uniforms.color.value = this.hoverColor)
  17748. }),
  17749. (n.prototype.hide = function (e, t) {
  17750. var i = $.Deferred()
  17751. if (
  17752. 0 === this.materials.disc.uniforms.opacity.value &&
  17753. !g.isRunning(this.visibleTransition)
  17754. )
  17755. return i.resolve().promise()
  17756. ;(e = e || 0), (t = t || 0), g.cancel(this.visibleTransition)
  17757. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity,
  17758. r = t + e,
  17759. o = t / r
  17760. return (
  17761. (this.visibleTransition = g.start(
  17762. (function (e) {
  17763. var t = m.property(e.materials.disc.uniforms.opacity, 'value', 0),
  17764. i = m.property(e.materials.pole, 'opacity', 0)
  17765. return function (n) {
  17766. t(n), e.materials.pole && i(n)
  17767. }
  17768. })(this),
  17769. r * n,
  17770. function () {
  17771. i.resolve()
  17772. },
  17773. o,
  17774. v[a.warp.blendEasing]
  17775. )),
  17776. i.promise()
  17777. )
  17778. }),
  17779. (n.prototype.show = function (e, t) {
  17780. var i = $.Deferred()
  17781. if (
  17782. this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity &&
  17783. !g.isRunning(this.visibleTransition)
  17784. )
  17785. return i.resolve().promise()
  17786. ;(e = e || 0), (t = t || 0), g.cancel(this.visibleTransition)
  17787. var n =
  17788. (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) /
  17789. a.tags.disc.opacity,
  17790. r = t + e,
  17791. o = t / r
  17792. return (
  17793. (this.visibleTransition = g.start(
  17794. (function (e) {
  17795. var t = m.property(
  17796. e.materials.disc.uniforms.opacity,
  17797. 'value',
  17798. a.tags.disc.opacity
  17799. ),
  17800. i = m.property(e.materials.pole, 'opacity', a.tags.pole.opacity)
  17801. return function (n) {
  17802. t(n), e.materials.pole && i(n)
  17803. }
  17804. })(this),
  17805. r * n,
  17806. function () {
  17807. i.resolve()
  17808. },
  17809. o,
  17810. v[a.warp.blendEasing]
  17811. )),
  17812. i.promise()
  17813. )
  17814. }),
  17815. (n.prototype.closestPanoTowardTag = function (e, t) {
  17816. var i = [],
  17817. o = [],
  17818. l = this.disc.getWorldPosition()
  17819. if (e === s.PANORAMA) {
  17820. var c = 0.5,
  17821. h = t.position.clone().sub(l).normalize()
  17822. i.push(p.filters.isPanoAligned()),
  17823. i.push(p.filters.isNeighbourPanoTo(t)),
  17824. i.push(p.filters.inPanoDirection(l, h, c)),
  17825. o.push(p.scoreFunctions.direction(l, h))
  17826. }
  17827. var u = new r.Vector3(),
  17828. d = function (e) {
  17829. u.copy(l).sub(e.position)
  17830. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z))),
  17831. i = a.tags.navigate.tiltTolerance
  17832. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  17833. },
  17834. f = function (e) {
  17835. return (
  17836. Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance ||
  17837. Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  17838. )
  17839. }
  17840. i.push(f, d), o.push(p.scoreFunctions.distanceSquared(this, -2))
  17841. var g = this.model.panos.sortByScore(i, o)
  17842. if (a.tags.navigate.lineOfSight) {
  17843. for (var m = 0; m < g.length; m++) {
  17844. var v = g[m].item,
  17845. A = v.position.distanceTo(l)
  17846. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  17847. return null
  17848. n.raycaster.set(v.position, l.clone().sub(v.position).normalize())
  17849. var y = n.raycaster.intersectObjects(this.model.colliders)
  17850. if (0 === y.length || y[0].distance > A) return v
  17851. }
  17852. return null
  17853. }
  17854. return g.length > 0 && g[0].item
  17855. }),
  17856. (n.prototype.examine = function (e) {
  17857. var t = e.mode,
  17858. i =
  17859. (a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano)) ||
  17860. e.currentPano,
  17861. n = this.disc.getWorldPosition()
  17862. this.billboard.setActiveState()
  17863. var o = function () {
  17864. var t = this.billboard.getDimensions(),
  17865. n = new r.Vector3()
  17866. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  17867. n.unproject(e.camera),
  17868. e.flyToPano({
  17869. pano: i,
  17870. lookAtPoint: n
  17871. })
  17872. }.bind(this)
  17873. if (t === s.PANORAMA)
  17874. if (i !== e.currentPano) {
  17875. var l = {
  17876. pano: i,
  17877. lookAtPoint: n,
  17878. duration: null,
  17879. maxDistanceOverride: null,
  17880. skipWarpingCheck: !1
  17881. }
  17882. e.flyToPano(l, o)
  17883. } else
  17884. setTimeout(
  17885. function () {
  17886. this.billboard.open().then(function () {
  17887. o()
  17888. })
  17889. }.bind(this),
  17890. 0
  17891. )
  17892. else {
  17893. var c = {
  17894. pano: i
  17895. }
  17896. if (n) {
  17897. var h = new r.Matrix4().lookAt(i.position, n, new r.Vector3(0, 1, 0))
  17898. c.quaternion = new r.Quaternion().setFromRotationMatrix(h)
  17899. }
  17900. ;(c.callback = o), (c.duration = 1500), (c.mode = s.PANORAMA), e.flyToNewMode(c)
  17901. }
  17902. }),
  17903. (n.prototype.update = (function (e, t) {
  17904. var i = new r.Vector3()
  17905. return function (e, t) {
  17906. ;(this.discWorldPosition = this.disc.getWorldPosition()),
  17907. this.updateDisc(e, t),
  17908. this.billboard.needsUpdate() &&
  17909. (i.copy(this.discWorldPosition).project(t),
  17910. i.z < 1 && ((i.y *= -1), this.billboard.update(i, this.getDiscRadius(i, t))))
  17911. }
  17912. })()),
  17913. (n.prototype.updateDisc = (function (e, t) {
  17914. var i = new r.Vector3(),
  17915. o = new r.Vector3(),
  17916. l = new r.Vector3(),
  17917. c = new r.Vector3(),
  17918. h = new r.Vector3()
  17919. return function (e, t) {
  17920. var u = a.tags.visibility,
  17921. d = a.tags.disc.scale,
  17922. p =
  17923. e === s.DOLLHOUSE || e === s.FLOORPLAN
  17924. ? a.tags.visibility.visibleDistance
  17925. : t.position.distanceTo(this.discWorldPosition)
  17926. if (
  17927. ((this.obj3d.visible =
  17928. 0 !== this.disc.material.opacity &&
  17929. (u.anyDistance || p <= u.visibleDistance || e === s.TRANSITIONING) &&
  17930. (!u.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) &&
  17931. (!u.hideOffScreenDisc || !this.offScreen(this.disc, t)) &&
  17932. (!u.hideOffScreenObject || !this.offScreen(this.obj3d, t))),
  17933. this.obj3d.visible)
  17934. ) {
  17935. this.disc.quaternion.copy(t.quaternion)
  17936. var f =
  17937. d.maxSize -
  17938. (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound)
  17939. i.copy(this.discWorldPosition).project(t),
  17940. o.set($('#player').width() / 2, $('#player').height() / 2, 1).multiply(i),
  17941. l.set(f / 2, 0, 0).add(o),
  17942. c.set(2 / $('#player').width(), 2 / $('#player').height(), 1).multiply(l),
  17943. h.copy(c).unproject(t)
  17944. var g = h.distanceTo(this.discWorldPosition),
  17945. m = 1 + (a.tags.disc.scale.responsiveness / 100) * (n.viewportScale() - 1)
  17946. ;(this.discScale = g * m),
  17947. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  17948. }
  17949. }
  17950. })()),
  17951. (n.prototype.getDiscRadius = (function (e, t) {
  17952. var i = new r.Vector3()
  17953. return function (e, t) {
  17954. return (
  17955. i
  17956. .set(-this.discScale / 2, 0, 0)
  17957. .applyQuaternion(t.quaternion)
  17958. .add(this.discWorldPosition)
  17959. .project(t),
  17960. Math.abs(e.x - i.x) * $('#player').width()
  17961. )
  17962. }
  17963. })()),
  17964. (n.prototype.tagVisibleOnCurrentFloor = function (e) {
  17965. return (
  17966. !(e === s.DOLLHOUSE || e === s.FLOORPLAN) ||
  17967. this.model.allFloorsVisible ||
  17968. !this.floor.hidden
  17969. )
  17970. }),
  17971. (n.prototype.offScreen = function (e, t) {
  17972. var i = e.getWorldPosition().project(t)
  17973. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  17974. }),
  17975. (n.viewportScale = function () {
  17976. return (
  17977. (n.viewportWidth === $('#player').width() &&
  17978. n.viewportHeight === $('#player').height()) ||
  17979. ((n.viewportWidth = $('#player').width()),
  17980. (n.viewportHeight = $('#player').height()),
  17981. (n.currentViewportScale = Math.sqrt(
  17982. Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize
  17983. ))),
  17984. n.currentViewportScale
  17985. )
  17986. }),
  17987. (t.exports = n)
  17988. }).call(this, '/js/tag/tag.js')
  17989. },
  17990. {
  17991. '../enum/Colors': 19,
  17992. '../enum/RenderLayers': 41,
  17993. '../enum/RenderOrder': 42,
  17994. '../enum/Viewmode': 51,
  17995. '../objects/Panorama': 148,
  17996. '../settings': 166,
  17997. '../shaders': 167,
  17998. '../util/common': 185,
  17999. '../util/easing': 186,
  18000. '../util/lerp': 188,
  18001. '../util/logger': 189,
  18002. '../util/math': 190,
  18003. '../util/texture': 194,
  18004. '../util/transitions': 195,
  18005. './Billboard/Billboard': 119,
  18006. './Billboard/BillboardEvent': 120,
  18007. events: 202,
  18008. three: 217
  18009. }
  18010. ],
  18011. 124: [
  18012. function (e, t, i) {
  18013. ;(function (i) {
  18014. 'use strict'
  18015. function n() {
  18016. ;(this.tagState = y.IDLE),
  18017. (this.intersectTag = null),
  18018. (this.hoveredTag = null),
  18019. (this.activeTag = null),
  18020. (this.tagDiscs = []),
  18021. (this.raycaster = new r.Raycaster()),
  18022. (this.modelManager = null),
  18023. (this.player = null),
  18024. (this.totaltags = 0),
  18025. (this.navigatingViaTag = !1),
  18026. (this.enabled = !1)
  18027. }
  18028. var r = e('three'),
  18029. o = e('../util/logger'),
  18030. a = e('../util/common'),
  18031. s = e('../controls/serializer'),
  18032. l = e('../objects/Snapshot'),
  18033. c = e('../settings'),
  18034. h = e('./Billboard/BillboardEvent'),
  18035. u = e('./Media/MediaEvent'),
  18036. d = e('./Media/LinkType'),
  18037. p = e('../enum/Viewmode'),
  18038. f = e('../enum/WarpStyle'),
  18039. g = e('../enum/BlackoutStyle'),
  18040. m = e('../enum/ModelManagerEvents'),
  18041. v = e('../enum/tagEvents'),
  18042. A = e('../enum/PlayerEvents'),
  18043. y = (e('../util/lerp'), e('../enum/TagStates')),
  18044. C = e('events').EventEmitter,
  18045. I = new o(i)
  18046. a.extend(n, C),
  18047. (n.prototype.init = function (e, t) {
  18048. ;(this.modelManager = e), (this.player = t), this.updateModel(), this.bindEvents()
  18049. }),
  18050. (n.prototype.update = function (e) {
  18051. this.updateTags(
  18052. this.player.mode,
  18053. this.player.camera,
  18054. this.player.currentPano,
  18055. this.player.flying
  18056. )
  18057. }),
  18058. (n.prototype.updateTags = function (e, t, i, n) {
  18059. for (var r in this.model.tags) this.model.tags[r].update(e, t, i, n)
  18060. }),
  18061. (n.prototype.updateModel = function () {
  18062. ;(this.model = this.modelManager.getActiveModel()),
  18063. this.gettagsFromModel(),
  18064. (this.totaltags = Object.keys(this.model.tags).length)
  18065. }),
  18066. (n.prototype.gettagsFromModel = function () {
  18067. this.tagDiscs = []
  18068. for (var e in this.model.tags) {
  18069. var t = this.model.tags[e].disc
  18070. t && this.tagDiscs.push(t)
  18071. }
  18072. }),
  18073. (n.prototype.bindEvents = function () {
  18074. function e() {
  18075. Object.keys(this.model.tags).forEach(
  18076. function (e) {
  18077. var t = this.model.tags[e]
  18078. t.bindEvents(),
  18079. t.billboard.on(
  18080. u.LINK_CLICK,
  18081. function (e) {
  18082. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  18083. }.bind(this)
  18084. ),
  18085. t.billboard.on(
  18086. u.IMAGE_OPENED,
  18087. function () {
  18088. ;(this.tagState = y.EXAMINE), this.emit(u.IMAGE_OPENED)
  18089. }.bind(this)
  18090. ),
  18091. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  18092. }.bind(this)
  18093. )
  18094. }
  18095. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  18096. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  18097. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  18098. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  18099. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  18100. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  18101. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  18102. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  18103. e.call(this)
  18104. }),
  18105. (n.prototype.navigateViaLink = function (e) {
  18106. var t = s.deserialize(e)
  18107. if (t)
  18108. if (t.mode === p.PANORAMA) {
  18109. try {
  18110. this.player.model.panos.get(t.panoId)
  18111. } catch (e) {
  18112. return void I.warn('Unable to find panorama location', t.panoId)
  18113. }
  18114. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  18115. } else {
  18116. var i = {
  18117. cameraMode: t.mode,
  18118. position: t.position,
  18119. quaternion: t.quaternion,
  18120. scanId: t.panoId,
  18121. orthoZoom: t.zoom,
  18122. floorVisibility: t.floorVisibility,
  18123. thumbUrl: null,
  18124. name: null
  18125. }
  18126. this.player.flyToNewMode({
  18127. mode: t.mode,
  18128. duration: c.warp.outsideTime,
  18129. warpDest: new l(i),
  18130. force: !0
  18131. })
  18132. }
  18133. }),
  18134. (n.prototype.handleWarpStart = function (e, t, i, n) {
  18135. this.dismissExaminedTag(),
  18136. t === f.BLACK &&
  18137. ((null !== n && void 0 !== n) || (n = c.warp.teleportTime),
  18138. e && (i = g.END),
  18139. this.hideShowTagsForBlackoutStyle(i, n))
  18140. }),
  18141. (n.prototype.handleWarpInterruption = function (e, t, i) {
  18142. ;(null !== i && void 0 !== i) || (i = c.warp.teleportTime),
  18143. this.hideShowTagsForBlackoutStyle(t, i)
  18144. }),
  18145. (n.prototype.hideShowTagsForBlackoutStyle = function (e, t) {
  18146. var i = 0,
  18147. n = 0,
  18148. r = t / 2
  18149. switch (((null !== e && void 0 !== e) || (e = g.MIDDLE), e)) {
  18150. case g.END:
  18151. this.hideAlltags(r)
  18152. break
  18153. case g.BEGINNING:
  18154. this.hideAlltags().done(this.showAlltags.bind(this, r))
  18155. break
  18156. case g.NONE:
  18157. break
  18158. case g.MIDDLE:
  18159. ;(i = r),
  18160. (n = r),
  18161. this.hideAlltags(n),
  18162. setTimeout(
  18163. function () {
  18164. this.showAlltags(i)
  18165. }.bind(this),
  18166. n
  18167. )
  18168. break
  18169. case g.FADEIN:
  18170. setTimeout(
  18171. function () {
  18172. this.showAlltags(r)
  18173. }.bind(this),
  18174. r
  18175. )
  18176. }
  18177. }),
  18178. (n.prototype.onPlayerModeChanging = function (e, t) {
  18179. t !== p.PANORAMA && this.dismissExaminedTag(),
  18180. t === p.PANORAMA &&
  18181. player.currentPano &&
  18182. !player.currentPano.isAligned() &&
  18183. (t = p.OUTDOOR)
  18184. var i = t !== p.OUTDOOR
  18185. i !== this.model.tagsShown &&
  18186. (i
  18187. ? this.showAlltags(c.tags.startup.fadeInDuration)
  18188. : this.hideAlltags(c.tags.startup.fadeInDuration))
  18189. }),
  18190. (n.prototype.onPanoChange = function (e, t) {
  18191. var i = this.navigatingViaTag
  18192. if (((this.navigatingViaTag = !1), !i)) {
  18193. this.dismissExaminedTag()
  18194. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA,
  18195. r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA
  18196. n !== r &&
  18197. (r === p.PANORAMA
  18198. ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0)
  18199. : this.hideAlltags(c.tags.startup.fadeInDuration))
  18200. }
  18201. }),
  18202. (n.prototype.onPlayerReady = function (e, t, i) {
  18203. this.startAlltags(e, t ? i : null)
  18204. }),
  18205. (n.prototype.onPlayerFlyingEnded = function (e, t) {
  18206. this.updateClosestTags(e)
  18207. }),
  18208. (n.prototype.dismissExaminedTag = function () {
  18209. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  18210. this.hoveredTag && (this.hoveredTag.setFreeState(!0), (this.hoveredTag = null))
  18211. }),
  18212. (n.prototype.startAlltags = function (e, t) {
  18213. ;(this.model.shouldShowtags = c.tags.enabled),
  18214. (this.enabled = !0),
  18215. e ||
  18216. (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  18217. t &&
  18218. setTimeout(
  18219. function () {
  18220. this.activateTag(this.model.getTagBySid(t))
  18221. }.bind(this),
  18222. c.tags.startup.fadeInDuration / 2
  18223. ))
  18224. }),
  18225. (n.prototype.showAlltags = function (e, t, i) {
  18226. function n() {
  18227. o++, o === this.totaltags && ((this.model.tagsShown = !0), r.resolve())
  18228. }
  18229. var r = $.Deferred()
  18230. if (
  18231. (!i &&
  18232. this.player.mode === p.PANORAMA &&
  18233. this.player.currentPano &&
  18234. !this.player.currentPano.isAligned()) ||
  18235. !this.model.shouldShowtags
  18236. )
  18237. return r.resolve().promise()
  18238. var o = 0
  18239. for (var a in this.model.tags) {
  18240. var s = this.model.tags[a]
  18241. s.show(e, t).done(n.bind(this))
  18242. }
  18243. return r.promise()
  18244. }),
  18245. (n.prototype.hideAlltags = function (e, t) {
  18246. function i() {
  18247. r++, r === this.totaltags && ((this.model.tagsShown = !1), n.resolve())
  18248. }
  18249. var n = $.Deferred(),
  18250. r = 0
  18251. for (var o in this.model.tags) {
  18252. var a = this.model.tags[o]
  18253. a.hide(e, t).done(i.bind(this)), a === this.activeTag && this.dismissActiveTag()
  18254. }
  18255. return n.promise()
  18256. }),
  18257. (n.prototype.enableHovering = function () {
  18258. this.enabled = !0
  18259. }),
  18260. (n.prototype.disableHovering = function () {
  18261. this.enabled = !1
  18262. }),
  18263. (n.prototype.activateTag = function (e, t) {
  18264. ;(t = t || y.EXAMINE),
  18265. (this.activeTag = e),
  18266. (this.activeTag.hoveringDisc = !0),
  18267. this.activeTag.setHoverState(t === y.EXAMINE),
  18268. (this.tagState = t),
  18269. this.emit(v.TagActivated, e)
  18270. }),
  18271. (n.prototype.dismissActiveTag = function () {
  18272. ;(this.activeTag.hoveringDisc = !1), this.activeTag.setFreeState(!0)
  18273. var e = this.activeTag
  18274. ;(this.activeTag = null), (this.tagState = y.IDLE), this.emit(v.TagDismissed, e)
  18275. }),
  18276. (n.prototype.clickedOnTag = function (e) {
  18277. var t = function () {
  18278. ;(this.navigatingViaTag = !0),
  18279. this.activeTag.examine(this.player),
  18280. this.emit(v.TagNavigation, this.activeTag)
  18281. }.bind(this)
  18282. return this.tagState !== y.EXAMINE
  18283. ? (this.activateTag(this.intersectTag, y.EXAMINE),
  18284. (this.activeTag = this.intersectTag),
  18285. t(),
  18286. !0)
  18287. : (this.dismissActiveTag(), !1)
  18288. }),
  18289. (n.prototype.intersecttag = (function () {
  18290. var e = new r.Vector3(),
  18291. t = new r.Vector3(),
  18292. i = new r.Vector3()
  18293. return function (n, r, o) {
  18294. if (!this.enabled) return null
  18295. var a = null,
  18296. s = this.tagDiscs.filter(function (e) {
  18297. return e.parent.visible
  18298. })
  18299. if (s.length > 0) {
  18300. var l = this.model.floors.reduce(function (e, t) {
  18301. return t.hidden ? e : e.concat(t.collider.children)
  18302. }, s)
  18303. e.set(n.x, n.y, -1).unproject(o),
  18304. t.set(n.x, n.y, 1).unproject(o),
  18305. i.copy(t).sub(e).normalize(),
  18306. this.raycaster.set(e, i)
  18307. var c = this.raycaster.intersectObjects(l)
  18308. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  18309. }
  18310. return (
  18311. (this.intersectTag = a),
  18312. r &&
  18313. (this.activeTag &&
  18314. a !== this.activeTag &&
  18315. (this.tagState === y.BROWSE || (this.tagState === y.EXAMINE && a)) &&
  18316. this.dismissActiveTag(),
  18317. a &&
  18318. a !== this.activeTag &&
  18319. (a.listeners(h.ENTER).length < 1 &&
  18320. (a.billboard.on(
  18321. h.ENTER,
  18322. function () {
  18323. this.hoveredTag = a
  18324. }.bind(this)
  18325. ),
  18326. a.billboard.on(
  18327. h.LEAVE,
  18328. function () {
  18329. this.hoveredTag = null
  18330. }.bind(this)
  18331. )),
  18332. this.activateTag(a, y.BROWSE))),
  18333. a
  18334. )
  18335. }
  18336. })()),
  18337. (n.prototype.rankedtagInDirection = (function () {
  18338. var e = [],
  18339. t = [],
  18340. i = new r.Vector3(),
  18341. n = new r.Vector3(),
  18342. o = new r.Vector3()
  18343. return function (r, a, s, l) {
  18344. var c = 0
  18345. t.length = 0
  18346. for (var h = 0; h < this.closesttags.length; h++) {
  18347. var u = this.closesttags[h]
  18348. n.copy(u.position),
  18349. n.add(u.discPosition),
  18350. i.copy(a),
  18351. i.sub(n).negate(),
  18352. i.normalize()
  18353. var d = i.dot(l)
  18354. if (d >= 0) {
  18355. o.copy(n), o.project(s)
  18356. var p = this.intersecttag(o, !1, s)
  18357. if (p) {
  18358. if (c >= e.length)
  18359. for (var f = 0; f < 64; f++)
  18360. e.push({
  18361. tag: u,
  18362. dot: d
  18363. })
  18364. var g = e[c]
  18365. ;(g.tag = u),
  18366. (g.dot = d),
  18367. (g.position = math.projectPositionToCanvas(n, s)),
  18368. t.push(g),
  18369. c++
  18370. }
  18371. }
  18372. }
  18373. return (
  18374. t.sort(function (e, t) {
  18375. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  18376. }),
  18377. r < t.length ? t[r].tag : null
  18378. )
  18379. }
  18380. })()),
  18381. (n.prototype.updateClosestTags = (function () {
  18382. var e = new r.Vector3(),
  18383. t = 30
  18384. return function (i) {
  18385. this.closesttags || (this.closesttags = []), (this.closesttags.length = 0)
  18386. var n = this.model.tags
  18387. if (n)
  18388. for (var r in n)
  18389. if (n.hasOwnProperty(r)) {
  18390. var o = n[r],
  18391. a = o.position
  18392. e.copy(i), e.sub(a).negate()
  18393. var s = e.lengthSq()
  18394. s < t && this.closesttags.push(o)
  18395. }
  18396. }
  18397. })()),
  18398. (t.exports = n)
  18399. }).call(this, '/js/tag/tagManager.js')
  18400. },
  18401. {
  18402. '../controls/serializer': 14,
  18403. '../enum/BlackoutStyle': 18,
  18404. '../enum/tagEvents': 32,
  18405. '../enum/ModelManagerEvents': 33,
  18406. '../enum/PlayerEvents': 40,
  18407. '../enum/TagStates': 44,
  18408. '../enum/Viewmode': 51,
  18409. '../enum/WarpStyle': 52,
  18410. '../objects/Snapshot': 153,
  18411. '../settings': 166,
  18412. '../util/common': 185,
  18413. '../util/lerp': 188,
  18414. '../util/logger': 189,
  18415. './Billboard/BillboardEvent': 120,
  18416. './Media/LinkType': 130,
  18417. './Media/MediaEvent': 131,
  18418. events: 202,
  18419. three: 217
  18420. }
  18421. ],
  18422. 125: [
  18423. function (e, t, i) {
  18424. ;(function (i) {
  18425. 'use strict'
  18426. function n() {
  18427. ;(this.embedWrapper = null), (this.embedElement = null)
  18428. }
  18429. var r = e('../../util/ajax'),
  18430. o = e('./mediaSettings'),
  18431. a = e('../../settings'),
  18432. s = e('../../util/logger'),
  18433. l = new s(i)
  18434. ;(n.prototype.createDomElement = function () {
  18435. return (
  18436. (this.embedWrapper = document.createElement('div')),
  18437. this.embedWrapper.classList.add('tag-embed'),
  18438. this.embedWrapper.classList.add('hidden'),
  18439. this.embedWrapper
  18440. )
  18441. }),
  18442. (n.prototype.load = function (e) {
  18443. var t =
  18444. 'https://api.embedly.com/1/oembed?key=' +
  18445. a.appConfig.embedly_key +
  18446. '&url=' +
  18447. encodeURIComponent(e) +
  18448. '&maxwidth=' +
  18449. o.maxEmbedWidth
  18450. return new Promise(
  18451. function (e, i) {
  18452. r.get(t).then(
  18453. function (t) {
  18454. if (((t = JSON.parse(t)), t.html && t.html.indexOf('<script') === -1)) {
  18455. this.embedWrapper.innerHTML = t.html
  18456. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth
  18457. if (((this.embedWrapper.style.width = n + 'px'), t.height)) {
  18458. var r = t.height / t.width
  18459. this.embedWrapper.style.height = n * r + 'px'
  18460. }
  18461. this.embedElement = this.embedWrapper.firstChild
  18462. var a = []
  18463. try {
  18464. a = [].slice.call(this.embedElement.querySelectorAll('a'))
  18465. } catch (e) {
  18466. l.debug('Error getting `a` elements for embed; was it an iframe?')
  18467. }
  18468. a.forEach(function (e) {
  18469. e.setAttribute('target', '_blank')
  18470. }),
  18471. this.embedElement.classList.add('hidden'),
  18472. this.embedWrapper.classList.remove('hidden'),
  18473. e()
  18474. } else i('Not a valid embed')
  18475. }.bind(this),
  18476. function (e) {
  18477. i(e.response)
  18478. }
  18479. )
  18480. }.bind(this)
  18481. )
  18482. }),
  18483. (n.prototype.show = function () {
  18484. this.embedElement && this.embedElement.classList.remove('hidden')
  18485. }),
  18486. (n.prototype.hide = function () {
  18487. this.embedElement && this.embedElement.classList.add('hidden')
  18488. }),
  18489. (t.exports = n)
  18490. }).call(this, '/js/tag/Media/EmbedlyEmbed.js')
  18491. },
  18492. {
  18493. '../../settings': 166,
  18494. '../../util/ajax': 181,
  18495. '../../util/logger': 189,
  18496. './mediaSettings': 132
  18497. }
  18498. ],
  18499. 126: [
  18500. function (e, t, i) {
  18501. ;(function (i) {
  18502. 'use strict'
  18503. function n(e) {
  18504. o.call(this),
  18505. (this.options = e),
  18506. (this.playerControls = null),
  18507. (this.state = s.NOT_READY)
  18508. }
  18509. var r = e('../../util/browser'),
  18510. o = e('./EmbedlyEmbed'),
  18511. a = e('../../util/logger'),
  18512. s =
  18513. (new a(i),
  18514. Object.freeze({
  18515. NOT_READY: 'player.not.ready',
  18516. CUED: 'player.cued',
  18517. PLAYING: 'player.playing',
  18518. PAUSED: 'player.paused'
  18519. }))
  18520. ;(n.prototype = Object.create(o.prototype)),
  18521. (n.prototype.createDomElement = function () {
  18522. return (
  18523. (this.embedWrapper = document.createElement('div')),
  18524. this.embedWrapper.classList.add('tag-video'),
  18525. this.embedWrapper.classList.add('hidden'),
  18526. this.embedWrapper
  18527. )
  18528. }),
  18529. (n.prototype.load = function (e) {
  18530. var t = function () {
  18531. function e(e) {
  18532. ;(this.playerState = s.CUED),
  18533. this.options.startMuted && this.playerControls.mute()
  18534. }
  18535. function t(e) {
  18536. this.playerState = e
  18537. }
  18538. function i(e) {
  18539. this.playerControls.setCurrentTime(0),
  18540. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  18541. }
  18542. ;(this.playerControls = new playerjs.Player(this.embedElement)),
  18543. this.playerControls.on('ready', e.bind(this)),
  18544. this.playerControls.on('play', t.bind(this, s.PLAYING)),
  18545. this.playerControls.on('pause', t.bind(this, s.PAUSED)),
  18546. this.playerControls.on('ended', i.bind(this))
  18547. }.bind(this)
  18548. return o.prototype.load.call(this, e).then(t.bind(this))
  18549. }),
  18550. (n.prototype.play = (function () {
  18551. var e = r.isMobile()
  18552. return function () {
  18553. this.playerState !== s.NOT_READY &&
  18554. this.playerControls &&
  18555. !e &&
  18556. ((this.state === s.CUED && this.options.autoPlay) || this.options.autoResume) &&
  18557. this.playerControls.play()
  18558. }
  18559. })()),
  18560. (n.prototype.pause = function () {
  18561. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  18562. }),
  18563. (t.exports = n)
  18564. }).call(this, '/js/tag/Media/EmbedlyPlayer.js')
  18565. },
  18566. {
  18567. '../../util/browser': 182,
  18568. '../../util/logger': 189,
  18569. './EmbedlyEmbed': 125
  18570. }
  18571. ],
  18572. 127: [
  18573. function (e, t, i) {
  18574. ;(function (i) {
  18575. 'use strict'
  18576. function n(e) {
  18577. function t() {
  18578. return (
  18579. a.debug('requesting file from embedly:', e.href),
  18580. r
  18581. .get(e.href, {
  18582. responseType: e.responseType
  18583. })
  18584. .then(function (t) {
  18585. return a.debug('requesting file finished:', e.href), t
  18586. })
  18587. )
  18588. }
  18589. function i() {}
  18590. return (s = new Promise(function (e, n) {
  18591. s.catch(i).then(function () {
  18592. t().then(e, n)
  18593. })
  18594. }))
  18595. }
  18596. var r = e('../../util/ajax'),
  18597. o = (e('./mediaSettings'), e('../../util/logger')),
  18598. a = new o(i),
  18599. s = Promise.resolve()
  18600. t.exports.enqueue = n
  18601. }).call(this, '/js/tag/Media/EmbedlyQueue.js')
  18602. },
  18603. {
  18604. '../../util/ajax': 181,
  18605. '../../util/logger': 189,
  18606. './mediaSettings': 132
  18607. }
  18608. ],
  18609. 128: [
  18610. function (e, t, i) {
  18611. ;(function (i) {
  18612. 'use strict'
  18613. function n() {
  18614. ;(this.imageWrapper = null), (this.width = 0), (this.height = 0), (this.aspect = 1)
  18615. }
  18616. var r = e('./MediaEvent'),
  18617. o = e('./EmbedlyQueue'),
  18618. a = e('events').EventEmitter,
  18619. s = e('../../util/logger'),
  18620. l = e('../../settings')
  18621. new s(i)
  18622. ;(n.prototype = Object.create(a.prototype)),
  18623. (n.prototype.createDomElement = function () {
  18624. return (
  18625. (this.imageWrapper = document.createElement('div')),
  18626. this.imageWrapper.classList.add('tag-image'),
  18627. this.imageWrapper.classList.add('hidden'),
  18628. this.imageWrapper.addEventListener(
  18629. 'click',
  18630. function (e) {
  18631. e.stopPropagation(),
  18632. this.emit(r.IMAGE_OPENING),
  18633. (this.imageWrapper.style.pointerEvents = 'none')
  18634. }.bind(this)
  18635. ),
  18636. this.imageWrapper
  18637. )
  18638. }),
  18639. (n.prototype.onClosed = function () {
  18640. this.imageWrapper.style.pointerEvents = 'auto'
  18641. }),
  18642. (n.prototype.load = function (e) {
  18643. var t = Math.max(window.screen.height, window.screen.width),
  18644. i =
  18645. 'https://i.embed.ly/1/display/resize?key=' +
  18646. l.appConfig.embedly_key +
  18647. '&url=' +
  18648. encodeURIComponent(e) +
  18649. '&width=' +
  18650. t +
  18651. '&height=' +
  18652. t
  18653. return new Promise(
  18654. function (e, t) {
  18655. function n(t) {
  18656. var i = t.target
  18657. ;(this.width = i.naturalWidth),
  18658. (this.height = i.naturalHeight),
  18659. (this.aspect = this.width / this.height)
  18660. var n = t.target.src
  18661. ;(this.imageWrapper.style.backgroundImage = 'url("' + n + '")'),
  18662. (this.imageWrapper.style.width = this.width + 'px'),
  18663. (this.imageWrapper.style.height = this.height + 'px'),
  18664. this.imageWrapper.classList.remove('hidden'),
  18665. e()
  18666. }
  18667. o.enqueue({
  18668. href: i,
  18669. responseType: 'arraybuffer'
  18670. }).then(
  18671. function (e) {
  18672. var t = new Uint8Array(e),
  18673. i = new Blob([t]),
  18674. r = new window.Image()
  18675. r.addEventListener('load', n.bind(this))
  18676. var o = URL.createObjectURL(i)
  18677. r.src = o
  18678. }.bind(this),
  18679. t
  18680. )
  18681. }.bind(this)
  18682. )
  18683. }),
  18684. (t.exports = n)
  18685. }).call(this, '/js/tag/Media/Image.js')
  18686. },
  18687. {
  18688. '../../settings': 166,
  18689. '../../util/logger': 189,
  18690. './EmbedlyQueue': 127,
  18691. './MediaEvent': 131,
  18692. events: 202
  18693. }
  18694. ],
  18695. 129: [
  18696. function (e, t, i) {
  18697. 'use strict'
  18698. function n(e) {
  18699. ;(this.label = e.label),
  18700. (this.href = e.url),
  18701. (this.type = this.updateLinkForType()),
  18702. (this.domElement = null),
  18703. (this.id = c++)
  18704. }
  18705. var r = e('./LinkType'),
  18706. o = e('./MediaEvent'),
  18707. a = e('../../util/browser'),
  18708. s = e('../../analytics'),
  18709. l = e('events').EventEmitter,
  18710. c = 0
  18711. ;(n.prototype = Object.create(l.prototype)),
  18712. (n.prototype.updateLinkForType = function () {
  18713. function e(e) {
  18714. var t = new RegExp('[#&?]start=([^#&?]*)'),
  18715. i = t.exec(e)
  18716. return i[1]
  18717. }
  18718. function t(e) {
  18719. return e + '&play=1'
  18720. }
  18721. var i = a.valueFromHash('m') || a.valueFromHash('model')
  18722. return this.href.indexOf('port.com/show') !== -1 ||
  18723. this.href.indexOf(window.location.host + '/show') !== -1
  18724. ? this.href.indexOf(i) !== -1 && this.href.indexOf('start=') !== -1
  18725. ? ((this.href = e(this.href)), r.NAVIGATION)
  18726. : ((this.href = t(this.href)), r.MODEL)
  18727. : r.EXT_LINK
  18728. })
  18729. var h = {}
  18730. ;(n.prototype.createDomElement = function () {
  18731. function e(e) {
  18732. switch (
  18733. (e.stopPropagation(),
  18734. (h[this.id] = !0),
  18735. s.trackAlways('click_tag_link', {
  18736. link_type: this.type,
  18737. link_count: c,
  18738. links_clicked: Object.keys(h).length
  18739. }),
  18740. this.type)
  18741. ) {
  18742. case r.MODEL:
  18743. window.location.replace(this.href)
  18744. break
  18745. case r.EXT_LINK:
  18746. window.open(this.href, '_blank')
  18747. }
  18748. this.emit(o.LINK_CLICK, {
  18749. type: this.type,
  18750. url: this.href
  18751. })
  18752. }
  18753. if (
  18754. ((this.domElement = document.createElement('a')),
  18755. this.domElement.classList.add('tag-link'),
  18756. (this.domElement.textContent = this.label),
  18757. this.type === r.EXT_LINK)
  18758. ) {
  18759. this.domElement.textContent += ' '
  18760. var t = document.createElement('i')
  18761. t.classList.add('icon-ext-link'),
  18762. (t.title = 'Link to external web site'),
  18763. this.domElement.appendChild(t)
  18764. }
  18765. return this.domElement.addEventListener('click', e.bind(this)), this.domElement
  18766. }),
  18767. (t.exports = n)
  18768. },
  18769. {
  18770. '../../analytics': 4,
  18771. '../../util/browser': 182,
  18772. './LinkType': 130,
  18773. './MediaEvent': 131,
  18774. events: 202
  18775. }
  18776. ],
  18777. 130: [
  18778. function (e, t, i) {
  18779. 'use strict'
  18780. t.exports = {
  18781. NAVIGATION: 'navigation',
  18782. MODEL: 'model',
  18783. EXT_LINK: 'ext-link'
  18784. }
  18785. },
  18786. {}
  18787. ],
  18788. 131: [
  18789. function (e, t, i) {
  18790. 'use strict'
  18791. t.exports = Object.freeze({
  18792. LINK_CLICK: 'mtmedia.link',
  18793. IMAGE_LOADED: 'mtmedia.image.loaded',
  18794. IMAGE_OPENING: 'mtmedia.image.opening',
  18795. IMAGE_OPENED: 'mtmedia.image.opened',
  18796. IMAGE_CLOSING: 'mtmedia.image.closing',
  18797. IMAGE_CLOSED: 'mtmedia.image.closed',
  18798. VIDEO_START: 'mtmedia.video.start',
  18799. VIDEO_PAUSE: 'mtmedia.video.pause',
  18800. VIDEO_ENDED: 'mtmedia.video.end'
  18801. })
  18802. },
  18803. {}
  18804. ],
  18805. 132: [
  18806. function (e, t, i) {
  18807. 'use strict'
  18808. t.exports = Object.freeze({
  18809. maxEmbedWidth: 350,
  18810. defaultAspectRatio: 0.75
  18811. })
  18812. },
  18813. {}
  18814. ],
  18815. 133: [
  18816. function (e, t, i) {
  18817. 'use strict'
  18818. t.exports = Object.freeze({
  18819. TEXT: 'text',
  18820. LINK: 'link',
  18821. IMAGE: 'photo',
  18822. VIDEO: 'video',
  18823. RICH: 'rich'
  18824. })
  18825. },
  18826. {}
  18827. ],
  18828. 134: [
  18829. function (e, t, i) {
  18830. 'use strict'
  18831. function n(e) {
  18832. this.capabilities = {
  18833. links: {
  18834. enable: e.supportLinks,
  18835. keepLabels: e.keepLinkLabels
  18836. }
  18837. }
  18838. }
  18839. var r = e('./DescriptionChunkType')
  18840. ;(n.prototype.parse = function (e, t) {
  18841. var i = [],
  18842. n = e.split('[').map(function (e, t) {
  18843. return 0 === t ? e : '[' + e
  18844. })
  18845. return (
  18846. n.forEach(
  18847. function (e) {
  18848. var n = this.findMarkdown(e)
  18849. if (n) {
  18850. if (n.url.indexOf('javascript:') !== -1) return
  18851. this.addLinkChunk(i, n, t), this.addTextChunk(i, e.slice(n.markdown.length))
  18852. } else this.addTextChunk(i, e)
  18853. }.bind(this)
  18854. ),
  18855. i
  18856. )
  18857. }),
  18858. (n.prototype.findMarkdown = function (e) {
  18859. var t = /\[([^\]]*)\]\((.*)\)/,
  18860. i = e.match(t)
  18861. if (i) {
  18862. for (
  18863. var n = i[2], r = 1, o = 0;
  18864. o < n.length && ('(' === n[o] ? r++ : ')' === n[o] && r--, 0 !== r);
  18865. )
  18866. o++
  18867. var a = n.length - o
  18868. return {
  18869. markdown: i[0].substring(0, i[0].length - a),
  18870. label: i[1],
  18871. url: i[2].substring(0, o)
  18872. }
  18873. }
  18874. }),
  18875. (n.prototype.addTextChunk = function (e, t) {
  18876. 0 !== t.length &&
  18877. e.push({
  18878. type: r.TEXT,
  18879. text: t
  18880. })
  18881. }),
  18882. (n.prototype.addLinkChunk = function (e, t) {
  18883. if (!this.capabilities.links.enable)
  18884. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label))
  18885. var i = {
  18886. label: t.label,
  18887. url: t.url
  18888. }
  18889. i.url.indexOf('://') === -1 && (i.url = 'http://' + i.url),
  18890. e.push({
  18891. type: r.LINK,
  18892. link: i
  18893. })
  18894. }),
  18895. (t.exports = n)
  18896. },
  18897. {
  18898. './DescriptionChunkType': 133
  18899. }
  18900. ],
  18901. 135: [
  18902. function (e, t, i) {
  18903. ;(function (i) {
  18904. 'use strict'
  18905. var n = e('../util/logger'),
  18906. r = new n(i),
  18907. o = {
  18908. parseIdsFromChunkName: function (e, t) {
  18909. ;(t.floorId = o.parseFloor(e)), (t.roomId = o.parseRoom(e))
  18910. },
  18911. parseFloor: function (e) {
  18912. var t = e.match(/_group([0-9]+)/)
  18913. if (!t) return 0
  18914. try {
  18915. return parseInt(t[1], 10)
  18916. } catch (e) {
  18917. return (
  18918. r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'), 0
  18919. )
  18920. }
  18921. },
  18922. parseRoom: function (e) {
  18923. var t = e.match(/_sub([0-9]+)/)
  18924. if (!t) return -1
  18925. try {
  18926. return parseInt(t[1], 10)
  18927. } catch (e) {
  18928. return (
  18929. r.warn(
  18930. 'Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'
  18931. ),
  18932. 0
  18933. )
  18934. }
  18935. }
  18936. }
  18937. t.exports = o
  18938. }).call(this, '/js/model/Chunks.js')
  18939. },
  18940. {
  18941. '../util/logger': 189
  18942. }
  18943. ],
  18944. 136: [
  18945. function (e, t, i) {
  18946. ;(function (i) {
  18947. 'use strict'
  18948. function n(e) {
  18949. s.call(this), (this.model = e), (this.exploded = !1)
  18950. }
  18951. var r = e('../objects/Floor'),
  18952. o = (e('../settings'), e('../util/logger')),
  18953. a = e('../util/transitions'),
  18954. s = e('../util/IndexedCollection'),
  18955. l = e('../util/common'),
  18956. c = e('../util/easing')
  18957. new o(i)
  18958. l.inherit(n, s),
  18959. (n.prototype.add = function (e) {
  18960. s.prototype.add.call(this, e), this.model.add(e)
  18961. }),
  18962. (n.prototype.getIndex = function (e) {
  18963. return e.floorIndex
  18964. }),
  18965. (n.prototype.build = function () {
  18966. this.list.forEach(function (e) {
  18967. e.build()
  18968. })
  18969. }),
  18970. (n.prototype.size = function () {
  18971. return this.length
  18972. }),
  18973. (n.prototype.sort = function () {
  18974. s.prototype.sort.call(this, function (e, t) {
  18975. return e.floorIndex - t.floorIndex
  18976. })
  18977. }),
  18978. (n.prototype.nextFloor = function (e, t) {
  18979. return this.index[e.floorIndex + t] || null
  18980. }),
  18981. (n.prototype.getFloorAtPoint = function (e) {
  18982. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  18983. var r = this.list[n],
  18984. o = r.distanceToPoint(e)
  18985. ;(!t || i > o) && ((i = o), (t = r))
  18986. }
  18987. return t
  18988. }),
  18989. (n.prototype.getOrMakeFloor = function (e) {
  18990. var t = this.index[e]
  18991. return t || ((t = new r(this.model, e)), this.add(t)), t
  18992. }),
  18993. (n.prototype.hide = function () {
  18994. this.list.forEach(function (e) {
  18995. e.hide()
  18996. })
  18997. }),
  18998. (n.prototype.show = function () {
  18999. this.list.forEach(function (e) {
  19000. e.show()
  19001. })
  19002. }),
  19003. (n.prototype.names = function () {
  19004. return this.list.reduce(function (e, t) {
  19005. return e.concat(t.name)
  19006. }, [])
  19007. }),
  19008. (n.prototype.toggleExplodeHorizontal = function () {
  19009. function e(e, t) {
  19010. r.copy(e.position),
  19011. (e.position.x = i[e.floorIndex] * t),
  19012. (e.position.y = 1 * e.floorIndex * t),
  19013. r.sub(e.position).multiplyScalar(-1),
  19014. e.panos.forEach(function (e) {
  19015. e.translate(r)
  19016. })
  19017. }
  19018. var t,
  19019. i = [],
  19020. n = 0
  19021. this.list.forEach(function (e, r, o) {
  19022. ;(t =
  19023. r > 0
  19024. ? Math.max(
  19025. o[r - 1].boundingBox.max.x - e.boundingBox.min.x,
  19026. e.boundingBox.size().x / 2
  19027. )
  19028. : 0),
  19029. (n += t),
  19030. (i[r] = n)
  19031. }),
  19032. (i = i.map(function (e) {
  19033. return e - n / 2
  19034. }))
  19035. var r = this.list[0].position.clone()
  19036. this.exploded
  19037. ? this.list.forEach(function (t) {
  19038. a.start(
  19039. function (i) {
  19040. e(t, 1 - i)
  19041. },
  19042. 1500,
  19043. null,
  19044. 0,
  19045. c.easeOutExpo
  19046. )
  19047. })
  19048. : this.list.forEach(function (t) {
  19049. a.start(
  19050. function (i) {
  19051. e(t, i)
  19052. },
  19053. 1500,
  19054. null,
  19055. 0,
  19056. c.easeOutExpo
  19057. )
  19058. }),
  19059. (this.exploded = !this.exploded)
  19060. }),
  19061. (n.prototype.toggleExplodeVertical = function () {
  19062. function e(e, i) {
  19063. var n = n.copy(e.position)
  19064. ;(e.position.y = (5 * e.floorIndex - t.y / 2) * i),
  19065. n.sub(e.position).multiplyScalar(-1),
  19066. e.panos.forEach(function (e) {
  19067. e.translate(n)
  19068. })
  19069. }
  19070. var t = this.model.size
  19071. this.list[0].position.clone()
  19072. this.exploded
  19073. ? this.list.forEach(function (t) {
  19074. a.start(
  19075. function (i) {
  19076. e(t, 1 - i)
  19077. },
  19078. 1500,
  19079. null,
  19080. 0,
  19081. c.easeOutExpo
  19082. )
  19083. })
  19084. : this.list.forEach(function (t) {
  19085. a.start(
  19086. function (i) {
  19087. e(t, i)
  19088. },
  19089. 1500,
  19090. null,
  19091. 0,
  19092. c.easeOutExpo
  19093. )
  19094. }),
  19095. (this.exploded = !this.exploded)
  19096. }),
  19097. (t.exports = n)
  19098. }).call(this, '/js/model/FloorCollection.js')
  19099. },
  19100. {
  19101. '../objects/Floor': 146,
  19102. '../settings': 166,
  19103. '../util/IndexedCollection': 175,
  19104. '../util/common': 185,
  19105. '../util/easing': 186,
  19106. '../util/logger': 189,
  19107. '../util/transitions': 195
  19108. }
  19109. ],
  19110. 137: [
  19111. function (e, t, i) {
  19112. ;(function (i) {
  19113. 'use strict'
  19114. function n() {
  19115. c.call(this)
  19116. }
  19117. var r = e('../settings'),
  19118. o = e('../util/logger'),
  19119. a = e('../enum/Viewmode'),
  19120. s = e('../objects/Snapshot'),
  19121. l = (e('../util/math'), e('../util/common')),
  19122. c = e('../util/IndexedCollection'),
  19123. h = new o(i)
  19124. l.inherit(n, c),
  19125. (n.prototype.getImage = function (e) {
  19126. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  19127. }),
  19128. (n.prototype.filterByModesAndReel = function (e, t) {
  19129. for (var i = [], n = 0; n < t.length; n += 1) {
  19130. var r = t[n],
  19131. o = this.index[r.sid]
  19132. o && i.push(o)
  19133. }
  19134. var s = e[a.DOLLHOUSE],
  19135. l = e[a.FLOORPLAN]
  19136. ;(i = i.filter(function (e) {
  19137. if (!e.metadata || void 0 === e.metadata.camera_mode) return !0
  19138. var t
  19139. try {
  19140. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  19141. } catch (e) {
  19142. return h.debug(e.message), !1
  19143. }
  19144. return t === a.PANORAMA || (t === a.FLOORPLAN && l) || (t === a.DOLLHOUSE && s)
  19145. })),
  19146. i.length !== this.list.length &&
  19147. h.info('Disallowed ' + (this.list.length - i.length) + ' highlight images'),
  19148. (this.list = i),
  19149. this.reIndex()
  19150. }),
  19151. (n.prototype.getHeroLocations = function (panos) {
  19152. //改 增加二级location
  19153. if (0 === this.list.length) return []
  19154. var locations = []
  19155. var deal = (info, container) => {
  19156. var src = info.thumbnail_signed_src,
  19157. o = info.name || ''
  19158. if (info.metadata && void 0 !== info.metadata.camera_quaternion) {
  19159. if (!r.show360Views.enabled && info.metadata.scan_id) {
  19160. let a = panos.get(info.metadata.scan_id)
  19161. if (a && !a.isAligned()) return
  19162. }
  19163. var cameraMode = a.convertWorkshopModeInt(info.metadata.camera_mode)
  19164. if (cameraMode === a.MESH) return
  19165. if (window.isLocal) src = manage.dealURL(src)
  19166. else
  19167. src =
  19168. 'one' === g_version
  19169. ? g_Prefix + src + '?' + randomTime().getTime()
  19170. : src + '?' + randomTime().getTime()
  19171. var l = {
  19172. cameraMode: cameraMode,
  19173. position: info.metadata.camera_position,
  19174. quaternion: info.metadata.camera_quaternion,
  19175. zoom: info.metadata.zoom,
  19176. panoId: info.metadata.scan_id,
  19177. orthoZoom: info.metadata.ortho_zoom,
  19178. floorVisibility:
  19179. void 0 !== info.metadata.floor_visibility
  19180. ? info.metadata.floor_visibility.slice(0)
  19181. : [],
  19182. thumbUrl: src,
  19183. name: n.filterImageName(o),
  19184. sid: info.sid
  19185. }
  19186. var item = new s(l)
  19187. item.momentTour = info.momentTour
  19188. item.dontRot = info.dontRot
  19189. item.rotTime = info.rotTime
  19190. item.musicInfo = info.musicInfo || g_data2.tourAudio[info.sid] || {} //新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  19191. container.push(item)
  19192. return item
  19193. }
  19194. }
  19195. this.list.forEach(image => {
  19196. if (image.images) {
  19197. var folder = $.extend({}, image)
  19198. folder.heroLocations = []
  19199. image.images.list.forEach(child => {
  19200. deal(child, folder.heroLocations)
  19201. })
  19202. folder.musicInfo = folder.musicInfo || {}
  19203. locations.push(folder)
  19204. delete folder.images
  19205. delete folder.locations
  19206. } else {
  19207. var item = deal(image, locations)
  19208. }
  19209. })
  19210. return locations
  19211. }),
  19212. (n.prototype.getIndex = function (e) {
  19213. return e.sid
  19214. }),
  19215. (n.filterImageName = function (e) {
  19216. return '' === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  19217. }),
  19218. (t.exports = n)
  19219. }).call(this, '/js/model/ImageCollection.js')
  19220. },
  19221. {
  19222. '../enum/Viewmode': 51,
  19223. '../objects/Snapshot': 153,
  19224. '../settings': 166,
  19225. '../util/IndexedCollection': 175,
  19226. '../util/common': 185,
  19227. '../util/logger': 189,
  19228. '../util/math': 190
  19229. }
  19230. ],
  19231. 138: [
  19232. function (e, t, i) {
  19233. ;(function (i) {
  19234. 'use strict'
  19235. function n() {
  19236. u.call(this)
  19237. }
  19238. var r = e('../label/Label'),
  19239. o = e('../settings'),
  19240. a = e('../util/logger'),
  19241. s = e('../util/math'),
  19242. l = e('../util/ajax'),
  19243. c = e('./RoomCollection'),
  19244. h = e('../util/common'),
  19245. u = e('../util/IndexedCollection')
  19246. new a(i)
  19247. h.inherit(n, u),
  19248. (n.prototype.getIndex = function (e) {
  19249. return e.labelId
  19250. }),
  19251. (n.prototype.associateWithRooms = function (e) {
  19252. this.forEach(function (t) {
  19253. e.forEach(function (e) {
  19254. e.roomId === t.roomId && (t.room = e)
  19255. })
  19256. })
  19257. }),
  19258. (n.prototype.createFromLabelData = function (e) {
  19259. e.forEach(
  19260. function (e) {
  19261. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId)
  19262. t = c.generateRoomId(e.floorId, t)
  19263. var i = new r(e.sid, e.position || e.positions[0], e.text, e.floorId, t)
  19264. ;(i.position = s.convertWorkshopVector(i.position)), this.add(i), i.build()
  19265. }.bind(this)
  19266. )
  19267. }),
  19268. (n.prototype.load = function (e, t) {
  19269. return l
  19270. .get(e, {
  19271. responseType: 'json',
  19272. auth: t ? o.authorizationHeader : null
  19273. })
  19274. .done(
  19275. function (e) {
  19276. var t = []
  19277. for (var i in e) {
  19278. var n = e[i]
  19279. t.push(n)
  19280. }
  19281. this.createFromLabelData(t)
  19282. }.bind(this)
  19283. )
  19284. }),
  19285. (n.parseRoomIndexFromWorkshopRoomId = function (e) {
  19286. var t = -1
  19287. if (e) {
  19288. if (typeof e == 'number') {
  19289. //add
  19290. t = parseInt(e)
  19291. } else {
  19292. var i = e.split('_')
  19293. t = parseInt(i[0])
  19294. }
  19295. }
  19296. return t
  19297. }),
  19298. (t.exports = n)
  19299. }).call(this, '/js/model/LabelCollection.js')
  19300. },
  19301. {
  19302. '../label/Label': 90,
  19303. '../settings': 166,
  19304. '../util/IndexedCollection': 175,
  19305. '../util/ajax': 181,
  19306. '../util/common': 185,
  19307. '../util/logger': 189,
  19308. '../util/math': 190,
  19309. './RoomCollection': 141
  19310. }
  19311. ],
  19312. 139: [
  19313. function (e, t, i) {
  19314. ;(function (i) {
  19315. 'use strict'
  19316. function n(e, t) {
  19317. o.Object3D.call(this)
  19318. this.sid = window.number //t.sid,
  19319. ;(this.data = t),
  19320. (this.options = e),
  19321. (this.urls = new s(e.urlFiles)),
  19322. (this.isPublic = void 0 !== t.is_public && t.is_public),
  19323. //创建heroLocations
  19324. (this.images = new _(this)),
  19325. this.images.extend(t.images),
  19326. this.images.forEach(info => {
  19327. if (info.locations) {
  19328. info.images = new _(this)
  19329. info.images.extend(info.locations)
  19330. }
  19331. })
  19332. this.heroLocations = []
  19333. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  19334. ;(this.outdoorPanoLocations = []),
  19335. (this.floors = new d(this)),
  19336. (this.floorsEnabled = void 0 === e.floors || e.floors),
  19337. (this.changingFloor = !1),
  19338. (this.chunks = []),
  19339. (this.panos = new A()),
  19340. (this.colliders = []),
  19341. (this.loadPanosPromise = null),
  19342. (this.loadMeshTexturesPromise = null),
  19343. (this.auxDataPromise = null),
  19344. (this.meshTexturesLoaded = !1),
  19345. (this.meshTextures = []),
  19346. (this.tags = {}),
  19347. (this.tagsShown = !1),
  19348. (this.shouldShowtags = !1),
  19349. (this.has360Views = !1),
  19350. (this.showingLabels = f.labels.enabled && t.player_options.labels),
  19351. (this.supportedModes = {}),
  19352. (this.supportedModes[c.PANORAMA] = !0),
  19353. (this.supportedModes[c.DOLLHOUSE] =
  19354. !t.player_options || (t.player_options.dollhouse && w.valueFromHash('dh', 1))),
  19355. (this.supportedModes[c.FLOORPLAN] =
  19356. !t.player_options || (t.player_options.floor_plan && w.valueFromHash('dh', 1))),
  19357. (this.supportedModes[c.TRANSITIONING] = !0),
  19358. (this.supportsTiles = this.configureTiling()),
  19359. // this.supportsVR = t.is_vr,
  19360. (this.supportsVR = window.DATA.supportsVR || false) //true; // 方奕卓 VR功能可配置
  19361. ;(this.mode = c.DOLLHOUSE),
  19362. (this.size = null),
  19363. (this.center = null),
  19364. (this.boundingBox = new o.Box3()),
  19365. (this.currentFloor = null),
  19366. (this.allFloorsVisible = !0),
  19367. (this.projectedPano0 = null),
  19368. (this.projectedPano1 = null),
  19369. this.floorsEnabled &&
  19370. t.floors &&
  19371. t.floors.indexOf(',') !== -1 &&
  19372. t.floors.split(',').forEach(
  19373. function (e, t) {
  19374. this.addFloor(new u(this, t, e.trim()))
  19375. }.bind(this)
  19376. ),
  19377. (this.waitQueue = []),
  19378. this.on(
  19379. 'load',
  19380. function (e) {
  19381. 0 !== this.waitQueue.length &&
  19382. ((this.waitQueue = this.waitQueue.filter(function (e) {
  19383. return !e.isLoadedCallback()
  19384. })),
  19385. 0 === this.waitQueue.length && this.emit('waiting-done'))
  19386. }.bind(this)
  19387. ),
  19388. this.setupCustomProperties()
  19389. this.hots = {}
  19390. }
  19391. function r() {
  19392. try {
  19393. var e = document.createElement('canvas'),
  19394. t = e.getContext('webgl')
  19395. t || (t = e.getContext('experimental-webgl'))
  19396. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  19397. return i
  19398. } catch (e) {
  19399. return 0
  19400. }
  19401. }
  19402. var o = e('three'),
  19403. a = e('../util/ajax'),
  19404. s = e('../util/ModelUrls'),
  19405. l = e('../objects/BoundingTextureSkybox'),
  19406. c = e('../enum/Viewmode'),
  19407. h = e('../enum/RenderOrder'),
  19408. u = (e('../enum/AlignmentType'), e('../objects/Floor')),
  19409. d = e('./FloorCollection'),
  19410. p = e('../objects/Chunk'),
  19411. f =
  19412. (e('../objects/Room'),
  19413. e('../objects/Snapshot'),
  19414. e('../label/Label'),
  19415. e('../util/math'),
  19416. e('../settings')),
  19417. ss = e('../shaders'),
  19418. g = e('../util/logger'),
  19419. m = e('../tag/tag'),
  19420. v = (e('../tag/tagManager'), e('../objects/Panorama')),
  19421. A = e('../util/PanoramaCollection'),
  19422. y = e('../loaders/ModelLoader'),
  19423. C = e('../loaders/ModelTextureLoader'),
  19424. I = e('../loaders/SweepDataLoader'),
  19425. E = e('../util/transitions'),
  19426. b = e('../util/common'),
  19427. es = e('../util/easing'),
  19428. lerp = e('../util/lerp'),
  19429. tex = e('../util/texture'),
  19430. w = e('./../util/browser'),
  19431. _ = e('./ImageCollection'),
  19432. T = e('./RoomCollection'),
  19433. x = e('./LabelCollection'),
  19434. S = e('./Chunks'),
  19435. cameraLight = e('./util/cameraLight'),
  19436. M = e('./../util/showcase'),
  19437. R = e('../exception/BasicException'),
  19438. P = (e('../constants'), e('events').EventEmitter),
  19439. GLCubeFaces = e('../enum/GLCubeFaces'),
  19440. //,Hot = e("hot")
  19441. O = new g(i)
  19442. ;(n.prototype = Object.create(o.Object3D.prototype)),
  19443. b.extend(n, P),
  19444. (n.prototype.setupCustomProperties = function () {
  19445. var e = f.modelAlpha
  19446. Object.defineProperty(this, 'alpha', {
  19447. get: function () {
  19448. return e
  19449. },
  19450. set: function (t) {
  19451. e = t
  19452. //console.log(t)
  19453. this.chunks.forEach(function (chunk) {
  19454. if (chunk.material && chunk.material.uniforms.modelAlpha) {
  19455. chunk.material.uniforms.modelAlpha.value = e
  19456. //修改一下defines,为了在不需要map时不加载map。 by xzw
  19457. /* if (e>0) {
  19458. if (!('useModelMap' in chunk.material.defines)) {
  19459. chunk.material.defines.useModelMap = ''
  19460. chunk.material.needsUpdate = true
  19461. console.log('add useModelMap')
  19462. }
  19463. } else {
  19464. if ('useModelMap' in chunk.material.defines) {
  19465. delete chunk.material.defines.useModelMap
  19466. chunk.material.needsUpdate = true
  19467. chunk.material.uniforms.map.value.dispose() //防止崩溃(但是因为这样飞出要等待时间所以被去掉了)
  19468. console.log('delete useModelMap')
  19469. }
  19470. } */
  19471. }
  19472. })
  19473. }
  19474. })
  19475. }),
  19476. (n.prototype.configureTiling = function () {
  19477. var e = r()
  19478. if (e < 2048) return !1
  19479. O.warn('Max cube texture size: ' + e)
  19480. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  19481. var i = f.tiling.tilingFlagNames[t]
  19482. if ('1' === w.valueFromHash(i, null)) return !0
  19483. if ('0' === w.valueFromHash(i, null)) return !1
  19484. }
  19485. //--------------------------------------------许钟文-------------------------------------------
  19486. //return true;
  19487. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  19488. //--------------------------------------------e n d -------------------------------------------
  19489. }),
  19490. (n.prototype.toggleAlpha = function () {
  19491. this.alpha < 1 ? (this.alpha = 1) : (this.alpha = 0)
  19492. }),
  19493. (n.prototype.load = function (e) {
  19494. var t = function () {
  19495. return $.when(this.loadPanos(), this.loadMesh())
  19496. },
  19497. i = this.urls.init().then(t.bind(this))
  19498. return (
  19499. e
  19500. ? (i = i.then(this.loadMeshTextures.bind(this)))
  19501. : i.then(this.loadMeshTextures.bind(this)),
  19502. (this.auxDataPromise = $.when(
  19503. /*this.loadHighlightReel(), this.loadtags() */ this.loadhots(),
  19504. this.loadLabels()
  19505. )),
  19506. $.when(i, this.auxDataPromise).done(this.build.bind(this))
  19507. ) //不要另外使用active_reel文件
  19508. }),
  19509. (n.prototype.loadMesh = function () {
  19510. function e(e) {
  19511. O.error(e), n.reject('loading-failed')
  19512. }
  19513. function t(e, t) {
  19514. n.notify(e, t)
  19515. }
  19516. function i(e, t) {
  19517. if (0 === e.length) {
  19518. O.warn(
  19519. 'No geometry found for model, loading faux geometry, disabling outside mode'
  19520. ),
  19521. (r.supportedModes[c.DOLLHOUSE] = !1),
  19522. (r.supportedModes[c.FLOORPLAN] = !1)
  19523. var i = new p({
  19524. geometry: new o.PlaneBufferGeometry(5, 5, 1, 1)
  19525. })
  19526. ;(i.material.visible = !1),
  19527. i.rotateX(-Math.PI / 2),
  19528. i.geometry.computeBoundingBox(),
  19529. (e = [i])
  19530. }
  19531. e.forEach(function (e) {
  19532. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0
  19533. r.addChunk(t, e)
  19534. }),
  19535. r.floors.sort(),
  19536. n.resolve(r)
  19537. }
  19538. var n = $.Deferred(),
  19539. r = this
  19540. return y.load(r.data.job.uuid, r.urls, i, t, e), n.promise()
  19541. }),
  19542. (n.prototype.loadMeshTextures = function () {
  19543. return this.loadTexturesPromise
  19544. ? this.loadTexturesPromise
  19545. : ((this.loadTexturesPromise = C.load(this, this.meshTextures).then(
  19546. function () {
  19547. this.meshTexturesLoaded = !0
  19548. }.bind(this)
  19549. )),
  19550. this.loadTexturesPromise)
  19551. }),
  19552. /* n.prototype.loadtags = function() {//xzw改
  19553. var e = $.Deferred();
  19554. if (!f.tags.enabled)
  19555. return e.resolve();
  19556. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  19557. t = "data/" + this.sid + "/tags.json"
  19558. return a.get(t, {
  19559. responseType: "json",
  19560. auth: this.isPublic ? null : f.authorizationHeader
  19561. }).done(function(t) {
  19562. var i = 0
  19563. , n = 0;
  19564. for (var r in t) {
  19565. var o = t[r];
  19566. o.enabled && (n++,
  19567. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  19568. i++))
  19569. }
  19570. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  19571. e.resolve()
  19572. }
  19573. .bind(this)).fail(function() {
  19574. O.warn("Getting tags failed, not displaying tags."),
  19575. e.resolve()
  19576. }),
  19577. e
  19578. } */
  19579. (n.prototype.shineHots = function () {
  19580. //xzw
  19581. E.trigger({
  19582. func: function (e) {
  19583. var opa = e <= 0.5 ? 2 * e : -2 * e + 2
  19584. for (var i in this.hots) {
  19585. this.hots[i].mesh.material.uniforms.opac.value = opa
  19586. }
  19587. }.bind(this),
  19588. cycling: true,
  19589. duration: 3000,
  19590. //easing: "easeInOutQuad",
  19591. name: 'hotShine'
  19592. })
  19593. }),
  19594. /* n.prototype.loadOverlays = function(overlays){
  19595. var overlays = window.data2 && window.data2.overlays
  19596. overlays && overlays.forEach((info)=>{
  19597. new Overlay(info)
  19598. })
  19599. Overlay.load()
  19600. }
  19601. */
  19602. (n.prototype.loadhots = function () {
  19603. //xzw
  19604. initHot(this)
  19605. var r = $.Deferred()
  19606. var t = g_Prefix + 'data/' + this.sid + '/data2.js' + '?' + randomTime().getTime()
  19607. return (
  19608. a
  19609. .get(t, {
  19610. responseType: 'json',
  19611. auth: this.isPublic ? null : f.authorizationHeader
  19612. })
  19613. .done(
  19614. function (e) {
  19615. window.data2 = e
  19616. this.roomLabels = []
  19617. if (!e) {
  19618. console.error('data2 is null')
  19619. } else {
  19620. g_data2 = hotMatcher(e)
  19621. this.hotsCount = 0
  19622. let create = () => {
  19623. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  19624. if (e.hots) {
  19625. var sids = Object.keys(e.hots).sort((a, b) => {
  19626. return e.hots[a].order - e.hots[b].order
  19627. })
  19628. sids.forEach(sid => {
  19629. e.hots[sid].sid = sid
  19630. //if(e.hots[sid].texType == "shine" || e.hots[sid].texType == "photo" ){
  19631. //e.hots[sid].styleImg = []
  19632. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && 'byHot')
  19633. //}
  19634. })
  19635. }
  19636. if (e.overlays) {
  19637. e.overlays.forEach(info => {
  19638. //if(info.file.includes('m/data/762/edit/20210312_112357584.mp4') )return;
  19639. new Hot(info, 'byOverlay')
  19640. })
  19641. }
  19642. Hot.createHotList()
  19643. Hot.startLoad()
  19644. if (DATA.roomLabels) {
  19645. DATA.roomLabels.forEach(data => {
  19646. this.roomLabels.push(new RoomLabel(data))
  19647. })
  19648. }
  19649. }
  19650. if (player.currentPano) {
  19651. create()
  19652. } else {
  19653. let f = () => {
  19654. window.bus.removeEventListener('playerAndModelReady', f)
  19655. create()
  19656. }
  19657. window.bus.addEventListener('playerAndModelReady', f)
  19658. }
  19659. g_index = w.valueFromHash('m')
  19660. }
  19661. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  19662. /* var dataJsPromise = $.Deferred();
  19663. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  19664. a.get(dataJsUrl,{
  19665. responseType: "json",
  19666. auth: this.isPublic ? null : f.authorizationHeader
  19667. }).done(function(data) {
  19668. window.hotData = data;
  19669. this.createHotItem(data, this.hots);
  19670. for(let i in this.hots){//add
  19671. data[i] && this.hots[i].initStyleImg(data[i]);
  19672. }
  19673. dataJsPromise.resolve();
  19674. }.bind(this)).fail(function(){
  19675. console.log('Data.js is empty');
  19676. dataJsPromise.resolve();
  19677. }) */
  19678. r.resolve()
  19679. }.bind(this)
  19680. )
  19681. .fail(function () {
  19682. console.log('没有热点')
  19683. r.resolve()
  19684. }),
  19685. r
  19686. )
  19687. }),
  19688. (n.prototype.loadPanos = function () {
  19689. if (this.loadPanosPromise) return this.loadPanosPromise
  19690. var e = new I(this)
  19691. return (
  19692. (this.loadPanosPromise = e.load().then(
  19693. function (e) {
  19694. return (
  19695. this.data.sweeps &&
  19696. Object.keys(this.data.sweeps).length > 0 &&
  19697. (e = e.filter(
  19698. function (e) {
  19699. if (this.data.sweeps[e.uuid]) return this.data.sweeps[e.uuid].enabled
  19700. else console.log(e.uuid)
  19701. }.bind(this)
  19702. )),
  19703. this.panos.extend(
  19704. e.map(
  19705. function (e) {
  19706. return new v(this, e.uuid, e, this.supportsTiles)
  19707. }.bind(this)
  19708. )
  19709. ),
  19710. this.panos.forEach(
  19711. function (e) {
  19712. e.neighbourUUIDs &&
  19713. (e.neighbourUUIDs.forEach(
  19714. function (t) {
  19715. var i = this.panos.get(t)
  19716. i && this.panos.setNeighbour(e, i, !0)
  19717. }.bind(this)
  19718. ),
  19719. (e.neighbourPanos =
  19720. this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0)))
  19721. }.bind(this)
  19722. ),
  19723. 0 === this.panos.length &&
  19724. (O.warn('Model has no panos, turning off inside mode'),
  19725. (this.supportedModes[c.PANORAMA] = !1)),
  19726. $.when(this)
  19727. )
  19728. }.bind(this)
  19729. )),
  19730. this.loadPanosPromise
  19731. )
  19732. }),
  19733. (n.prototype.loadHighlightReel = function () {
  19734. //xzw
  19735. var e = $.Deferred(),
  19736. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  19737. t = this.options.urlBase + 'data/' + this.sid + '/active_reel.json'
  19738. return (
  19739. a
  19740. .get(t, {
  19741. responseType: 'json',
  19742. auth: this.isPublic ? null : f.authorizationHeader
  19743. })
  19744. .done(
  19745. function (t) {
  19746. t.reel
  19747. ? (O.info('Got highlight reel with ' + t.reel.length + ' items'),
  19748. this.images.filterByModesAndReel(this.supportedModes, t.reel))
  19749. : O.info('No highlight reel found'),
  19750. e.resolve()
  19751. }.bind(this)
  19752. )
  19753. .fail(function () {
  19754. O.warn('Getting highlight reel failed, no highlights available'), e.resolve()
  19755. }),
  19756. e
  19757. )
  19758. }),
  19759. (n.prototype.waitForLoad = function (e, t) {
  19760. t() ||
  19761. (this.waitQueue.push({
  19762. object: e,
  19763. isLoadedCallback: t
  19764. }),
  19765. 1 === this.waitQueue.length && this.emit('waiting'))
  19766. }),
  19767. (n.prototype.hide = function () {
  19768. this.floors.hide()
  19769. }),
  19770. (n.prototype.show = function () {
  19771. this.floors.show()
  19772. }),
  19773. (n.prototype.floorNames = function () {
  19774. return this.floors.names()
  19775. }),
  19776. (n.prototype.warpDestFloors = function (e, t) {
  19777. if (!e || this.floors.length !== e.length) return void this.toggleAllFloors(!0)
  19778. var i = e.findIndex(
  19779. function (e) {
  19780. return e
  19781. }.bind(this)
  19782. )
  19783. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  19784. }),
  19785. (n.prototype.setFloor = function (e, t, i) {
  19786. this.allFloorsVisible && this.emit('allfloors.toggled', !1, this.currentFloor),
  19787. (this.allFloorsVisible = !1),
  19788. this._setFloor(e, t, i)
  19789. }),
  19790. (n.prototype.toggleAllFloors = function (e) {
  19791. ;(this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible),
  19792. this.emit('allfloors.toggled', this.allFloorsVisible, this.currentFloor),
  19793. this._setFloor(this.currentFloor)
  19794. }),
  19795. (n.prototype._setFloor = function (e, t, i) {
  19796. ;(t = t || this.mode),
  19797. this.emit('floor.changed', e, t, this.currentFloor),
  19798. (this.currentFloor = e)
  19799. var n
  19800. if (t === c.PANORAMA) {
  19801. if ((this.show(), this.shouldShowtags && this.tagsShown))
  19802. for (n in this.tags) this.tags[n].show(f.showFloorDuration)
  19803. } else if (
  19804. (t === c.FLOORPLAN || t === c.DOLLHOUSE) &&
  19805. (this.floors.list.forEach(
  19806. function (e, t) {
  19807. e.toggle(
  19808. e === this.currentFloor || this.allFloorsVisible,
  19809. i || this.allFloorsVisible
  19810. )
  19811. }.bind(this)
  19812. ),
  19813. this.shouldShowtags && this.tagsShown)
  19814. )
  19815. for (n in this.tags) {
  19816. var r = this.tags[n]
  19817. this.allFloorsVisible
  19818. ? r.show(f.showFloorDuration)
  19819. : r.floor === this.currentFloor
  19820. ? r.show(f.showFloorDuration, f.showFloorDelay)
  19821. : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  19822. }
  19823. var o = this,
  19824. a = e
  19825. E.start(
  19826. function () {},
  19827. f.showFloorDelay,
  19828. function () {
  19829. o.floors.forEach(function (e) {
  19830. e.chunks.forEach(function (t) {
  19831. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  19832. })
  19833. })
  19834. }.bind(this)
  19835. )
  19836. }),
  19837. (n.prototype.toggleExplode = function () {
  19838. this.floors.toggleExplodeHorizontal()
  19839. }),
  19840. (n.prototype.toggleExplodeUp = function () {
  19841. this.floors.toggleExplodeVertical()
  19842. }),
  19843. (n.prototype.nextFloor = function (e) {
  19844. return this.floors.nextFloor(this.currentFloor, e)
  19845. }),
  19846. (n.prototype.addFloor = function (e) {
  19847. this.floors.add(e)
  19848. }),
  19849. (n.prototype.getFloorAtPoint = function (e) {
  19850. return this.floors.getFloorAtPoint(e)
  19851. }),
  19852. (n.prototype.getTagBySid = function (e) {
  19853. return this.tags[e]
  19854. }),
  19855. (n.prototype.addChunk = function (e, t) {
  19856. this.floors.getOrMakeFloor(e).addChunk(t), this.chunks.push(t)
  19857. }),
  19858. (n.prototype.setMode = function (e) {
  19859. if (!this.supportedModes[e]) throw new R('Mode not supported for this model: ' + e)
  19860. this.mode = e
  19861. this.skybox.material.transparent = e == 'panorama' ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  19862. this.chunks.forEach(function (t) {
  19863. t.setMode(e)
  19864. })
  19865. }),
  19866. (n.prototype.build = function () {
  19867. this.heroLocations = this.images.getHeroLocations(this.panos)
  19868. var e = function () {
  19869. return (
  19870. !!(
  19871. this.heroImage &&
  19872. this.heroImage.metadata &&
  19873. this.heroImage.metadata.scan_id &&
  19874. this.panos.get(this.heroImage.metadata.scan_id)
  19875. ) && !this.panos.get(this.heroImage.metadata.scan_id).isAligned()
  19876. )
  19877. }.bind(this)()
  19878. ;(this.has360Views =
  19879. (f.show360Views.enabled &&
  19880. this.heroLocations.some(
  19881. function (e) {
  19882. return (
  19883. e.cameraMode === c.PANORAMA &&
  19884. this.panos.get(e.panoId) &&
  19885. !this.panos.get(e.panoId).isAligned()
  19886. )
  19887. }.bind(this)
  19888. )) ||
  19889. e),
  19890. null === this.heroImage && O.warn('No hero image defined.'),
  19891. (this.currentFloor = this.floors.last()),
  19892. this.floors.build(),
  19893. (this.colliders = this.floors.reduce(function (e, t) {
  19894. return e.concat(t.collider.children)
  19895. }, [])),
  19896. this.panos.forEach(
  19897. function (e) {
  19898. e.build1(),
  19899. e.on(
  19900. 'enter',
  19901. function () {
  19902. e.floor !== this.currentFloor && this.setFloor(e.floor)
  19903. }.bind(this)
  19904. )
  19905. }.bind(this)
  19906. )
  19907. //有很多场景的floorPosition在地面之下,导致marker看不到,所以探测一下
  19908. let time1 = performance.now()
  19909. let downVec = new THREE.Vector3(0, -1, 0)
  19910. this.panos.forEach(pano => {
  19911. player.raycaster.set(pano.position, downVec)
  19912. let collider = pano.floor.collider.children
  19913. let n = player.raycaster.intersectObjects(collider, true) //add true
  19914. if (n && n[0]) {
  19915. if (n[0].point.y - pano.floorPosition.y > 0.03) {
  19916. //console.error(`${pano.id}, 探测高度${n[0].point.y.toPrecision(5)} 原高度 ${pano.floorPosition.y.toPrecision(5)}, 相差 ${(n[0].point.y - pano.floorPosition.y).toPrecision(5)}`)
  19917. pano.originFloorY = pano.floorPosition.y
  19918. pano.floorPosition.y = n[0].point.y
  19919. }
  19920. }
  19921. //是否需要排除一下相差过高的?因为可能探测到的是长椅这样的
  19922. })
  19923. let time2 = performance.now()
  19924. console.log('探测时间', time2 - time1)
  19925. this.panos.forEach(function (e) {
  19926. e.build2()
  19927. }),
  19928. this.floors.forEach(
  19929. function (e) {
  19930. this.boundingBox.union(e.boundingBox)
  19931. }.bind(this)
  19932. ),
  19933. (this.size = this.boundingBox.size()),
  19934. (this.center = this.boundingBox.center()),
  19935. this.floors.forEach(
  19936. function (e) {
  19937. O.info(
  19938. 'Floor ' +
  19939. e +
  19940. ': ' +
  19941. e.children.length +
  19942. ' chunks, ' +
  19943. e.panos.length +
  19944. ' panos.'
  19945. )
  19946. }.bind(this)
  19947. ),
  19948. this.panos.populate_path_graph(),
  19949. (this.skybox = new l(this.boundingBox)),
  19950. (this.skybox.matrixWorldNeedsUpdate = !0),
  19951. this.add(this.skybox)
  19952. /* setTimeout(function() {
  19953. //this.hotsCount && this.shineHots()
  19954. Hot.beginShineHot()
  19955. }
  19956. .bind(this), 1300) */
  19957. //add-----
  19958. {
  19959. let maxCount = browser.isMobile() ? 200000 : 400000
  19960. let noVisiHots = this.hotGroup.children.filter(
  19961. e => !e.info.visiblePanos && e.info.texType != 'shine'
  19962. ) //只看非热点的,否则数据太多
  19963. let visiHots = this.hotGroup.children.filter(e => e.info.visiblePanos)
  19964. let c = this.panos.list.length * this.colliders.length * noVisiHots.length
  19965. if (c > maxCount) {
  19966. //防止加载时间过长,分批计算
  19967. console.log('hot分批setVisiblePanos')
  19968. Hot.visiPanosCountSlice = Math.ceil(
  19969. maxCount / this.colliders.length / noVisiHots.length
  19970. )
  19971. Hot.visiEveryDurSlice = browser.isMobile() ? 25 : 16
  19972. let dur =
  19973. Math.ceil(this.panos.list.length / Hot.visiPanosCountSlice) *
  19974. Hot.visiEveryDurSlice
  19975. console.log(
  19976. Hot.visiPanosCountSlice,
  19977. Hot.visiEveryDurSlice,
  19978. dur,
  19979. Math.round(dur * noVisiHots.length)
  19980. )
  19981. if (noVisiHots.length) {
  19982. let i = 0
  19983. let hotVisiInterval = setInterval(() => {
  19984. noVisiHots[i].setVisiblePanos(noVisiHots[i].info.visiblePanos)
  19985. i++
  19986. if (i >= noVisiHots.length) {
  19987. clearInterval(hotVisiInterval)
  19988. }
  19989. }, dur)
  19990. }
  19991. }
  19992. }
  19993. //---------
  19994. this.createFloorLogo()
  19995. return (
  19996. O.debug('Done building model'),
  19997. v.raycastsDone > 0 &&
  19998. (O.warn('raycasts: ' + v.raycastsDone),
  19999. O.warn('raycasts skipped: ' + v.raycastsSkipped)),
  20000. this.buildRooms(),
  20001. this.labels.associateWithRooms(this.rooms),
  20002. $.when(this)
  20003. )
  20004. }),
  20005. (n.prototype.createFloorLogo = function () {
  20006. console.log('createFloorLogo')
  20007. if (this.floorLogos || !settings.floorlogoURL) return
  20008. var url = settings.floorlogoURL
  20009. var map = tex.load(url) //可以追加done
  20010. this.floorLogos = []
  20011. for (var i = 0; i < 2; i++) {
  20012. //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  20013. var material = new o.MeshBasicMaterial({
  20014. opacity: 0,
  20015. map: map,
  20016. side: o.DoubleSide,
  20017. transparent: !0,
  20018. depthWrite: !1,
  20019. depthTest: false //改 在chunk\skybox外也可看到
  20020. })
  20021. var logo = new o.Mesh(new o.PlaneGeometry(2, 2, 1, 1), material)
  20022. //var s = (Store.metadata.floorLogoSize || 100)/100;
  20023. //logo.scale.set(s,s,s);
  20024. logo.position.set(0, -1.5, 0)
  20025. logo.lookAt(logo.position.clone().add(new o.Vector3(0, 1, 0)))
  20026. logo.renderOrder = 100 //cover the videoSkybox
  20027. //logo.layers.set(0)
  20028. this.add(logo)
  20029. this.floorLogos.push(logo)
  20030. }
  20031. this.floorLogos[1].visible = false
  20032. })
  20033. ;(n.prototype.adjustfloorLogoHeight = function (o) {
  20034. var h = player.currentPano.floorPosition.y + 0.01
  20035. this.floorLogos[1].position.setY(h)
  20036. this.floorLogos[0].position.setY(h)
  20037. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  20038. }),
  20039. (n.prototype.changefloorLogoOpa = function (o) {
  20040. //改 i, opacity, time, delay
  20041. if (!this.floorLogos) return
  20042. E.cancelById('flOpa_' + o.index) //先停止之前该logo的透明度变化
  20043. if (o.from != void 0) this.floorLogos[o.index].material.opacity = o.from //初始透明度
  20044. if (!o.dur) {
  20045. //立刻
  20046. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  20047. this.floorLogos[o.index].material.opacity = o.opa
  20048. } else {
  20049. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  20050. E.start(
  20051. lerp.property(this.floorLogos[o.index].material, 'opacity', o.opa),
  20052. o.dur || 0,
  20053. null,
  20054. o.delay || 0,
  20055. es['easeInQuad'],
  20056. 'changefloorLogoOpa',
  20057. 'flOpa_' + o.index
  20058. )
  20059. }
  20060. }),
  20061. (n.prototype.updateFloorlogo = (function () {
  20062. //xzw add 更新地标的旋转
  20063. var lastQ, lastP
  20064. var equals = function (v1, v2, min) {
  20065. return Math.abs(v1 - v2) < min
  20066. }
  20067. var isSame = function (now, last, k) {
  20068. //如果和上次相同就不改变
  20069. if (!last) return false
  20070. var R = k.sceneRenderer
  20071. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  20072. //暂时:
  20073. var min = 0.0008
  20074. var same =
  20075. equals(now.x, last.x, min) &&
  20076. equals(now.y, last.y, min) &&
  20077. equals(now.z, last.z, min) &&
  20078. (now.w != void 0 ? equals(now.w, last.w, min) : true)
  20079. return same
  20080. }
  20081. return function (Q, k) {
  20082. if (!Q) return
  20083. /* if(Config.ifFish && window.lowFPS){
  20084. this.fLCompute++;
  20085. if(R.AFPS < 38){
  20086. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  20087. else if(k.flying && k.fLCompute%2 !=1) return;
  20088. k.fLCompute %= 4;
  20089. }else if(R.AFPS < 45){
  20090. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  20091. else if(k.flying && k.fLCompute%2 !=1) return;
  20092. k.fLCompute %= 6;
  20093. }else{
  20094. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  20095. //else if(k.flying && k.fLCompute%2 !=1) return;
  20096. k.fLCompute %= 2;
  20097. }
  20098. } */
  20099. var sameQ, sameP, quaternion, visible
  20100. for (var i = 0; i < 2; i++) {
  20101. var logo = this.floorLogos[i]
  20102. if (!logo.visible || logo.material.uniforms.opacity.value == 0) continue
  20103. visible = true
  20104. }
  20105. if (!visible) return //如果两个都不可见,就不更改,如果有一个可见,就都改
  20106. var c = k.cameraControls.activeControl
  20107. var sameQ = c
  20108. ? c.lat < 10
  20109. ? equals(c.lon, lastQ, 0.1)
  20110. : equals(c.lon, lastQ, 1)
  20111. : false
  20112. sameQ || (lastQ = c ? c.lon : null) //相机旋转是否改变了
  20113. for (var i = 0; i < 2; i++) {
  20114. var logo = this.floorLogos[i]
  20115. if (!sameQ) {
  20116. if (!quaternion) {
  20117. var a = new THREE.Vector3(0, 0, -1)
  20118. a.applyQuaternion(Q)
  20119. a.setY(0)
  20120. var _ = new THREE.Matrix4().lookAt(
  20121. a,
  20122. new THREE.Vector3(),
  20123. new THREE.Vector3(0, 1, 0)
  20124. )
  20125. quaternion = new THREE.Quaternion().setFromRotationMatrix(_)
  20126. var a = new THREE.Quaternion(0, 0.7071067811865476, 0.7071067811865476, 0) //计算得
  20127. quaternion.multiply(a)
  20128. }
  20129. logo.quaternion.copy(quaternion)
  20130. }
  20131. }
  20132. }
  20133. })())
  20134. ;(n.prototype.loadLabels = function () {
  20135. //xzw
  20136. this.labels = new x(this)
  20137. var e = $.Deferred()
  20138. //加载俯视图的标签 注释这个备注就会加载
  20139. //原先是labels, 改为showLabels,因为之前的somedata写的labels都是true
  20140. window.DATA.showingLabels ? (this.showingLabels = true) : ''
  20141. if (!this.showingLabels) return e.resolve()
  20142. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  20143. var t = g_Prefix + 'data/' + this.sid + '/labels.json'
  20144. return (
  20145. this.labels
  20146. .load(t, !this.isPublic)
  20147. .done(e.resolve.bind(e))
  20148. .fail(function () {
  20149. O.warn('Getting labels failed, not displaying labels.'), e.resolve()
  20150. }),
  20151. e
  20152. )
  20153. }),
  20154. (n.prototype.buildRooms = function () {
  20155. ;(this.rooms = new T(this)),
  20156. this.rooms.createFromChunks(this.chunks),
  20157. this.rooms.calcRoomBoundaries()
  20158. }),
  20159. (n.prototype.updateProjectedPanos = function () {
  20160. this.projectedPano0 &&
  20161. this.projectedPano1 &&
  20162. this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  20163. }),
  20164. (n.prototype.setProjectedPanos = function (e, t, i) {
  20165. ;(void 0 !== i && null !== i) || (i = !0),
  20166. (i = !!i),
  20167. (this.projectedPano0 = e),
  20168. (this.projectedPano1 = t),
  20169. this.skybox.material.setProjectedPanos(e, t, i),
  20170. this.chunks.forEach(function (n) {
  20171. n.materialInside.setProjectedPanos(e, t, i)
  20172. })
  20173. }),
  20174. (n.prototype.setSide = function (e) {
  20175. this.floors.forEach(function (t) {
  20176. t.collider.material.side = e
  20177. })
  20178. }),
  20179. (n.prototype.heroCount = function () {
  20180. return this.heroLocations ? this.heroLocations.length : 0
  20181. }),
  20182. (n.prototype.getHeroDescriptorByIndex = function (e = []) {
  20183. //改 因增加了二级目录
  20184. if (e[0] < 0)
  20185. return (
  20186. O.warn('Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0.'), null
  20187. )
  20188. if (this.heroCount() < 1)
  20189. return (
  20190. O.warn('Model.getHeroDescriptorByIndex() -> No hero locations in this model'),
  20191. null
  20192. )
  20193. var t = this.heroLocations[e[0]]
  20194. if (t.heroLocations && e[1] != void 0) {
  20195. t = t.heroLocations[e[1]]
  20196. }
  20197. return void 0 === t
  20198. ? (O.warn(
  20199. 'Model.getHeroDescriptorByIndex() -> Index ' + e + ' is not a validindex'
  20200. ),
  20201. null)
  20202. : t
  20203. }),
  20204. (n.prototype.findPanoramicHero = function () {
  20205. for (var e in this.heroLocations)
  20206. if (this.heroLocations[e].cameraMode === c.PANORAMA) return this.heroLocations[e]
  20207. return null
  20208. }),
  20209. (n.prototype.listImagePanos = function () {
  20210. var e = [],
  20211. t = this
  20212. return (
  20213. this.images.forEach(function (i) {
  20214. if (i.metadata && i.metadata.scan_id) {
  20215. var n = t.panos.get(i.metadata.scan_id)
  20216. n && (t.supportsTiles || n.isLoaded('high') || e.push(n))
  20217. }
  20218. }),
  20219. e
  20220. )
  20221. }),
  20222. (n.prototype.fadePanoMarkers = function (/* e, t */ opacity, dur, o = {}) {
  20223. //改
  20224. //this.panos.fadeMarkerOpacity(e, t)
  20225. if (window.DATA.hideFloorMarker) return
  20226. var currentPano = player.currentPano
  20227. opacity = void 0 == opacity ? _settings.panorama.markerOpacity : opacity //不传opacity代表显示
  20228. var hideWhenFlyOut = () => {
  20229. var shows = [],
  20230. hides = []
  20231. player.model.panos.forEach(pano => {
  20232. hides.push(pano)
  20233. })
  20234. this.panos.fadeMarkerOpacity(0, dur, [{ toOp: 0, member: hides }])
  20235. }
  20236. if (opacity == 0) {
  20237. hideWhenFlyOut()
  20238. } else {
  20239. if (player.mode == 'panorama' && currentPano) {
  20240. var shows = [],
  20241. hides = []
  20242. player.model.panos.forEach(pano => {
  20243. //是邻近点就显示否则隐藏
  20244. if (currentPano.neighbourPanos[pano.id]) {
  20245. shows.push(pano)
  20246. } else {
  20247. hides.push(pano)
  20248. }
  20249. })
  20250. this.panos.fadeMarkerOpacity(opacity, dur, [
  20251. { toOp: opacity, member: shows },
  20252. { toOp: 0, member: hides }
  20253. ])
  20254. } else if (player.modeTran.split('-')[1] != 'panorama') {
  20255. //飞出后marker隐藏
  20256. hideWhenFlyOut()
  20257. }
  20258. }
  20259. }),
  20260. (n.prototype.setSweepVisibility = function (e) {
  20261. this.panos.forEach(function (t) {
  20262. t.marker && (t.marker.visible = e)
  20263. })
  20264. }),
  20265. (n.prototype.outsideAllowed = function () {
  20266. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  20267. }),
  20268. (n.prototype.addHighMapCube = function () {
  20269. //创建8*8的tile cube
  20270. if (
  20271. player.qualityManager.getMaxZoomClass() == '4k' &&
  20272. player.qualityManager.maxRenderTargetSize == 2048
  20273. ) {
  20274. var geo = new THREE.PlaneGeometry(1, 1, 1, 1)
  20275. var cube = new THREE.Object3D()
  20276. cube.tiles = []
  20277. for (var cubeIndex = 0; cubeIndex < 6; cubeIndex++) {
  20278. var face = new THREE.Object3D()
  20279. for (var i = 0; i < 8; i++) {
  20280. for (var j = 0; j < 8; j++) {
  20281. var tile = new THREE.Mesh(geo, new THREE.MeshBasicMaterial({ side: 2 }))
  20282. tile.position.set(i - 3.5, j - 3.5, -4)
  20283. if (highMapAddColor) {
  20284. tile.material.opacity = 0.4
  20285. var colorHue = Math.random()
  20286. tile.material.color = new THREE.Color().setHSL(colorHue, 0.6, 0.9)
  20287. }
  20288. tile.material.transparent = true
  20289. tile.material.depthTest /* = tile.material.depthWrite */ = false //防止chunk比cube近从而被遮 且能不遮住box视频和热点等
  20290. tile.visible = false
  20291. tile.tileX = i
  20292. tile.tileY = j
  20293. tile.cubeFace = cubeIndex
  20294. tile.renderOrder = 2 //RenderOrder.highTileCube
  20295. cube.tiles.push(tile)
  20296. face.add(tile)
  20297. }
  20298. }
  20299. switch (cubeIndex) {
  20300. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  20301. face.rotation.set(0, Math.PI / 2, 0)
  20302. break
  20303. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  20304. face.rotation.set(0, -Math.PI / 2, 0)
  20305. break
  20306. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  20307. var rot1 = new THREE.Quaternion().setFromAxisAngle(
  20308. new THREE.Vector3(0, 1, 0),
  20309. Math.PI
  20310. )
  20311. var rot2 = new THREE.Quaternion().setFromAxisAngle(
  20312. new THREE.Vector3(1, 0, 0),
  20313. Math.PI / 2
  20314. )
  20315. face.quaternion.copy(rot1).multiply(rot2)
  20316. //face.rotation.set(Math.PI/2,0,0);
  20317. break
  20318. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  20319. //face.rotation.set(-Math.PI/2,0,0);
  20320. var rot1 = new THREE.Quaternion().setFromAxisAngle(
  20321. new THREE.Vector3(0, 1, 0),
  20322. Math.PI
  20323. )
  20324. var rot2 = new THREE.Quaternion().setFromAxisAngle(
  20325. new THREE.Vector3(1, 0, 0),
  20326. -Math.PI / 2
  20327. )
  20328. face.quaternion.copy(rot1).multiply(rot2)
  20329. break
  20330. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  20331. face.rotation.set(0, Math.PI, 0)
  20332. break
  20333. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  20334. face.rotation.set(0, 0, 0)
  20335. }
  20336. face.scale.set(1, -1, 1)
  20337. cube.add(face)
  20338. }
  20339. cube.name = 'highMapCube'
  20340. this.highMapCube = cube
  20341. this.add(cube)
  20342. cube.scale.set(0.21, 0.21, 0.21) //camera.near is 0.1
  20343. this.highMapCube.visible = false
  20344. this.highMapCube.texLoadedCount = 0
  20345. player.once('pano.chosen', () => {
  20346. //wait sceneRenderer
  20347. player.sceneRenderer.on('after-render', e => {
  20348. if (this.highMapCube.visibleTiles) {
  20349. this.updateTiles()
  20350. }
  20351. if (player && player.lastFrameChanged) {
  20352. common.intervalTool.isWaiting(
  20353. 'update4kTiles',
  20354. () => {
  20355. let vectorForward = player.getDirection()
  20356. this.updateTiles(vectorForward)
  20357. },
  20358. 500
  20359. )
  20360. }
  20361. })
  20362. })
  20363. }
  20364. })
  20365. /*
  20366. highMapCube会遮住场景中所有物体, 如果一定要显示的话,只能类似potree中的那样渲染一个深度贴图出来(model无需贴图),然后其他所有物体的shader中都加入一段代码。(貌似本身已经支持了?)
  20367. */
  20368. n.prototype.isHighMapLoaded = function (cubeFace, tileX, tileY) {
  20369. var tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  20370. return !!tile.material.map
  20371. }
  20372. n.prototype.updateTiles = function (direction) {
  20373. if (!this.highMapCube || !this.highMapCube.visible) return
  20374. if (this.highMapCube.tiles.filter(e => e.image).length <= 10) return //加载的太少了
  20375. //performance.mark('updateTiles-start')
  20376. if (direction) {
  20377. let camera = player.cameraControls.cameras.panorama
  20378. let hfov =
  20379. THREE.Math.degToRad(
  20380. cameraLight.getHFOVForCamera(camera, $('#player').width(), $('#player').height())
  20381. ) / 2
  20382. let vfov = THREE.Math.degToRad(camera.fov) / 2
  20383. /* let hcos = Math.cos(hfov / 2)
  20384. let vcos = Math.cos(vfov / 2) */
  20385. let list = this.highMapCube.tiles
  20386. list.forEach(e => {
  20387. //屏幕外的不显示
  20388. let pos = e.getWorldPosition(new THREE.Vector3())
  20389. let dir = new THREE.Vector3().subVectors(pos, this.highMapCube.position).normalize()
  20390. let hcos_ = dir.clone().setY(direction.y).normalize().dot(direction) //在direction的斜面上水平角度差
  20391. let hRad = Math.acos(hcos_)
  20392. let vRad = -200
  20393. if (hRad > hfov + 0.08) {
  20394. e.score = -100
  20395. } else {
  20396. vRad = Math.abs(Math.acos(dir.y) - Math.acos(direction.y))
  20397. if (vRad > vfov + 0.08) {
  20398. e.score = -100
  20399. } else {
  20400. e.score = -(hRad / hfov + vRad / vfov)
  20401. }
  20402. }
  20403. e.scores = hRad.toFixed(3) + ', ' + vRad.toFixed(3)
  20404. if (e.score == -100) {
  20405. this.resetTile(e)
  20406. }
  20407. })
  20408. this.highMapCube.visibleTiles = list.filter(e => e.score > -100)
  20409. /* this.highMapCube.visibleTiles.sort((e,b)=>{return e.score-b.score})
  20410. this.highMapCube.visibleTiles = this.highMapCube.visibleTiles.slice(0,10)
  20411. */
  20412. //list.forEach(e=>e.scoreLabel.setText(e.scores))
  20413. }
  20414. let needRecover = this.highMapCube.visibleTiles.filter(e => !e.material.map)
  20415. if (needRecover.length) {
  20416. let maxCount = 1 //common.getBestCount({ name: '4kmaxTileRecover', minCount: 0, maxCount: 2, durBound1: 1.5, durBound2: 6, ifLog: false, maxHistory: 2 })
  20417. let count = 0
  20418. needRecover.forEach((e, i) => {
  20419. //只更新若干个,因为太耗时了, 其余的等下帧更新
  20420. if (count >= maxCount) return
  20421. let r = this.recoverTile(e)
  20422. if (r) count++
  20423. })
  20424. }
  20425. }
  20426. n.prototype.getHighImage = function (image, cubeFace, tileX, tileY) {
  20427. this.gotSomeHighImg = true //标记,需要马上updateTiles
  20428. let tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  20429. tile.image = image //先记录下来
  20430. }
  20431. n.prototype.updateHighMap = function (image, cubeFace, tileX, tileY) {
  20432. let tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  20433. if (image) tile.image = image //先记录下来
  20434. if (tile.material.map) return
  20435. if (this.highMapCube.visibleTiles && !this.highMapCube.visibleTiles.includes(tile)) {
  20436. return
  20437. }
  20438. //简易创建贴图
  20439. /* var tex = this.$app.core.get('SceneRenderer').initSizedTexture2D(512, THREE.ClampToEdgeWrapping)
  20440. //var loaded = this.$app.core.get('Player').model.isHighMapLoaded(tile.cubeFace, tile.tileX, tile.tileY)
  20441. this.$app.core.get('SceneRenderer').uploadTexture2D(image, tex, 0, 0, 512, 512) //只替换tex对应的img,不新建
  20442. */
  20443. var tex = new THREE.Texture()
  20444. tex.image = image
  20445. tex.flipY = false
  20446. tex.wrapS = tex.wrapT = THREE.ClampToEdgeWrapping
  20447. tex.generateMipmaps = false
  20448. tex.minFilter = THREE.LinearFilter
  20449. tex.needsUpdate = true
  20450. tile.material.map = tex
  20451. if (highMapAddColor) {
  20452. tile.material.opacity = 1
  20453. }
  20454. tile.visible = true
  20455. tile.material.needsUpdate = true //发现每次开始放大但还未放大到4k时也会把之前加载过的4k加载
  20456. //console.log( {level:1} , 'updateHighMap', cubeFace, tileX, tileY)
  20457. }
  20458. n.prototype.recoverTile = function (tile) {
  20459. if (tile.material.map) return
  20460. if (tile.image) {
  20461. this.updateHighMap(tile.image, tile.cubeFace, tile.tileX, tile.tileY)
  20462. return true
  20463. } else {
  20464. //console.log('no image')
  20465. }
  20466. }
  20467. n.prototype.resetTile = function (tile, kill) {
  20468. if (kill) {
  20469. //完全消灭
  20470. tile.image = null
  20471. }
  20472. let map = tile.material.map
  20473. if (map) {
  20474. map.dispose() //这句其实无效。本来可以使用three自带的deallocateTexture(texture),但因为创建的方式不是普通的new Texture,所以并没有onTextureDispose的侦听,故要自己写
  20475. map.loaded = !1
  20476. map.version = 0
  20477. //这两句才是真正释放贴图资源的 ,类似app.sceneRenderer.deallocateCubeTexture(tile.material.map)
  20478. var h = player.sceneRenderer.renderer.properties.get(map)
  20479. player.sceneRenderer.renderer.getContext().deleteTexture(h.__webglTexture)
  20480. tile.material.map = null
  20481. if (highMapAddColor) {
  20482. tile.material.opacity = 0.4
  20483. }
  20484. tile.material.needsUpdate = true
  20485. tile.visible = false
  20486. //this.highMapCube.texLoadedCount --
  20487. //console.log({level:1},'resetTile'/* , tile.cubeFace, tile.tileX, tile.tileY */)
  20488. }
  20489. }
  20490. n.prototype.resetHighMap = function () {
  20491. if (!this.highMapCube) return
  20492. this.highMapCube.children.forEach(e =>
  20493. e.children.forEach(tile => {
  20494. this.resetTile(tile, true)
  20495. })
  20496. )
  20497. //this.highMapCube.texLoadedCount = 0
  20498. this.highMapCube.visibleTiles = null
  20499. this.hideHighMap()
  20500. }
  20501. n.prototype.setHighMap = function (pano) {
  20502. if (!this.highMapCube) return
  20503. this.highMapCube.position.copy(pano.position)
  20504. this.highMapCube.quaternion.copy(pano.quaternion)
  20505. }
  20506. n.prototype.showHighMap = function () {
  20507. if (!this.highMapCube) return
  20508. this.highMapCube.visible = true
  20509. }
  20510. n.prototype.hideHighMap = function () {
  20511. if (!this.highMapCube) return
  20512. this.highMapCube.visible = false
  20513. }
  20514. //缩小后继续显示cube呢还是不显示? 不显示的话,就要把cube上的复制到renderTarget上……会不会又崩溃,or没加载的显示???
  20515. t.exports = n
  20516. }).call(this, '/js/model/Model.js')
  20517. },
  20518. {
  20519. '../constants': 8,
  20520. '../enum/AlignmentType': 17,
  20521. '../enum/RenderOrder': 42,
  20522. '../enum/Viewmode': 51,
  20523. '../exception/BasicException': 55,
  20524. '../label/Label': 90,
  20525. '../loaders/ModelLoader': 105,
  20526. '../loaders/ModelTextureLoader': 106,
  20527. '../loaders/SweepDataLoader': 107,
  20528. '../tag/tag': 123,
  20529. './util/cameraLight': 184,
  20530. '../tag/tagManager': 124,
  20531. '../objects/BoundingTextureSkybox': 143,
  20532. '../objects/Chunk': 144,
  20533. '../objects/Floor': 146,
  20534. '../objects/Panorama': 148,
  20535. '../objects/Room': 150,
  20536. '../objects/Snapshot': 153,
  20537. '../settings': 166,
  20538. '../shaders': 167,
  20539. '../util/ModelUrls': 177,
  20540. '../util/PanoramaCollection': 178,
  20541. '../util/ajax': 181,
  20542. '../util/common': 185,
  20543. '../util/easing': 186,
  20544. '../util/lerp': 188,
  20545. '../util/logger': 189,
  20546. '../util/math': 190,
  20547. '../util/texture': 194,
  20548. '../util/transitions': 195,
  20549. './../util/browser': 182,
  20550. './../util/showcase': 193,
  20551. './Chunks': 135,
  20552. './FloorCollection': 136,
  20553. './ImageCollection': 137,
  20554. './LabelCollection': 138,
  20555. './RoomCollection': 141,
  20556. events: 202,
  20557. three: 217,
  20558. hot: 'hot',
  20559. '../enum/GLCubeFaces': 25
  20560. }
  20561. ],
  20562. 140: [
  20563. function (e, t, i) {
  20564. 'use strict'
  20565. function n() {
  20566. ;(this.modelMap = {}),
  20567. (this.activeModel = null),
  20568. (this.modelCount = 0),
  20569. (this.tileDownloader = null),
  20570. (this.panoRenderer = null)
  20571. }
  20572. var r = (e('three'), e('../util/common')),
  20573. o = e('../exception/BasicException'),
  20574. a = e('../enum/ModelManagerEvents'),
  20575. s = e('../enum/PanoRendererEvents'),
  20576. l = e('events').EventEmitter
  20577. ;(n.prototype.init = function (e, t, i) {
  20578. ;(this.tileDownloader = e),
  20579. (this.panoRenderer = t),
  20580. (this.qualityManager = i),
  20581. this.bindEvents()
  20582. }),
  20583. (n.prototype.bindEvents = function () {
  20584. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  20585. }),
  20586. (n.prototype.onTileRendered = function (e, t, i, n) {}),
  20587. (n.prototype.addModel = function (e) {
  20588. ;(this.modelMap[e.sid] = e),
  20589. 0 === this.modelCount && this.activateModel(e.sid),
  20590. this.modelCount++,
  20591. this.emit(a.ModelAdded)
  20592. }),
  20593. (n.prototype.getModel = function (e) {
  20594. return this.modelMap[e]
  20595. }),
  20596. (n.prototype.activateModel = function (e) {
  20597. var t = this.modelMap[e]
  20598. if (!t) throw new o('Tried to activate invalid model!')
  20599. var i = this.activeModel
  20600. ;(this.activeModel = t),
  20601. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  20602. this.tileDownloader.setUrls(t.urls),
  20603. t.panos.forEach(
  20604. function (e) {
  20605. e.attachToPanoRenderer(this.panoRenderer),
  20606. (e.tileDownloader = this.tileDownloader),
  20607. (e.qualityManager = this.qualityManager)
  20608. }.bind(this)
  20609. ),
  20610. this.emit(a.ActiveModelChanged, {
  20611. oldModel: i,
  20612. model: t
  20613. })
  20614. }),
  20615. (n.prototype.getActiveModel = function () {
  20616. return this.activeModel
  20617. }),
  20618. r.extend(n, l),
  20619. (t.exports = n)
  20620. },
  20621. {
  20622. '../enum/ModelManagerEvents': 33,
  20623. '../enum/PanoRendererEvents': 35,
  20624. '../exception/BasicException': 55,
  20625. '../util/common': 185,
  20626. events: 202,
  20627. three: 217
  20628. }
  20629. ],
  20630. 141: [
  20631. function (e, t, i) {
  20632. ;(function (i) {
  20633. 'use strict'
  20634. function n() {
  20635. s.call(this)
  20636. }
  20637. var r = e('../objects/Room'),
  20638. o = (e('../settings'), e('../util/logger')),
  20639. a = (e('../util/transitions'), e('../util/easing'), e('../util/common')),
  20640. s = e('../util/IndexedCollection'),
  20641. l = e('./Chunks')
  20642. new o(i)
  20643. a.inherit(n, s),
  20644. (n.prototype.getIndex = function (e) {
  20645. return e.roomId
  20646. }),
  20647. (n.prototype.calcRoomBoundaries = function () {
  20648. this.forEach(function (e) {
  20649. e.calcBoundaries()
  20650. })
  20651. }),
  20652. (n.prototype.createFromChunks = function (e) {
  20653. var t = {
  20654. floorId: -1,
  20655. roomId: -1
  20656. },
  20657. i = {}
  20658. e.forEach(
  20659. function (e) {
  20660. l.parseIdsFromChunkName(e.name, t)
  20661. var o = i[t.roomId]
  20662. if (!o) {
  20663. var a = n.generateRoomId(t.floorId, t.roomId)
  20664. ;(o = new r(t.floorId, a)), this.add(o), (i[t.roomId] = o)
  20665. }
  20666. o.addChunk(e)
  20667. }.bind(this)
  20668. ),
  20669. this.calcRoomBoundaries()
  20670. }),
  20671. (n.generateRoomId = function (e, t) {
  20672. return e + '_' + t
  20673. }),
  20674. (t.exports = n)
  20675. }).call(this, '/js/model/RoomCollection.js')
  20676. },
  20677. {
  20678. '../objects/Room': 150,
  20679. '../settings': 166,
  20680. '../util/IndexedCollection': 175,
  20681. '../util/common': 185,
  20682. '../util/easing': 186,
  20683. '../util/logger': 189,
  20684. '../util/transitions': 195,
  20685. './Chunks': 135
  20686. }
  20687. ],
  20688. 142: [
  20689. function (e, t, i) {
  20690. 'use strict'
  20691. function n(e, t, i) {
  20692. e = e.clone().expandByScalar(0.01) //改
  20693. var n = e.size(),
  20694. o = new r.BoxGeometry(n.x, n.y, n.z)
  20695. ;(o.boundingBox = e),
  20696. r.Mesh.call(this, o, t),
  20697. this.position.copy(e.center()),
  20698. (this.frustumCulled = !1),
  20699. i && this.add(new r.WireframeHelper(this))
  20700. }
  20701. var r = e('three')
  20702. ;(n.prototype = Object.create(r.Mesh.prototype)),
  20703. (n.prototype.constructor = n),
  20704. (t.exports = n)
  20705. },
  20706. {
  20707. three: 217
  20708. }
  20709. ],
  20710. 143: [
  20711. function (e, t, i) {
  20712. ;(function (i) {
  20713. 'use strict'
  20714. function n(e) {
  20715. h.time('Computing a nice bounding cubemap')
  20716. var t = new a({
  20717. side: r.BackSide,
  20718. transparent: !0
  20719. })
  20720. ;(t.uniforms.modelAlpha.value = 0),
  20721. (t.uniforms.opacity.value = 1 - s.modelAlpha),
  20722. (this.renderOrder = l.boundingSkybox),
  20723. o.call(this, e, t),
  20724. h.timeEnd('Computing a nice bounding cubemap')
  20725. }
  20726. var r = e('three'),
  20727. o = (e('../enum/Viewmode'), e('../shaders'), e('./BoundingMesh')),
  20728. a = e('../materials/ModelTextureMaterial'),
  20729. s = e('../settings'),
  20730. l = e('../enum/RenderOrder'),
  20731. c = e('../util/logger'),
  20732. h = new c(i)
  20733. ;(n.prototype = Object.create(o.prototype)),
  20734. (n.prototype.constructor = n),
  20735. (t.exports = n)
  20736. }).call(this, '/js/objects/BoundingTextureSkybox.js')
  20737. },
  20738. {
  20739. '../enum/RenderOrder': 42,
  20740. '../enum/Viewmode': 51,
  20741. '../materials/ModelTextureMaterial': 118,
  20742. '../settings': 166,
  20743. '../shaders': 167,
  20744. '../util/logger': 189,
  20745. './BoundingMesh': 142,
  20746. three: 217
  20747. }
  20748. ],
  20749. 144: [
  20750. function (e, t, i) {
  20751. 'use strict'
  20752. function n(e) {
  20753. this.materialInside = new s({
  20754. side: r.DoubleSide
  20755. })
  20756. var t = r.UniformsUtils.clone(o.modelOutside.uniforms)
  20757. ;(this.materialOutside = new r.RawShaderMaterial({
  20758. fragmentShader: o.modelOutside.fragmentShader,
  20759. vertexShader: o.modelOutside.vertexShader,
  20760. uniforms: t,
  20761. side: r.FrontSide,
  20762. name: 'chunkOut'
  20763. })),
  20764. r.Mesh.call(this, e.geometry, this.materialInside),
  20765. (this.name = e.name || ''),
  20766. (this.textureName = e.textureName),
  20767. (this.meshUrl = e.meshUrl)
  20768. }
  20769. var r = e('three'),
  20770. o = e('../shaders'),
  20771. a = e('../enum/Viewmode'),
  20772. s = e('../materials/ModelTextureMaterial')
  20773. ;(n.prototype = Object.create(r.Mesh.prototype)),
  20774. (n.prototype.setTextureMap = function (e) {
  20775. ;(this.materialInside.uniforms.map.value = e),
  20776. (this.materialOutside.uniforms.map.value = e)
  20777. }),
  20778. (n.prototype.setMode = function (e) {
  20779. var t =
  20780. e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside
  20781. ;(t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide),
  20782. (t.transparent = this.material.transparent),
  20783. (t.uniforms.opacity.value = this.material.uniforms.opacity.value),
  20784. (this.material = t)
  20785. }),
  20786. (t.exports = n)
  20787. },
  20788. {
  20789. '../enum/Viewmode': 51,
  20790. '../materials/ModelTextureMaterial': 118,
  20791. '../shaders': 167,
  20792. three: 217
  20793. }
  20794. ],
  20795. 145: [
  20796. function (e, t, i) {
  20797. 'use strict'
  20798. function n(e) {
  20799. ;(this.chunksize = e || 10),
  20800. (this.chunks = {}),
  20801. (this.boundingBoxes = {}),
  20802. (this.children = []),
  20803. (this.offset = new r.Vector3(0, 0.5, 0)),
  20804. (this.material = new r.MeshBasicMaterial({
  20805. color: 16777215 * Math.random(),
  20806. side: r.DoubleSide
  20807. }))
  20808. }
  20809. var r = e('three')
  20810. e('../enum/Viewmode')
  20811. ;(n.prototype.add = function (e) {
  20812. var t,
  20813. i,
  20814. n,
  20815. o,
  20816. a,
  20817. s,
  20818. l,
  20819. c,
  20820. h,
  20821. u,
  20822. d,
  20823. p,
  20824. f,
  20825. g,
  20826. m = e.attributes
  20827. m
  20828. ? ((t = m.position.array), (i = void 0 !== e.index ? e.index.array : void 0))
  20829. : ((t = e.vertices), (n = e.faces))
  20830. var v = new r.Vector3()
  20831. if (i)
  20832. for (o = 0, a = i.length; o < a; o += 3) {
  20833. var A = 3 * i[o],
  20834. y = 3 * i[o + 1],
  20835. C = 3 * i[o + 2]
  20836. ;(s = (t[A] + t[y] + t[C]) / 3),
  20837. (l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3),
  20838. (c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3),
  20839. (h = Math.floor(s / this.chunksize)),
  20840. (u = Math.floor(l / this.chunksize)),
  20841. (d = Math.floor(c / this.chunksize)),
  20842. (p = h + '.' + u + '.' + d),
  20843. p in this.chunks
  20844. ? ((g = this.chunks[p]), (f = this.boundingBoxes[p]))
  20845. : ((g = this.chunks[p] = []), (f = this.boundingBoxes[p] = new r.Box3())),
  20846. g.push(
  20847. t[A],
  20848. t[A + 1],
  20849. t[A + 2],
  20850. t[y],
  20851. t[y + 1],
  20852. t[y + 2],
  20853. t[C],
  20854. t[C + 1],
  20855. t[C + 2]
  20856. ),
  20857. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  20858. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  20859. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  20860. }
  20861. else
  20862. for (o = 0, a = t.length; o < a; o += 9)
  20863. (s = (t[o] + t[o + 3] + t[o + 6]) / 3),
  20864. (l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3),
  20865. (c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3),
  20866. (h = Math.floor(s / this.chunksize)),
  20867. (u = Math.floor(l / this.chunksize)),
  20868. (d = Math.floor(c / this.chunksize)),
  20869. (p = h + '.' + u + '.' + d),
  20870. p in this.chunks
  20871. ? ((g = this.chunks[p]), (f = this.boundingBoxes[p]))
  20872. : ((g = this.chunks[p] = []), (f = this.boundingBoxes[p] = new r.Box3())),
  20873. g.push(
  20874. t[o],
  20875. t[o + 1],
  20876. t[o + 2],
  20877. t[o + 3],
  20878. t[o + 4],
  20879. t[o + 5],
  20880. t[o + 6],
  20881. t[o + 7],
  20882. t[o + 8]
  20883. ),
  20884. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  20885. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  20886. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  20887. }),
  20888. (n.prototype.build = function () {
  20889. var e = new r.Object3D()
  20890. e.material = this.material
  20891. for (var t in this.chunks) {
  20892. var i = this.chunks[t],
  20893. n = new r.BufferGeometry()
  20894. n.addAttribute('position', new r.BufferAttribute(new Float32Array(i), 3)),
  20895. (n.boundingBox = this.boundingBoxes[t])
  20896. var o = new r.Mesh(n, this.material)
  20897. ;(o.material.visible = !1), e.add(o), (this.chunks[t] = [])
  20898. }
  20899. return e
  20900. }),
  20901. (t.exports = n)
  20902. },
  20903. {
  20904. '../enum/Viewmode': 51,
  20905. three: 217
  20906. }
  20907. ],
  20908. 146: [
  20909. function (e, t, i) {
  20910. 'use strict'
  20911. var r = e('three'),
  20912. o = e('../settings'),
  20913. a = e('../util/common'),
  20914. s = e('../util/lerp'),
  20915. l = e('./ChunkedCollider'),
  20916. c = e('../util/transitions'),
  20917. h = e('../util/easing'),
  20918. u = (e('../objects/Panorama'), e('../enum/RenderOrder')),
  20919. d = e('../localization/localize')
  20920. function n(e, t, i) {
  20921. r.Object3D.call(this),
  20922. (this.model = e),
  20923. (this.floorIndex = t),
  20924. (this.lang = o.languageTag),
  20925. (this.name =
  20926. i || o.languageTag === 'cn' ? 'Floor ' + (t + 1) + '' : '第' + (t + 1) + '层'),
  20927. (this.panos = []),
  20928. (this.chunks = []),
  20929. (this.colliderBuilder = new l(3)),
  20930. (this.collider = null),
  20931. (this.center = null),
  20932. (this.boundingBox = new r.Box3()),
  20933. (this.size = null),
  20934. (this.hidden = !1),
  20935. (this.conservativeBoundingBox = new r.Box3()),
  20936. (this.debugColor = 16777215 * Math.random()),
  20937. (this.transition = null)
  20938. }
  20939. ;(n.prototype = Object.create(r.Object3D.prototype)),
  20940. (n.prototype.enter = function (e) {
  20941. this.model.setFloor(this, e)
  20942. }),
  20943. (n.prototype.hide = function (e) {
  20944. if (!this.hidden || this.transition) {
  20945. this.chunks.forEach(function (e) {
  20946. e.material.transparent = !0
  20947. }),
  20948. c.cancel(this.transition)
  20949. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay,
  20950. i = e ? 0 : o.hideFloorDelay / t
  20951. this.transition = c.start(
  20952. s.allUniforms(this.chunks, 'opacity', 0.08),
  20953. t,
  20954. function () {
  20955. this.hidden = !0
  20956. }.bind(this),
  20957. i,
  20958. h.easeInOutQuad
  20959. )
  20960. }
  20961. }),
  20962. (n.prototype.show = function (e) {
  20963. if (this.hidden || this.transition) {
  20964. ;(this.hidden = !1), c.cancel(this.transition)
  20965. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay,
  20966. i = e ? 0 : o.showFloorDelay / t
  20967. this.transition = c.start(
  20968. s.allUniforms(this.chunks, 'opacity', 1),
  20969. t,
  20970. function () {
  20971. this.hidden ||
  20972. this.chunks.forEach(function (e) {
  20973. e.material.transparent = !1
  20974. })
  20975. }.bind(this),
  20976. i,
  20977. h.easeInOutQuad
  20978. )
  20979. }
  20980. }),
  20981. (n.prototype.toggle = function (e, t) {
  20982. ;(e = void 0 === e ? this.hidden : e), e ? this.show(t) : this.hide(t)
  20983. }),
  20984. (n.prototype.containsPoint = function (e) {
  20985. return this.collider.children.some(function (t) {
  20986. return (
  20987. t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  20988. t.geometry.boundingBox.containsPoint(e)
  20989. )
  20990. })
  20991. }),
  20992. (n.prototype.distanceToPoint = function (e) {
  20993. var t = null,
  20994. i = 1 / 0
  20995. return (
  20996. this.collider.children.forEach(function (n) {
  20997. n.geometry.boundingBox || n.geometry.computeBoundingBox()
  20998. var r = n.geometry.boundingBox.distanceToPoint(e)
  20999. ;(!t || i > r) && ((i = r), (t = n))
  21000. }),
  21001. i
  21002. )
  21003. }),
  21004. (n.prototype.addChunk = function (e) {
  21005. ;(e.renderOrder = u.ghostFloor),
  21006. this.add(e),
  21007. this.chunks.push(e),
  21008. this.boundingBox.union(e.geometry.boundingBox),
  21009. (this.size = this.boundingBox.size()),
  21010. this.colliderBuilder.add(e.geometry)
  21011. }),
  21012. (n.prototype.addPano = function (e) {
  21013. this.panos.push(e), this.add(e.skyboxMesh), e.marker && this.add(e.marker)
  21014. if (e.neighbourUUIDs && e.neighbourUUIDs.length) {
  21015. //add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  21016. var t = new r.Vector3(1, 1, 1),
  21017. i = new r.Box3().setFromCenterAndSize(e.position, t)
  21018. this.boundingBox.union(i)
  21019. }
  21020. }),
  21021. (n.prototype.build = function () {
  21022. ;(this.collider = this.colliderBuilder.build(!0)),
  21023. this.add(this.collider),
  21024. (this.center = this.boundingBox.center()),
  21025. this.conservativeBoundingBox.copy(this.boundingBox),
  21026. (this.conservativeBoundingBox.min.y = a.lowerMedian(
  21027. this.collider.children.map(function (e) {
  21028. return e.geometry.boundingBox.min.y
  21029. }),
  21030. 5
  21031. )),
  21032. (this.conservativeBoundingBox.max.y = a.lowerMedian(
  21033. this.collider.children.map(function (e) {
  21034. return e.geometry.boundingBox.max.y
  21035. }),
  21036. 5
  21037. ))
  21038. this.colliderBuilder = null
  21039. }),
  21040. (n.prototype.toShortString = function () {
  21041. return a.nth(this.floorIndex + 1)
  21042. }),
  21043. (n.prototype.toString = function () {
  21044. return this.name
  21045. }),
  21046. (n.prototype.constructor = n), //add
  21047. (t.exports = n)
  21048. },
  21049. {
  21050. '../enum/RenderOrder': 42,
  21051. '../localization/localize': 108,
  21052. './strings-cn-CN': 109,
  21053. '../objects/Panorama': 148,
  21054. '../settings': 166,
  21055. '../util/common': 185,
  21056. '../util/easing': 186,
  21057. '../util/lerp': 188,
  21058. '../util/transitions': 195,
  21059. './ChunkedCollider': 145,
  21060. three: 217
  21061. }
  21062. ],
  21063. 147: [
  21064. function (e, t, i) {
  21065. 'use strict'
  21066. function n(e) {
  21067. ;(this.player = e), (this.obj3d = null), (this.UP = new r.Vector3(0, 1, 0))
  21068. }
  21069. var r = e('three'),
  21070. o = e('../settings')
  21071. ;(n.prototype.prefs = {
  21072. linewidth: 3,
  21073. height: 0.07,
  21074. opacity: 0.45,
  21075. endScale: 0.05
  21076. }),
  21077. (n.prototype.discard = function () {
  21078. if (this.obj3d) {
  21079. var e = this.obj3d.parent
  21080. e && e.remove(this.obj3d)
  21081. }
  21082. this.obj3d = null
  21083. }),
  21084. (n.prototype.draw = function () {
  21085. if ((this.discard(), o.showNeighbors)) {
  21086. var e = this.player.currentPano.floor
  21087. this.obj3d = new r.Object3D()
  21088. var t = this.player.model.panos.getNeighbours(this.player.currentPano),
  21089. i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position)
  21090. i.y += this.prefs.height
  21091. var n = 0.1525,
  21092. a = 0.127,
  21093. s = 0.0127,
  21094. l = 0.1,
  21095. c = 0.19,
  21096. h = 0.2032,
  21097. u = 0.2286,
  21098. d = 0.255,
  21099. p = new r.Matrix4()
  21100. for (var f in t)
  21101. if (t[f]) {
  21102. var g = this.player.model.panos.get(f),
  21103. m =
  21104. (g.position.clone().sub(this.player.model.position),
  21105. g.position.clone().sub(g.floorPosition)),
  21106. v = g.floorPosition.clone().sub(this.player.model.position)
  21107. v.y += this.prefs.height
  21108. var A = new r.Geometry()
  21109. A.vertices.push(
  21110. new r.Vector3(0, -s, 0),
  21111. new r.Vector3(-s, 0, 0),
  21112. new r.Vector3(0, s, 0),
  21113. new r.Vector3(s, 0, 0),
  21114. new r.Vector3(0, -s, 0)
  21115. ),
  21116. A.vertices.push(
  21117. new r.Vector3(0, -d, 0),
  21118. new r.Vector3(d, -d, 0),
  21119. new r.Vector3(d, n, 0),
  21120. new r.Vector3(-n, n, 0),
  21121. new r.Vector3(-n, a, 0),
  21122. new r.Vector3(-c, l, 0),
  21123. new r.Vector3(-c, -h, 0),
  21124. new r.Vector3(-n, -u, 0),
  21125. new r.Vector3(-n, -d, 0),
  21126. new r.Vector3(0, -d, 0)
  21127. ),
  21128. p.identity().setPosition(m),
  21129. A.applyMatrix(p),
  21130. A.vertices.push(new r.Vector3(0, -this.prefs.endScale, 0)),
  21131. A.vertices.push(
  21132. new r.Vector3(-this.prefs.endScale, -this.prefs.endScale, 0),
  21133. new r.Vector3(-this.prefs.endScale, this.prefs.endScale, 0),
  21134. new r.Vector3(this.prefs.endScale, this.prefs.endScale, 0),
  21135. new r.Vector3(this.prefs.endScale, -this.prefs.endScale, 0)
  21136. ),
  21137. p.lookAt(v, i, this.UP).setPosition(v),
  21138. A.applyMatrix(p),
  21139. A.vertices.push(v, i)
  21140. var y = new r.Line(
  21141. A,
  21142. new r.LineBasicMaterial({
  21143. color: g.debugColor.getHex(),
  21144. transparent: !0,
  21145. opacity: this.prefs.opacity,
  21146. depthWrite: !1,
  21147. name: 'sLine' + f,
  21148. linewidth: this.prefs.linewidth
  21149. })
  21150. )
  21151. this.obj3d.add(y)
  21152. }
  21153. e.add(this.obj3d)
  21154. }
  21155. }),
  21156. (n.prototype.update = function () {
  21157. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  21158. }),
  21159. (t.exports = n)
  21160. },
  21161. {
  21162. '../settings': 166,
  21163. three: 217
  21164. }
  21165. ],
  21166. 148: [
  21167. function (e, t, i) {
  21168. ;(function (i) {
  21169. 'use strict'
  21170. function n(e, t, i, n) {
  21171. ;(this.model = e),
  21172. (this.id = t),
  21173. (this.alignmentType = i.alignmentType || l.ALIGNED),
  21174. (this.neighbourUUIDs = i.neighbours || null),
  21175. (this.neighbourPanos = null),
  21176. (this.floor = null),
  21177. (this.floorIndex = i.floor),
  21178. (this.failedLoadingAt = 0),
  21179. (this.maxLoadRetries = 4),
  21180. (this.origin = i.position.clone()),
  21181. (this.position =
  21182. this.alignmentType === l.UNALIGNED ? new r.Vector3(0, -5, 0) : i.position.clone()),
  21183. (this.quaternion = i.quaternion.clone()),
  21184. (this.skyboxMesh = new r.Mesh(E)),
  21185. this.skyboxMesh.position.copy(this.position),
  21186. this.skyboxMesh.quaternion.copy(this.quaternion),
  21187. (this.skyboxMesh.name = 'skybox'),
  21188. (this.skyboxMesh.visible = !1),
  21189. this.skyboxMesh.updateMatrix(),
  21190. this.skyboxMesh.updateMatrixWorld(),
  21191. (this.marker = null),
  21192. (this.showFloorMarker = !window.DATA.hideFloorMarker)
  21193. if (this.isAligned()) {
  21194. ;(this.marker = new r.Mesh(
  21195. b,
  21196. new r.MeshBasicMaterial({
  21197. map: w,
  21198. side: r.DoubleSide,
  21199. opacity: 0,
  21200. transparent: !0,
  21201. depthWrite: !1
  21202. })
  21203. )),
  21204. (this.marker.visible = false) //改:先不显示,之后根据opacity显示
  21205. ;(this.marker.renderOrder = s.panoMarker),
  21206. (this.marker.name = 'marker'),
  21207. (this.marker.pano = this),
  21208. this.marker.layers.set(v.PANOMARKERS),
  21209. this.marker.updateMatrixWorld()
  21210. if (!window.DATA.hideFloorMarker) {
  21211. //xzw
  21212. let opa = this.marker.material.opacity
  21213. Object.defineProperty(this.marker.material, 'opacity', {
  21214. get: function () {
  21215. return opa
  21216. },
  21217. set: o => {
  21218. opa = o
  21219. convertTool.updateVisible(this.marker, 'hideWhenZeroOpa', o > 0)
  21220. //if(o==0)console.log('o==0',this.id,this.marker.visible)
  21221. //console.log(o,this.id,this.marker.visible)
  21222. }
  21223. })
  21224. }
  21225. a.colorMarkerOnLoad &&
  21226. this.on('load', function () {
  21227. this.marker.material.color.set(65280)
  21228. })
  21229. }
  21230. ;(this.debugColor = new r.Color().setHSL(
  21231. 0.06 + 0.53 * Math.random(),
  21232. 0.8 + 0.2 * Math.random(),
  21233. 0.5 + 0.2 * Math.random()
  21234. )),
  21235. (this.floorPosition = i.puck ? i.puck.clone() : null),
  21236. (this.tiled = n),
  21237. this.tiled
  21238. ? (this.solidSkybox = null)
  21239. : ((this.solidSkybox = new r.Texture([null, null, null, null, null, null])),
  21240. (this.solidSkybox.flipY = !1),
  21241. a.minimalMemoryMode &&
  21242. ((this.solidSkybox.minFilter = r.LinearFilter),
  21243. (this.solidSkybox.magFilter = r.LinearFilter),
  21244. (this.solidSkybox.generateMipmaps = !1))),
  21245. (this.zoomed = !1),
  21246. (this.panoRenderer = null),
  21247. (this.qualityManager = null),
  21248. (this.tileDownloader = null),
  21249. (this.tiledPanoRenderTarget = null),
  21250. (this.minimumTiledPanoLoaded = !1),
  21251. (this.highestPartialTileRenderOpCompleted = 0),
  21252. (this.highestFullTileRenderOpCompleted = 0),
  21253. (this.shouldRedrawOnBaseLoaded = !1),
  21254. (this.lockUntilRenderingComplete = !1),
  21255. a.colorMarkerOnLoad &&
  21256. this.on('load', function () {
  21257. this.marker.material.color.set(65280)
  21258. })
  21259. /********************************************************************fyz改vr from徐世廷*************************************************************/
  21260. var e = new r.TextureLoader()
  21261. e.setCrossOrigin(!0)
  21262. var g = e.load('images/texture.jpg')
  21263. if (
  21264. ((this.vrMarker = new r.Mesh(
  21265. new r.OctahedronGeometry(0.1, 0),
  21266. new r.MeshLambertMaterial({
  21267. color: 16777215,
  21268. transparent: !0,
  21269. opacity: 0.75,
  21270. map: g
  21271. })
  21272. )),
  21273. (this.vrMarker.boluoType = 'vr'),
  21274. (this.vrMarker.position.z = 1),
  21275. (this.vrMarker.enabled = !0),
  21276. (this.vrMarker.visible = !1),
  21277. (window.vrMarkers = window.vrMarkers || []),
  21278. window.vrMarkers.push(this.vrMarker),
  21279. this.marker && this.marker.add(this.vrMarker),
  21280. a.showAxis &&
  21281. (this.skyboxMesh.add(
  21282. new r.ArrowHelper(new r.Vector3(0, 1, 0), new r.Vector3(0, 0, 0), 1, 255)
  21283. ),
  21284. this.skyboxMesh.add(
  21285. new r.ArrowHelper(new r.Vector3(0, 0, 1), new r.Vector3(0, 0, 0), 1, 16711680)
  21286. ),
  21287. this.skyboxMesh.add(
  21288. new r.ArrowHelper(new r.Vector3(1, 0, 0), new r.Vector3(0, 0, 0), 1, 65280)
  21289. )),
  21290. this.adjustAngleEnable)
  21291. ) {
  21292. var i = new r.Quaternion()
  21293. i.setFromAxisAngle(new r.Vector3(1, 0, 0), this.adjustAngleX),
  21294. this.skyboxMesh.quaternion.multiply(i)
  21295. var m = new r.Quaternion()
  21296. m.setFromAxisAngle(new r.Vector3(0, 1, 0), this.adjustAngleY),
  21297. this.skyboxMesh.quaternion.multiply(m)
  21298. var n = new r.Quaternion()
  21299. n.setFromAxisAngle(new r.Vector3(0, 0, 1), this.adjustAngleZ),
  21300. this.skyboxMesh.quaternion.multiply(n),
  21301. this.skyboxMesh.updateMatrix(),
  21302. this.skyboxMesh.updateMatrixWorld(),
  21303. this.model.updateProjectedPanos()
  21304. }
  21305. /**************************************************************************************************************************************/
  21306. }
  21307. var r = e('three'),
  21308. o = e('../util/logger'),
  21309. a = e('../settings'),
  21310. s = (e('../enum/Viewmode'), e('../enum/RenderOrder')),
  21311. l = e('../enum/AlignmentType'),
  21312. c = (e('../util/common'), e('../util/transitions')),
  21313. h = e('../util/lerp'),
  21314. u = e('../util/ajax'),
  21315. d = e('../util/texture'),
  21316. p = e('../util/panorama'),
  21317. f = (e('../enum/TileDownloaderEvents'), e('../enum/PanoramaEvents')),
  21318. g = e('../enum/PanoRendererEvents'),
  21319. m = e('../enum/PanoSizeClass'),
  21320. v = e('../enum/RenderLayers'),
  21321. A =
  21322. (e('../scene/SceneRenderer'),
  21323. e('../enum/GLCubeFaces'),
  21324. e('../exception/BasicException')),
  21325. y = e('../tile/TileUtils'),
  21326. C = e('events').EventEmitter,
  21327. I = new o(i),
  21328. E = new r.SphereBufferGeometry(0.1),
  21329. b = new r.PlaneBufferGeometry(0.35, 0.35, 1, 1),
  21330. w = d.load('images/marker.png')
  21331. w.anisotropy = browser.isMobile() ? 1 : 3 //add
  21332. ;(n.prototype = Object.create(C.prototype)),
  21333. (n.prototype.enter = (function () {
  21334. var e = null
  21335. return function () {
  21336. this.setZoomed(!1),
  21337. this.emit('enter', {
  21338. oldPano: e,
  21339. newPano: this
  21340. }),
  21341. (e = this)
  21342. this.model.setHighMap(this) //add
  21343. }
  21344. })()),
  21345. (n.prototype.exit = function () {
  21346. this.tiled
  21347. ? (this.clearWaitDeferreds(),
  21348. (this.minimumTiledPanoLoaded = !1),
  21349. (this.tiledPanoRenderTarget = null),
  21350. this.setZoomed(!1),
  21351. this.panoRenderer.deactivateTiledPano(this),
  21352. (this.highestPartialTileRenderOpCompleted = 0),
  21353. (this.highestFullTileRenderOpCompleted = 0))
  21354. : (this.solidSkybox.dispose(),
  21355. (this.solidSkybox.loaded = !1),
  21356. (this.solidSkybox.version = 0)),
  21357. this.emit('exit')
  21358. }),
  21359. (n.prototype.hoverOn = function (e) {
  21360. this.marker &&
  21361. (c.start(
  21362. h.property(this.marker.material, 'opacity', a[e].markerOpacityOnHover),
  21363. 250
  21364. ),
  21365. a.navigation.panoScores & a.navigation.mouseDirection &&
  21366. this.addTextSprite('HIT', 12525854))
  21367. }),
  21368. (n.prototype.hoverOff = function (e) {
  21369. this.marker &&
  21370. c.start(h.property(this.marker.material, 'opacity', a[e].markerOpacity), 250)
  21371. }),
  21372. (n.prototype.build1 = function () {
  21373. ;(this.floor =
  21374. this.floor ||
  21375. this.model.floors.get(this.floorIndex) ||
  21376. (this.model.floors.list.length == 1
  21377. ? this.model.floors.list[0]
  21378. : this.raycastToFindFloor()) ||
  21379. this.model.getFloorAtPoint(this.position)),
  21380. this.floor.addPano(this),
  21381. (this.floorPosition = this.floorPosition || this.raycastFloorPosition()),
  21382. (this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos()),
  21383. a.colorMarkerByFloor &&
  21384. this.marker &&
  21385. this.marker.material.color.set(this.floor.debugColor)
  21386. }),
  21387. (n.prototype.build2 = function () {
  21388. ;(this.floorPosition = this.floorPosition || this.interpolateFloorPosition()),
  21389. (this.height = this.position.distanceTo(this.floorPosition)),
  21390. this.placeMarker()
  21391. }),
  21392. (n.prototype.interpolateFloorPosition = function () {
  21393. var e = this.model.panos
  21394. .filter(n.filters.isNeighbourPanoTo(this))
  21395. .filter(function (e) {
  21396. return !!e.floorPosition
  21397. })
  21398. .sort(
  21399. function (e, t) {
  21400. return (
  21401. e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  21402. )
  21403. }.bind(this)
  21404. ),
  21405. t = this.position.clone()
  21406. return (
  21407. e.length >= 2
  21408. ? (t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2)
  21409. : t.add(a.noMeshFloorPositionOffset),
  21410. t
  21411. )
  21412. }),
  21413. (n.prototype.raycastFloorPosition = function () {
  21414. I.warn('Performance warning: Raycasting to find floor position')
  21415. var e = new r.Raycaster(this.position, new r.Vector3(0, -1, 0)),
  21416. t = e.intersectObjects(this.model.colliders)
  21417. return t.length ? t[0].point : null
  21418. }),
  21419. (n.prototype.raycastToFindFloor = (function () {
  21420. var e = [
  21421. new r.Vector3(0, -1, 0),
  21422. new r.Vector3(1, -1, 0),
  21423. new r.Vector3(0, -1, 1),
  21424. new r.Vector3(-1, -1, 0),
  21425. new r.Vector3(0, -1, -1),
  21426. new r.Vector3(1, 0, 0),
  21427. new r.Vector3(0, 0, 1),
  21428. new r.Vector3(-1, 0, 0),
  21429. new r.Vector3(0, 0, -1)
  21430. ]
  21431. return function () {
  21432. I.warn('Performance warning: Raycasting to find floor index')
  21433. for (var t = 0; t < e.length; t++) {
  21434. var i = new r.Raycaster(this.position.clone(), e[t].clone()),
  21435. n = i.intersectObjects(this.model.colliders)
  21436. if (n.length) return n[0].object.parent.parent
  21437. }
  21438. return null
  21439. }
  21440. })()),
  21441. (n.prototype.placeMarker = function () {
  21442. this.marker &&
  21443. (this.marker.position.copy(this.floorPosition),
  21444. //this.fixedFloorY != void 0 && this.marker.position.setY(this.fixedFloorY),//add
  21445. (this.marker.position.y += settings.markerHeight),
  21446. this.marker.lookAt(new r.Vector3(0, 1, 0).add(this.marker.position)))
  21447. }),
  21448. (n.prototype.translate = function (e) {
  21449. this.position.add(e), this.floorPosition.add(e)
  21450. }),
  21451. (n.prototype.findClosestMidtpointPanoTo = function (e) {
  21452. new r.Vector3().addVectors(this.position, e.position).divideScalar(2)
  21453. return this.model.panos.find(
  21454. [n.filters.notIn([this, e])],
  21455. [n.sortFunctions.distanceToPoint(point)]
  21456. )
  21457. }),
  21458. (n.prototype.attachToPanoRenderer = function (e) {
  21459. ;(this.panoRenderer = e),
  21460. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  21461. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  21462. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  21463. this.panoRenderer.on(
  21464. g.UploadAttemptedForAllTiles,
  21465. this.onUploadAttemptedForAllTiles.bind(this)
  21466. )
  21467. })
  21468. var _ = {}
  21469. ;(n.prototype.getWaitDeferred = function (e) {
  21470. var t = _[this.id]
  21471. t || ((t = {}), (_[this.id] = t))
  21472. var i = t[e]
  21473. return (
  21474. i ||
  21475. ((i = {
  21476. deferred: $.Deferred(),
  21477. active: !1
  21478. }),
  21479. (t[e] = i)),
  21480. i
  21481. )
  21482. }),
  21483. (n.prototype.resetWaitDeferred = function (e) {
  21484. var t = this.getWaitDeferred(e)
  21485. ;(t.active = !1), (t.deferred = $.Deferred())
  21486. }),
  21487. (n.prototype.clearWaitDeferreds = function () {
  21488. var e = _[this.id]
  21489. e || ((e = {}), (_[this.id] = e))
  21490. for (var t in e)
  21491. if (e.hasOwnProperty(t)) {
  21492. var i = e[t]
  21493. ;(i.active = !1), (i.deferred = $.Deferred())
  21494. }
  21495. }),
  21496. (n.prototype.loadTiledPano = (function () {
  21497. var e = (new r.Vector3(), []),
  21498. t = []
  21499. return function (i, n, r, o, a, s) {
  21500. ;(null !== o && void 0 !== o) || (o = !0), (null !== a && void 0 !== a) || (a = !0)
  21501. var l = this.getWaitDeferred(i),
  21502. c = l.deferred,
  21503. h = null,
  21504. u = null
  21505. if (
  21506. (r && ('number' == typeof r ? (h = r) : ((h = r.hFov), (u = r.vFov))),
  21507. !this.isLoaded(i))
  21508. ) {
  21509. if (!l.active) {
  21510. if (((l.active = !0), r)) {
  21511. var d = y.matchingTilesInDirection(this, i, n, h, u)
  21512. ;(e[this.id + ':' + i] = {
  21513. tileCount: 0,
  21514. targetTileCount: d
  21515. }),
  21516. I.info('Loading partial pano: ' + this.id + ' with ' + d + ' tiles')
  21517. }
  21518. t[this.id] ||
  21519. ((t[this.id] = !0),
  21520. this.on(
  21521. f.LoadComplete,
  21522. function (e, t) {
  21523. //console.warn('点位下载完成 ', 'id:'+this.id, 'count:'+t )
  21524. var i = this.getWaitDeferred(e).deferred
  21525. i &&
  21526. 'pending' === i.state() &&
  21527. this.highestPartialTileRenderOpCompleted >= e &&
  21528. (i.resolve(e, t), this.resetWaitDeferred(e))
  21529. }.bind(this)
  21530. ),
  21531. this.on(
  21532. f.LoadFailed,
  21533. function (e) {
  21534. var t = this.getWaitDeferred(e).deferred
  21535. t &&
  21536. 'pending' === t.state() &&
  21537. this.highestPartialTileRenderOpCompleted >= e &&
  21538. (t.reject(e), this.resetWaitDeferred(e))
  21539. }.bind(this)
  21540. ),
  21541. this.on(
  21542. f.TileLoaded,
  21543. function (t, i, n) {
  21544. //console.log('tileLoaded', 'id:'+this.id, 'size:'+t, 'index:'+i )
  21545. var r = this.getWaitDeferred(t).deferred
  21546. if (r && 'pending' === r.state()) {
  21547. r.notify(t, i, n)
  21548. var o = e[this.id + ':' + t]
  21549. o &&
  21550. (o.tileCount++,
  21551. o.tileCount === o.targetTileCount &&
  21552. (this.onPanoRendered(this.id, t, n, !0),
  21553. r.resolve(t, n),
  21554. this.resetWaitDeferred(t)))
  21555. }
  21556. }.bind(this)
  21557. ))
  21558. }
  21559. this.tileDownloader.clearForceQueue(),
  21560. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  21561. (this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(
  21562. this,
  21563. Math.min(2048, this.qualityManager.getMaxNavPanoSize()),
  21564. o
  21565. )), //不要超过2048否则漫游到下一个点时卡顿
  21566. this.panoRenderer.renderPanoTiles(this.id, n, a)
  21567. }
  21568. return c.promise()
  21569. }
  21570. })()),
  21571. (n.prototype.onUploadAttemptedForAllTiles = function (e, t, i) {
  21572. if (e === this.id) {
  21573. var n = this.qualityManager.getPanoSize(m.BASE)
  21574. t === n &&
  21575. this.shouldRedrawOnBaseLoaded &&
  21576. ((this.shouldRedrawOnBaseLoaded = !1),
  21577. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  21578. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  21579. }
  21580. }),
  21581. (n.prototype.onTileRendered = function (e, t, i, n) {
  21582. e === this.id && this.emit(f.TileLoaded, t, i, n)
  21583. }),
  21584. (n.prototype.onPanoRendered = function (e, t, i, n) {
  21585. e === this.id &&
  21586. ((this.minimumTiledPanoLoaded = !0),
  21587. this.updateSkyboxForZoomLevel(),
  21588. t > this.highestPartialTileRenderOpCompleted &&
  21589. (this.highestPartialTileRenderOpCompleted = t),
  21590. !n &&
  21591. t > this.highestFullTileRenderOpCompleted &&
  21592. (this.highestFullTileRenderOpCompleted = t),
  21593. this.emit('load', t),
  21594. this.model.emit('load', this),
  21595. this.emit(f.LoadComplete, t, i))
  21596. }),
  21597. (n.prototype.setZoomed = function (e) {
  21598. ;(this.zoomed = e), this.updateSkyboxForZoomLevel()
  21599. if (e) {
  21600. //add
  21601. if (player.qualityManager.getNavZoomClass() != '1k') {
  21602. this.model.showHighMap()
  21603. }
  21604. } else {
  21605. this.model.hideHighMap()
  21606. }
  21607. }),
  21608. (n.prototype.ensureSkyboxReadyForRender = function () {
  21609. this.tiled ||
  21610. (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  21611. (this.solidSkybox.loaded = !0))
  21612. }),
  21613. (n.prototype.updateSkyboxForZoomLevel = function () {
  21614. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  21615. }),
  21616. (n.prototype.getSkyboxTexture = function () {
  21617. //return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  21618. if (!this.tiled) {
  21619. return this.solidSkybox
  21620. }
  21621. if (this.minimumTiledPanoLoaded) {
  21622. if (
  21623. this.zoomed &&
  21624. (this.qualityManager.maxRenderTargetSize > this.qualityManager.maxNavPanoSize ||
  21625. player.qualityManager.getNavZoomClass() == '4k')
  21626. ) {
  21627. //change 如果放大后和不放大都是2k就不用这个
  21628. return this.panoRenderer.zoomRenderTarget.texture
  21629. } else {
  21630. this.tiledPanoRenderTarget.texture.mapping = THREE.UVMapping //add
  21631. return this.tiledPanoRenderTarget.texture
  21632. }
  21633. } else {
  21634. return null
  21635. }
  21636. }),
  21637. (n.prototype.onTileRenderFail = function (e, t, i) {
  21638. e === this.id && this.emit(f.LoadFailed, t)
  21639. }),
  21640. (n.prototype.isLoaded = function (e) {
  21641. if (this.tiled) {
  21642. if (e && 'string' == typeof e)
  21643. throw new A(
  21644. 'Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass'
  21645. )
  21646. return (
  21647. !!this.minimumTiledPanoLoaded &&
  21648. (!e || this.highestPartialTileRenderOpCompleted >= e)
  21649. )
  21650. }
  21651. if (e && 'number' == typeof e)
  21652. throw new A(
  21653. 'Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.'
  21654. )
  21655. return !!this.solidSkybox.high || e in this.solidSkybox
  21656. }),
  21657. (n.prototype.loadCube = function (e) {
  21658. if (this.isLoaded(e)) return I.info('Skipping load of pano, already loaded'), $.when()
  21659. this.emit('loading', e), this.model.emit('loading', this)
  21660. var t = p.getCubemapUrls(this.model.urls, this.id, e),
  21661. i = t.filter(function (e) {
  21662. return !e
  21663. })
  21664. 'low' === e &&
  21665. i.length > 0 &&
  21666. (I.info('Pano', this.id, 'not available in low res, loading high res right away'),
  21667. (e = 'high'),
  21668. (t = p.getCubemapUrls(this.model.urls, this.id, e)))
  21669. var n = 0,
  21670. r = [0, 1, 2, 3, 4, 5].map(
  21671. function (e, i, n) {
  21672. return u.getImage(t[i])
  21673. }.bind(this)
  21674. )
  21675. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(
  21676. function (t, i, n, r, o, a) {
  21677. return (
  21678. (this.solidSkybox[e] = [t, i, n, r, o, a]),
  21679. ('high' !== e && this.solidSkybox.high) ||
  21680. ((this.solidSkybox.image = this.solidSkybox[e]),
  21681. (this.solidSkybox.low = null)),
  21682. (this.solidSkybox.needsUpdate = !0),
  21683. this.emit('load', e),
  21684. this.model.emit('load', this),
  21685. this
  21686. )
  21687. }.bind(this),
  21688. function () {
  21689. I.error('Downloading cubemap for pano', this.id, 'failed'),
  21690. (this.failedLoadingAt = Date.now())
  21691. }.bind(this),
  21692. function () {
  21693. return $.when(++n, 6)
  21694. }
  21695. )
  21696. }),
  21697. (n.raycastsSkipped = 0),
  21698. (n.raycastsDone = 0),
  21699. (n.prototype.findNeighourPanos = function () {
  21700. return (
  21701. this.model.panos.setNeighbour(this.id, this.id, !1),
  21702. this.model.panos.forEach(
  21703. function (e) {
  21704. if (
  21705. e !== this &&
  21706. (!this.model.panos.neighbourMap[this.id] ||
  21707. void 0 === this.model.panos.neighbourMap[this.id][e.id])
  21708. ) {
  21709. var t = this.position.distanceTo(e.position)
  21710. if (t > a.panoramaNeighbourMaxDistance)
  21711. return this.model.panos.setNeighbour(this, e, !1), void n.raycastsSkipped++
  21712. var i = e.position.clone().sub(this.position).normalize(),
  21713. o = new r.Raycaster(this.position, i.clone(), 0, t),
  21714. s = o.intersectObjects(this.model.colliders)
  21715. n.raycastsDone++,
  21716. this.model.panos.setNeighbour(this, e, 0 === s.length),
  21717. a.showNeighbourRaycasts &&
  21718. (s.length
  21719. ? this.floor.model.add(
  21720. new r.ArrowHelper(i, this.position, s[0].distance, 16711680)
  21721. )
  21722. : this.floor.model.add(
  21723. new r.ArrowHelper(i, this.position, t, 16777215, 0, 0)
  21724. ))
  21725. }
  21726. }.bind(this)
  21727. ),
  21728. this.model.panos.neighbourMap[this.id]
  21729. )
  21730. }),
  21731. (n.prototype.worldPosition = function () {
  21732. return this.position
  21733. }),
  21734. (n.prototype.addLabel = function () {
  21735. this.removeLabel()
  21736. this.label = new TextSprite({
  21737. sizeInfo: {
  21738. minSize: 100,
  21739. maxSize: 200,
  21740. nearBound: 0.7,
  21741. farBound: 10, //Math.max(20, player.model.size.length() / 3),
  21742. farBoundPlan: 100
  21743. },
  21744. backgroundColor: { r: 255, g: 255, b: 255, a: 0.4 },
  21745. textColor: { r: 0, g: 0, b: 0, a: 1 },
  21746. borderRadius: 15,
  21747. renderOrder: 5,
  21748. text: this.id //`${this.id}-f${this.floorIndex}`
  21749. })
  21750. let position = this.floorPosition.clone()
  21751. position.y += 0.2
  21752. this.label.position.copy(position)
  21753. this.floor.add(this.label)
  21754. }),
  21755. (n.prototype.removeLabel = function () {
  21756. this.label &&
  21757. (this.floor.remove(this.label), this.label.material.dispose(), (this.label = null))
  21758. }),
  21759. /* n.prototype.addTextSprite = function(e, t) {
  21760. this.removeTextSprite();
  21761. var i = document.createElement("canvas")
  21762. , n = i.getContext("2d");
  21763. i.width = 256,
  21764. i.height = 256;
  21765. var o = "Arial"
  21766. , a = 60;
  21767. n.font = "bold " + a + "px " + o,
  21768. n.fillStyle = "white";
  21769. var s = n.measureText(e).width;
  21770. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  21771. var l = new r.Texture(i);
  21772. l.needsUpdate = !0;
  21773. var c = new r.SpriteMaterial({
  21774. map: l,
  21775. color: t || 16428055
  21776. });
  21777. this.text3d = new r.Sprite(c),
  21778. this.text3d.position.copy(this.skyboxMesh.position),
  21779. this.floor.add(this.text3d)
  21780. }
  21781. ,
  21782. n.prototype.removeTextSprite = function() {
  21783. this.text3d && (this.floor.remove(this.text3d),
  21784. this.text3d = null)
  21785. }*/
  21786. (n.prototype.isAligned = function () {
  21787. return this.alignmentType === l.ALIGNED
  21788. }),
  21789. (n.filters = {
  21790. inDirection: function (e, t, i) {
  21791. return function (n) {
  21792. var r = n.position.clone().sub(e).normalize()
  21793. return r.dot(t) > i
  21794. }
  21795. },
  21796. inFloorDirection: function (e, t, i) {
  21797. return function (n) {
  21798. var r = n.floorPosition.clone().sub(e).normalize()
  21799. return r.dot(t) > i
  21800. }
  21801. },
  21802. inPanoDirection: function (e, t, i) {
  21803. return (
  21804. (i = a.navigation.panoScores ? a.navigation.filterStrictness : i),
  21805. function (n) {
  21806. var r = n.floorPosition.clone().sub(e).normalize(),
  21807. o = n.position.clone().sub(e).normalize()
  21808. return r.dot(t) > i || o.dot(t) > i
  21809. }
  21810. )
  21811. },
  21812. atFloor: function (e) {
  21813. return function (t) {
  21814. return !e || t.floor === e
  21815. }
  21816. },
  21817. not: function (e) {
  21818. return function (t) {
  21819. return t !== e
  21820. }
  21821. },
  21822. notIn: function (e) {
  21823. return function (t) {
  21824. return e.indexOf(t) === -1
  21825. }
  21826. },
  21827. isLoaded: function () {
  21828. return function (e) {
  21829. return e.isLoaded()
  21830. }
  21831. },
  21832. isNotLoaded: function () {
  21833. return function (e) {
  21834. return !e.isLoaded()
  21835. }
  21836. },
  21837. isCloseEnoughTo: function (e, t) {
  21838. return function (i) {
  21839. return e.distanceTo(i.floorPosition) < t
  21840. }
  21841. },
  21842. hasMinimumHeightDifferenceTo: function (e, t) {
  21843. return function (i) {
  21844. return Math.abs(i.position.y - e.y) > t
  21845. }
  21846. },
  21847. isNotBehindNormal: function (e, t) {
  21848. var i = new r.Vector3()
  21849. return (
  21850. (t = t.clone()),
  21851. function (n) {
  21852. var r = i.copy(n.position).sub(e).normalize()
  21853. return r.dot(t) > 0
  21854. }
  21855. )
  21856. },
  21857. isNeighbourPanoTo: function (e) {
  21858. return function (t) {
  21859. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  21860. }
  21861. },
  21862. isNeighbourOfNeighbourTo: function (e) {
  21863. return function (t) {
  21864. return (
  21865. !!e.neighbourPanos[t.id] ||
  21866. e.neighbourUUIDs.some(function (i) {
  21867. var n = e.model.panos.get(i)
  21868. return !!n && n.neighbourPanos[t.id]
  21869. })
  21870. )
  21871. }
  21872. },
  21873. isNotRecentlyFailed: function (e) {
  21874. return function (t) {
  21875. return Date.now() - t.failedLoadingAt > e
  21876. }
  21877. },
  21878. isOnVisibleFloor: function () {
  21879. return function (e) {
  21880. return !e.floor.hidden
  21881. }
  21882. },
  21883. isPanoAligned: function () {
  21884. return function (e) {
  21885. return e.isAligned()
  21886. }
  21887. }
  21888. }),
  21889. (n.sortFunctions = {
  21890. distanceToPoint: function (e) {
  21891. return function (t, i) {
  21892. return t.position.distanceTo(e) - i.position.distanceTo(e)
  21893. }
  21894. },
  21895. floorDistanceToPoint: function (e) {
  21896. return function (t, i) {
  21897. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  21898. }
  21899. },
  21900. choose: function (e) {
  21901. return function (t, i) {
  21902. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  21903. }
  21904. }
  21905. }),
  21906. (n.scoreFunctions = {
  21907. distance: function (e, t) {
  21908. return (
  21909. (t = t || a.navigation.distanceFactor),
  21910. function (i) {
  21911. return e ? e.position.distanceTo(i.position) * t : 0
  21912. }
  21913. )
  21914. },
  21915. distanceSquared: function (e, t) {
  21916. return (
  21917. (t = t || a.navigation.distanceFactor),
  21918. function (i) {
  21919. return e ? e.position.distanceToSquared(i.position) * t : 0
  21920. }
  21921. )
  21922. },
  21923. direction: function (e, t) {
  21924. return function (i) {
  21925. var n = i.position.clone().sub(e).normalize()
  21926. return n.dot(t) * a.navigation.directionFactor
  21927. }
  21928. },
  21929. angle: function (e, t) {
  21930. return function (i) {
  21931. var n = i.position.clone().sub(e).normalize()
  21932. return n.angleTo(t) * a.navigation.angleFactor
  21933. }
  21934. },
  21935. inFieldOfView: function (e, t) {
  21936. return function (i) {
  21937. var n = i.position.clone().sub(e).normalize()
  21938. return n.dot(t) > 0.75 ? 10 : -1
  21939. }
  21940. },
  21941. optionality: function (e) {
  21942. return function (t) {
  21943. var i = t.neighbourUUIDs.filter(function (t) {
  21944. return !(t in e.neighbourUUIDs) && t !== e.id
  21945. })
  21946. return i.length * a.navigation.optionalityFactor
  21947. }
  21948. },
  21949. penalizeHeightDifferenceUnder: function (e, t) {
  21950. return function (i) {
  21951. return e.y - i.position.y < t ? -20 : 0
  21952. }
  21953. }
  21954. }),
  21955. (t.exports = n)
  21956. }).call(this, '/js/objects/Panorama.js')
  21957. },
  21958. {
  21959. '../enum/AlignmentType': 17,
  21960. '../enum/GLCubeFaces': 25,
  21961. '../enum/PanoRendererEvents': 35,
  21962. '../enum/PanoSizeClass': 36,
  21963. '../enum/PanoramaEvents': 37,
  21964. '../enum/RenderLayers': 41,
  21965. '../enum/RenderOrder': 42,
  21966. '../enum/TileDownloaderEvents': 45,
  21967. '../enum/Viewmode': 51,
  21968. '../exception/BasicException': 55,
  21969. '../scene/SceneRenderer': 158,
  21970. '../settings': 166,
  21971. '../tile/TileUtils': 174,
  21972. '../util/ajax': 181,
  21973. '../util/common': 185,
  21974. '../util/lerp': 188,
  21975. '../util/logger': 189,
  21976. '../util/panorama': 191,
  21977. '../util/texture': 194,
  21978. '../util/transitions': 195,
  21979. events: 202,
  21980. three: 217
  21981. }
  21982. ],
  21983. 149: [
  21984. function (e, t, i) {
  21985. 'use strict'
  21986. function n(e) {
  21987. var t = r.UniformsUtils.clone(c.waypoint.uniforms)
  21988. ;(t.map.value = d),
  21989. (t.opacity.value = 0),
  21990. t.color.value.set(o.reticuleColor),
  21991. (t.showMouseMarker = !window.DATA.hideMouseMarker)
  21992. r.Mesh.call(
  21993. this,
  21994. new r.PlaneBufferGeometry(0.4, 0.4, 1, 1),
  21995. new r.RawShaderMaterial({
  21996. side: r.DoubleSide,
  21997. depthWrite: !1,
  21998. depthTest: !1,
  21999. transparent: !0,
  22000. vertexShader: c.waypoint.vertexShader,
  22001. fragmentShader: c.waypoint.fragmentShader,
  22002. uniforms: t,
  22003. name: 'waypoint',
  22004. opacity: 0,
  22005. visible: t.showMouseMarker // 显示/隐藏鼠标标志
  22006. })
  22007. ),
  22008. this.layers.set(h.RETICULE),
  22009. (this.renderOrder = u.reticule),
  22010. (this.player = e),
  22011. (this.direction = new r.Vector3()),
  22012. (this.hidden = !0),
  22013. (this.mouseLastMoveTime = Date.now())
  22014. }
  22015. var r = e('three'),
  22016. o = e('../settings'),
  22017. a = e('../util/transitions'),
  22018. s = e('../util/texture'),
  22019. l = e('../util/lerp'),
  22020. c = e('../shaders'),
  22021. h = e('../enum/RenderLayers'),
  22022. u = e('../enum/RenderOrder'),
  22023. d = s.load('images/reticule.png')
  22024. d.anisotropy = browser.isMobile() ? 1 : 4 //各向异性
  22025. ;(n.prototype = Object.create(r.Mesh.prototype)),
  22026. (n.prototype.move = function (e, t, i) {
  22027. ;(this.hidden = i), (this.mouseLastMoveTime = Date.now())
  22028. }),
  22029. (n.prototype.hide = function () {
  22030. this.hidden ||
  22031. ((this.hidden = !0),
  22032. a.start(
  22033. l.property(this.material.uniforms.opacity, 'value', 0),
  22034. o.reticuleOpacityTransitionTime
  22035. ))
  22036. }),
  22037. (n.prototype.show = function () {
  22038. ;(this.hidden = !1),
  22039. this.material.opacity <= 0 &&
  22040. a.start(
  22041. l.property(
  22042. this.material.uniforms.opacity,
  22043. 'value',
  22044. o[this.player.mode].reticuleOpacity
  22045. ),
  22046. o.reticuleOpacityTransitionTime
  22047. )
  22048. }),
  22049. (n.prototype.update = function () {
  22050. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout &&
  22051. !this.hidden &&
  22052. this.hide()
  22053. }),
  22054. (n.prototype.updatePosition = function (e, t) {
  22055. if (!this.hidden) {
  22056. if (!t) return this.hide()
  22057. var i = t.point,
  22058. n = e.distanceTo(i),
  22059. r = 1 + 0.01 * n
  22060. n < 1 && (r -= 1 - n),
  22061. this.show(),
  22062. this.scale.set(r, r, r),
  22063. (this.direction = this.direction.multiplyScalar(0.8)),
  22064. this.direction.add(t.face.normal.clone().multiplyScalar(0.2)),
  22065. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(0.01)),
  22066. this.lookAt(this.position.clone().add(this.direction))
  22067. }
  22068. }),
  22069. (n.prototype.writeAstag = function () {
  22070. var e =
  22071. Math.floor(4294967296 * (1 + Math.random())).toString(16) +
  22072. Math.floor(16 * (1 + Math.random())).toString(16),
  22073. t = new Date()
  22074. this.tagCount = 'undefined' == typeof this.tagCount ? 1 : this.tagCount + 1
  22075. var i = {
  22076. enabled: !0,
  22077. version: '0',
  22078. created: t.toISOString(),
  22079. created_by: 'APITest',
  22080. position: this.position.clone(),
  22081. stem: {
  22082. enabled: o.tags.pole.enabled,
  22083. direction: this.direction.multiplyScalar(o.tags.pole.height)
  22084. },
  22085. label: 'tag ' + this.tagCount,
  22086. description: 'Description ' + e,
  22087. floor: (function (e) {
  22088. if (e.currentFloor) {
  22089. var t = e.floors.indexOf(e.currentFloor)
  22090. return t > -1 ? t : void 0
  22091. }
  22092. })(this.player.model),
  22093. type: 'info',
  22094. metadata: {
  22095. preferred_camera: {
  22096. mode: this.player.mode
  22097. }
  22098. }
  22099. }
  22100. console.log('--------------------------'), console.log(JSON.stringify(i))
  22101. var n = this.player.model.addtag(e, i).build()
  22102. n &&
  22103. (n.disc && this.player.tagDiscs.push(n.disc),
  22104. n.visible || n.show(o.tags.startup.fadeInDuration))
  22105. }),
  22106. (t.exports = n)
  22107. },
  22108. {
  22109. '../enum/RenderLayers': 41,
  22110. '../enum/RenderOrder': 42,
  22111. '../settings': 166,
  22112. '../shaders': 167,
  22113. '../util/lerp': 188,
  22114. '../util/texture': 194,
  22115. '../util/transitions': 195,
  22116. three: 217
  22117. }
  22118. ],
  22119. 150: [
  22120. function (e, t, i) {
  22121. 'use strict'
  22122. function n(e, t) {
  22123. ;(this.chunks = []),
  22124. (this.floorId = e),
  22125. (this.roomId = t),
  22126. (this.position = new r.Vector3())
  22127. }
  22128. var r = e('three')
  22129. ;(n.prototype.addChunk = function (e) {
  22130. this.chunks.push(e)
  22131. }),
  22132. (n.prototype.calcBoundaries = function () {
  22133. for (
  22134. var e = new r.Vector3(),
  22135. t = new r.Vector3(0, 0, 0),
  22136. i = new r.Vector3(0, 0, 0),
  22137. n = new r.Vector3(0, 0, 0),
  22138. o = 0,
  22139. a = 0;
  22140. a < this.chunks.length;
  22141. a++
  22142. ) {
  22143. var s = this.chunks[a],
  22144. l = s.geometry.attributes.position
  22145. if (l)
  22146. for (var c = 0; c < l.array.length; c += 3)
  22147. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  22148. t.add(e),
  22149. 0 === c ? (i.copy(e), n.copy(e)) : (i.max(e), n.min(e)),
  22150. o++
  22151. }
  22152. o > 0 ? (t.multiplyScalar(1 / o), (this.average = t)) : (this.average = null),
  22153. (this.boundsMax = i),
  22154. (this.boundsMin = n),
  22155. (this.center = new r.Vector3()),
  22156. this.center.copy(i).sub(n).multiplyScalar(0.5).add(n)
  22157. }),
  22158. (t.exports = n)
  22159. },
  22160. {
  22161. three: 217
  22162. }
  22163. ],
  22164. 151: [
  22165. function (e, t, i) {
  22166. ;(function (i) {
  22167. 'use strict'
  22168. function n(e, t, i) {
  22169. ;(this.obj3d = null),
  22170. (this.nodes = []),
  22171. (this.colorHull = []),
  22172. (this.shortPaths = {}),
  22173. (this.floorHull = null),
  22174. (this.cameraHull = null),
  22175. (this.floorPathDistance = 0),
  22176. (this.floorCurvePoints = null),
  22177. (this.floorCurveColors = null),
  22178. (this.camCurvePoints = null),
  22179. (this.warpDestHeroLoc = null),
  22180. (this.warpDestPano = null),
  22181. (this.warpPathPoints = null),
  22182. (this.warpPathLengths = [0]),
  22183. (this.warpLength = 0),
  22184. (this.closeWarpDistance = 4),
  22185. (this.UP = A.UP.clone()),
  22186. (this.longestStep = 0),
  22187. (this.upcomingTransType = null),
  22188. (this.burnsDir = 1), //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  22189. (this.prevNextDist = 0),
  22190. (this.nextI = 0),
  22191. (this.activeTransType = null),
  22192. (this.lastTransType = null),
  22193. (this.bunnyObj = null),
  22194. (this.director = e),
  22195. (this.player = t),
  22196. (this.playerControls = i),
  22197. (this.modelManager = t.modelManager),
  22198. this.updateModel(),
  22199. this.updateDefaultsFromModelData(),
  22200. this.bindEvents(),
  22201. (this.warping = !1),
  22202. (this.waitingToWarp = !1),
  22203. (this.warpInterrupted = !1),
  22204. (this.warpInterruptionBlackoutStyle = null),
  22205. (this.warpInterruptionTravelTime = null)
  22206. }
  22207. var r = e('three'),
  22208. o = e('../util/logger'),
  22209. a = e('../enum/Viewmode'),
  22210. s = e('../enum/RenderOrder'),
  22211. l = e('../enum/WarpStyle'),
  22212. c = e('../settings'),
  22213. h = e('../util/math'),
  22214. u = e('../util/lerp'),
  22215. d = e('../util/easing'),
  22216. p = e('../util/transitions'),
  22217. f = e('../objects/Snapshot'),
  22218. g = e('../effects'),
  22219. m = e('../shaders'),
  22220. v = (e('../gui/gui'), e('../util/texture')),
  22221. A = e('../enum/Vectors'),
  22222. y = (e('../model/ModelManager'), new o(i)),
  22223. C = e('../enum/PlayerEvents'),
  22224. I = e('../enum/BlackoutStyle'),
  22225. E = e('../enum/ModelManagerEvents'),
  22226. b = e('../constants'),
  22227. w = {
  22228. path: v.loadBase64(
  22229. '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'
  22230. ),
  22231. pathEnd: v.load('images/End.png'),
  22232. pathStart: v.loadBase64(
  22233. '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=='
  22234. )
  22235. }
  22236. ;(n.prototype.setScene = function (e) {
  22237. this.createCpm(e), this.createBunnyObj(e)
  22238. }),
  22239. (n.prototype.updateModel = function () {
  22240. this.model = this.modelManager.getActiveModel()
  22241. }),
  22242. (n.prototype.bindEvents = function () {
  22243. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  22244. }),
  22245. (n.prototype.updateDefaultsFromModelData = function () {
  22246. this.model.data
  22247. }),
  22248. (n.prototype.pointPathDistance = function (e) {
  22249. for (var t = 0, i = 1; i < e.length; i += 1) t += e[i - 1].distanceTo(e[i])
  22250. return t
  22251. }),
  22252. (n.prototype.pointPathLengths = function (e) {
  22253. for (var t = [0], i = 1; i < e.length; i += 1)
  22254. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]))
  22255. return t
  22256. }),
  22257. (n.prototype.interpAlongPath = function (e, t, i) {
  22258. var n,
  22259. o = new r.Vector3(),
  22260. a = t[t.length - 1]
  22261. if (i < 1) {
  22262. n = i * a
  22263. for (var s = 1; s < t.length; s += 1)
  22264. if (t[s] > n) {
  22265. var l = (n - t[s - 1]) / (t[s] - t[s - 1])
  22266. return o.copy(e[s]), o.sub(e[s - 1]), o.multiplyScalar(l), o.add(e[s - 1]), o
  22267. }
  22268. } else o.copy(e[e.length - 1])
  22269. return o
  22270. }),
  22271. (n.prototype.pathHeight = function () {
  22272. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  22273. }),
  22274. (n.prototype.createBunnyObj = function (e) {
  22275. this.bunnyObj ||
  22276. ((this.bunnyObj = new r.AxisHelper(0.1)),
  22277. (this.bunnyObj.visible = c.warp.showBunny)),
  22278. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  22279. e.add(this.bunnyObj)
  22280. }),
  22281. (n.prototype.createCpm = function (e) {
  22282. if (!this.currentPanoMarker) {
  22283. var t = this.makeWaypointObj(w.pathEnd, 'Current')
  22284. ;(t.material.uniforms.opacity.value = 0),
  22285. (this.currentPanoMarker = {
  22286. mesh: t,
  22287. placed: !1
  22288. })
  22289. }
  22290. this.currentPanoMarker.mesh.parent &&
  22291. this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  22292. this.placeCpm(),
  22293. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  22294. }),
  22295. (n.prototype.placeCpm = function () {
  22296. if (
  22297. c.path.mapGuides &&
  22298. this.player.currentPano &&
  22299. this.player.currentPano.isAligned()
  22300. ) {
  22301. var e = this.player.currentPano.floor
  22302. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor &&
  22303. (this.currentPanoMarker.mesh.parent &&
  22304. this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  22305. e.add(this.currentPanoMarker.mesh)),
  22306. this.currentPanoMarker.mesh.position
  22307. .copy(this.player.currentPano.floorPosition)
  22308. .sub(e.position),
  22309. (this.currentPanoMarker.mesh.position.y += this.pathHeight()),
  22310. (this.currentPanoMarker.placed = !0)
  22311. } else this.popOutCpm()
  22312. }),
  22313. (n.prototype.fadeInCpm = function (e) {
  22314. ;(this.player.mode === a.PANORAMA &&
  22315. this.player.currentPano &&
  22316. !this.player.currentPano.isAligned()) ||
  22317. (c.path.mapGuides &&
  22318. this.currentPanoMarker.placed &&
  22319. p.start(
  22320. u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, 'value', 1),
  22321. e
  22322. ))
  22323. }),
  22324. (n.prototype.fadeOutCpm = function (e) {
  22325. p.start(
  22326. u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, 'value', 0),
  22327. e
  22328. )
  22329. }),
  22330. (n.prototype.popInCpm = function () {
  22331. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  22332. }),
  22333. (n.prototype.popOutCpm = function () {
  22334. this.fadeOutCpm(2)
  22335. }),
  22336. (n.prototype.brushPrefs = {
  22337. linewidth: 7,
  22338. strokeWidth: 15,
  22339. cvSegments: 48,
  22340. paveStep: 0.1,
  22341. paveWidth: 0.2,
  22342. lookBlendDist: 3,
  22343. maxTurn: r.Math.degToRad(2)
  22344. }),
  22345. (n.prototype.panoPathDistance = function (e) {
  22346. var t = this.model.panos
  22347. if (!e || e.length < 2) return 0
  22348. for (var i = [], n = 0; n < e.length; n += 1) i.push(t.get(e[n]).floorPosition)
  22349. return this.pointPathDistance(i)
  22350. }),
  22351. (n.prototype.loadTileTexture = function (e) {
  22352. var t = v.load(
  22353. e,
  22354. function (t) {
  22355. ;(t.wrapS = r.RepeatWrapping),
  22356. (t.wrapT = r.RepeatWrapping),
  22357. (t.needsUpdate = !0),
  22358. y.debug('path texture "' + e + '" is ready')
  22359. },
  22360. function () {
  22361. y.error('path texture "' + e + '" failed')
  22362. }
  22363. )
  22364. return (t.mapping = r.UVMapping), t
  22365. }),
  22366. (n.prototype.buildWarpDestinationDescriptor = function (e, t, i, n, r, o) {
  22367. var a = {
  22368. cameraMode: n,
  22369. position: e,
  22370. quaternion: t,
  22371. panoId: i,
  22372. orthoZoom: o,
  22373. floorVisibility: r,
  22374. thumbUrl: null,
  22375. name: null
  22376. }
  22377. return new f(a)
  22378. }),
  22379. (n.prototype.buildWarpDestinationDescriptorFromHero = function (e) {
  22380. return this.buildWarpDestinationDescriptor(
  22381. e.position,
  22382. e.quaternion,
  22383. this.getHeroId(e),
  22384. e.cameraMode,
  22385. e.floorVisibility,
  22386. e.orthoZoom
  22387. )
  22388. }),
  22389. (n.prototype.setWarpDestination = function (e) {
  22390. this.warpDestHeroLoc = e
  22391. }),
  22392. (n.prototype.setWarpDestinationByHeroIndex = function (e) {
  22393. var t = this.getHeroDescriptorByHeroIndex(e)
  22394. return null !== t && (this.setWarpDestination(t), !0)
  22395. }),
  22396. (n.prototype.setWarpDestinationByPano = function (e, t) {
  22397. var i = this.model.panos.get(e.id)
  22398. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  22399. }),
  22400. (n.prototype.setWarpDestinationByPanoId = function (e, t) {
  22401. var i = this.model.panos.get(e)
  22402. if (i) {
  22403. t = t || new r.Quaternion()
  22404. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, 'panorama', [], -1)
  22405. return this.setWarpDestination(n), !0
  22406. }
  22407. return !1
  22408. }),
  22409. (n.prototype.getHeroDescriptorByHeroIndex = function (e) {
  22410. var t = this.model.heroCount()
  22411. /* if (null !== this.warpDestHeroLoc && t < 2)
  22412. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  22413. this.model.getHeroDescriptorByIndex(0); */
  22414. var i = this.model.getHeroDescriptorByIndex(e)
  22415. if (i) {
  22416. var n = i.isPano() ? i.panoId : i.cameraMode
  22417. y.debug(
  22418. 'ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' +
  22419. n +
  22420. '" out of ' +
  22421. t +
  22422. ' choices.'
  22423. )
  22424. }
  22425. return i
  22426. }),
  22427. (n.prototype.getHeroDescriptorByPano = function (e) {
  22428. var t = this.model.panos.get(e.id)
  22429. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  22430. }),
  22431. (n.prototype.getHeroDescriptorByPanoId = function (e) {
  22432. var t = this.getHeroIndexFromPanoId(e)
  22433. return this.getHeroDescriptorByHeroIndex(t)
  22434. }),
  22435. (n.prototype.getHeroIndexFromPanoId = function (e) {
  22436. for (var t = 0; t < this.model.heroLocations.length; t++) {
  22437. var i = this.model.heroLocations[t],
  22438. n = this.getHeroId(i)
  22439. if (n && n === e) return t
  22440. }
  22441. return -1
  22442. }),
  22443. (n.prototype.getHeroPano = function (e) {
  22444. if (null === e) return y.warn('getHeroPano(): no destination'), null
  22445. var t = this.getHeroId(e),
  22446. i = this.model.panos.get(t)
  22447. return (
  22448. void 0 === i &&
  22449. ((i = null), '' !== t && y.debug('unable to find pano "' + t + '"')),
  22450. i
  22451. )
  22452. }),
  22453. (n.prototype.getHeroId = function (e) {
  22454. return e.panoId
  22455. }),
  22456. (n.prototype.setWarpDestPano = function () {
  22457. return (this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc)), this.warpDestPano
  22458. }),
  22459. (n.prototype.brushToWarpPano = function (e, t) {
  22460. if ((this.discardPathObject(), !this.setWarpDestPano())) return !1
  22461. if (
  22462. (this.warpDestHeroLoc.cameraMode !== a.PANORAMA &&
  22463. y.warn('Can only brush from pano to pano'),
  22464. !this.warpDestPano)
  22465. )
  22466. return y.info('No brush'), !1
  22467. if (!this.player.currentPano)
  22468. return y.debug('No current pano, visibility undefined'), !1
  22469. if (!this.warpDestPano) return y.info('No wPano, visibility undefined'), !1
  22470. if (!this.warpDestPano.isAligned())
  22471. return y.debug('Cannot brush to unaligned pano'), !1
  22472. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides,
  22473. n = !0
  22474. if (this.player.currentPano.id === this.warpDestPano.id)
  22475. y.debug('Already at destination pano')
  22476. else {
  22477. ;(this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano)),
  22478. (n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1),
  22479. (this.obj3d = new r.Object3D()),
  22480. y.debug(
  22481. 'Brushing from "' +
  22482. this.player.currentPano.id +
  22483. '" to "' +
  22484. this.warpDestPano.id +
  22485. '" (' +
  22486. (this.nodes ? this.nodes.length : 0) +
  22487. ')'
  22488. ),
  22489. n
  22490. ? (y.info('No "walkable" route, using fall-back warp style transition'),
  22491. (e = t))
  22492. : (this.setPathHulls(this.nodes),
  22493. this.setFloorCurves(),
  22494. i &&
  22495. ('chevron' === c.path.style
  22496. ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints))
  22497. : 'ribbon' === c.path.style &&
  22498. this.obj3d.add(
  22499. this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)
  22500. ))),
  22501. this.player.currentPano.floor.add(this.obj3d)
  22502. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN,
  22503. s = e === l.STD
  22504. if (!n && (i || s)) {
  22505. if (o) {
  22506. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints)
  22507. this.obj3d.add(h)
  22508. }
  22509. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1])
  22510. this.obj3d.add(u)
  22511. }
  22512. this.appearSlow()
  22513. }
  22514. return (this.upcomingTransType = e), !n
  22515. }),
  22516. (n.prototype.findShortestPath = function (e, t) {
  22517. if (!e || !t) return null
  22518. var i = c.warp.walkExtraPanosDistance,
  22519. n = e.id + ':' + t.id + ':' + i
  22520. if (this.shortPaths.hasOwnProperty(n))
  22521. return this.shortPaths[n] ? this.shortPaths[n].slice() : null
  22522. var r = t.id + ':' + e.id + ':' + i
  22523. if (this.shortPaths.hasOwnProperty(r))
  22524. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null
  22525. var o = this.model.panos.aStarSearch(e, t)
  22526. return (
  22527. this.model.panos.includeNodesNearPath(o, i),
  22528. (this.shortPaths[n] = o ? o.slice() : null),
  22529. o
  22530. )
  22531. }),
  22532. (n.prototype.makePathHulls = function (e) {
  22533. var t,
  22534. i,
  22535. n,
  22536. r,
  22537. o,
  22538. a = 0,
  22539. s = [],
  22540. l = [],
  22541. h = [],
  22542. u = this.model.panos
  22543. ;(t = u.get(e[0])), (r = t.floor.floorIndex)
  22544. for (var d = 0; d < e.length; d += 1)
  22545. (t = u.get(e[d])),
  22546. (i = t.floorPosition.clone().sub(this.model.position)),
  22547. (i.y += this.pathHeight()),
  22548. s.push(i),
  22549. l.push(t.position.clone()),
  22550. (n = t.floor.floorIndex),
  22551. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  22552. d > 0 && ((o = l[d].distanceTo(l[d - 1])), o > a && (a = o))
  22553. return (
  22554. a > this.longestStep &&
  22555. ((this.longestStep = a), y.debug('path contains ' + a + ' meter segment')),
  22556. {
  22557. floor: s,
  22558. camera: l,
  22559. color: h
  22560. }
  22561. )
  22562. }),
  22563. (n.prototype.makeFloorCurves = function (e, t, i) {
  22564. var n =
  22565. this.player.mode === a.PANORAMA
  22566. ? c.path.waypointIndoorRadius
  22567. : c.path.waypointRadius,
  22568. o = this.pointPathDistance(e) - 2 * n,
  22569. s = e.slice(0),
  22570. l = s[1].clone().sub(s[0])
  22571. ;(l.y = 0),
  22572. l.normalize().multiplyScalar(n),
  22573. (s[0] = new r.Vector3().copy(s[0]).add(l)),
  22574. (l = s[s.length - 2].clone().sub(s[s.length - 1])),
  22575. (l.y = 0),
  22576. l.normalize().multiplyScalar(n),
  22577. (s[s.length - 1] = new r.Vector3().copy(s[s.length - 1]).add(l))
  22578. var h = new r.CatmullRomCurve3(s),
  22579. u = Math.floor(o / i)
  22580. ;(u = 4 * Math.floor(u / 4)), (u = Math.max(4, u))
  22581. for (
  22582. var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3(), A = 0;
  22583. A < g.length;
  22584. A += 1
  22585. ) {
  22586. ;(f = 0), (d = g[A].distanceTo(e[0]))
  22587. for (var y = 1; y < e.length; y += 1)
  22588. v.copy(g[A]).sub(e[y]), (v.y *= 4), (p = v.length()), p < d && (f = y)
  22589. m.push(t[f])
  22590. }
  22591. return {
  22592. distance: o,
  22593. points: g,
  22594. colors: m
  22595. }
  22596. }),
  22597. (n.prototype.makeCameraCurvePoints = function (e, t) {
  22598. var i = this.pointPathDistance(e),
  22599. n = new r.CatmullRomCurve3(e)
  22600. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  22601. }),
  22602. (n.prototype.makeCameraCurveTangents = function (e, t) {
  22603. var i = this.pointPathDistance(e),
  22604. n = new r.CatmullRomCurve3(e),
  22605. o = Math.max(2, Math.floor(i / t))
  22606. o || (o = 5)
  22607. for (var a = [], s = 0; s <= o; s++) a.push(n.getTangentAt(s / o))
  22608. return a
  22609. }),
  22610. (n.prototype.setPathHulls = function (e) {
  22611. var t = this.makePathHulls(e)
  22612. ;(this.floorHull = t.floor), (this.cameraHull = t.camera), (this.colorHull = t.color)
  22613. }),
  22614. (n.prototype.setFloorCurves = function () {
  22615. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep)
  22616. ;(this.floorPathDistance = e.distance),
  22617. (this.floorCurvePoints = e.points),
  22618. (this.floorCurveColors = e.colors)
  22619. }),
  22620. (n.prototype.setCameraCurvePoints = function () {
  22621. this.camCurvePoints = this.makeCameraCurvePoints(
  22622. this.cameraHull,
  22623. c.warp.stepFactor * this.brushPrefs.paveStep
  22624. )
  22625. }),
  22626. (n.prototype.chooseWarpPath = function (e) {
  22627. var t,
  22628. i,
  22629. n,
  22630. o = this.playerControls.cameras[a.PANORAMA]
  22631. if (this.player.currentPano === this.warpDestPano || !e)
  22632. return (this.warpPathPoints = null), (this.warpLength = 0), !1
  22633. ;(this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano)),
  22634. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1
  22635. ? (y.debug('warp path to unreachable node'),
  22636. (t = this.warpDestPano.position.clone().sub(o.position)),
  22637. (i = t.clone().negate()),
  22638. t.multiplyScalar(0.15).add(o.position),
  22639. i.multiplyScalar(0.15).add(this.warpDestPano.position),
  22640. (t.y = o.position.y),
  22641. (i.y = this.warpDestPano.position.y),
  22642. (n = new r.CubicBezierCurve3(
  22643. o.position.clone(),
  22644. t,
  22645. i,
  22646. this.warpDestPano.position.clone()
  22647. )),
  22648. (this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)))
  22649. : (y.debug(
  22650. 'follow warp path (path distance was ' +
  22651. this.nodes.length +
  22652. ' nodes, ' +
  22653. this.floorPathDistance +
  22654. ')'
  22655. ),
  22656. this.setCameraCurvePoints(),
  22657. (this.warpPathPoints = this.camCurvePoints.slice(0))),
  22658. (this.warpLength = 0),
  22659. (this.warpPathLengths = [0])
  22660. for (
  22661. var s = new r.Vector3(),
  22662. l = new r.Vector3(),
  22663. h = Math.cos(r.Math.degToRad(c.warp.minBrakeAngle)),
  22664. u = Math.cos(r.Math.degToRad(c.warp.maxBrakeAngle)),
  22665. d = 1;
  22666. d < this.warpPathPoints.length;
  22667. d += 1
  22668. ) {
  22669. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d])
  22670. var p = s.length()
  22671. s.y *= c.warp.climbEffort
  22672. var f = s.length() / p
  22673. if (d > 1) {
  22674. s.setY(0).normalize(),
  22675. l
  22676. .copy(this.warpPathPoints[d - 2])
  22677. .sub(this.warpPathPoints[d - 1])
  22678. .setY(0)
  22679. .normalize()
  22680. var g = Math.min(1, s.dot(l)),
  22681. m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h))
  22682. f = Math.max(m, f)
  22683. }
  22684. ;(this.warpLength += p * f), (this.warpPathLengths[d] = this.warpLength)
  22685. }
  22686. return !0
  22687. }),
  22688. (n.prototype.drawPathRibbon = function (e, t) {
  22689. this.bunnyObj.visible = c.warp.showBunny
  22690. for (
  22691. var i = 0.6 * c.path.ribbonWidth * 0.5,
  22692. n = new r.Vector3(),
  22693. o = new r.Vector3(0, this.pathHeight(), 0),
  22694. l = new r.Geometry(),
  22695. h = new r.Vector3(),
  22696. u = 0;
  22697. u < e.length;
  22698. u += 1
  22699. ) {
  22700. h.copy(e[u]),
  22701. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  22702. h.normalize(),
  22703. n.crossVectors(h, A.UP),
  22704. n.multiplyScalar(i)
  22705. var d = new r.Vector3().copy(e[u]).add(o)
  22706. d.sub(n),
  22707. l.vertices.push(d),
  22708. (d = new r.Vector3().copy(e[u]).add(o)),
  22709. d.add(n),
  22710. l.vertices.push(d)
  22711. }
  22712. var p,
  22713. f = 0
  22714. for (u = 0; u < e.length - 1; u += 1) {
  22715. var g = 2 * u,
  22716. v = f
  22717. f += e[u + 1].distanceTo(e[u])
  22718. var y = f,
  22719. C = t[u],
  22720. I = t[u + 1]
  22721. ;(p = new r.Face3(g, g + 1, g + 2)),
  22722. (p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)]),
  22723. l.faces.push(p),
  22724. l.faceVertexUvs[0].push([
  22725. new r.Vector2(0, v),
  22726. new r.Vector2(1, v),
  22727. new r.Vector2(0, y)
  22728. ]),
  22729. (p = new r.Face3(g + 2, g + 1, g + 3)),
  22730. (p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)]),
  22731. l.faces.push(p),
  22732. l.faceVertexUvs[0].push([
  22733. new r.Vector2(0, y),
  22734. new r.Vector2(1, v),
  22735. new r.Vector2(1, y)
  22736. ])
  22737. }
  22738. l.computeFaceNormals(), l.computeVertexNormals()
  22739. var E, b
  22740. this.player.mode === a.PANORAMA
  22741. ? ((b = r.UniformsUtils.clone(m.ribbon.uniforms)),
  22742. (b.map.value = w.path),
  22743. (b.opacity.value = 0),
  22744. b.color.value.set(c.path.color),
  22745. (E = new r.RawShaderMaterial({
  22746. side: r.DoubleSide,
  22747. depthWrite: !1,
  22748. transparent: !0,
  22749. vertexShader: m.ribbon.vertexShader,
  22750. fragmentShader: m.ribbon.fragmentShader,
  22751. uniforms: b,
  22752. name: 'ribbonT',
  22753. opacity: 0
  22754. })))
  22755. : (E = new r.MeshBasicMaterial({
  22756. color: 16777215,
  22757. side: r.DoubleSide,
  22758. name: 'ribbonOut',
  22759. vertexColors: r.VertexColors
  22760. }))
  22761. var _ = new r.Mesh(l, E)
  22762. return (
  22763. (_.name = 'ribbon'),
  22764. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  22765. _
  22766. )
  22767. }),
  22768. (n.prototype.drawPathPavement = function (e) {
  22769. for (
  22770. var t,
  22771. i = 0.25,
  22772. n = new r.Vector3(),
  22773. o = new r.Geometry(),
  22774. s = new r.Vector3(),
  22775. l = 0;
  22776. l < e.length;
  22777. l += 1
  22778. )
  22779. s.copy(e[l]),
  22780. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  22781. s.normalize(),
  22782. n.crossVectors(s, A.UP),
  22783. n.multiplyScalar(this.brushPrefs.paveWidth),
  22784. (t = new r.Vector3().copy(e[l])),
  22785. t.sub(n),
  22786. o.vertices.push(t),
  22787. o.vertices.push(new r.Vector3().copy(e[l])),
  22788. (t = new r.Vector3().copy(e[l])),
  22789. t.add(n),
  22790. o.vertices.push(t)
  22791. var h, u, d
  22792. for (l = 0; l < e.length - 1; l += 1)
  22793. (h = 3 * l + 1),
  22794. (u = l * i),
  22795. (d = u + i),
  22796. o.faces.push(new r.Face3(h - 1, h, h + 3)),
  22797. o.faceVertexUvs[0].push([
  22798. new r.Vector2(0, u),
  22799. new r.Vector2(0.5, u),
  22800. new r.Vector2(0.5, d)
  22801. ]),
  22802. o.faces.push(new r.Face3(h + 3, h + 2, h - 1)),
  22803. o.faceVertexUvs[0].push([
  22804. new r.Vector2(0.5, d),
  22805. new r.Vector2(0, d),
  22806. new r.Vector2(0, u)
  22807. ]),
  22808. o.faces.push(new r.Face3(h + 3, h, h + 1)),
  22809. o.faceVertexUvs[0].push([
  22810. new r.Vector2(0.5, d),
  22811. new r.Vector2(0.5, u),
  22812. new r.Vector2(1, u)
  22813. ]),
  22814. o.faces.push(new r.Face3(h + 3, h + 1, h + 4)),
  22815. o.faceVertexUvs[0].push([
  22816. new r.Vector2(0.5, d),
  22817. new r.Vector2(1, u),
  22818. new r.Vector2(1, d)
  22819. ])
  22820. var p =
  22821. this.player.mode === a.PANORAMA
  22822. ? new r.MeshBasicMaterial({
  22823. color: c.path.color,
  22824. side: r.DoubleSide,
  22825. transparent: !0,
  22826. depthWrite: !1,
  22827. opacity: 0,
  22828. name: 'paveT',
  22829. map: w.path
  22830. })
  22831. : new r.MeshBasicMaterial({
  22832. color: c.path.color,
  22833. side: r.DoubleSide,
  22834. transparent: !0,
  22835. depthWrite: !1,
  22836. opacity: 1,
  22837. name: 'paveO',
  22838. map: w.path
  22839. })
  22840. return new r.Mesh(o, p)
  22841. }),
  22842. (n.prototype.hintPrefs = {
  22843. rad: 0.18,
  22844. width: 0.0125,
  22845. depth: 0.0625,
  22846. setBack: -0.04,
  22847. markRad: 0.25,
  22848. markInnerRad: 0.16
  22849. }),
  22850. (n.prototype.makeWaypointObj = function (e, t) {
  22851. var i = new r.Geometry(),
  22852. n =
  22853. this.player.mode === a.PANORAMA
  22854. ? c.path.waypointIndoorRadius
  22855. : c.path.waypointRadius,
  22856. o = this.pathHeight()
  22857. i.vertices.push(
  22858. new r.Vector3(-n, o, n),
  22859. new r.Vector3(-n, o, -n),
  22860. new r.Vector3(n, o, -n),
  22861. new r.Vector3(n, o, n)
  22862. ),
  22863. i.faces.push(new r.Face3(0, 1, 2), new r.Face3(2, 3, 0)),
  22864. i.faceVertexUvs[0].push([
  22865. new r.Vector2(0, 0),
  22866. new r.Vector2(1, 0),
  22867. new r.Vector2(1, 1)
  22868. ]),
  22869. i.faceVertexUvs[0].push([
  22870. new r.Vector2(1, 1),
  22871. new r.Vector2(0, 1),
  22872. new r.Vector2(0, 0)
  22873. ])
  22874. var s = r.UniformsUtils.clone(m.waypoint.uniforms)
  22875. ;(s.map.value = e), (s.opacity.value = 0), s.color.value.set(c.path.color)
  22876. var l = {
  22877. side: r.DoubleSide,
  22878. depthWrite: !1,
  22879. transparent: !0,
  22880. vertexShader: m.waypoint.vertexShader,
  22881. fragmentShader: m.waypoint.fragmentShader,
  22882. uniforms: s,
  22883. name: 'waypoint',
  22884. opacity: 0
  22885. }
  22886. this.player.mode !== a.PANORAMA && ((l.depthTest = !1), (l.name = 'wayPtOut'))
  22887. var h = new r.RawShaderMaterial(l),
  22888. u = new r.Mesh(i, h)
  22889. return (u.name = t), u
  22890. }),
  22891. (n.prototype.makeStartMarker = function (e, t) {
  22892. var i = new r.Vector3().copy(t[1]).sub(t[0])
  22893. ;(i.y = 0), i.normalize()
  22894. var n = Math.acos(i.x),
  22895. o = this.makeWaypointObj(w.pathStart, 'Start')
  22896. return o.rotateOnAxis(new r.Vector3(0, 1, 0), n), o.position.copy(e), o
  22897. }),
  22898. (n.prototype.makeEndMarker = function (e) {
  22899. var t = this.makeWaypointObj(w.pathEnd, 'End'),
  22900. i = this.model.panos.get(this.nodes[0]).floor.floorIndex,
  22901. n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex
  22902. return (
  22903. i < n
  22904. ? t.material.uniforms.color.value.set(c.path.colorUp)
  22905. : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  22906. t.position.copy(e),
  22907. t
  22908. )
  22909. }),
  22910. (n.prototype.pathClean = function (e) {
  22911. if (e) {
  22912. for (var t in e.children) this.pathClean(e.children[t])
  22913. e.geometry && e.geometry.dispose(), e.material && e.material.dispose()
  22914. }
  22915. }),
  22916. (n.prototype.discardPathObject = function () {
  22917. if (this.obj3d) {
  22918. var e = this.obj3d.parent
  22919. e && e.remove(this.obj3d), this.pathClean(this.obj3d)
  22920. }
  22921. ;(this.obj3d = null), this.popInCpm()
  22922. }),
  22923. (n.prototype.discardSlow = function () {
  22924. if (this.obj3d) {
  22925. if (this.player.mode !== a.PANORAMA) return void this.discardPathObject()
  22926. for (
  22927. var e,
  22928. t = this,
  22929. i = 0,
  22930. n = function () {
  22931. this.discardPathObject()
  22932. }.bind(this),
  22933. r = 0;
  22934. r < t.obj3d.children.length;
  22935. r += 1
  22936. )
  22937. (e = t.obj3d.children[r]),
  22938. void 0 !== e.material &&
  22939. e.material.transparent === !0 &&
  22940. (void 0 !== e.material.uniforms
  22941. ? p.start(
  22942. u.property(e.material.uniforms.opacity, 'value', 0),
  22943. c.path.fadeOutTime,
  22944. n,
  22945. 0,
  22946. d[c.warp.blendEasing]
  22947. )
  22948. : p.start(
  22949. u.property(e.material, 'opacity', 0),
  22950. c.path.fadeOutTime,
  22951. n,
  22952. 0,
  22953. d[c.warp.blendEasing]
  22954. ),
  22955. (i += 1),
  22956. (n = null))
  22957. 0 === i && this.discardPathObject(),
  22958. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  22959. }
  22960. }),
  22961. (n.prototype.appearSlow = function () {
  22962. var e,
  22963. t = this
  22964. this.fadeOutCpm(c.path.fadeInTime)
  22965. for (
  22966. var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0;
  22967. n < t.obj3d.children.length;
  22968. n += 1
  22969. )
  22970. (e = t.obj3d.children[n]),
  22971. void 0 !== e.material &&
  22972. e.material.transparent === !0 &&
  22973. (void 0 !== e.material.uniforms
  22974. ? p.start(
  22975. u.property(e.material.uniforms.opacity, 'value', i),
  22976. c.path.fadeInTime,
  22977. null,
  22978. 0,
  22979. d[c.warp.blendEasing]
  22980. )
  22981. : p.start(
  22982. u.property(e.material, 'opacity', i),
  22983. c.path.fadeInTime,
  22984. null,
  22985. 0,
  22986. d[c.warp.blendEasing]
  22987. ))
  22988. }),
  22989. (n.prototype.update = function () {
  22990. this.obj3d && this.obj3d.updateMatrixWorld()
  22991. }),
  22992. (n.prototype.calcBurnsAmount = function (e) {
  22993. //计算导览点旋转角
  22994. var t = r.Math.degToRad(c.warp.burnsAngle)
  22995. if (this.player.mode === a.PANORAMA) {
  22996. var i = this.burnsDir * t
  22997. if (this.upcomingTransType === l.BLACK) return i
  22998. var n = e
  22999. if (null === n) return y.warn('Transition request for non-highlight'), i
  23000. var o = this.getHeroDescriptorByHeroIndex(n)
  23001. if (null === o) return i
  23002. if (!o.isPano()) return i
  23003. var s = this.getHeroPano(o),
  23004. h = this.playerControls.cameras[a.PANORAMA],
  23005. u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize(),
  23006. d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t),
  23007. p = function (e) {
  23008. var i = Math.acos(Math.min(1, e.dot(u))),
  23009. n = new r.Vector3().crossVectors(u, e)
  23010. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  23011. }
  23012. if (s === this.player.currentPano)
  23013. return (i = p(
  23014. A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize()
  23015. ))
  23016. var f = this.findShortestPath(this.player.currentPano, s)
  23017. if (void 0 === f || null === f || f.length < 1)
  23018. return y.debug('Empty path ahead...'), i
  23019. var g = this.makePathHulls(f),
  23020. m = new r.CatmullRomCurve3(g.camera),
  23021. v = Math.min(0.1, c.warp.lookAheadDist / m.getLength())
  23022. return (i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize()))
  23023. }
  23024. return this.player.mode === a.DOLLHOUSE ? 0.02 * this.burnsDir : this.burnsDir
  23025. }),
  23026. (n.prototype.waitNextStep = function (e, t, time) {
  23027. //xzw 改时间
  23028. var i = time == void 0 ? c.warp.tourStepDelay : time
  23029. i == void 0 &&
  23030. (i =
  23031. this.lastTransType === l.BLACK
  23032. ? b.tourStepDelaySlideShow
  23033. : b.tourStepDelayDefault)
  23034. var n = new r.Euler(),
  23035. o = new r.Vector3()
  23036. y.debug('Starting wait: ' + (void 0 !== t))
  23037. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem) //this.model.heroLocations[this.director.currentItem[0]]
  23038. var s = currentLocation.dontRot || this.calcBurnsAmount(e),
  23039. h = function () {
  23040. this.endWarpState(),
  23041. this.player.mode === a.DOLLHOUSE &&
  23042. (this.playerControls.cameras[
  23043. a.DOLLHOUSE
  23044. ].controls.rotationAcceleration.x = 0),
  23045. t && t()
  23046. }.bind(this),
  23047. u = function (e, t) {
  23048. if (this.warpInterrupted) return h(), !0
  23049. var r = t || 1e3 / 60
  23050. if (c.warp.doBurns && !currentLocation.dontRot)
  23051. if (this.player.mode === a.PANORAMA) {
  23052. var l = this.playerControls.cameras[a.PANORAMA]
  23053. n.setFromQuaternion(l.quaternion, c.warp.eOrder)
  23054. var u = i == 0 ? s : (r * s) / i
  23055. u = Math.sign(u) * Math.max(u, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  23056. ;(n.y += u),
  23057. o.set(0, 0, -1),
  23058. o.applyEuler(n),
  23059. o.add(l.position),
  23060. l.controls.lookAt(o),
  23061. l.controls.lookVector.copy(o),
  23062. l.lookAt(o)
  23063. } else
  23064. this.player.mode === a.DOLLHOUSE
  23065. ? (this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s)
  23066. : (this.playerControls.controls[a.FLOORPLAN].absoluteScale *= 0.9996)
  23067. }.bind(this)
  23068. this.startWarpState(), p.start(u, i, h, 0, d.easeInOutQuad, 'wait')
  23069. }),
  23070. (n.prototype.warpToNonPano = function (e) {
  23071. if (
  23072. (this.discardPathObject(),
  23073. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE ||
  23074. this.warpDestHeroLoc.cameraMode === a.FLOORPLAN)
  23075. ) {
  23076. var t = function () {
  23077. e && e()
  23078. }.bind(this)
  23079. this.player.flyToNewMode({
  23080. mode: this.warpDestHeroLoc.cameraMode,
  23081. duration: c.warp.outsideTime,
  23082. warpDest: this.warpDestHeroLoc,
  23083. callback: t,
  23084. force: !0
  23085. })
  23086. } else y.warn('no warp destination!!!'), e && e()
  23087. }),
  23088. (n.prototype._resetWarpShaderParams = function (e) {
  23089. //
  23090. this.player.mode === a.PANORAMA &&
  23091. (void 0 !== e.material.uniforms.blackout &&
  23092. (e.material.uniforms.blackout.value = 0),
  23093. void 0 !== e.material.uniforms.modelAlpha &&
  23094. (e.material.uniforms.modelAlpha.value = 0))
  23095. /* if(momentTourBlackNewType && "newBlack" in e.material.defines){
  23096. delete e.material.defines.newBlack;
  23097. e.material.needsUpdate = true
  23098. } */
  23099. }),
  23100. (n.prototype._clearWarpShading = function () {
  23101. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  23102. this._resetWarpShaderParams(e[t]), (e[t].visible = !0)
  23103. this._resetWarpShaderParams(this.model.skybox)
  23104. }),
  23105. (n.prototype._warpStopFlying = function () {
  23106. ;(this.activeTransType = null), this.placeCpm()
  23107. }),
  23108. (n.prototype._wrapupTravelOnlyBits = function () {
  23109. this._warpStopFlying(),
  23110. this.warpPathPoints &&
  23111. (this.player.currentPano.exit(),
  23112. this.warpDestPano.enter(),
  23113. (this.player.currentPano = this.warpDestPano)),
  23114. this.player.spider.draw(),
  23115. this.placeCpm()
  23116. }),
  23117. (n.prototype._wrapupTravel = function (e) {
  23118. this._wrapupTravelOnlyBits(), this.warpCameraAim(e)
  23119. }),
  23120. (n.prototype._wrapupWarpShading = function (e) {
  23121. this._clearWarpShading(), this._wrapupTravel(e)
  23122. }),
  23123. (n.prototype.wrapupWarpShadingOnly = function (e, t) {
  23124. t !== I.END && this._clearWarpShading(),
  23125. this._wrapupTravelOnlyBits(),
  23126. (this.upcomingTransType = null),
  23127. e && e()
  23128. }),
  23129. (n.prototype._warpCameraAim = function (e, t) {
  23130. //到每个片段终点时转向终点朝向。
  23131. var i = this.warpDestHeroLoc.quaternion,
  23132. n = this.playerControls.cameras[a.PANORAMA],
  23133. o = new r.Vector3(0, 0, 1).applyQuaternion(i).normalize(),
  23134. s = new r.Vector3(0, 0, 1).applyQuaternion(n.quaternion).normalize(),
  23135. l = s.dot(o),
  23136. u = r.Math.radToDeg(Math.acos(l)),
  23137. f = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder),
  23138. g = new r.Euler().setFromQuaternion(n.quaternion, c.warp.eOrder),
  23139. m = new r.Euler(f.x - g.x, f.y - g.y, f.z - g.z, c.warp.eOrder)
  23140. ;(m.y = h.constrainedTurn(m.y)), (this.burnsDir = Math.sign(m.y))
  23141. var v = new r.Euler(0, 0, 0, c.warp.eOrder),
  23142. A = new r.Vector3(),
  23143. C = function (e, t) {
  23144. return (
  23145. !!this.warpInterrupted ||
  23146. ((v.x = g.x + e * m.x),
  23147. (v.y = g.y + e * m.y),
  23148. (v.z = g.z + e * m.z),
  23149. A.set(0, 0, -1),
  23150. A.applyEuler(v),
  23151. A.add(n.position),
  23152. n.controls.lookAt(A),
  23153. n.controls.lookVector.copy(A),
  23154. void n.lookAt(A))
  23155. )
  23156. }.bind(this)
  23157. /* return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
  23158. ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  23159. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  23160. ):
  23161. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  23162. ,void (t && t())
  23163. ) */
  23164. this.warpDestHeroLoc.zoom != this.player.zoomLevel && //add 原地转向最终方位时
  23165. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom, e)
  23166. return u > c.warp.minRotation
  23167. ? p.start(C, e, t, 0, d[c.warp.movementEasing])
  23168. : (y.info(
  23169. 'Aim angle only is ' + u.toPrecision(3) + ' degrees, skipping explicit re-aim'
  23170. ),
  23171. void (t && t()))
  23172. }),
  23173. (n.prototype._warpBendAim = function (e, t, i, n) {
  23174. var o = n || 0,
  23175. s = this.playerControls.cameras[a.PANORAMA],
  23176. l = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  23177. this.warpDestHeroLoc.quaternion,
  23178. c.warp.eOrder
  23179. ),
  23180. u = new r.Euler().setFromQuaternion(s.quaternion, c.warp.eOrder),
  23181. f = new r.Euler(l.x - u.x, l.y - u.y, l.z - u.z, c.warp.eOrder)
  23182. f.y = h.constrainedTurn(f.y)
  23183. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x))
  23184. ;(f.x = g * Math.sign(f.x)),
  23185. (g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g)),
  23186. (this.burnsDir = Math.sign(f.y)),
  23187. (g *= Math.sign(f.y)),
  23188. (f.y = g)
  23189. var m = new r.Euler(0, 0, 0, c.warp.eOrder),
  23190. v = new r.Vector3(),
  23191. A = function (e, t) {
  23192. if (e < 0.5) (m.x = u.x + e * f.x), (m.y = u.y + e * f.y), (m.z = u.z + e * f.z)
  23193. else {
  23194. var i = (1 - e) * c.warp.softBendEnd
  23195. ;(m.x = l.x - i * f.x), (m.y = l.y - i * f.y), (m.z = l.z - i * f.z)
  23196. }
  23197. v.set(0, 0, -1), v.applyEuler(m), v.add(s.position)
  23198. s.controls.lookAt(v), s.controls.lookVector.copy(v), s.lookAt(v)
  23199. }.bind(this)
  23200. if (window.DATA.momentTourBlackNewType) {
  23201. A(1)
  23202. } else return p.start(A, t, i, o, d[c.warp.movementEasing])
  23203. }),
  23204. (n.prototype._warpStepCameraAim = function (e, t, i) {
  23205. var n = this.playerControls.cameras[a.PANORAMA],
  23206. o = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  23207. this.warpDestHeroLoc.quaternion,
  23208. c.warp.eOrder
  23209. ),
  23210. s = new r.Euler().setFromQuaternion(n.quaternion, c.warp.eOrder),
  23211. l = new r.Euler(o.x - s.x, o.y - s.y, o.z - s.z, c.warp.eOrder)
  23212. ;(l.y = h.constrainedTurn(l.y)), (this.burnsDir = Math.sign(l.y))
  23213. var u = new r.Euler(0, 0, 0, c.warp.eOrder),
  23214. f = new r.Vector3(),
  23215. g = function (e, t) {
  23216. e < 0.5 ? u.copy(s) : u.copy(o),
  23217. f.set(0, 0, -1),
  23218. f.applyEuler(u),
  23219. f.add(n.position),
  23220. n.controls.lookAt(f),
  23221. n.controls.lookVector.copy(f),
  23222. n.lookAt(f)
  23223. }.bind(this)
  23224. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  23225. }),
  23226. (n.prototype.setBurnsDir = function () {
  23227. var e = this.playerControls.cameras[a.PANORAMA],
  23228. t = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  23229. this.warpDestHeroLoc.quaternion,
  23230. c.warp.eOrder
  23231. ),
  23232. i = new r.Euler().setFromQuaternion(e.quaternion, c.warp.eOrder),
  23233. n = new r.Euler(t.x - i.x, t.y - i.y, t.z - i.z, c.warp.eOrder)
  23234. ;(n.y = h.constrainedTurn(n.y)), (this.burnsDir = Math.sign(n.y))
  23235. }),
  23236. (n.prototype.stepWarpPath = function (firstPos, e) {
  23237. var i = this.playerControls.cameras[a.PANORAMA]
  23238. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  23239. if (!n) {
  23240. return i.position.copy(this.warpDestPano.position), !0
  23241. }
  23242. /* if (!this.warpPathPoints)
  23243. return i.position.copy(this.warpDestPano.position),
  23244. !0;
  23245. var n = this.warpPathPoints[0] */
  23246. var o = this.warpDestPano.position
  23247. /* console.log(firstPos)
  23248. console.log(o) */
  23249. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  23250. var s = new r.Vector3()
  23251. e < 0.5
  23252. ? s
  23253. .copy(this.cameraHull[1])
  23254. .sub(n)
  23255. .normalize()
  23256. .multiplyScalar(c.warp.softPushDist * e)
  23257. .add(n)
  23258. : s
  23259. .copy(this.cameraHull[this.cameraHull.length - 2])
  23260. .sub(o)
  23261. .normalize()
  23262. .multiplyScalar(c.warp.softPushDist * c.warp.softPushEnd * (1 - e))
  23263. .add(o),
  23264. i.position.copy(s)
  23265. } else e < 0.5 ? i.position.copy(n) : i.position.copy(o)
  23266. }),
  23267. (n.prototype.interruptAndFastForward = function (e, t) {
  23268. this.warping &&
  23269. ((this.warpInterrupted = !0),
  23270. (this.warpInterruptionBlackoutStyle = e),
  23271. (this.warpInterruptionTravelTime = t),
  23272. (null !== this.warpInterruptionBlackoutStyle &&
  23273. void 0 !== this.warpInterruptionBlackoutStyle) ||
  23274. (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  23275. (null !== this.warpInterruptionTravelTime &&
  23276. void 0 !== this.warpInterruptionTravelTime) ||
  23277. (this.warpInterruptionTravelTime = c.minWarpTime))
  23278. }),
  23279. (n.prototype.warpCameraAim = function (e) {
  23280. var t = c.warp.minWarpTime
  23281. if (this.upcomingTransType === l.BLACK) t = c.warp.teleportTime
  23282. else {
  23283. var i = this.playerControls.cameras[a.PANORAMA],
  23284. n = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(
  23285. this.warpDestHeroLoc.quaternion,
  23286. c.warp.eOrder
  23287. ),
  23288. o = new r.Euler().setFromQuaternion(i.quaternion, c.warp.eOrder),
  23289. s = new r.Euler(n.x - o.x, n.y - o.y, n.z - o.z, c.warp.eOrder)
  23290. s.y = h.constrainedTurn(s.y)
  23291. var u = (1e3 * Math.abs(s.y)) / r.Math.degToRad(c.warp.maxAimPerSec)
  23292. t = Math.max(t, u)
  23293. }
  23294. var d = function () {
  23295. this._warpStopFlying(), this.discardSlow(), e && e()
  23296. }.bind(this)
  23297. this._warpCameraAim(t, d)
  23298. }),
  23299. (n.prototype.warpCommonParameters = function (e, t, i, n) {
  23300. this.model.skybox.material.uniforms.blackout.value = n
  23301. var r = u.uniform(this.model.skybox, 'progress', 1),
  23302. o = u.allUniforms(this.model.chunks, 'progress', 1),
  23303. a = !1,
  23304. s = function () {
  23305. if (this.warpInterrupted) return (a = !0), !0
  23306. }.bind(this),
  23307. l = function (e, t) {
  23308. return i && a
  23309. ? ((this.model.skybox.material.uniforms.progress.value = 0), !0)
  23310. : void r(e, t)
  23311. }.bind(this),
  23312. h = function (e, t) {
  23313. return i && a ? (o(0), !0) : void o(e, t)
  23314. }.bind(this)
  23315. p.start(s, e, null, t, null, 'safeHaltWatch'),
  23316. p.start(l, e, null, t, d[c.warp.blendEasing], 'skyboxProgress'),
  23317. p.start(h, e, null, t, d[c.warp.blendEasing], 'chunkProgress')
  23318. }),
  23319. (n.prototype.warpTravel_STD = function (e) {
  23320. var t,
  23321. i = Math.min(c.warp.lookAheadMax, c.warp.lookAheadDist / this.warpLength),
  23322. n = this.playerControls.cameras[a.PANORAMA],
  23323. o = (Math.min(0.25, 3 / this.warpLength), Math.min(0.35, 7 / this.warpLength)),
  23324. s = new r.Euler(0, 0, 0, c.warp.eOrder),
  23325. f = new r.Vector3(),
  23326. m = new r.Euler().setFromQuaternion(n.quaternion, c.warp.eOrder),
  23327. v = new r.Euler().copy(m),
  23328. C = n.position.clone(),
  23329. E = new r.Matrix4(),
  23330. b = new r.Euler(),
  23331. w = c.warp.minWarpTime
  23332. ;(w += this.warpLength * c.warp.timePerMeter),
  23333. c.warp.flySpeed > 0.01 && (w = (1e3 * this.warpLength) / c.warp.flySpeed)
  23334. var _ = !1,
  23335. T = this.warpDestHeroLoc.quaternion,
  23336. x = new r.Vector3(0, 0, -1).applyQuaternion(T).normalize(),
  23337. S = this.warpPathPoints[this.warpPathPoints.length - 1]
  23338. .clone()
  23339. .sub(this.warpPathPoints[this.warpPathPoints.length - 2])
  23340. .normalize(),
  23341. M = S.dot(x),
  23342. R = r.Math.radToDeg(Math.acos(M)),
  23343. P = function (e) {
  23344. var t = o,
  23345. i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1))
  23346. return i
  23347. },
  23348. O = function () {
  23349. return (
  23350. E.lookAt(C, t, A.UP),
  23351. s.setFromRotationMatrix(E, c.warp.eOrder),
  23352. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  23353. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  23354. h.constrainedTurn(b.y)
  23355. )
  23356. }.bind(this),
  23357. L = function (e, t) {
  23358. if (this.warpInterrupted) return (_ = !0), !0
  23359. }.bind(this),
  23360. D = function (e, t) {
  23361. return _ || !this.warpPathPoints ? (g.blur(0), !0) : void g.blur(e)
  23362. }.bind(this),
  23363. N = u.allUniforms(this.model.chunks, 'modelAlpha', 1),
  23364. B = function (e, t) {
  23365. return _ || !this.warpPathPoints ? (N(0), !0) : void N(e, t)
  23366. }.bind(this),
  23367. F = function (e, t) {
  23368. if (!this.warpPathPoints) return n.position.copy(this.warpDestPano.position), !0
  23369. if (_) return !0
  23370. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e)
  23371. n.position.copy(i),
  23372. (C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, 0.99 * e))
  23373. }.bind(this),
  23374. V = function (e, n) {
  23375. return this.warpPathPoints
  23376. ? !!_ ||
  23377. void (t = this.interpAlongPath(
  23378. this.warpPathPoints,
  23379. this.warpPathLengths,
  23380. Math.min(e + i, 1)
  23381. ))
  23382. : (y.debug('Lost bunny.'), !0)
  23383. }.bind(this),
  23384. U = function (e, o) {
  23385. if (_) return y.debug('>>>> Walkthrough interupted at t=' + e), !0
  23386. if (!this.warpPathPoints) return !0
  23387. var a = this.warpLength * e,
  23388. l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist),
  23389. u = r.Math.smoothstep(
  23390. a,
  23391. this.warpLength - this.brushPrefs.lookBlendDist,
  23392. this.warpLength
  23393. )
  23394. c.warp.matchCam && (l *= 1 - u),
  23395. E.lookAt(C, t, A.UP),
  23396. s.setFromRotationMatrix(E, c.warp.eOrder),
  23397. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  23398. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  23399. (b.y = h.constrainedTurn(b.y)),
  23400. (s.x = m.x + l * b.x),
  23401. (s.y = m.y + l * b.y),
  23402. (s.z = m.z + l * b.z),
  23403. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  23404. (b.y = h.constrainedTurn(b.y))
  23405. var d = (r.Math.degToRad(c.warp.maxTurnPerSec) * o) / 1e3
  23406. ;(b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y))),
  23407. (v.x = v.x + b.x * c.warp.turnFriction),
  23408. (v.y = v.y + b.y * c.warp.turnFriction),
  23409. (v.z = v.z + b.z * c.warp.turnFriction),
  23410. (v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x))
  23411. var p = t.clone().sub(C).normalize()
  23412. if (R < c.warp.maxAimRotation && u > 0) {
  23413. var g = 1 - u
  23414. ;(p.x = p.x * g + u * S.x),
  23415. (p.y = p.y * g + u * S.y),
  23416. (p.z = p.z * g + u * S.z),
  23417. p.normalize()
  23418. }
  23419. this.bunnyObj.position.copy(n.position).add(p),
  23420. f.set(0, 0, -1).applyEuler(v).normalize(),
  23421. f.multiplyScalar(8),
  23422. f.add(n.position),
  23423. (e > 1 - i && c.warp.matchCam) ||
  23424. (n.controls.lookAt(f), n.controls.lookVector.copy(f), n.lookAt(f))
  23425. }.bind(this),
  23426. k = function () {
  23427. _
  23428. ? (this.discardSlow(),
  23429. (this.upcomingTransType = l.BLACK),
  23430. this.warpTravel_BLACK(-0.5, this.warpInterruptionTravelTime, I.BEGINNING, e))
  23431. : this._wrapupWarpShading(e)
  23432. }.bind(this)
  23433. V(0)
  23434. var H =
  23435. c.warp.motionLeadTime +
  23436. (1e3 * Math.abs(O())) / r.Math.degToRad(c.warp.maxTurnPerSec)
  23437. w += H
  23438. var G = H / w
  23439. this.warpCommonParameters(w, G, !0, I.NONE),
  23440. p.start(L, w, null, 0, null, '_haltWatcher'),
  23441. c.warp.blur > 0 &&
  23442. ((g.blurStrength = c.warp.blur), p.start(D, w, null, G, P, 'blurring')),
  23443. p.start(B, w, null, G, P, 'modelAlpha'),
  23444. p.start(F, w, null, G, d[c.warp.blendEasing], 'followPath'),
  23445. p.start(V, w, null, G, d[c.warp.blendEasing], 'goBunny'),
  23446. p.start(U, w, k, 0, d[c.warp.blendEasing], 'lookAtBunny')
  23447. }),
  23448. (n.prototype.warpTravel_BLACK = function (e, t, i, n) {
  23449. var r = e || 0
  23450. ;(void 0 !== t && null !== t) || (t = c.warp.teleportTime)
  23451. //add
  23452. var done = () => {
  23453. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  23454. this.player.transitionPos({
  23455. type: 'beforeFlytopano',
  23456. pano: this.player.currentPano,
  23457. dur: 100
  23458. }) //add
  23459. }
  23460. if (window.DATA.momentTourBlackNewType) {
  23461. player.sceneRenderer.effects.fastTranMaskPass.start(player.sceneRenderer)
  23462. var camera = this.playerControls.cameras[a.PANORAMA]
  23463. var end = this.warpDestHeroLoc.position
  23464. camera.position.copy(end)
  23465. setTimeout(() => {
  23466. player.sceneRenderer.effects.fastTranMaskPass.stop()
  23467. this.wrapupWarpShadingOnly(n, i)
  23468. done()
  23469. }, t)
  23470. } else {
  23471. var o = function () {
  23472. this.wrapupWarpShadingOnly(n, i)
  23473. done()
  23474. }.bind(this)
  23475. var firstPos = this.player.position.clone() //add
  23476. p.start(
  23477. this.stepWarpPath.bind(this, firstPos),
  23478. t,
  23479. o,
  23480. r,
  23481. d[c.warp.blendEasing],
  23482. 'stepMotion'
  23483. )
  23484. }
  23485. this.warpCommonParameters(t, r, !1, i)
  23486. this.model.chunks.concat(this.model.skybox).forEach(function (e) {
  23487. // 改
  23488. if (window.DATA.momentTourBlackNewType) {
  23489. e.material.uniforms.blackout.value = 5 //i 改
  23490. //e.material.defines.newBlack = ''
  23491. //e.material.needsUpdate = true
  23492. } else {
  23493. e.material.uniforms.blackout.value = i
  23494. }
  23495. }),
  23496. this._warpBendAim(null, t, null, r)
  23497. }),
  23498. (n.prototype.flightStepWalk = (function (e, t, i) {
  23499. var n = 0.001,
  23500. o = 1,
  23501. a = 1.2,
  23502. s = new r.Vector3(),
  23503. h = new r.Vector3(),
  23504. u = function (e, t) {
  23505. //导览速度
  23506. var i = Math.min(
  23507. this.player.position.distanceTo(e.position),
  23508. c.transition.flytimeMaxDistanceThreshold
  23509. ),
  23510. // , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  23511. r = i * c.warp.flytimeDistanceMultiplier + c.warp.flyTime
  23512. h.copy(A.FORWARD),
  23513. this.player.getDirection(h),
  23514. s.copy(t).sub(e.position).normalize()
  23515. var l = s.dot(h),
  23516. u = Math.acos(l),
  23517. d = u / r
  23518. d > n && ((r *= d / n), u < o && (r *= a))
  23519. return (r / DATA.tourWalkSpeed) * 100 // 改
  23520. }
  23521. return function (e, t, i) {
  23522. if (this.warpInterrupted) i && i()
  23523. else if (this.activeTransType !== l.WALK)
  23524. this._clearWarpShading(),
  23525. this._warpStopFlying(),
  23526. this.player.spider.draw(),
  23527. this.placeCpm(),
  23528. i && i()
  23529. else if (this.player.currentPano !== e) {
  23530. var n = {
  23531. pano: e,
  23532. lookAtPoint: t,
  23533. duration: null,
  23534. maxDistanceOverride: c.warp.walkMaxDist,
  23535. skipWarpingCheck: !1,
  23536. constantMoveSpeed: !0
  23537. }
  23538. if (e == this.warpDestPano) {
  23539. //到达终点前,放大到终点的zoom
  23540. n.zoomLevel = this.warpDestHeroLoc.zoom
  23541. }
  23542. ;(n.duration = u.call(this, e, t)), this.player.nonInterruptingFlyToPano(n, i)
  23543. } else i && i()
  23544. }
  23545. })()),
  23546. (n.prototype.makeWalkFlightFunc = function (e, t, i) {
  23547. return this.flightStepWalk.bind(this, e, t, i)
  23548. }),
  23549. (n.prototype.warpTravel_WALK = (function () {
  23550. var e = []
  23551. return function (t) {
  23552. var i = this.player.model.panos
  23553. e.length = 0
  23554. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  23555. var s = this.nodes[a],
  23556. l = i.get(s)
  23557. a === this.nodes.length - 1
  23558. ;(o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist),
  23559. (n && o) || (e.push(s), (n = l))
  23560. }
  23561. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1])
  23562. var h = e.length,
  23563. u = i.get(e[h - 1]),
  23564. d = new Array(h + 1)
  23565. d[d.length - 1] = function () {
  23566. t && t()
  23567. }.bind(this)
  23568. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  23569. var g = e[p]
  23570. u = i.get(g)
  23571. var m = new r.Vector3()
  23572. this.getLookAtForWalkingTourNode(e, p, m),
  23573. (d[f - 1] = this.makeWalkFlightFunc(u, m, d[f])),
  23574. p--
  23575. }
  23576. d[0]()
  23577. }
  23578. })()),
  23579. (n.prototype.getLookAtForWalkingTourNode = (function () {
  23580. var e = new r.Vector3(),
  23581. t = new r.Vector3(),
  23582. i = new r.Vector3(),
  23583. n = new r.Vector3(),
  23584. o = new r.Vector3(),
  23585. a = 0.65,
  23586. s = 0.75,
  23587. l = 0.2,
  23588. c = 0.4,
  23589. h = 0.2,
  23590. u = 3
  23591. return function (r, d, p) {
  23592. var f = r.length
  23593. if (d >= f) return !1
  23594. var g = 1,
  23595. m = 1
  23596. t.set(0, 0, 0), o.set(0, 0, 0)
  23597. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  23598. if (
  23599. ((v = this.player.model.panos.get(r[A])),
  23600. this.getOrientationForWalkingTourNode(r, A, i),
  23601. A === d && e.copy(i),
  23602. n.copy(i),
  23603. A > d)
  23604. ) {
  23605. var y = n.dot(e) < a
  23606. ;(g *= y ? l : s), (m *= y ? h : c)
  23607. }
  23608. i.multiplyScalar(g), t.add(i), o.lerp(v.position, m)
  23609. }
  23610. return t.normalize(), p.copy(o), p.add(t), !0
  23611. }
  23612. })()),
  23613. (n.prototype.getOrientationForWalkingTourNode = function (e, t, i) {
  23614. var n = e.length
  23615. if (t >= n) return !1
  23616. if (t === n - 1) i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion)
  23617. else {
  23618. var r = this.player.model.panos.get(e[t]),
  23619. o = this.player.model.panos.get(e[t + 1])
  23620. i.copy(o.position).sub(r.position)
  23621. }
  23622. return i.normalize(), !0
  23623. }),
  23624. (n.prototype.warpCameraTravel = function (e, t, i, n) {
  23625. if (
  23626. ((this.activeTransType = this.upcomingTransType),
  23627. (this.lastTransType = this.activeTransType),
  23628. (this.upcomingTransType = null),
  23629. !e)
  23630. ) {
  23631. var r = function () {
  23632. this._wrapupTravel(n)
  23633. }.bind(this),
  23634. o = {
  23635. pano: this.warpDestPano,
  23636. lookAtPoint: null,
  23637. duration: null,
  23638. maxDistanceOverride: null,
  23639. skipWarpingCheck: !1
  23640. }
  23641. return void this.player.flyToPano(o, r)
  23642. }
  23643. this.activeTransType === l.BLACK
  23644. ? this.warpTravel_BLACK(null, i, t, n)
  23645. : this.activeTransType === l.WALK
  23646. ? this.warpTravel_WALK(
  23647. function () {
  23648. this._clearWarpShading(),
  23649. this._warpStopFlying(),
  23650. this.player.spider.draw(),
  23651. this.placeCpm(),
  23652. n && n()
  23653. }.bind(this)
  23654. )
  23655. : this.warpTravel_STD(n)
  23656. }),
  23657. (n.prototype.startWarpState = function () {
  23658. ;(this.warping = !0),
  23659. (this.warpInterrupted = !1),
  23660. (this.warpInterruptionBlackoutStyle = null),
  23661. (this.warpInterruptionTravelTime = null)
  23662. }),
  23663. (n.prototype.endWarpState = function () {
  23664. this.warping = !1
  23665. }),
  23666. (n.prototype.warpToPano = function (e, t, i, n) {
  23667. if (this.warping) return void y.warn('Cannot warp when already warping')
  23668. if (
  23669. ((this.upcomingTransType = e),
  23670. (this.activeTransType = null),
  23671. !this.setWarpDestPano())
  23672. )
  23673. return (this.upcomingTransType = null), void this.warpToNonPano(n)
  23674. if (this.player.mode !== a.PANORAMA)
  23675. return (
  23676. (this.upcomingTransType = null),
  23677. this.discardSlow(),
  23678. void this.player.flyToNewMode({
  23679. mode: a.PANORAMA,
  23680. pano: this.warpDestPano,
  23681. duration: c.warp.outsideTime,
  23682. warpDest: this.warpDestHeroLoc,
  23683. callback: n,
  23684. force: !0
  23685. })
  23686. )
  23687. if (!this.warpDestPano)
  23688. return (
  23689. y.warn('no warp destination, callback dropped'),
  23690. void (this.upcomingTransType = null)
  23691. )
  23692. var r = !(
  23693. this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) &&
  23694. this.warpDestPano !== this.player.currentPano &&
  23695. this.warpDestPano.position.distanceTo(this.player.currentPano.position) <
  23696. c.warp.nearPanoDist
  23697. ),
  23698. o = this.chooseWarpPath(r)
  23699. if (o && this.upcomingTransType !== l.WALK) {
  23700. var s = function () {
  23701. ;(this.waitingToWarp = !1), this.warpToPano(e, t, i, n)
  23702. }.bind(this)
  23703. if (
  23704. this.player.checkAndWaitForPanoLoad(
  23705. this.warpDestPano,
  23706. 'high',
  23707. 'low',
  23708. this.player.basePanoSize,
  23709. s
  23710. )
  23711. )
  23712. return void (this.waitingToWarp = !0)
  23713. }
  23714. this.player.currentPano ||
  23715. (y.warn('Arrived at a very strange spot!'),
  23716. (this.player.currentPano = this.warpDestPano),
  23717. this.placeCpm(),
  23718. this.fadeOutCpm(c.path.fadeOutTime),
  23719. this.player.spider.draw()),
  23720. y.debug('Warping to pano ', this.warpDestPano.position),
  23721. this.upcomingTransType !== l.WALK &&
  23722. this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  23723. this.startWarpState()
  23724. var h = function () {
  23725. this.endWarpState(), n && n()
  23726. }.bind(this)
  23727. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h)
  23728. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  23729. }),
  23730. (t.exports = n)
  23731. }).call(this, '/js/objects/ShowPath.js')
  23732. },
  23733. {
  23734. '../constants': 8,
  23735. '../effects': 16,
  23736. '../enum/BlackoutStyle': 18,
  23737. '../enum/ModelManagerEvents': 33,
  23738. '../enum/PlayerEvents': 40,
  23739. '../enum/RenderOrder': 42,
  23740. '../enum/Vectors': 50,
  23741. '../enum/Viewmode': 51,
  23742. '../enum/WarpStyle': 52,
  23743. '../gui/gui': 65,
  23744. '../model/ModelManager': 140,
  23745. '../objects/Snapshot': 153,
  23746. '../settings': 166,
  23747. '../shaders': 167,
  23748. '../util/easing': 186,
  23749. '../util/lerp': 188,
  23750. '../util/logger': 189,
  23751. '../util/math': 190,
  23752. '../util/texture': 194,
  23753. '../util/transitions': 195,
  23754. three: 217
  23755. }
  23756. ],
  23757. 152: [
  23758. function (e, t, i) {
  23759. 'use strict'
  23760. function n() {
  23761. var e = new r.SphereBufferGeometry(a.skyboxRadius, 20, 5),
  23762. t = new r.RawShaderMaterial({
  23763. fragmentShader: o.skysphere.fragmentShader,
  23764. vertexShader: o.skysphere.vertexShader,
  23765. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  23766. side: r.BackSide,
  23767. name: 'skysphere'
  23768. })
  23769. ;(t.uniforms.radius.value = e.parameters.radius), r.Mesh.call(this, e, t)
  23770. }
  23771. var r = e('three'),
  23772. o = e('../shaders'),
  23773. a = e('../settings')
  23774. ;(n.prototype = Object.create(r.Mesh.prototype)),
  23775. (n.prototype.constructor = n),
  23776. (t.exports = n)
  23777. },
  23778. {
  23779. '../settings': 166,
  23780. '../shaders': 167,
  23781. three: 217
  23782. }
  23783. ],
  23784. 153: [
  23785. function (e, t, i) {
  23786. ;(function (i) {
  23787. 'use strict'
  23788. function n(e) {
  23789. o.call(this, e),
  23790. (this.sid = e.sid), //xzw add
  23791. (this.panoId = e.panoId),
  23792. (this.orthoZoom = e.orthoZoom),
  23793. (this.floorVisibility = e.floorVisibility),
  23794. (this.thumbUrl = e.thumbUrl),
  23795. (this.name = e.name),
  23796. (this.zoom = e.zoom)
  23797. }
  23798. var r = (e('three'), e('../util/logger')),
  23799. o =
  23800. (e('../settings'),
  23801. e('../enum/Viewmode'),
  23802. e('../util/common'),
  23803. e('../util/transitions'),
  23804. e('../util/lerp'),
  23805. e('../util/ajax'),
  23806. e('../util/texture'),
  23807. e('./View'))
  23808. e('events').EventEmitter, new r(i)
  23809. ;(n.prototype = Object.create(o.prototype)),
  23810. (n.prototype.isPano = function () {
  23811. return this.panoId && '' !== this.panoId && this.panoId != 'outside'
  23812. }),
  23813. (t.exports = n)
  23814. }).call(this, '/js/objects/Snapshot.js')
  23815. },
  23816. {
  23817. '../enum/Viewmode': 51,
  23818. '../settings': 166,
  23819. '../util/ajax': 181,
  23820. '../util/common': 185,
  23821. '../util/lerp': 188,
  23822. '../util/logger': 189,
  23823. '../util/texture': 194,
  23824. '../util/transitions': 195,
  23825. './View': 154,
  23826. events: 202,
  23827. three: 217
  23828. }
  23829. ],
  23830. 154: [
  23831. function (e, t, i) {
  23832. ;(function (i) {
  23833. 'use strict'
  23834. function n(e) {
  23835. ;(e = e || {}),
  23836. (this.position = new r.Vector3()),
  23837. (this.quaternion = new r.Quaternion()),
  23838. this.update(e)
  23839. }
  23840. var r = e('three'),
  23841. o = e('../util/logger'),
  23842. a =
  23843. (e('../settings'),
  23844. e('../enum/Viewmode'),
  23845. e('../util/common'),
  23846. e('../util/transitions'),
  23847. e('../util/lerp'),
  23848. e('../util/ajax'),
  23849. e('../util/texture'),
  23850. e('events').EventEmitter)
  23851. new o(i)
  23852. ;(n.prototype = Object.create(a.prototype)),
  23853. (n.prototype.isValid = function () {
  23854. return !!this.cameraMode
  23855. }),
  23856. (n.prototype.update = function (e) {
  23857. return (
  23858. (this.cameraMode = e.cameraMode || this.cameraMode),
  23859. (this.pano = e.pano || this.pano),
  23860. e.position && this.position.copy(e.position),
  23861. e.quaternion && this.quaternion.copy(e.quaternion),
  23862. this
  23863. )
  23864. }),
  23865. (t.exports = n)
  23866. }).call(this, '/js/objects/View.js')
  23867. },
  23868. {
  23869. '../enum/Viewmode': 51,
  23870. '../settings': 166,
  23871. '../util/ajax': 181,
  23872. '../util/common': 185,
  23873. '../util/lerp': 188,
  23874. '../util/logger': 189,
  23875. '../util/texture': 194,
  23876. '../util/transitions': 195,
  23877. events: 202,
  23878. three: 217
  23879. }
  23880. ],
  23881. 155: [
  23882. function (e, t, i) {
  23883. //player.js
  23884. ;(function (i) {
  23885. 'use strict'
  23886. function n(e) {
  23887. ;(this.currentPano = null),
  23888. (this.nextPano = null),
  23889. (this.camera = null),
  23890. (this.paused = !1),
  23891. (this.flying = !1),
  23892. (this.sceneIntersectionPlane = null),
  23893. (this.target = new r.Vector3()),
  23894. (this.mouse = new r.Vector3(1.1, 1.1, 0.5)),
  23895. (this.mouseAtMouseDown = new r.Vector2()),
  23896. (this.mouseCouldBeClickToMove = !1),
  23897. (this.mouseLastMoveTime = Date.now()),
  23898. (this.mouseDown = !1),
  23899. (this.mouseDownTimer = null),
  23900. (this.couldBeLongTap = !1),
  23901. (this.containsMouse = !1), //
  23902. (this.isTouchEvent = !1),
  23903. (this.isPanoHover = !1),
  23904. (this.reticule = new a(this)),
  23905. (this.panoMarkers = []),
  23906. (this.spider = new h(this)),
  23907. (this.quaternion = new r.Quaternion()),
  23908. (this.position = new r.Vector3(15, 10, 15)),
  23909. (this.previousState = null),
  23910. (this.lastInsideView = new c()),
  23911. (this.last360View = new c()),
  23912. (this.raycaster = new r.Raycaster()),
  23913. (this.intersect = null),
  23914. (this.lastChangeTime = Date.now()),
  23915. (this.history = new I()),
  23916. (this.cameraControls = null),
  23917. (this.path = null),
  23918. (this.model = null),
  23919. (this.domElement = null),
  23920. (this.cachedPanoCandidates = null),
  23921. (this.basePanoSize = 0),
  23922. (this.standardPanoSize = 0),
  23923. (this.highPanoSize = 0),
  23924. (this.ultraHighPanoSize = 0),
  23925. (this.zoomLevel = 1),
  23926. (this.zooming = 0),
  23927. (this.zoomSpeed = 0.5),
  23928. (this.scrollZoomSpeed = 0.06),
  23929. (this.zoomSpeedAdjust = 0.05),
  23930. (this.defaultZoomIncrement = 0.2),
  23931. (this.baseFov = f.insideFOV),
  23932. (this.zoomFov = this.baseFov),
  23933. (this.zoomEnabled = !0),
  23934. (this.preRenderingEnabled = !1),
  23935. this.setupCustomProperties(e),
  23936. (this.zoomStats = new L())
  23937. window.player = this
  23938. this.modeTran = ''
  23939. }
  23940. var r = e('three'),
  23941. o = e('./util/logger'),
  23942. a = e('./objects/Reticule'),
  23943. s = e('./objects/Panorama'),
  23944. l = e('./objects/ShowPath'),
  23945. c = e('./objects/View'),
  23946. h = (e('./objects/Snapshot'), e('./objects/NSpider')),
  23947. u = e('./enum/Viewmode'),
  23948. d = (e('./enum/TagStates'), e('./enum/Vectors')),
  23949. p = e('./enum/Keys'),
  23950. f = (e('./enum/AlignmentType'), e('./settings')),
  23951. g = e('./util/common'),
  23952. m = (e('./util/browser'), e('./util/math')),
  23953. v = e('./util/lerp'),
  23954. A = e('./util/easing'),
  23955. y = e('./util/transitions'),
  23956. C = e('events').EventEmitter,
  23957. I = (e('./shaders'), e('./util/history')),
  23958. E = (e('./util/camera'), e('./model/ModelManager'), e('./enum/PathDiscardMode')),
  23959. b = e('./enum/PathDisplayMode'),
  23960. w = e('./enum/PlayerEvents'),
  23961. _ = e('./enum/ControlEvents'),
  23962. T = e('./enum/ModelManagerEvents'),
  23963. x = e('./enum/WarpStyle'),
  23964. S = e('./enum/BlackoutStyle'),
  23965. M = e('./exception/BasicException'),
  23966. R = e('./enum/PanoSizeClass'),
  23967. P = (e('./tile/TileDownloader'), e('./tile/TilePrioritizer')),
  23968. O = (e('./enum/PanoramaEvents'), e('./enum/ZoomEvents')),
  23969. L = e('./util/ZoomStats'),
  23970. D = e('./constants'),
  23971. N = e('./util/common'),
  23972. B = e('./util/cameraLight'),
  23973. //, Hot = e('hot')
  23974. F = new o(i),
  23975. V = Object.freeze({
  23976. FlyToPano: y.getUniqueId(),
  23977. FlyToNewMode: y.getUniqueId(),
  23978. FlyToSameMode: y.getUniqueId(),
  23979. FlyToViewFloor: y.getUniqueId(),
  23980. LookTransition: y.getUniqueId(),
  23981. ZoomTransition: y.getUniqueId()
  23982. })
  23983. ;(n.prototype = Object.create(C.prototype)),
  23984. (n.prototype.init = function (e) {
  23985. ;(this.modelManager = e.modelManager),
  23986. (this.tileDownloader = e.tileDownloader),
  23987. (this.panoRenderer = e.panoRenderer),
  23988. (this.qualityManager = e.qualityManager),
  23989. (this.domElement = e.container),
  23990. (this.camera = e.camera),
  23991. (this.tagManager = e.tagManager),
  23992. (this.cameraControls = e.controls),
  23993. (this.path = new l(e.director, this, e.controls)),
  23994. (this.basePanoSize = this.qualityManager.getPanoSize(R.BASE)),
  23995. (this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD)),
  23996. (this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH)),
  23997. (this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH)),
  23998. (this.tileDownloader.processPriorityQueue = !1),
  23999. (this.tileDownloader.tilePrioritizer = new P(
  24000. this.qualityManager,
  24001. this.basePanoSize,
  24002. this.standardPanoSize,
  24003. this.highPanoSize,
  24004. this.ultraHighPanoSize
  24005. )),
  24006. this.bindEvents(e.container),
  24007. this.updateModel()
  24008. })
  24009. //xzw add: 截图
  24010. function dataURLtoBlob(dataurl) {
  24011. var arr = dataurl.split(','),
  24012. mime = arr[0].match(/:(.*?);/)[1],
  24013. bstr = atob(arr[1]),
  24014. n = bstr.length,
  24015. u8arr = new Uint8Array(n)
  24016. while (n--) {
  24017. u8arr[n] = bstr.charCodeAt(n)
  24018. }
  24019. return new Blob([u8arr], { type: mime })
  24020. }
  24021. n.prototype.screenShot = function (o) {
  24022. if (this.flying || this.flyingToTag) return
  24023. var R = this.sceneRenderer
  24024. R.updateScreenSize(o)
  24025. for (var i in this.model.panos.index) {
  24026. if (!this.model.panos.index[i].marker) continue
  24027. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible
  24028. this.model.panos.index[i].marker.visible = false
  24029. }
  24030. for (var i in this.model.hots) {
  24031. this.model.hots[i].mesh.visible = false
  24032. }
  24033. this.reticule.visible = false
  24034. this.reticule.forceUnvisible = true
  24035. this.path.currentPanoMarker.mesh.visible = false
  24036. setTimeout(
  24037. function () {
  24038. //因resize效用没办法立即生效(原因未知),故而延后
  24039. R.renderer.clear(true, true, true)
  24040. R.renderer.render(R.scene, R.camera)
  24041. var imgData = R.renderer.domElement.toDataURL(o.type, 0.9)
  24042. o.f && o.f(imgData)
  24043. R.updateScreenSize({ resize: true })
  24044. this.reticule.visible = true
  24045. for (var i in this.model.hots) {
  24046. this.model.hots[i].mesh.visible = true
  24047. }
  24048. for (var i in this.model.panos.index) {
  24049. this.model.panos.index[i].marker.visible =
  24050. this.model.panos.index[i].marker.forceHide
  24051. }
  24052. this.path.currentPanoMarker.mesh.visible = true
  24053. R.renderer.render(R.scene, R.camera)
  24054. }.bind(this),
  24055. 30
  24056. ) //这个数字不能太小
  24057. }
  24058. var scaleImg = e('scaleImg')
  24059. var ResizeImg = function (img, option) {
  24060. var img2 //不能直接改img 否则可能触发第二次img.onload
  24061. var compress = function (ratio, type) {
  24062. var image = img2 || img
  24063. var c = document.createElement('canvas')
  24064. c.width = image.width
  24065. c.height = image.height
  24066. var ctx = c.getContext('2d')
  24067. ctx.drawImage(image, 0, 0, image.width, image.height)
  24068. img2 = scaleImg(ratio /* option.maxSize/oldSize */, c, type /* option.type||"png" */) //最大不能超过0.8M
  24069. }
  24070. var reCom = function () {
  24071. //如果有了img2 就只需要img2 否则创造新的img2
  24072. var image = img2 || img
  24073. var blob = dataURLtoBlob(image.src)
  24074. if (option.maxWeight && blob.size > option.maxWeight) {
  24075. compress(option.maxWeight / blob.size, 'jpeg')
  24076. blob = dataURLtoBlob(image.src)
  24077. }
  24078. if (!img2) {
  24079. img2 = new Image()
  24080. }
  24081. img2.base64Src = image.src
  24082. img2.src = window.URL.createObjectURL(blob)
  24083. }
  24084. var oldSize = Math.max(img.width, img.height)
  24085. if (option.toType != 'png') {
  24086. //不是非要png的话
  24087. if (option.oldType == 'jpeg') {
  24088. //jpeg先判断尺寸,然后是尺寸
  24089. if (oldSize > option.maxSize) {
  24090. compress(option.maxSize / oldSize, 'jpeg')
  24091. }
  24092. reCom()
  24093. } else if (option.oldType == 'png') {
  24094. //png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  24095. if (option.maxWeight && option.weight > option.maxWeight) {
  24096. //如果一开始大小不大就不压缩 还是png
  24097. compress(oldSize > option.maxSize ? option.maxSize / oldSize : 1, 'jpeg')
  24098. reCom()
  24099. }
  24100. }
  24101. } else {
  24102. //?貌似png会越压缩越大?
  24103. }
  24104. return img2 || img
  24105. }
  24106. var _fixType = function (type) {
  24107. type = type.toLowerCase().replace(/jpg/i, 'jpeg')
  24108. var r = type.match(/png|jpeg|bmp|gif/)[0]
  24109. return 'image/' + r
  24110. }
  24111. var saveFile = function (data, filename) {
  24112. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a')
  24113. save_link.href = data
  24114. save_link.download = filename
  24115. var event = document.createEvent('MouseEvents')
  24116. event.initMouseEvent(
  24117. 'click',
  24118. true,
  24119. false,
  24120. window,
  24121. 0,
  24122. 0,
  24123. 0,
  24124. 0,
  24125. 0,
  24126. false,
  24127. false,
  24128. false,
  24129. false,
  24130. 0,
  24131. null
  24132. )
  24133. save_link.dispatchEvent(event)
  24134. }
  24135. ;(n.prototype.getWrapShot = function () {
  24136. //获取导览点截图/初始画面和信息
  24137. var info = this.getSnapAngleInfo()
  24138. var str = ',{\r\t' + info
  24139. var arg = arguments[0]
  24140. this.screenShot({
  24141. width: g_snapShotWidth * 4,
  24142. height: g_snapShotHeight * 4,
  24143. type: 'image/jpeg',
  24144. f: function (imgData) {
  24145. if (arg && arg.__callback) {
  24146. return arg.__callback(imgData, info)
  24147. }
  24148. var img = new Image()
  24149. img.src = imgData
  24150. img.onload = function () {
  24151. var img2 = ResizeImg(this, { maxSize: g_snapShotWidth, oldType: 'jpeg' }) //暂定缩略图大小
  24152. img2.src.replace(_fixType('image/jpeg'), 'image/octet-stream')
  24153. var filename = 'snap' + new Date().getTime()
  24154. saveFile(img2.src, filename + '.jpg')
  24155. str += ',\r\t"thumbnail_signed_src":"' + filename + '.jpg",'
  24156. str += '\r\t"sid":"' + filename + '",'
  24157. str += '\r\t"name":"' + filename + '"\r}'
  24158. logData(str)
  24159. }
  24160. }
  24161. })
  24162. }),
  24163. (n.prototype.getSnapAngleInfo = function () {
  24164. var info = {}
  24165. var str = '"metadata":{'
  24166. var q = this.camera.quaternion.clone()
  24167. switch (this.mode) {
  24168. case 'panorama':
  24169. info.scan_id = this.currentPano.id
  24170. str += '"scan_id":"' + this.currentPano.id + '",'
  24171. break
  24172. case 'floorplan':
  24173. info.camera_mode = 1
  24174. q = new r.Quaternion().setFromAxisAngle(
  24175. new r.Vector3(0, 1, 0),
  24176. r.Math.degToRad(90)
  24177. )
  24178. q.multiply(this.camera.quaternion)
  24179. str += '"camera_mode":1,'
  24180. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  24181. str +=
  24182. '"ortho_zoom":' +
  24183. m.toPrecision(this.cameraControls.activeControl.currentScale, 4) +
  24184. ','
  24185. break
  24186. case 'dollhouse':
  24187. info.camera_mode = 2
  24188. str += '"camera_mode":2,'
  24189. break
  24190. }
  24191. info.camera_position = m.toPrecision(this.camera.position.toArray(), 4)
  24192. console.log(info.camera_position)
  24193. if (window.screenSta === 'tour') {
  24194. // fyz 导览截屏需要做额外的
  24195. /**fyz 对相机截屏的角度进行校对 */
  24196. var out = new r.Quaternion(q.x, q.y, q.z, q.w)
  24197. out.multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  24198. out.x *= -1
  24199. out.w *= -1
  24200. info.camera_quaternion = m.toPrecision(out.toArray(), 4)
  24201. } else {
  24202. info.camera_quaternion = m.toPrecision(q.toArray(), 4)
  24203. }
  24204. info.zoom = this.zoomLevel
  24205. console.log(info.camera_quaternion)
  24206. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  24207. // fyz 扩展编辑页面, 加上导览点缩放值
  24208. str +=
  24209. '"camera_position":[' +
  24210. info.camera_position +
  24211. '],"camera_quaternion":[' +
  24212. info.camera_quaternion +
  24213. '], "zoom":' +
  24214. info.zoom +
  24215. '}'
  24216. return str
  24217. })
  24218. //------end
  24219. ;(n.prototype.setupCustomProperties = function (e) {
  24220. var t = e || u.PANORAMA
  24221. Object.defineProperty(this, 'mode', {
  24222. get: function () {
  24223. return t
  24224. },
  24225. set: function (e) {
  24226. var i = t
  24227. ;(t = e), this.onModeUpdated(i, t)
  24228. }
  24229. })
  24230. }),
  24231. (n.prototype.isInMode = function () {
  24232. for (var e = 0; e < arguments.length; e++) if (this.mode === arguments[e]) return !0
  24233. return !1
  24234. }),
  24235. (n.prototype.isOutsideMode = function (e) {
  24236. return (e = e || this.mode), e === u.DOLLHOUSE || e === u.FLOORPLAN
  24237. }),
  24238. (n.prototype.is360View = function (e, t) {
  24239. return e === u.PANORAMA && t && !t.isAligned()
  24240. }),
  24241. (n.prototype.setScene = function (e) {
  24242. ;(this.sceneIntersectionPlane = e.plane),
  24243. this.path.setScene(e),
  24244. this.moveReticuleToScene(e)
  24245. }),
  24246. (n.prototype.moveReticuleToScene = function (e) {
  24247. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  24248. e.add(this.reticule)
  24249. }),
  24250. (n.prototype.updateModel = function () {
  24251. function e(e, t, n) {
  24252. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  24253. }
  24254. function t(e, t) {
  24255. if (this.mode === u.DOLLHOUSE) {
  24256. var n = e ? this.model.center.y : (n = t.center.y)
  24257. i.call(this, n)
  24258. }
  24259. }
  24260. function i(e) {
  24261. var t = this.cameraControls.cameras[u.DOLLHOUSE],
  24262. i = this.cameraControls.controls[u.DOLLHOUSE],
  24263. n = t.position.y + (e - i.target.y),
  24264. r = f.showFloorDuration + f.showFloorDelay
  24265. y.start(
  24266. v.property(i.target, 'y', e),
  24267. r,
  24268. null,
  24269. f.flydown.movementDelay,
  24270. A[f.flydown.movementEasing],
  24271. null,
  24272. V.FlyToViewFloor
  24273. ),
  24274. y.start(
  24275. v.property(t.position, 'y', n),
  24276. r,
  24277. null,
  24278. f.flydown.movementDelay,
  24279. A[f.flydown.movementEasing],
  24280. null,
  24281. V.FlyToViewFloor
  24282. )
  24283. }
  24284. ;(this.model = this.modelManager.getActiveModel()),
  24285. this.model.on('floor.changed', e.bind(this)),
  24286. this.model.on('allfloors.toggled', t.bind(this)),
  24287. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model))
  24288. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  24289. var e2 = this
  24290. this.model.panos.list.forEach(function (a) {
  24291. a.vrMarker.addEventListener('click', function () {
  24292. e2.flyToPano({
  24293. pano: a
  24294. })
  24295. })
  24296. })
  24297. /********************************************************************************************************************************************/
  24298. this.model.addHighMapCube() //add
  24299. this.on(w.FlyingStarted, this.model.resetHighMap.bind(this.model))
  24300. }),
  24301. (n.prototype.updateModelDependentData = function () {
  24302. this.cameraControls.setModelForControls(this.model),
  24303. this.getPanoMarkersFromModel(this.model)
  24304. }),
  24305. (n.prototype.onModelChanged = function () {
  24306. this.updateModel(), this.updateModelDependentData()
  24307. }),
  24308. (n.prototype.getPanoMarkersFromModel = function (e) {
  24309. this.panoMarkers = e.panos.list.reduce(function (e, t) {
  24310. return t.marker ? e.concat(t.marker) : e
  24311. }, [])
  24312. }),
  24313. (n.prototype.handleControlMove = function (e) {
  24314. this.emit(w.Move, e)
  24315. }),
  24316. (n.prototype.handleControlInputStart = function (e) {
  24317. this.emit(w.InputStart, e)
  24318. }),
  24319. (n.prototype.onModeUpdated = function (e, t) {
  24320. this.cameraControls.activateControls(t), this.emit(w.ModeChanged, e, t)
  24321. }),
  24322. (n.prototype.isWarping = function () {
  24323. //是否导览缓慢走向某个点
  24324. return this.path.warping
  24325. }),
  24326. (n.prototype.isWaitingToWarp = function () {
  24327. return this.path.waitingToWarp
  24328. }),
  24329. (n.prototype.getLabelScaleFactor = function () {
  24330. if (this.isOutsideMode()) {
  24331. var e = 10,
  24332. t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e)
  24333. return t
  24334. }
  24335. return 0.5
  24336. }),
  24337. /* n.prototype.changeMusic = function() {//xzw add
  24338. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  24339. } */
  24340. (n.prototype.bindEvents = function (e) {
  24341. e !== document && e.setAttribute('tabindex', -1),
  24342. e.addEventListener('mousedown', this.onMouseDown.bind(this)),
  24343. e.addEventListener('mousemove', this.onMouseMove.bind(this)),
  24344. e.addEventListener('mouseover', this.onMouseOver.bind(this)),
  24345. e.addEventListener('mouseout', this.onMouseOut.bind(this)),
  24346. e.addEventListener('mouseup', this.onMouseUp.bind(this)),
  24347. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  24348. e.addEventListener('touchstart', this.onTouchStart.bind(this)),
  24349. e.addEventListener('touchmove', this.onTouchMove.bind(this)),
  24350. e.addEventListener('touchend', this.onTouchEnd.bind(this)),
  24351. e.addEventListener('pointerdown', this.onPointerDown.bind(this)),
  24352. e.addEventListener('pointermove', this.onPointerMove.bind(this)),
  24353. e.addEventListener('pointerup', this.onPointerUp.bind(this)),
  24354. e.addEventListener('pointerout', this.onPointerOut.bind(this)),
  24355. e.addEventListener('pointercancel', this.onPointerCancel.bind(this)),
  24356. document.addEventListener('keydown', this.onKeyDown.bind(this)),
  24357. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  24358. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  24359. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  24360. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  24361. window.addEventListener('snapshotBegin', this.getWrapShot.bind(this)), //xzw add
  24362. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  24363. // lzb
  24364. window.getSeft && getSeft(this)
  24365. }),
  24366. (n.prototype.onMouseDown = function (e) {
  24367. e.currentTarget !== document && e.currentTarget.focus(),
  24368. 0 === e.button &&
  24369. (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  24370. this.updateIntersect())
  24371. }),
  24372. (n.prototype.onMouseMove = function (e) {
  24373. ;(this.isTouchEvent = !1), this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  24374. }),
  24375. (n.prototype.onMouseOver = function (e) {
  24376. ;(this.containsMouse = !0),
  24377. !this.mouseDown || (0 !== e.which && 0 !== e.buttons) || (this.mouseDown = !1)
  24378. }),
  24379. (n.prototype.onMouseOut = function (e) {
  24380. this.containsMouse = !1
  24381. }),
  24382. (n.prototype.onMouseUp = function (e) {
  24383. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  24384. }),
  24385. (n.prototype.onTouchStart = function (e) {
  24386. if ((e.currentTarget !== document && e.currentTarget.focus(), !this.mouseDown)) {
  24387. this.couldBeLongTap = !0
  24388. var t = g.average(e.changedTouches, 'clientX'),
  24389. i = g.average(e.changedTouches, 'clientY')
  24390. this.handleInputStart.call(this, t, i, !0),
  24391. (this.mouseDownTimer = setTimeout(
  24392. function () {
  24393. this.updateIntersect(), this.handleInputEnd.call(this, t, i, !0)
  24394. }.bind(this),
  24395. f.input.longTapThreshold
  24396. ))
  24397. }
  24398. }),
  24399. (n.prototype.onTouchMove = function (e) {
  24400. var t = g.average(e.changedTouches, 'clientX'),
  24401. i = g.average(e.changedTouches, 'clientY')
  24402. this.handleInputMove.call(this, t, i, !0)
  24403. }),
  24404. (n.prototype.onTouchEnd = function (e) {
  24405. if ((clearTimeout(this.mouseDownTimer), this.mouseDown)) {
  24406. ;(this.couldBeLongTap = !1), this.updateIntersect()
  24407. var t = g.average(e.changedTouches, 'clientX'),
  24408. i = g.average(e.changedTouches, 'clientY')
  24409. this.handleInputEnd.call(this, t, i, !0)
  24410. }
  24411. //add
  24412. if (this.intersectHot) this.intersectHot.setHoverState(false)
  24413. this.intersectHot = null
  24414. Hot.mobileAutoPlay(this)
  24415. }),
  24416. (n.prototype.onPointerDown = function (e) {
  24417. return (
  24418. e.currentTarget !== document && e.currentTarget.focus(),
  24419. this.mouseDown || 'mouse' === e.pointerType
  24420. ? this.onMouseDown(e)
  24421. : ((this.couldBeLongTap = !0),
  24422. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  24423. void (this.mouseDownTimer = setTimeout(
  24424. function () {
  24425. this.updateIntersect(),
  24426. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  24427. }.bind(this),
  24428. f.input.longTapThreshold
  24429. )))
  24430. )
  24431. }),
  24432. (n.prototype.onPointerMove = function (e) {
  24433. 'mouse' !== e.pointerType
  24434. ? this.handleInputMove.call(this, e.clientX, e.clientY, !0)
  24435. : this.onMouseMove(e)
  24436. }),
  24437. (n.prototype.onPointerUp = function (e) {
  24438. return this.mouseDown && 'mouse' !== e.pointerType
  24439. ? (clearTimeout(this.mouseDownTimer),
  24440. (this.couldBeLongTap = !1),
  24441. this.updateIntersect(),
  24442. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0))
  24443. : this.onMouseUp(e)
  24444. }),
  24445. (n.prototype.onPointerOut = function (e) {
  24446. this.mouseDown = !1
  24447. }),
  24448. (n.prototype.onPointerCancel = function (e) {
  24449. this.mouseDown = !1
  24450. }),
  24451. (n.prototype.onKeyDown = function (e) {
  24452. var t = function () {
  24453. this.cameraControls.activeControl &&
  24454. this.cameraControls.activeControl.emit(_.Move, 'key')
  24455. }.bind(this),
  24456. i = e.which
  24457. switch (i) {
  24458. case p.F:
  24459. t(), this.changeFloor(-1)
  24460. break
  24461. case p.R:
  24462. t(), this.changeFloor(1)
  24463. }
  24464. if (this.mode === u.PANORAMA)
  24465. switch (i) {
  24466. case p.UPARROW:
  24467. case p.W:
  24468. this.flyLocalDirection(d.FORWARD.clone())
  24469. break
  24470. case p.DOWNARROW:
  24471. case p.S:
  24472. this.flyLocalDirection(d.BACK.clone())
  24473. break
  24474. case p.A:
  24475. this.flyLocalDirection(d.LEFT.clone())
  24476. break
  24477. case p.D:
  24478. this.flyLocalDirection(d.RIGHT.clone())
  24479. }
  24480. }),
  24481. (n.prototype.handleScrollPinchZoom = (function () {
  24482. return function (e) {
  24483. var t = e,
  24484. i = this.zoomLevel
  24485. this.zoomBy(t),
  24486. this.currentPano &&
  24487. this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  24488. }
  24489. })()),
  24490. (n.prototype.handleControlPinch = function (e) {
  24491. f.zoom.enabled
  24492. ? this.handleScrollPinchZoom(1 - e)
  24493. : this.flyLocalDirection(new r.Vector3(0, 0, e).normalize())
  24494. }),
  24495. (n.prototype.handleControlScroll = function (e) {
  24496. f.zoom.enabled
  24497. ? (e > 0 ? (e = 1 + this.scrollZoomSpeed) : e < 0 && (e = 1 - this.scrollZoomSpeed),
  24498. 0 !== e && this.handleScrollPinchZoom(e))
  24499. : this.flyLocalDirection(new r.Vector3(0, 0, -e).normalize())
  24500. }),
  24501. (n.prototype.handleInputStart = function (e, t, i) {
  24502. //许钟文加
  24503. var pad = this.handelPadding(e, t)
  24504. e = pad.x
  24505. t = pad.y
  24506. ;(this.isTouchEvent = i),
  24507. m.convertScreenPositionToNDC(e, t, this.mouse),
  24508. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  24509. (this.mouseCouldBeClickToMove = !0),
  24510. (this.mouseDown = !0)
  24511. Hot.mobileAutoPlay(this)
  24512. }),
  24513. (n.prototype.handelPadding = function (x, y) {
  24514. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  24515. if (!this.pad)
  24516. this.pad = {
  24517. //可以直接用$("#player")[0].getBoundingClientRect() , 因为body没有offset
  24518. x: dom.getOffset('left', $('#player')[0]),
  24519. y: dom.getOffset('top', $('#player')[0])
  24520. }
  24521. return {
  24522. x: x - this.pad.x,
  24523. y: y - this.pad.y
  24524. }
  24525. })
  24526. ;(n.prototype.handleInputMove = function (e, t, i) {
  24527. //许钟文加
  24528. var pad = this.handelPadding(e, t)
  24529. e = pad.x
  24530. t = pad.y
  24531. ;(this.isTouchEvent = i),
  24532. m.convertScreenPositionToNDC(e, t, this.mouse),
  24533. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC &&
  24534. ((this.mouseCouldBeClickToMove = !1),
  24535. (this.couldBeLongTap = !1),
  24536. clearTimeout(this.mouseDownTimer)),
  24537. (this.mouseLastMoveTime = Date.now()),
  24538. this.reticule.move(e, t, i)
  24539. }),
  24540. (n.prototype.handleInputEnd = function (e, t, i) {
  24541. //xzw
  24542. if (
  24543. ((this.isTouchEvent = i),
  24544. (this.mouseDown = !1),
  24545. this.cameraControls.controls[u.PANORAMA].emit('interaction.direct'),
  24546. !i && this.couldBeLongTap)
  24547. )
  24548. return !0
  24549. if (this.handleLongTap()) return !0
  24550. /* if(this.director.tourIsPlaying){
  24551. return !0;
  24552. } */
  24553. if (this.mouseCouldBeClickToMove) {
  24554. if (this.flying)
  24555. return (
  24556. this.path.activeTransType === x.WALK &&
  24557. this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType), //停止导览
  24558. !0
  24559. )
  24560. //add----
  24561. if (this.checkHotClick())
  24562. //add
  24563. return !0
  24564. if (this.hoveringPlane) {
  24565. this.clickOverlay(this.hoveringPlane)
  24566. return
  24567. }
  24568. if (
  24569. (this.cameraControls.activeControl &&
  24570. this.cameraControls.activeControl.emit(
  24571. _.Move,
  24572. this.isTouchEvent ? 'touch' : 'mouse'
  24573. ),
  24574. this.history.invalidate(),
  24575. this.intersect)
  24576. )
  24577. return this.flyToPanoClosestToMouse()
  24578. if (this.mode === u.PANORAMA) {
  24579. var n = this.closestPanoInDirection(this.getMouseDirection())
  24580. return n
  24581. ? this.flyToPano({
  24582. pano: n
  24583. })
  24584. : this.bump(this.getMouseDirection())
  24585. }
  24586. }
  24587. //this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode) //xzw 删,否则拖拽后就不高亮了
  24588. }),
  24589. (n.prototype.handleLongTap = function () {
  24590. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  24591. return (
  24592. this.cameraControls.activeControl &&
  24593. this.cameraControls.activeControl.emit(_.LongTap, 'touch'),
  24594. !0
  24595. )
  24596. }),
  24597. (n.prototype.checktagClick = function () {
  24598. if (this.tagManager.intersectTag) {
  24599. var e = this.isTouchEvent,
  24600. t = this.tagManager.clickedOnTag(e, this)
  24601. return e || t || y.cancelById(V.LookTransition), !0
  24602. }
  24603. if (this.tagManager.activeTag) return this.tagManager.dismissActiveTag(), !1
  24604. }),
  24605. (n.prototype.rankedtagInDirection = function (e, t) {
  24606. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  24607. }),
  24608. (n.prototype.start = function (e) {
  24609. //-------------------
  24610. //-------------------
  24611. var t = e.mode,
  24612. i = e.pano,
  24613. n = e.position,
  24614. rr = e.quaternion,
  24615. o = e.tag,
  24616. a = e.quickstart,
  24617. s = $.Deferred()
  24618. this.updateModelDependentData(), this.updateFromControls(), this.findDefaultViews()
  24619. var l = this.is360View(t, i)
  24620. return (
  24621. !this.model.outsideAllowed() || l || a
  24622. ? this.startInside(i, n, rr, o, s)
  24623. : this.startOutside(e, s),
  24624. s.done(
  24625. function (e) {
  24626. this.emit(w.Ready, l, e, o)
  24627. }.bind(this)
  24628. ),
  24629. s.promise()
  24630. )
  24631. }),
  24632. (n.prototype.startOutside = function (e, t) {
  24633. var i = e.mode,
  24634. n = e.pano,
  24635. r = e.position,
  24636. o = e.quaternion,
  24637. a = e.zoom,
  24638. s = e.floorVisibility,
  24639. l = e.tag
  24640. this.emit(w.StartOutside, f[i].transitionTime),
  24641. this.isOutsideMode(i)
  24642. ? (this.model.warpDestFloors(s, !0),
  24643. y.cancelById(V.FlyToViewFloor),
  24644. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  24645. t.resolve(!1))
  24646. : this.startInsideWithFlyin(n, r, o, l, t)
  24647. }),
  24648. (n.prototype.startInside = function (e, t, i, n, r) {
  24649. ;(r = r || $.Deferred()), (this.currentPano = e)
  24650. window.bus.dispatchEvent({ type: 'playerAndModelReady' })
  24651. this.ready = true
  24652. var o = e && !e.isAligned()
  24653. if (((t = o ? e.position : t || e.position), (i = i || e.quaternion), e)) {
  24654. var a = this.startInside.bind(this, e, t, i, n, r)
  24655. if (this.checkAndWaitForPanoLoad(e, 'high', 'low', this.basePanoSize, a)) return
  24656. }
  24657. //add
  24658. this.transitionPos({ type: 'beforeFlytopano', pano: this.currentPano, dur: 0 })
  24659. //this.updateHotVisible()
  24660. Hot.updateVisibles([this.currentPano])
  24661. this.modeTran = 'panorama-panorama'
  24662. return (
  24663. (this.mode = u.PANORAMA),
  24664. e.floor.enter(this.mode),
  24665. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  24666. this.switchCameraMode(this.mode, i),
  24667. this.emit(w.StartInside, o),
  24668. r.resolve(!0),
  24669. r
  24670. )
  24671. }),
  24672. (n.prototype.startInsideWithFlyin = function (e, t, i, n, r) {
  24673. if (((r = r || $.Deferred()), this.dollhouseMode(), !e))
  24674. return (
  24675. F.warn('Player.startInsideWithFlyin() -> targetPano is invalid.'),
  24676. r.resolve(!1),
  24677. r
  24678. )
  24679. t = t || e.position
  24680. var o = i || this.cameraControls.activeControl.camera.quaternion,
  24681. a = e.position
  24682. return (
  24683. this.fitDollhouse(a, t, o),
  24684. setTimeout(
  24685. function (t) {
  24686. this.cameraControls.activeControl &&
  24687. (this.cameraControls.activeControl.maxDistance = t)
  24688. var n = {
  24689. mode: u.PANORAMA,
  24690. pano: e,
  24691. quaternion: i,
  24692. callback: function () {
  24693. this.emit(w.FlyinFinished), r.resolve(!0)
  24694. }.bind(this)
  24695. }
  24696. this.flyToNewMode(n)
  24697. }.bind(this, this.cameraControls.activeControl.maxDistance),
  24698. f.startupFlyinDelay
  24699. ),
  24700. r
  24701. )
  24702. }),
  24703. (n.prototype.checkAndWaitForPanoLoad = (function () {
  24704. var e = {},
  24705. t = {},
  24706. i = 5e3,
  24707. n = function () {
  24708. for (var n in e)
  24709. if (e.hasOwnProperty(n) && e[n]) {
  24710. var r = performance.now() - t[n]
  24711. if (r < i) return !0
  24712. }
  24713. return !1
  24714. }
  24715. return function (r, o, a, s, l, c, h, u, d, p) {
  24716. if (n()) return !0
  24717. var f = function (t, i, n) {
  24718. N.delayOneFrame(
  24719. function () {
  24720. ;(e[t] = !1), l && l(i, n)
  24721. }.bind(this)
  24722. )
  24723. }.bind(this, r.id),
  24724. g = function (t, i) {
  24725. N.delayOneFrame(
  24726. function () {
  24727. ;(e[t] = !1), c && c(i)
  24728. }.bind(this)
  24729. )
  24730. }.bind(this, r.id)
  24731. try {
  24732. return (
  24733. (null !== u && void 0 !== u) || (u = !0),
  24734. this.model.supportsTiles
  24735. ? (e[r.id] = this.checkAndWaitForTiledPanoLoad(r, s, f, g, h, u, d, p))
  24736. : (e[r.id] = this.checkAndWaitForWholePanoLoad(r, o, a, f, u)),
  24737. e[r.id] && (t[r.id] = performance.now()),
  24738. e[r.id]
  24739. )
  24740. } catch (n) {
  24741. throw ((e[r.id] = !1), (t[r.id] = performance.now() - i), n)
  24742. }
  24743. }
  24744. })()),
  24745. (n.prototype.checkAndWaitForWholePanoLoad = function (e, t, i, n, r) {
  24746. if (!e)
  24747. throw new M(
  24748. 'Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.'
  24749. )
  24750. return (
  24751. r &&
  24752. this.model.waitForLoad(e, function () {
  24753. return e.isLoaded(i)
  24754. }),
  24755. !e.isLoaded(t) && (e.loadCube(t).done(n), !0)
  24756. )
  24757. }),
  24758. (n.prototype.checkAndWaitForTiledPanoLoad = (function () {
  24759. var e = new r.Vector3()
  24760. return function (t, i, n, r, o, a, s, l) {
  24761. if (!t)
  24762. throw new M(
  24763. 'Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.'
  24764. )
  24765. return (
  24766. e.copy(d.FORWARD),
  24767. this.getDirection(e),
  24768. !t.isLoaded(i) &&
  24769. (a &&
  24770. this.model.waitForLoad(t, function () {
  24771. return t.isLoaded(i)
  24772. }),
  24773. t
  24774. .loadTiledPano(i, e, null, s, l)
  24775. .done(
  24776. function (e, t) {
  24777. n && n(e, t)
  24778. }.bind(this)
  24779. )
  24780. .fail(
  24781. function (e) {
  24782. r && r(e)
  24783. }.bind(this)
  24784. )
  24785. .progress(
  24786. function (e, t, i) {
  24787. o && o(e, t, i)
  24788. }.bind(this)
  24789. ),
  24790. !0)
  24791. )
  24792. }
  24793. })()),
  24794. (n.prototype.switchCameraMode = function (e, t) {
  24795. var i = this.cameraControls.controls[e],
  24796. n = i.camera
  24797. switch (e) {
  24798. case u.PANORAMA:
  24799. n.position.copy(this.currentPano.position)
  24800. var o = t
  24801. ? d.FORWARD.clone().applyQuaternion(t)
  24802. : this.getDirection().setY(0).normalize()
  24803. i.lookAt(o.add(n.position))
  24804. break
  24805. case u.DOLLHOUSE:
  24806. /* var a = this.position.clone();
  24807. this.mode === u.PANORAMA ? a.add(new r.Vector3(0,6,0)).add(this.getDirection().multiplyScalar(-10)) : a.add(d.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6),
  24808. n.position.copy(a),
  24809. i.target.copy(this.target.clone().setY(this.model.center.y));
  24810. break; */
  24811. //for多楼层 且 让模型刚好适应屏幕
  24812. var box = this.model.boundingBox.clone()
  24813. box.applyMatrix4(this.camera.matrixWorld) //将 boundingbox、也就是模型, 转换到当前相机朝向
  24814. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  24815. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1) //获得在当前窗口的横向的fov
  24816. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2)) //根据上面获得的参数得到target到相机的距离
  24817. //console.log(boxSize.x,distance, boxSize.length() / 2)
  24818. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  24819. if (this.mode === u.PANORAMA) {
  24820. i.target.copy(this.model.center)
  24821. var vec = this.getDirection().negate().setY(1).normalize() //获得朝向
  24822. } else {
  24823. i.target.copy(this.target.clone().setY(this.model.center.y))
  24824. var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  24825. }
  24826. vec.multiplyScalar(distance)
  24827. n.position.copy(i.target.clone().add(vec))
  24828. break
  24829. case u.FLOORPLAN:
  24830. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  24831. i.target.copy(this.model.center).setY(0),
  24832. i.zoomToContain(this.model.size),
  24833. i.rotateToView(this.model.size, this.getDirection())
  24834. }
  24835. i.update(0)
  24836. }),
  24837. (n.prototype.update = (function () {
  24838. var e = (new r.Vector3(), {}),
  24839. t = []
  24840. return function (i) {
  24841. this.updatePersistentZooming(i),
  24842. this.updateFromControls(i),
  24843. this.getCurrentNodePanos(t)
  24844. this.lastFrameChanged = false
  24845. if (this.hasChanged(e)) {
  24846. this.lastFrameChanged = e.cameraChanged3
  24847. ? 'level3'
  24848. : e.cameraChanged2
  24849. ? 'level2'
  24850. : e.cameraChanged
  24851. ? 'level1'
  24852. : false
  24853. ;(this.lastChangeTime = Date.now()),
  24854. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  24855. this.emit(w.ViewChanged, e),
  24856. // 注意: player.cameraControls.activeControl.camera 的 matrix是错的
  24857. this.intersect && this.magnifier && this.magnifier.update(this.intersect.point)
  24858. }
  24859. if (e.cameraChanged2) {
  24860. //变化要更大些
  24861. }
  24862. if (e.cameraChanged) {
  24863. this.mode == 'panorama' &&
  24864. window.cad &&
  24865. cad.setSign(
  24866. { x: this.position.x, y: this.position.z },
  24867. this.cameraControls.controls.panorama.lon
  24868. )
  24869. /* for(var i in this.model.hots){
  24870. this.model.hots[i].updateTitle(this)
  24871. } */
  24872. Hot.updateHots()
  24873. }
  24874. this.model.supportsTiles &&
  24875. (this.updateTileDownloader(t), this.updatePanoRenderer(t)),
  24876. this.updatePreRendering(t),
  24877. this.reticule.update(),
  24878. this.path.update(),
  24879. this.spider.update(),
  24880. this.cachedPanoCandidates &&
  24881. f.navigation.panoScores &&
  24882. this.model.panos.showPanoScores(this.cachedPanoCandidates),
  24883. this.updateControlLocks(),
  24884. this.model.supportsTiles && this.updateZoomPano()
  24885. }
  24886. })()),
  24887. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  24888. var lastMode, lastPano;
  24889. return function(){
  24890. var mode = this.mode;
  24891. var pano = mode == "panorama" ? this.currentPano : "";
  24892. if(mode != "panorama" || pano != lastPano){
  24893. overlay.noBlock = null
  24894. }
  24895. this.overlayGroup.children.forEach((overlay)=>{
  24896. if(overlay.overlayType == "video" ){
  24897. var matrix = overlay.plane.matrixWorld;
  24898. var inSight = false;
  24899. var cameraDir = this.getDirection();
  24900. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  24901. var vertexes = []
  24902. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  24903. for(let i=0; i<4; i++){
  24904. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  24905. vertexes.push(vertex)
  24906. if(overlay.noBlock == null){
  24907. if(!m.ifShelter(vertex)){
  24908. overlay.noBlock = true
  24909. }
  24910. inSight = true; break;
  24911. }else{
  24912. overlay.noBlock = true
  24913. }
  24914. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  24915. inSight = true; break;
  24916. }
  24917. }
  24918. }
  24919. overlay.inSight = inSight
  24920. if(!inSight)overlay.plane.material.map.image.pause()
  24921. else overlay.plane.material.map.image.play()//maybe fail
  24922. }
  24923. })
  24924. lastMode = mode, lastPano = pano
  24925. }
  24926. }() */
  24927. (n.prototype.updatePersistentZooming = function (e) {
  24928. 1 === this.zooming
  24929. ? this.zoomBy(1 + this.zoomSpeed * e)
  24930. : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  24931. }),
  24932. (n.prototype.updateControlLocks = function () {
  24933. this.currentPano &&
  24934. this.model.supportsTiles &&
  24935. (this.cameraControls.controls[u.PANORAMA].locked =
  24936. !this.currentPano.highestFullTileRenderOpCompleted &&
  24937. this.currentPano.lockUntilRenderingComplete)
  24938. }),
  24939. (n.prototype.updatePanoRenderer = (function () {
  24940. var e = new r.Vector3()
  24941. return function (t) {
  24942. var i = this.nextPano || this.currentPano
  24943. this.panoRenderer.hasQueuedTiles() &&
  24944. i &&
  24945. (e.copy(d.FORWARD), this.getDirection(e), this.panoRenderer.updateDirection(e))
  24946. }
  24947. })()),
  24948. (n.prototype.cleanupInactivePanos = (function () {
  24949. var e = [],
  24950. t = []
  24951. return function () {
  24952. ;(e.length = 0),
  24953. e.push(this.currentPano),
  24954. this.nextPano && e.push(this.nextPano),
  24955. (t.length = 0)
  24956. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  24957. t.push(this.panoRenderer.activePanos[i])
  24958. for (var n = 0; n < t.length; n++) {
  24959. for (var r = t[n], o = !0, a = 0; a < e.length; a++) r.id === e[a].id && (o = !1)
  24960. o && r.exit()
  24961. }
  24962. }
  24963. })()),
  24964. (n.prototype.updatePreRendering = (function () {
  24965. var e = {}
  24966. return function (t) {
  24967. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  24968. var i = this.nextPano || this.currentPano
  24969. if (i && t && t.length > 1) {
  24970. var n = t.findIndex(function (e) {
  24971. if (e.id === i.id) return !0
  24972. })
  24973. if (n >= 0 && n + 1 < t.length) {
  24974. var r = t[n + 1]
  24975. r.isLoaded(this.basePanoSize) ||
  24976. e[r.id] ||
  24977. (window.setTimeout(
  24978. function (t) {
  24979. this.checkAndWaitForPanoLoad(
  24980. t,
  24981. 'high',
  24982. 'low',
  24983. this.basePanoSize,
  24984. null,
  24985. null,
  24986. null,
  24987. !1,
  24988. !1,
  24989. !1
  24990. ),
  24991. window.setTimeout(
  24992. function (t) {
  24993. e[t.id] = !1
  24994. }.bind(this, t),
  24995. f.tiling.panoPreRenderRepeatDelay
  24996. )
  24997. }.bind(this, r),
  24998. f.tiling.panoPreRenderDelay
  24999. ),
  25000. (e[r.id] = !0))
  25001. }
  25002. }
  25003. }
  25004. }
  25005. })()),
  25006. (n.prototype.enablePreRendering = function () {
  25007. this.preRenderingEnabled = !0
  25008. }),
  25009. (n.prototype.disablePreRendering = function () {
  25010. ;(this.preRenderingEnabled = !1), this.cleanupInactivePanos()
  25011. }),
  25012. (n.prototype.updateTileDownloader = (function () {
  25013. var e = new r.Vector3()
  25014. return function (t) {
  25015. var i = this.nextPano || this.currentPano
  25016. i &&
  25017. (e.copy(d.FORWARD),
  25018. this.getDirection(e),
  25019. this.tileDownloader.tilePrioritizer.updateCriteria(
  25020. i,
  25021. this.position,
  25022. e,
  25023. t.length > 0 ? t : null
  25024. ),
  25025. (this.tileDownloader.processPriorityQueue = !0))
  25026. }
  25027. })()),
  25028. (n.prototype.updateFromControls = function (e) {
  25029. ;(null !== e && void 0 !== e) || (e = 0),
  25030. this.cameraControls.activeControl &&
  25031. (this.cameraControls.activeControl.update(e),
  25032. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  25033. this.position.copy(this.cameraControls.activeControl.camera.position),
  25034. this.target.copy(this.cameraControls.activeControl.target),
  25035. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  25036. this.camera.projectionMatrix.copy(
  25037. this.cameraControls.activeControl.camera.projectionMatrix
  25038. )),
  25039. this.camera.position.copy(this.position),
  25040. this.camera.quaternion.copy(this.quaternion),
  25041. this.camera.updateMatrix(),
  25042. this.camera.updateMatrixWorld()
  25043. }),
  25044. (n.prototype.hasChanged = function (e) {
  25045. if (!this.previousState) {
  25046. this.previousState = {
  25047. allFloorsVisible: this.model.allFloorsVisible,
  25048. position: this.position.clone(),
  25049. quaternion: this.quaternion.clone(),
  25050. mouse: this.mouse.clone(),
  25051. //labelScaleFactor: this.getLabelScaleFactor(),
  25052. currentFloor: this.model.currentFloor,
  25053. projectionMatrix: this.camera.projectionMatrix.clone(),
  25054. worldMatrix: this.camera.matrixWorld.clone(),
  25055. mode: this.mode,
  25056. modelPosition: this.model.position.clone(),
  25057. modelCenter: this.model.center.clone(),
  25058. zoomLevel: this.zoomLevel
  25059. }
  25060. e.cameraChanged = e.cameraChanged2 = true
  25061. return !0
  25062. }
  25063. //许钟文改 分成相机是否改变cameraChanged 和其他
  25064. var a =
  25065. this.position.equals(this.previousState.position) &&
  25066. this.quaternion.equals(this.previousState.quaternion) &&
  25067. this.camera.matrixWorld.equals(this.previousState.worldMatrix) &&
  25068. this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) &&
  25069. this.mode === this.previousState.mode &&
  25070. this.zoomLevel === this.previousState.zoomLevel &&
  25071. this.model.center.equals(this.previousState.modelCenter) &&
  25072. this.model.position.equals(this.previousState.modelPosition)
  25073. var t =
  25074. a &&
  25075. this.mouse.equals(this.previousState.mouse) &&
  25076. this.model.allFloorsVisible ===
  25077. this.previousState
  25078. .allFloorsVisible /* && this.getLabelScaleFactor() === this.previousState.labelScaleFactor */ &&
  25079. this.model.currentFloor === this.previousState.currentFloor &&
  25080. null === this.nextPano
  25081. e.cameraChanged = !a
  25082. ;(e.allFloorsVisible =
  25083. this.model.allFloorsVisible !== this.previousState.allFloorsVisible),
  25084. (e.moved = !this.position.equals(this.previousState.position)),
  25085. (e.rotated = !this.quaternion.equals(this.previousState.quaternion)),
  25086. (e.mouseMoved = !this.mouse.equals(this.previousState.mouse)),
  25087. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  25088. (e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor),
  25089. (e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(
  25090. this.previousState.projectionMatrix
  25091. )),
  25092. (e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(
  25093. this.previousState.worldMatrix
  25094. )),
  25095. (e.modeChanged = this.mode !== this.previousState.mode),
  25096. (e.modelPositionChanged = !this.model.position.equals(
  25097. this.previousState.modelPosition
  25098. )),
  25099. (e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter)),
  25100. (e.nextPanoActive = null !== this.nextPano),
  25101. (e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel)
  25102. /* if(e.cameraChanged){//
  25103. e.cameraChanged2 = !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 4) || !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix)
  25104. }else e.cameraChanged2 = false */
  25105. if (e.cameraChanged) {
  25106. e.cameraChanged2 =
  25107. e.cameraProjectionChanged ||
  25108. !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 5) ||
  25109. !MathLight.closeTo(this.position, this.previousState.position, 4)
  25110. e.cameraChanged3 =
  25111. e.cameraProjectionChanged ||
  25112. !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) ||
  25113. !MathLight.closeTo(this.position, this.previousState.position, 3)
  25114. } else {
  25115. e.cameraChanged2 = false
  25116. e.cameraChanged3 = false
  25117. }
  25118. ;(this.previousState.allFloorsVisible = this.model.allFloorsVisible),
  25119. this.previousState.position.copy(this.position),
  25120. this.previousState.quaternion.copy(this.quaternion),
  25121. this.previousState.mouse.copy(this.mouse),
  25122. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  25123. (this.previousState.currentFloor = this.model.currentFloor),
  25124. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  25125. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  25126. (this.previousState.mode = this.mode),
  25127. this.previousState.modelPosition.copy(this.model.position),
  25128. this.previousState.modelCenter.copy(this.model.center),
  25129. (this.previousState.zoomLevel = this.zoomLevel)
  25130. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  25131. return !t
  25132. }),
  25133. (n.prototype.updateIntersect = function () {
  25134. var e = this.flying || this.isWarping(),
  25135. t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged(),
  25136. i = y.getById(V.LookTransition),
  25137. n = !(e || t || this.isTouchEvent || (i.length && i[0].running))
  25138. {
  25139. //clear:
  25140. if (this.intersectHot) this.intersectHot.setHoverState(false)
  25141. this.intersectHot = null
  25142. CursorDeal.remove('hoverHot')
  25143. }
  25144. var deal = () => {
  25145. if (this.intersect && this.intersect.object.visible) {
  25146. if ('hotSprite' == this.intersect.object.type) {
  25147. this.intersectHot = this.intersect.object
  25148. while (!(this.intersectHot instanceof Hot)) {
  25149. this.intersectHot = this.intersectHot.parent
  25150. }
  25151. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass(
  25152. 'active'
  25153. )
  25154. this.intersectHot.setHoverState(true)
  25155. }
  25156. }
  25157. }
  25158. if (this.model.hotGroup) {
  25159. var hots = this.model.hotGroup.children.filter(
  25160. e =>
  25161. e.info.actionType.examine ||
  25162. e.info.actionType.fastTran ||
  25163. e.info.actionType.openHot ||
  25164. e.info.actionType.playAndPause
  25165. )
  25166. let colliders = this.model.floors.reduce(
  25167. function (e, t) {
  25168. return t.hidden ? e : e.concat(t.collider.children)
  25169. },
  25170. this.mode === 'panorama' ? this.panoMarkers : []
  25171. )
  25172. this.intersect = this.getMouseIntersect(
  25173. null,
  25174. hots.concat(colliders /* this.model.colliders */)
  25175. )
  25176. if (this.intersect) {
  25177. deal()
  25178. let intersect = this.intersect
  25179. if (this.intersectHot) {
  25180. this.intersect = null
  25181. CursorDeal.add('hoverHot')
  25182. } else {
  25183. if (intersect.object.parent.parent.hidden) {
  25184. //楼层已隐藏
  25185. this.intersect = null
  25186. }
  25187. }
  25188. }
  25189. } else {
  25190. this.intersect = this.getMouseIntersect()
  25191. }
  25192. this.intersect && this.updateClosestPano(this.intersect),
  25193. this.closestPano || this.closestPanoInDirection(this.getMouseDirection())
  25194. ? (this.reticule.updatePosition(this.position, this.intersect),
  25195. f.navigation.panoScores &&
  25196. !f.navigation.mouseDirection &&
  25197. this.closestPanoInDirection(this.getDirection()))
  25198. : this.reticule.hide()
  25199. }),
  25200. (n.prototype.checkHotClick = function () {
  25201. if (this.intersectHot) {
  25202. if (
  25203. this.intersectHot.texType == 'video' &&
  25204. this.intersectHot.info.actionType.playAndPause
  25205. ) {
  25206. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  25207. }
  25208. this.intersectHot.examine(this)
  25209. return true
  25210. }
  25211. }),
  25212. (n.prototype.getMouseDirection = function (e) {
  25213. e = e || this.mouse
  25214. var t = new r.Vector3(e.x, e.y, -1).unproject(this.camera),
  25215. i = new r.Vector3(e.x, e.y, 1).unproject(this.camera)
  25216. return i.sub(t).normalize()
  25217. }),
  25218. (n.prototype.hoverOverlay = function (mesh) {
  25219. if (!mesh) {
  25220. this.hoveringPlane = null
  25221. $('#player').css('cursor', this.currentCursor || '')
  25222. } else {
  25223. var overlay = mesh.parent
  25224. $('#player').css('cursor', 'pointer')
  25225. this.hoveringPlane = overlay
  25226. return true
  25227. }
  25228. }),
  25229. (n.prototype.clickOverlay = function (overlay) {
  25230. if (this.openOverlay && !overlay) return
  25231. var plane = overlay.plane
  25232. /* if(overlay.overlayType == "video"){
  25233. if(plane.material.map.image.paused) plane.material.map.image.play()
  25234. else plane.material.map.image.pause()
  25235. } */
  25236. if (overlay.overlayType == 'video') {
  25237. overlay.switchPlay(!!overlay.pausedByUser)
  25238. }
  25239. /* if(window.EditOverlay &&EditOverlay.editing){
  25240. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  25241. $('#overlayProp').removeClass('atRight').removeClass('hide')
  25242. EditOverlay.endAddPlane();
  25243. EditOverlay.updateOverlayPanel(overlay)
  25244. EditOverlay.controlSelectOverlay(overlay)
  25245. return;
  25246. } */
  25247. }),
  25248. (n.prototype.getMouseIntersect = function (e, t) {
  25249. //xzw change
  25250. ;(e = e || this.mouse.clone()),
  25251. (t =
  25252. t ||
  25253. this.model.floors.reduce(
  25254. function (e, t) {
  25255. return t.hidden ? e : e.concat(t.collider.children)
  25256. },
  25257. this.mode === u.PANORAMA ? this.panoMarkers : []
  25258. ))
  25259. var i = new r.Vector3(e.x, e.y, -1).unproject(this.camera)
  25260. this.raycaster.set(i, this.getMouseDirection(e))
  25261. var n = this.raycaster.intersectObjects(t, true) //add true
  25262. var o = n[0]
  25263. if (o) {
  25264. o.face &&
  25265. ((o.normal = o.face.normal.applyQuaternion(o.object.quaternion)),
  25266. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  25267. this.currentPano
  25268. ? (o.onFloor = o.point.y < this.position.y - 0.5 * this.currentPano.height)
  25269. : (o.onFloor = o.point.y < this.position.y - 0.5),
  25270. (o.horizontal = 0.8 < o.normal.y))
  25271. return o
  25272. }
  25273. }),
  25274. (n.prototype.updateClosestPano = function (e) {
  25275. var t = [s.filters.isPanoAligned()]
  25276. if (this.mode === u.PANORAMA) {
  25277. if (!this.currentPano) return
  25278. t.push(s.filters.not(this.currentPano)),
  25279. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  25280. t.push(
  25281. s.filters.inFloorDirection(
  25282. this.currentPano.floorPosition,
  25283. this.getDirection(),
  25284. 0.25
  25285. )
  25286. ),
  25287. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  25288. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  25289. } else {
  25290. t.push(s.filters.isOnVisibleFloor()), t.push(this.checkHasNeighbor) //add
  25291. this.mode !== u.FLOORPLAN &&
  25292. t.push(s.filters.inDirection(this.position, this.getDirection(), 0.25))
  25293. }
  25294. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)])
  25295. i !== this.closestPano
  25296. ? (i && (this.isPanoHover = !0),
  25297. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  25298. (this.closestPano = i),
  25299. this.closestPano && this.mode == 'panorama'
  25300. ? CursorDeal.add('hoverPano')
  25301. : CursorDeal.remove('hoverPano')) //add
  25302. : (this.isPanoHover = !1)
  25303. }),
  25304. (n.prototype.dollhouseMode = function (e, t) {
  25305. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  25306. (this.mode = u.DOLLHOUSE),
  25307. this.cameraControls.controls[u.DOLLHOUSE].reset()
  25308. var i = new r.Vector3(this.model.center.x, 0, this.model.center.z),
  25309. n = new r.Vector3(15, 10, 15)
  25310. if (e && t) {
  25311. var o = d.FORWARD.clone().applyQuaternion(t),
  25312. a = this.model.center.clone().sub(e),
  25313. s = a.dot(o)
  25314. s > 0
  25315. ? ((i = o.clone().multiplyScalar(s).add(e)), n.copy(e))
  25316. : F.warn(
  25317. "Tried to initiate dollhouse mode that wasn't looking at the model",
  25318. e,
  25319. t
  25320. )
  25321. }
  25322. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  25323. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  25324. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  25325. this.updateFromControls(),
  25326. (this.model.alpha = 1),
  25327. (this.model.skybox.material.uniforms.opacity.value = 0)
  25328. }),
  25329. (n.prototype.insideMode = function (e, t) {
  25330. var i = $.Deferred(),
  25331. n = t || null
  25332. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  25333. var r = [s.filters.isPanoAligned()]
  25334. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  25335. (e =
  25336. e ||
  25337. this.currentPano ||
  25338. this.model.panos.find(r, [
  25339. s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)
  25340. ])),
  25341. this.flyToNewMode({
  25342. mode: u.PANORAMA,
  25343. pano: e,
  25344. callback: n
  25345. })
  25346. .done(i.resolve.bind(i))
  25347. .fail(i.reject.bind(i))
  25348. } else {
  25349. var o =
  25350. this.mode === u.PANORAMA
  25351. ? 'Already in panorama mode'
  25352. : 'Cannot change mode during mode transition'
  25353. i.reject(o)
  25354. }
  25355. return i.promise()
  25356. }),
  25357. (n.prototype.fitDollhouse = function (e, t, i) {
  25358. //许钟文改 飞入前寻找和初始视角最合适的位置
  25359. //if(urlHasValue('oldEntry')){
  25360. //搬自一代。
  25361. var maxY = this.model.boundingBox.max.y
  25362. var n = d.FORWARD.clone().applyQuaternion(i),
  25363. i = n.clone().add(e)
  25364. this.cameraControls.activeControl.target.copy(i),
  25365. this.cameraControls.activeControl.camera.position
  25366. .set(0, maxY * 2.4, 0)
  25367. .add(e)
  25368. .add(n.multiplyScalar(-10))
  25369. //return;
  25370. /* //this.camera.position.copy(this.model.center);
  25371. //this.camera.updateMatrixWorld()
  25372. this.switchCameraMode("dollhouse", i) */
  25373. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  25374. //直接用一代的这个 效果和二代几乎一样,且不会甩
  25375. /* var n = d.FORWARD.clone().applyQuaternion(i);
  25376. this.cameraControls.activeControl.target.copy(n).add(e);
  25377. var o = d.RIGHT.clone().applyQuaternion(i)
  25378. , a = d.UP.clone()
  25379. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  25380. , l = this.model.boundingBox.max.clone()
  25381. , c = this.model.boundingBox.min.clone()
  25382. , h = [new r.Vector3(l.x,0,l.z).sub(e), new r.Vector3(l.x,0,c.z).sub(e), new r.Vector3(c.x,0,l.z).sub(e), new r.Vector3(c.x,0,c.z).sub(e)]
  25383. , u = 0
  25384. , p = 0
  25385. , g = 0;
  25386. h.forEach(function(e, t, i) {
  25387. var n = Math.abs(e.dot(o))
  25388. , r = e.dot(s);
  25389. n > u && (u = n,
  25390. p = r),
  25391. r > g && (g = r)
  25392. });
  25393. var m = Math.max(Math.abs(new r.Vector3(0,l.y,0).sub(e).dot(a)), Math.abs(new r.Vector3(0,c.y,0).sub(e).dot(a)))
  25394. , v = s.clone().multiplyScalar(p).add(t)
  25395. , A = s.clone().multiplyScalar(g).add(t);
  25396. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  25397. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  25398. p = Math.max(p, 10),
  25399. g = Math.max(g, 10);
  25400. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  25401. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  25402. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  25403. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  25404. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  25405. */
  25406. }),
  25407. (n.prototype.floorplanMode = function (e, t, i) {
  25408. this.mode = u.FLOORPLAN
  25409. var n = this.cameraControls.controls[u.FLOORPLAN]
  25410. n.reset()
  25411. var r = e ? e : this.model.center
  25412. if (
  25413. (n.target.copy(r).setY(0),
  25414. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  25415. i
  25416. ? ((n.currentScale = i / ($('#player').width() / $('#player').height())),
  25417. (n.absoluteScale = n.currentScale))
  25418. : n.zoomToContain(this.model.size),
  25419. t)
  25420. ) {
  25421. var o = d.LEFT.clone().applyQuaternion(t)
  25422. n.rotateLeft(-Math.atan2(o.x, o.z))
  25423. } else n.rotateToView(this.model.size, this.getDirection())
  25424. n.update(0)
  25425. }),
  25426. (n.prototype.nonInterruptingFlyToPano = function (e, t) {
  25427. return (e.skipWarpingCheck = !0), this.flyToPano(e, t)
  25428. }),
  25429. (n.prototype.updateMarkerVisi = function () {
  25430. //加
  25431. if (this.mode != 'panorama') return
  25432. this.model.panos.list.forEach(pano => {
  25433. if (!pano.marker) return
  25434. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id]
  25435. })
  25436. }),
  25437. /* n.prototype.updateHotVisible = function(pano){
  25438. var hots = this.model.hots;
  25439. pano = pano || this.currentPano;
  25440. for (var index in hots){
  25441. var visible;
  25442. if(this.mode != "panorama"){
  25443. visible = true;
  25444. }else{
  25445. //hots[index].mesh.material.depthTest = false;
  25446. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  25447. }
  25448. hots[index].mesh.visible = visible;
  25449. }
  25450. } */
  25451. (n.prototype.flyToPano = function (e, t) {
  25452. var i = e.pano,
  25453. aim = e.lookAtPoint,
  25454. aimQua = e.quaternion, //ADD
  25455. o = e.duration,
  25456. a = e.aimDuration,
  25457. s = e.maxDistanceOverride,
  25458. l = e.skipWarpingCheck,
  25459. c = e.constantMoveSpeed,
  25460. h = null,
  25461. p = null
  25462. if (aim) {
  25463. var _ = new r.Matrix4().lookAt(i.position, aim, d.UP)
  25464. aimQua = new r.Quaternion().setFromRotationMatrix(_)
  25465. } else aimQua = aimQua
  25466. var zoomLevel = e.zoomLevel || 1 //add
  25467. if (this.flying) return t && t(e)
  25468. window.specialScene &&
  25469. specialScene.special().specifySpot &&
  25470. specialScene.special().specifySpot(i)
  25471. if (
  25472. this.isWarping() &&
  25473. !l &&
  25474. (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD)
  25475. )
  25476. return F.warn('Player.flyToPano() -> Cannot fly when warping'), t && t(), !1
  25477. if ((this.updateLastView(), this.mode !== u.PANORAMA)) {
  25478. var m
  25479. void this.flyToNewMode({
  25480. mode: u.PANORAMA,
  25481. pano: i,
  25482. duration: o,
  25483. quaternion: aimQua,
  25484. callback: t
  25485. })
  25486. }
  25487. if (
  25488. !i ||
  25489. ((h = g.deepExtend(e)),
  25490. (p = function () {
  25491. N.delayOneFrame(
  25492. function () {
  25493. this.flyToPano(h, t)
  25494. }.bind(this)
  25495. )
  25496. }.bind(this)),
  25497. !this.checkAndWaitForPanoLoad(i, 'high', 'low', this.basePanoSize, p))
  25498. ) {
  25499. var C = function (e) {
  25500. t && t(e)
  25501. }.bind(this)
  25502. this.currentPano ||
  25503. ((this.currentPano = i),
  25504. this.path.placeCpm(),
  25505. this.path.fadeOutCpm(f.path.fadeOutTime),
  25506. this.spider.draw())
  25507. var I = o
  25508. if ('number' != typeof o) {
  25509. var E = s || f.transition.flytimeMaxDistanceThreshold
  25510. I =
  25511. Math.min(this.currentPano.position.distanceTo(i.position), E) *
  25512. f.transition.flytimeDistanceMultiplier +
  25513. f.transition.flyTime
  25514. }
  25515. if (
  25516. (f.transition.flySpeed > 0.01 &&
  25517. (I =
  25518. (1e3 * this.currentPano.position.distanceTo(i.position)) /
  25519. f.transition.flySpeed),
  25520. zoomLevel !== this.zoomLevel)
  25521. )
  25522. switch (f.zoom.transitionStyle) {
  25523. case 1:
  25524. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? I / 2 : I) //改
  25525. break
  25526. case 2:
  25527. return (
  25528. (h = g.deepExtend(e)),
  25529. (p = this.flyToPano.bind(this, h, t)),
  25530. void this.smoothZoomFovTo(
  25531. null,
  25532. zoomLevel,
  25533. f.zoom.restoreTime * (this.zoomLevel - 1),
  25534. p
  25535. )
  25536. )
  25537. }
  25538. if (aimQua) {
  25539. y.cancelById(V.LookTransition), (I *= f.transition.aimSlowFactor)
  25540. var b = this.cameraControls.activeControl.camera.quaternion.clone(),
  25541. S = b.clone(),
  25542. M = new r.Vector3()
  25543. if (i === this.currentPano) {
  25544. var R = d.FORWARD.clone().applyQuaternion(b),
  25545. P = d.FORWARD.clone().applyQuaternion(aimQua),
  25546. O = R.angleTo(P)
  25547. return (
  25548. (void 0 !== a && null !== a) ||
  25549. (a = ((1 * Math.sqrt(O)) / f.tags.navigate.rotateSpeedFactor) * 1e3),
  25550. void y.start(
  25551. function (e) {
  25552. S.copy(b),
  25553. v.quaternion(S, aimQua)(e),
  25554. M.copy(d.FORWARD)
  25555. .applyQuaternion(S)
  25556. .add(this.cameraControls.activeControl.camera.position),
  25557. this.cameraControls.activeControl.lookAt(M)
  25558. }.bind(this),
  25559. a,
  25560. C,
  25561. 0,
  25562. A[f.transition.movementEasing],
  25563. null,
  25564. V.LookTransition
  25565. )
  25566. )
  25567. }
  25568. }
  25569. if (i === this.currentPano) return void C()
  25570. this.flying = !0
  25571. var L = this.position.clone(),
  25572. D = this.currentPano
  25573. F.debug('Flying to pano ', i.position),
  25574. this.emit(w.PanoChosen, this.currentPano, i),
  25575. this.emit(w.FlyingStarted, i.position, L, i, D)
  25576. //---------before fly--------------- add
  25577. this.transitionPos({ type: 'beforeFlytopano', pano: i, dur: I }) //add
  25578. Hot.updateVisibles([this.currentPano, i], 'every')
  25579. //地标变化
  25580. if (this.model.floorLogos) {
  25581. this.model.changefloorLogoOpa({ index: 0, opa: 0, dur: p, delay: 0.7 }) //this.model.floorLogoFade(0, _duration*0.5, 0.7);
  25582. this.model.floorLogos[1].position.copy(
  25583. i.floorPosition.clone().sub(this.model.position)
  25584. )
  25585. //this.model.adjustfloorLogoHeight();
  25586. this.model.floorLogos[1].material.opacity = 0 //uniforms.opacity.value = 0;
  25587. this.model.floorLogos[1].visible = true
  25588. this.model.changefloorLogoOpa({ index: 1, opa: 1, dur: 250 }) //this.model.floorLogoShow(1,250);
  25589. }
  25590. //=======================================
  25591. this.nextPano = i
  25592. let beginTran = () => {
  25593. aimQua &&
  25594. y.start(
  25595. function (e) {
  25596. S.copy(b),
  25597. v.quaternion(S, aimQua)(e),
  25598. M.copy(d.FORWARD)
  25599. .applyQuaternion(S)
  25600. .add(this.cameraControls.activeControl.camera.position),
  25601. this.cameraControls.activeControl.lookAt(M)
  25602. }.bind(this),
  25603. I,
  25604. null,
  25605. 0,
  25606. A[f.transition.movementEasing],
  25607. null,
  25608. V.LookTransition
  25609. )
  25610. var B = c ? null : A[f.transition.movementEasing]
  25611. y.start(
  25612. v.uniform(this.model.skybox, 'progress', 1),
  25613. I,
  25614. null,
  25615. 0,
  25616. A[f.transition.blendEasing],
  25617. 'skyFly',
  25618. V.FlyToPano
  25619. ),
  25620. y.start(
  25621. v.allUniforms(this.model.chunks, 'progress', 1),
  25622. I,
  25623. null,
  25624. 0,
  25625. A[f.transition.blendEasing],
  25626. 'chunkFly',
  25627. V.FlyToPano
  25628. ),
  25629. y.start(
  25630. v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position),
  25631. I,
  25632. function (e) {
  25633. ;(this.flying = !1),
  25634. this.currentPano !== i && this.currentPano.exit(),
  25635. i.enter(),
  25636. (this.currentPano = i),
  25637. (this.nextPano = null),
  25638. this.path.placeCpm(),
  25639. this.path.fadeOutCpm(f.path.fadeOutTime),
  25640. this.spider.draw(),
  25641. this.emit(w.FlyingEnded, i.position, L, i, D),
  25642. this.updateMarkerVisi(), //add
  25643. C(e)
  25644. //add:
  25645. if (this.mode == 'panorama') {
  25646. if (this.model.floorLogos) {
  25647. this.model.floorLogos[0].position.copy(
  25648. this.model.floorLogos[1].position
  25649. )
  25650. //this.model.adjustfloorLogoHeight()
  25651. this.model.changefloorLogoOpa({ index: 0, opa: 1, dur: 0 }) //this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  25652. this.model.floorLogos[1].visible = false
  25653. }
  25654. this.model.fadePanoMarkers() //add
  25655. Hot.updateVisibles([this.currentPano]) //add
  25656. }
  25657. }.bind(this),
  25658. 0,
  25659. B,
  25660. 'camFly',
  25661. V.FlyToPano
  25662. )
  25663. }
  25664. if (
  25665. !this.model.supportsTiles &&
  25666. i.getSkyboxTexture().image[0].width >
  25667. 1024 /* || this.qualityManager.getMaxZoomClass() == '4k' */
  25668. ) {
  25669. setTimeout(() => {
  25670. beginTran()
  25671. }, 50) //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  25672. } else {
  25673. beginTran()
  25674. }
  25675. }
  25676. }),
  25677. (n.prototype.warpToPano = function (o = {}) {})
  25678. n.prototype.blackToPano = function (o = {}) {
  25679. //add 瞬间过渡
  25680. //o.panoId = "8bc9156b288d48459e4e0f74d7051ef1"
  25681. if (this.flying || this.isWarping()) return
  25682. let pano = o.pano || this.model.panos.index[o.panoId]
  25683. if (this.mode !== u.PANORAMA) {
  25684. var m
  25685. void this.flyToNewMode({
  25686. mode: u.PANORAMA,
  25687. pano,
  25688. duration: o.duration,
  25689. quaternion: o.quaternion
  25690. //callback: t
  25691. })
  25692. }
  25693. let oldPos = this.position.clone()
  25694. let oldPano = this.currentPano
  25695. this.path.warpDestPano = pano
  25696. var retry = () => {
  25697. ;(this.waitingToWarp = !1), this.blackToPano(o)
  25698. }
  25699. if (this.checkAndWaitForPanoLoad(pano, 'high', 'low', this.basePanoSize, retry))
  25700. return void (this.waitingToWarp = !0)
  25701. this.emit('pano.chosen', oldPano, pano)
  25702. this.flying = true
  25703. this.nextPano = pano //提前加载高清图片
  25704. this.path.warpDestHeroLoc = {
  25705. panoId: o.panoId,
  25706. position: pano.position,
  25707. quaternion: o.quaternion || this.quaternion.clone()
  25708. }
  25709. this.path.warpTravel_BLACK(null, 1500, 1, () => {
  25710. pano != this.currentPano && this.currentPano.exit()
  25711. pano.enter()
  25712. this.currentPano = pano
  25713. this.emit('flying.ended', pano.position, oldPos, pano, oldPano)
  25714. this.flying = false
  25715. this.nextPano = null
  25716. this.updateMarkerVisi() //add
  25717. })
  25718. }
  25719. window._transitionPosId = 9999
  25720. n.prototype.transitionPos = function (o = {}) {
  25721. //渐变overlay和热点的位置
  25722. y.cancelById(_transitionPosId)
  25723. var begin = function (object, pos, qua, scale) {
  25724. if (pos) {
  25725. if (!same(object.position, pos, 0.01)) {
  25726. y.start(
  25727. v.vector(object.position, pos),
  25728. o.dur,
  25729. e => {},
  25730. 0,
  25731. A[f.transition.movementEasing],
  25732. 'transitionPos',
  25733. _transitionPosId
  25734. )
  25735. }
  25736. if (qua && !same(object.quaternion, qua, 1e-6)) {
  25737. y.start(
  25738. v.quaternion(object.quaternion, qua),
  25739. o.dur,
  25740. e => {},
  25741. 0,
  25742. A[f.transition.movementEasing],
  25743. 'transitionPos',
  25744. _transitionPosId
  25745. )
  25746. }
  25747. if (scale && !same(object.scale, scale, 0.001)) {
  25748. y.start(
  25749. v.vector(object.scale, scale),
  25750. o.dur,
  25751. e => {},
  25752. 0,
  25753. A[f.transition.movementEasing],
  25754. 'transitionPos',
  25755. _transitionPosId
  25756. )
  25757. }
  25758. }
  25759. }
  25760. var same = function (vec1, vec2, diff) {
  25761. var s =
  25762. Math.abs(vec1.x - vec2.x) < diff &&
  25763. Math.abs(vec1.y - vec2.y) < diff &&
  25764. Math.abs(vec1.z - vec2.z) < diff
  25765. if (s && vec1.w) s = Math.abs(vec1.w - vec2.w) < diff
  25766. return s
  25767. }
  25768. var sid = o.pano != void 0 ? o.pano.id : 'outside'
  25769. for (let i in this.model.hots) {
  25770. //是否判断visible?
  25771. var hot = this.model.hots[i]
  25772. var panoData = hot.info.transformAtPanos[sid]
  25773. var useCustom = !panoData
  25774. //if(hot.usingTransformData || !useCustom){
  25775. var pos = useCustom ? hot.info.position : panoData.pos
  25776. var qua = hot.isSprite ? null : useCustom ? hot.info.quaternion : panoData.qua
  25777. var scale = useCustom ? hot.info.scale : panoData.scale
  25778. begin(hot, pos, qua, scale)
  25779. //}
  25780. //hot.usingTransformData = !useCustom;
  25781. }
  25782. }
  25783. window._tranOutsideFocus = 4399
  25784. n.prototype.focusPoint = function (o = {}) {
  25785. //当在外时,聚焦相机到这一点
  25786. console.log('focusPoint')
  25787. if (this.mode == 'floorplan') {
  25788. var modelSize = o.modelSize || new THREE.Vector3(8, 8, 8) //可视范围
  25789. var control = this.cameraControls.controls.floorplan
  25790. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  25791. var currentScale = control.absoluteScale
  25792. var currentTarget = control.target.clone()
  25793. y.cancelById(window._tranOutsideFocus, true)
  25794. y.start(
  25795. function (progress) {
  25796. control.absoluteScale = absoluteScale * progress + currentScale * (1 - progress)
  25797. control.target = o.aim
  25798. .clone()
  25799. .multiplyScalar(progress)
  25800. .add(currentTarget.clone().multiplyScalar(1 - progress))
  25801. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  25802. }.bind(this),
  25803. o.dur || 600,
  25804. null /* cancelFuc */,
  25805. 0,
  25806. A[f.transition.movementEasing],
  25807. 'outsideFocus',
  25808. window._tranOutsideFocus,
  25809. null /* cancelFuc */
  25810. )
  25811. } else if (player.mode == 'dollhouse') {
  25812. var control = player.cameraControls.controls.dollhouse
  25813. var radius = o.radius || 8
  25814. var currentTarget = control.target.clone()
  25815. var dir = control.offset.clone().normalize()
  25816. var currentRadius = control.offset.length()
  25817. y.cancelById(window._tranOutsideFocus, true)
  25818. y.start(
  25819. function (progress) {
  25820. control.target = o.aim
  25821. .clone()
  25822. .multiplyScalar(progress)
  25823. .add(currentTarget.clone().multiplyScalar(1 - progress))
  25824. let radius_ = radius * progress + currentRadius * (1 - progress)
  25825. control.camera.position.copy(
  25826. control.target.clone().add(dir.clone().multiplyScalar(radius_))
  25827. )
  25828. }.bind(this),
  25829. o.dur || 600,
  25830. null /* cancelFuc */,
  25831. 0,
  25832. A[f.transition.movementEasing],
  25833. 'outsideFocus',
  25834. window._tranOutsideFocus,
  25835. null /* cancelFuc */
  25836. )
  25837. } else if (this.mode == 'panorama') {
  25838. this.flyToPano({
  25839. lookAtPoint: o.aim.clone(),
  25840. pano: this.currentPano,
  25841. aimDuration: o.dur || 600
  25842. })
  25843. }
  25844. }
  25845. /*
  25846. 切换到某个模式后再执行函数
  25847. */
  25848. n.prototype.FlyToMode = function (mode, f1, duration) {
  25849. var f2
  25850. if (this.mode == mode) {
  25851. f1 && f1()
  25852. } else {
  25853. f2 = f1
  25854. if (this.mode == 'transitioning' && this.modeTran.split('-')[1] != mode) {
  25855. //正飞向其他模式,就要先飞完再飞进来然后执行
  25856. this.afterCModeFuc = function () {
  25857. /* objects.gui.modeChange[mode](null, {
  25858. fuc: f2 这个写法会使得先添加的回调fuc取代之后添加的afterCModeFuc,所以统一改为afterCModeFuc
  25859. }); */
  25860. this.afterCModeFuc = f2
  25861. this.flyToNewMode({
  25862. mode: mode,
  25863. pano: mode == 'panorama' && this.currentPano
  25864. //callback : f2
  25865. })
  25866. //这个fuc在trainsitioning状态下传入是无效的,所以后面得用afterCModeFuc。但是执行完afterCModeFuc,afterCModeFuc会变为null,所以里面得用fuc。。orz
  25867. }.bind(this)
  25868. } else {
  25869. if (this.afterCModeFuc)
  25870. console.log('已经有afterCModeFuc了!!!!!!!!!!!!!!!')
  25871. this.afterCModeFuc = f2 //飞入后执行
  25872. try {
  25873. //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  25874. this.flyToNewMode({
  25875. mode: mode,
  25876. pano: mode == 'panorama' && this.currentPano,
  25877. duration: duration
  25878. })
  25879. } catch (e) {
  25880. console.log('FlyToMode遇到问题?')
  25881. }
  25882. }
  25883. }
  25884. }
  25885. ;(n.prototype.fastForwardActivePanoFlight = function (e) {
  25886. e = e || (f.transition.fastForwardFactor / 10) * 4 + 1
  25887. y.adjustSpeed(V.FlyToPano, e)
  25888. y.adjustSpeed(V.LookTransition, e)
  25889. }),
  25890. (n.prototype.flyToPanoClosestToMouse = function () {
  25891. if (
  25892. (Date.now() - this.mouseLastMoveTime > 50 &&
  25893. ((this.intersect = this.getMouseIntersect()),
  25894. this.intersect && this.updateClosestPano(this.intersect)),
  25895. this.closestPano)
  25896. )
  25897. return this.flyToPano({
  25898. pano: this.closestPano
  25899. })
  25900. var e = this.getMouseDirection()
  25901. this.flyDirection(e) ||
  25902. this.flyToPano({
  25903. pano: this.currentPano
  25904. })
  25905. }),
  25906. (n.prototype.flyLocalDirection = function (e) {
  25907. var t = this.getDirection(e),
  25908. i = 1 === e.z ? 0.4 : 0.75,
  25909. n = 1 === Math.abs(e.x)
  25910. return this.flyDirection(t, i, n)
  25911. }),
  25912. (n.prototype.flyDirection = function (e, t, i) {
  25913. Hot.closePopup() //xzw add
  25914. var n = $.Deferred()
  25915. this.history.invalidate()
  25916. var r = this.closestPanoInDirection(e, t, i)
  25917. return (
  25918. r
  25919. ? this.flyToPano(
  25920. {
  25921. pano: r
  25922. },
  25923. n.resolve.bind(n, !0)
  25924. )
  25925. : (this.bump(e), n.resolve(!1)),
  25926. n.promise()
  25927. )
  25928. }),
  25929. (n.prototype.closestPanoInDirection = function (e, t, i) {
  25930. return this.rankedPanoInDirection(0, e, t, i)
  25931. }),
  25932. (n.prototype.rankedPanoInDirection = (function () {
  25933. var e = {
  25934. pano: null,
  25935. candidates: []
  25936. }
  25937. return function (t, i, n, r) {
  25938. t || (t = 0), (n = void 0 !== n ? n : 0.75)
  25939. var o = r ? 'angle' : 'direction'
  25940. return (
  25941. this.model.panos.findRankedByScore(
  25942. t,
  25943. [
  25944. s.filters.isPanoAligned(),
  25945. s.filters.not(this.currentPano),
  25946. s.filters.isNeighbourPanoTo(this.currentPano),
  25947. s.filters.inPanoDirection(this.position, i, n)
  25948. ],
  25949. [
  25950. s.scoreFunctions.distanceSquared(this.currentPano),
  25951. s.scoreFunctions[o](this.position, i)
  25952. ],
  25953. e
  25954. ),
  25955. (this.cachedPanoCandidates = e.candidates),
  25956. e.pano
  25957. )
  25958. }
  25959. })()),
  25960. (n.prototype.bump = function (e) {
  25961. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  25962. var t,
  25963. i,
  25964. n,
  25965. r = f.transition,
  25966. o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8,
  25967. a = this.camera.getWorldDirection().dot(e),
  25968. s = Math.abs(a) > 0.5
  25969. if (s)
  25970. (t = function () {
  25971. y.start(
  25972. v.property(
  25973. this.cameraControls.cameras[u.PANORAMA],
  25974. 'zoom',
  25975. a > 0 ? 1.04 : 0.96
  25976. ),
  25977. o,
  25978. i,
  25979. 0,
  25980. A.easeInOutSine,
  25981. 'bumpZStart'
  25982. )
  25983. }.bind(this)),
  25984. (i = function () {
  25985. y.start(
  25986. v.property(this.cameraControls.cameras[u.PANORAMA], 'zoom', 1),
  25987. 5 * o,
  25988. n,
  25989. 0,
  25990. A.easeInOutSine,
  25991. 'bumpZRelax'
  25992. )
  25993. }.bind(this))
  25994. else {
  25995. var l = this.camera.position.clone(),
  25996. c = e.clone()
  25997. this.raycaster.set(l, c)
  25998. var h = this.model.floors.reduce(function (e, t) {
  25999. return e.concat(t.collider.children)
  26000. }, []),
  26001. d = this.raycaster.intersectObjects(h),
  26002. p = d.length > 0 ? d[0].distance / 25 : 0.04,
  26003. g = l.clone().add(c.multiplyScalar(p))
  26004. ;(t = function () {
  26005. y.start(
  26006. v.vector(this.cameraControls.cameras[u.PANORAMA].position, g),
  26007. o,
  26008. i,
  26009. 0,
  26010. A.easeInOutSine,
  26011. 'bumpTStart'
  26012. )
  26013. }.bind(this)),
  26014. (i = function () {
  26015. y.start(
  26016. v.vector(this.cameraControls.cameras[u.PANORAMA].position, l),
  26017. 5 * o,
  26018. n,
  26019. 0,
  26020. A.easeInOutSine,
  26021. 'bumpTRelax'
  26022. )
  26023. }.bind(this))
  26024. }
  26025. ;(n = function () {
  26026. this.flying = !1
  26027. }.bind(this)),
  26028. (this.flying = !0),
  26029. t()
  26030. }
  26031. }),
  26032. (n.prototype.changeFloor = function (e) {
  26033. if (!this.is360View(this.mode, this.currentPano))
  26034. if (this.mode === u.PANORAMA) {
  26035. var t = this.history.reversePano(e)
  26036. t && t.isAligned()
  26037. ? this.flyToPano({
  26038. pano: t
  26039. })
  26040. : this.changeFloorByScore(e)
  26041. } else this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  26042. }),
  26043. (n.prototype.changeFloorByScore = (function () {
  26044. var e = {
  26045. pano: null,
  26046. candidates: []
  26047. }
  26048. return function (t) {
  26049. var i = this.model.nextFloor(t)
  26050. return i
  26051. ? (this.model.panos.lowestByScore(
  26052. [s.filters.atFloor(i), s.filters.isPanoAligned()],
  26053. [
  26054. s.scoreFunctions.distance(this.currentPano),
  26055. s.scoreFunctions.direction(this.position, new r.Vector3(0, t, 0)),
  26056. s.scoreFunctions.penalizeHeightDifferenceUnder(this.position, 0.5)
  26057. ],
  26058. e
  26059. ),
  26060. void (e.pano
  26061. ? ((this.cachedPanoCandidates = e.candidates),
  26062. this.history.push(t, this.currentPano),
  26063. this.flyToPano({
  26064. pano: e.pano
  26065. }))
  26066. : F.warn('No pano found on selected floor, not moving there.')))
  26067. : void F.debug('player.changeFloor(' + t + '): no such floor')
  26068. }
  26069. })()),
  26070. (n.prototype.gotoFloor = function (e) {
  26071. var t = e - this.model.currentFloor.floorIndex
  26072. this.changeFloor(t)
  26073. }),
  26074. (n.prototype.getDirection = function (e) {
  26075. return (
  26076. (e = e ? e : new r.Vector3().copy(d.FORWARD)),
  26077. e.applyQuaternion(this.camera.quaternion)
  26078. )
  26079. }),
  26080. (n.prototype.flyToSameMode = function (e, t, i, n, o) {
  26081. if (((o = o || $.Deferred()), this.mode === u.TRANSITIONING))
  26082. return F.warn('should not be transitioning here'), n && n(!1), o.reject().promise()
  26083. var a = i || !1,
  26084. s = i ? i.position : this.position,
  26085. l = this.position.clone(),
  26086. c = this.currentPano
  26087. if (
  26088. (F.debug('New pose in mode ' + this.mode),
  26089. !e ||
  26090. ((retryCallback = function () {
  26091. N.delayOneFrame(
  26092. function () {
  26093. this.flyToSameMode(e, t, i, n, o)
  26094. }.bind(this)
  26095. )
  26096. }.bind(this)),
  26097. !this.checkAndWaitForPanoLoad(
  26098. e,
  26099. 'high',
  26100. 'low',
  26101. this.basePanoSize,
  26102. retryCallback
  26103. )))
  26104. ) {
  26105. var h = function () {
  26106. this.emit(w.FlyingEnded, s, l, e, c), n && n(!0)
  26107. }.bind(this),
  26108. d = f[this.mode],
  26109. p = void 0 !== t ? t : d.transitionTime,
  26110. g = new r.Vector3(),
  26111. C = new r.Vector3()
  26112. if ((this.emit(w.FlyingStarted, s, l, e, c), this.mode === u.PANORAMA))
  26113. F.warn('we should not be here for panorama views')
  26114. else if (this.mode === u.DOLLHOUSE)
  26115. if (a) {
  26116. var I = new r.Vector3(0, 1, 0)
  26117. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  26118. this.model.warpDestFloors(i.floorVisibility),
  26119. C.copy(i.position)
  26120. var E = new r.Vector3(0, 0, -1).applyQuaternion(i.quaternion),
  26121. b = new r.Raycaster(C.clone(), E.clone(), 0, 1 / 0),
  26122. _ = b.intersectObjects(this.model.colliders),
  26123. T = 3
  26124. _.length
  26125. ? (g.copy(_[0].point), (T = 0.75 * C.distanceTo(g)))
  26126. : (g.copy(E).multiplyScalar(3).add(C),
  26127. F.debug(
  26128. 'Tried to restore dollhouse mode that did not intersect...',
  26129. i.position,
  26130. i.quaternion
  26131. ))
  26132. var x = new r.Matrix4().lookAt(C, g, I),
  26133. S = new r.Euler().setFromRotationMatrix(x, f.warp.eOrder),
  26134. M = g.distanceTo(C),
  26135. R = new r.Matrix4().lookAt(
  26136. this.cameraControls.cameras[u.DOLLHOUSE].position,
  26137. this.cameraControls.controls[u.DOLLHOUSE].target,
  26138. I
  26139. ),
  26140. P = new r.Euler().setFromRotationMatrix(R, f.warp.eOrder),
  26141. O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(
  26142. this.cameraControls.controls[u.DOLLHOUSE].target
  26143. )
  26144. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0)
  26145. var L = new r.Euler(S.x - P.x, S.y - P.y, S.z - P.z, f.warp.eOrder)
  26146. ;(L.y =
  26147. L.y > Math.PI
  26148. ? (L.y -= 2 * Math.PI)
  26149. : L.y < -Math.PI
  26150. ? (L.y += 2 * Math.PI)
  26151. : L.y),
  26152. (this.path.burnsDir = Math.sign(L.y))
  26153. var D = new r.Euler(0, 0, 0, f.warp.eOrder),
  26154. B = new r.Vector3()
  26155. y.start(
  26156. v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g),
  26157. p,
  26158. null,
  26159. f.flydown.movementDelay,
  26160. A[f.flydown.movementEasing],
  26161. null,
  26162. V.FlyToSameMode
  26163. ),
  26164. y.start(
  26165. function (e, t) {
  26166. ;(D.x = P.x + e * L.x), (D.y = P.y + e * L.y), (D.z = P.z + e * L.z)
  26167. var i = O + e * (M - O)
  26168. B.set(0, 0, i)
  26169. .applyEuler(D)
  26170. .add(this.cameraControls.controls[u.DOLLHOUSE].target),
  26171. this.cameraControls.cameras[u.DOLLHOUSE].position
  26172. .copy(B)
  26173. .add(this.model.position)
  26174. }.bind(this),
  26175. p,
  26176. null,
  26177. f.flydown.movementDelay,
  26178. A[f.flydown.movementEasing],
  26179. null,
  26180. V.FlyToSameMode
  26181. ),
  26182. y.start(
  26183. function (e, t) {
  26184. this.cameraControls.controls[u.DOLLHOUSE].update(),
  26185. this.quaternion.copy(
  26186. this.cameraControls.cameras[u.DOLLHOUSE].quaternion
  26187. ),
  26188. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  26189. }.bind(this),
  26190. p,
  26191. null,
  26192. f.flydown.movementDelay,
  26193. A[f.flydown.movementEasing],
  26194. null,
  26195. V.FlyToSameMode
  26196. )
  26197. } else F.warn('invalid warp destination in flyToSameMode()? ignore it then')
  26198. else if ((this.path.placeCpm(), this.path.fadeInCpm(f.path.fadeInTime), i)) {
  26199. this.model.warpDestFloors(i.floorVisibility)
  26200. var U = this.cameraControls.cameras[u.FLOORPLAN],
  26201. k = this.cameraControls.controls[u.FLOORPLAN],
  26202. H = k.target.clone(),
  26203. G = i.position.clone().sub(H),
  26204. z = U.position.clone().sub(k.target),
  26205. W = z.length(),
  26206. j = new r.Vector3(-1, 0, 0).applyQuaternion(i.quaternion).normalize(),
  26207. Y = Math.atan2(k.offset.x, k.offset.z),
  26208. X = Math.atan2(j.x, j.z),
  26209. Z = k.absoluteScale,
  26210. q = m.convertWorkshopOrthoZoom(i.orthoZoom)
  26211. y.start(
  26212. function (e, t) {
  26213. k.target.copy(G).multiplyScalar(e).add(H)
  26214. var i = Y + (X - Y) * e
  26215. ;(k.offset.x = W * Math.sin(i)),
  26216. (k.offset.z = W * Math.cos(i)),
  26217. U.position.copy(k.target).add(k.offset),
  26218. (k.absoluteScale = Z + e * (q - Z)),
  26219. k.update(),
  26220. this.quaternion.copy(U.quaternion),
  26221. this.position.copy(U.position),
  26222. this.target.copy(k.target),
  26223. this.camera.projectionMatrix.copy(U.projectionMatrix)
  26224. }.bind(this),
  26225. p,
  26226. null,
  26227. 0,
  26228. A[f.flydown.movementEasing],
  26229. null,
  26230. V.FlyToSameMode
  26231. )
  26232. } else F.info('flyToSameMode() funny floorplan view? skipping')
  26233. return (
  26234. y.setTimeout(
  26235. function (e) {
  26236. ;(this.mode = e), h(), o.resolve(!0)
  26237. }.bind(this, this.mode),
  26238. p,
  26239. V.FlyToSameMode
  26240. ),
  26241. (this.mode = u.TRANSITIONING),
  26242. o.promise()
  26243. )
  26244. }
  26245. }),
  26246. (n.prototype.flyToNewMode = function (e, t) {
  26247. Hot.closePopup() //xzw add
  26248. e = e || {}
  26249. var i = e.mode,
  26250. n = e.pano,
  26251. o = e.duration,
  26252. a = e.warpDest,
  26253. s = e.callback,
  26254. l = e.force,
  26255. c = e.quaternion
  26256. if (((t = t || $.Deferred()), this.isWarping()))
  26257. return (
  26258. F.warn('Player.flyToNewMode() -> Cannot fly when warping'),
  26259. s && s(!1),
  26260. t.reject('Cannot change mode during tour transition').promise()
  26261. )
  26262. if (this.mode === u.TRANSITIONING)
  26263. return s && s(!1), t.reject('Cannot change mode during mode transition').promise()
  26264. if (i === this.mode)
  26265. return l
  26266. ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  26267. t.promise())
  26268. : (s && s(!1), t.reject('Already in ' + i + ' mode').promise())
  26269. var h = a || !1
  26270. F.debug('Switching mode to ' + i)
  26271. if (window.vrEnabled && i != 'panorama') {
  26272. return s && s(!1), t.reject('vr不允许飞出').promise()
  26273. }
  26274. var d = function () {
  26275. N.delayOneFrame(
  26276. function () {
  26277. this.flyToNewMode(e, t)
  26278. }.bind(this)
  26279. )
  26280. }.bind(this)
  26281. if (n && this.checkAndWaitForPanoLoad(n, 'low', 'low', this.basePanoSize, d))
  26282. return t.promise()
  26283. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  26284. return (
  26285. F.info('Waiting for model textures to be loaded before going out to dollhouse'),
  26286. this.model.waitForLoad(
  26287. this.model,
  26288. function () {
  26289. return this.model.meshTexturesLoaded
  26290. }.bind(this)
  26291. ),
  26292. this.model.loadMeshTextures().done(d),
  26293. t.promise()
  26294. )
  26295. this.history.invalidate(), this.updateLastView()
  26296. var p = this.mode,
  26297. C = this.cameraControls.cameras[i]
  26298. e = g.deepExtend({}, f[i], f[p + '-' + i])
  26299. var I = void 0 !== o ? o : e.transitionTime
  26300. this.emit(w.ModeChanging, p, i, n, I),
  26301. n && (this.currentPano = n),
  26302. this.switchCameraMode(i, c),
  26303. y.cancelById(V.LookTransition)
  26304. //before fly---------------------
  26305. this.modeTran = p + '-' + i //add
  26306. if (this.mode == 'panorama') {
  26307. if (this.model.floorLogos) {
  26308. this.model.floorLogos[0].visible = false
  26309. this.model.floorLogos[1].visible = false
  26310. }
  26311. }
  26312. if (i == 'panorama') {
  26313. this.transitionPos({ type: 'beforeFlyIn', pano: n, dur: I }) //add
  26314. } else {
  26315. this.transitionPos({ type: 'beforeFlyOut', dur: I / 2 }) //add
  26316. }
  26317. window.bus.dispatchEvent({ type: 'playerAndModelReady' })
  26318. this.ready = true
  26319. //------------------------------------
  26320. var beginTran = () => {
  26321. var _ = new r.Vector3().copy(this.position)
  26322. if (i === u.PANORAMA) {
  26323. this.emit(w.PanoChosen, n, n),
  26324. setTimeout(
  26325. function () {
  26326. n.floor.enter(i)
  26327. }.bind(this),
  26328. I / 2
  26329. ),
  26330. this.path.fadeOutCpm(f.path.fadeOutTime)
  26331. if (this.model.floorLogos) {
  26332. this.model.floorLogos[0].position.copy(
  26333. n.floorPosition.clone().sub(this.model.position)
  26334. ) //改
  26335. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position) //for floorIcon position
  26336. }
  26337. } else if (i === u.DOLLHOUSE) {
  26338. if (
  26339. (h && (this.model.stayPut = !0),
  26340. a
  26341. ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  26342. this.model.warpDestFloors(a.floorVisibility))
  26343. : this.model.toggleAllFloors(!0),
  26344. this.path.placeCpm(),
  26345. this.path.fadeInCpm(f.path.fadeInTime),
  26346. h)
  26347. ) {
  26348. var T = new r.Vector3(this.model.center.x, 0, this.model.center.z)
  26349. _.set(15, 10, 15)
  26350. var M = new r.Vector3(0, 0, -1).applyQuaternion(a.quaternion),
  26351. R = new r.Raycaster(a.position.clone(), M.clone(), 0, 1 / 0),
  26352. P = R.intersectObjects([this.sceneIntersectionPlane])
  26353. P.length
  26354. ? (T.copy(P[0].point),
  26355. _.copy(a.position),
  26356. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(
  26357. 0.75 * _.distanceTo(T),
  26358. !0
  26359. ))
  26360. : (F.warn(
  26361. 'Tried to restore dollhouse mode that did not intersect...',
  26362. a.position,
  26363. a.quaternion
  26364. ),
  26365. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  26366. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  26367. _.add(this.model.position),
  26368. C.position.copy(_),
  26369. this.cameraControls.controls[u.DOLLHOUSE].update()
  26370. }
  26371. } else if ((this.path.placeCpm(), this.path.fadeInCpm(f.path.fadeInTime), a)) {
  26372. this.model.warpDestFloors(a.floorVisibility)
  26373. var O = this.cameraControls.cameras[u.FLOORPLAN],
  26374. L = this.cameraControls.controls[u.FLOORPLAN],
  26375. D = O.position.clone().sub(L.target),
  26376. B = new r.Vector3(-1, 0, 0).applyQuaternion(a.quaternion).normalize(),
  26377. U = Math.atan2(B.x, B.z)
  26378. L.target.copy(a.position)
  26379. var k = D.length()
  26380. ;(L.offset.x = k * Math.sin(U)),
  26381. (L.offset.y = 0),
  26382. (L.offset.z = k * Math.cos(U)),
  26383. O.position.copy(L.target).add(L.offset)
  26384. L.target.clone().sub(C.position)
  26385. C.quaternion.copy(a.quaternion),
  26386. (L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom)),
  26387. (L.absoluteScale = L.currentScale),
  26388. L.update()
  26389. } else this.model.currentFloor.enter(i)
  26390. var H = this.currentPano,
  26391. G = this.position.clone()
  26392. this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  26393. (this.flying = !0),
  26394. this.isOutsideMode(i) && this.is360View(p, H)
  26395. ? (h ||
  26396. i !== u.DOLLHOUSE ||
  26397. (C.position.set(15, 10, 15),
  26398. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  26399. C.controls.update()),
  26400. (e.blackoutStyle = S.FADEIN),
  26401. (I = f.show360Views.transitionTime),
  26402. this.fade360View(I, C, e))
  26403. : this.isOutsideMode(p) && this.is360View(i, n)
  26404. ? (h && this.switchCameraMode(i, h.quaternion),
  26405. (this.mode = i),
  26406. this.path && this.path.popOutCpm(),
  26407. (e.blackoutStyle = S.END),
  26408. (I = f.show360Views.transitionTime),
  26409. this.fade360View(I, C, e))
  26410. : (y.start(
  26411. v.property(this.model, 'alpha', e.modelAlpha, null),
  26412. I * e.modelAlphaLength,
  26413. null,
  26414. e.modelAlphaDelay,
  26415. null,
  26416. V.FlyToNewMode
  26417. ),
  26418. y.start(
  26419. v.vector(this.position, C.position),
  26420. I,
  26421. null,
  26422. f.flydown.movementDelay,
  26423. A[f.flydown.movementEasing],
  26424. null,
  26425. V.FlyToNewMode
  26426. ),
  26427. y.start(
  26428. v.quaternion(this.quaternion, C.quaternion),
  26429. I * e.rotationDuration,
  26430. null,
  26431. e.rotationDelay,
  26432. A[f.flydown.rotationEasing],
  26433. null,
  26434. V.FlyToNewMode
  26435. ),
  26436. y.start(
  26437. v.matrix4(this.camera.projectionMatrix, C.projectionMatrix),
  26438. I * e.cameraMatrixDuration,
  26439. null,
  26440. e.cameraMatrixDelay,
  26441. e.cameraMatrixEase,
  26442. null,
  26443. V.FlyToNewMode
  26444. ),
  26445. y.start(
  26446. v.uniform(this.model.skybox, 'opacity', e.skyboxOpacity),
  26447. I * e.skyboxOpacityLength,
  26448. null,
  26449. e.skyboxOpacityDelay,
  26450. null,
  26451. V.FlyToNewMode
  26452. ),
  26453. y.start(
  26454. v.property(this.reticule.material.uniforms.opacity, 'value', 0),
  26455. I,
  26456. null,
  26457. V.FlyToNewMode
  26458. )),
  26459. y.setTimeout(
  26460. function () {
  26461. ;(this.flying = !1),
  26462. p === u.PANORAMA && i !== u.PANORAMA
  26463. ? this.currentPano.exit()
  26464. : p !== u.PANORAMA &&
  26465. i === u.PANORAMA &&
  26466. (this.currentPano !== H && H.exit(),
  26467. this.currentPano.enter(),
  26468. this.path.placeCpm(),
  26469. this.path.fadeOutCpm(f.path.fadeOutTime),
  26470. this.spider.draw()),
  26471. p === u.DOLLHOUSE &&
  26472. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  26473. (this.mode = i),
  26474. this.emit(w.FlyingEnded, _, G, this.currentPano, H)
  26475. //add:
  26476. this.updateMarkerVisi()
  26477. //(this.mode == u.PANORAMA) && this.updateHotVisible(),
  26478. this.mode == u.PANORAMA &&
  26479. this.model.floorLogos &&
  26480. (this.model.changefloorLogoOpa({ index: 0, from: 0, opa: 1, dur: 150 }), //this.model.floorLogoShow(0,150);
  26481. (this.model.floorLogos[0].visible = true))
  26482. if (this.afterCModeFuc) {
  26483. //手动加的函数
  26484. var cf = this.afterCModeFuc
  26485. this.afterCModeFuc = null //因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  26486. cf()
  26487. }
  26488. if (this.mode == u.PANORAMA) {
  26489. Hot.updateVisibles([this.currentPano])
  26490. this.model.fadePanoMarkers()
  26491. } else {
  26492. Hot.updateVisibles(true)
  26493. this.model.hotGroup.children.forEach(overlay => {
  26494. if (overlay.animateInfo) {
  26495. GifTexDeal.start(overlay.animation)
  26496. }
  26497. })
  26498. }
  26499. h && p !== u.PANORAMA && i === u.PANORAMA
  26500. ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s)
  26501. : (s && s(), t.resolve())
  26502. }.bind(this),
  26503. I,
  26504. V.FlyToNewMode
  26505. )
  26506. }
  26507. if (
  26508. i == 'panorama' &&
  26509. !this.model.supportsTiles &&
  26510. n.getSkyboxTexture().image[0].width > 1024
  26511. ) {
  26512. setTimeout(() => {
  26513. beginTran()
  26514. }, 16) //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  26515. } else {
  26516. beginTran()
  26517. }
  26518. this.mode = u.TRANSITIONING
  26519. //p == "panorama" && this.updateHotVisible(),
  26520. return t.promise()
  26521. }),
  26522. (n.prototype.fade360View = function (e, t, i) {
  26523. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  26524. $(this.domElement).fadeOut(
  26525. 0.5 * e,
  26526. function () {
  26527. ;(this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity),
  26528. (this.model.alpha = i.modelAlpha),
  26529. this.position.copy(t.position),
  26530. this.quaternion.copy(t.quaternion),
  26531. this.camera.projectionMatrix.copy(t.projectionMatrix),
  26532. $(this.domElement).fadeIn(0.5 * e)
  26533. }.bind(this)
  26534. )
  26535. }),
  26536. (n.prototype.findDefaultViews = function () {
  26537. this.findDefaultView(this.lastInsideView, !0),
  26538. this.findDefaultView(this.last360View, !1)
  26539. }),
  26540. (n.prototype.findDefaultView = function (e, t) {
  26541. var i,
  26542. n = this.model.heroLocations,
  26543. r = this.model.panos,
  26544. o = n.findIndex(function (e) {
  26545. if (e.cameraMode !== u.PANORAMA) return !1
  26546. var i = r.get(e.panoId)
  26547. return i && i.isAligned() === t
  26548. })
  26549. o >= 0
  26550. ? ((i = r.get(n[o].panoId)),
  26551. e.update({
  26552. cameraMode: u.PANORAMA,
  26553. pano: i,
  26554. position: n[o].position,
  26555. quaternion: n[o].quaternion
  26556. }))
  26557. : ((o = r.list.findIndex(function (e) {
  26558. return e.isAligned() === t
  26559. })),
  26560. o >= 0
  26561. ? ((i = r.list[o]),
  26562. e.update({
  26563. cameraMode: u.PANORAMA,
  26564. pano: i,
  26565. position: i.position
  26566. }))
  26567. : F.warn('There are no', t ? 'inside' : '360º', 'views in this model'))
  26568. }),
  26569. (n.prototype.updateLastView = function () {
  26570. if (this.mode === u.PANORAMA) {
  26571. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View
  26572. e.update({
  26573. pano: this.currentPano,
  26574. position: this.position,
  26575. quaternion: this.quaternion
  26576. })
  26577. }
  26578. }),
  26579. (n.prototype.goToLastView = function (e, t) {
  26580. var i = $.Deferred(),
  26581. n = i.resolve.bind(i),
  26582. r = i.reject.bind(i),
  26583. o = e ? this.lastInsideView : this.last360View
  26584. return (
  26585. this.isInMode(u.PANORAMA) &&
  26586. this.currentPano.isAligned() !== e &&
  26587. this.updateLastView(),
  26588. this.isInMode(u.PANORAMA)
  26589. ? (this.path && this.path.popOutCpm(),
  26590. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r))
  26591. : this.isOutsideMode() &&
  26592. this.flyToNewMode({
  26593. mode: o.cameraMode,
  26594. pano: o.pano,
  26595. quaternion: o.quaternion,
  26596. callback: t
  26597. })
  26598. .done(n)
  26599. .fail(r),
  26600. i.promise()
  26601. )
  26602. }),
  26603. (n.prototype.fadeToView = function (e, t, i, n) {
  26604. var r = $.Deferred(),
  26605. o = r.resolve.bind(r),
  26606. a = r.reject.bind(r)
  26607. if (!t.isValid() || (t.cameraMode === u.PANORAMA && !t.pano))
  26608. return (
  26609. F.warn('Tried to fade to an illegal view', t.cameraMode),
  26610. a('Cannot go to illegal view'),
  26611. r.promise()
  26612. )
  26613. var s =
  26614. (f[t.cameraMode],
  26615. function () {
  26616. $(this.domElement).fadeIn(0.5 * i), n && n(), o()
  26617. }.bind(this)),
  26618. l = e ? S.FADEIN : S.END
  26619. return (
  26620. this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  26621. $(this.domElement).fadeOut(
  26622. 0.5 * i,
  26623. function () {
  26624. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  26625. t.cameraMode === u.PANORAMA
  26626. ? this.flyToPano(
  26627. {
  26628. pano: t.pano,
  26629. lookAtPoint: d.FORWARD.clone()
  26630. .applyQuaternion(t.quaternion)
  26631. .add(t.pano.position),
  26632. duration: 0
  26633. },
  26634. s
  26635. )
  26636. : this.flyToNewMode({
  26637. mode: t.cameraMode,
  26638. quaternion: t.quaternion,
  26639. duration: 0,
  26640. callback: s
  26641. })
  26642. }.bind(this)
  26643. ),
  26644. r.promise()
  26645. )
  26646. }),
  26647. (n.prototype.startWarp = function (e, t, i, n, r, o) {
  26648. if (
  26649. (this.cameraControls.activeControl &&
  26650. (this.cameraControls.activeControl.enabled = !1),
  26651. this.flying)
  26652. )
  26653. return F.warn('Player.startWarp() -> Cannot warp when flying'), o && o(), !1
  26654. ;(null !== e && void 0 !== e) || (e = b.Show), this.history.invalidate()
  26655. e !== b.Retain
  26656. ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK)
  26657. : (i = this.path.upcomingTransType)
  26658. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned()
  26659. return (
  26660. this.emit(w.WarpStarted, a, i, n, r),
  26661. (n = n || S.MIDDLE),
  26662. this.path.warpToPano(
  26663. i,
  26664. n,
  26665. r,
  26666. function () {
  26667. t === E.Slow
  26668. ? this.path.discardSlow()
  26669. : t === E.Standard && this.path.discardPathObject(),
  26670. this.emit(w.WarpEnded, i),
  26671. this.cameraControls.activeControl &&
  26672. (this.cameraControls.activeControl.enabled = !0),
  26673. o && o()
  26674. }.bind(this)
  26675. ),
  26676. e === b.Hide && this.path.discardPathObject(),
  26677. !0
  26678. )
  26679. }),
  26680. (n.prototype.warpToPanoById = function (e, t, i, n, r, o, a, s) {
  26681. return this.path.setWarpDestinationByPanoId(e, t)
  26682. ? this.startWarp(i, n, r, o, a, s)
  26683. : (F.warn('Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()'),
  26684. s && s(),
  26685. !1)
  26686. }),
  26687. (n.prototype.warpToPanoByHeroIndex = function (e, t, i, n, r, o, a) {
  26688. return this.path.setWarpDestinationByHeroIndex(e)
  26689. ? this.startWarp(t, i, n, r, o, a)
  26690. : (F.warn(
  26691. 'Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()'
  26692. ),
  26693. a && a(),
  26694. !1)
  26695. }),
  26696. (n.prototype.warpToPano = function (e, t, i, n, r, o, a, s) {
  26697. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  26698. }),
  26699. (n.prototype.warpToNonPanoByHeroIndex = function (e, t) {
  26700. return this.path.setWarpDestinationByHeroIndex(e)
  26701. ? (this.path.warpToNonPano(t), !0)
  26702. : (F.warn(
  26703. 'Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()'
  26704. ),
  26705. t && t(),
  26706. !1)
  26707. }),
  26708. (n.prototype.aimTourCamera = function (e, t, i, n) {
  26709. return (
  26710. F.debug('player.aimTourCamera(' + e + ') calling warpToPanoByHeroIndex(' + e + ')'),
  26711. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  26712. )
  26713. }),
  26714. (n.prototype.showPathToHeroLocation = function (e) {
  26715. this.path.setWarpDestinationByHeroIndex(e) &&
  26716. this.path.brushToWarpPano(x.STD, x.BLACK)
  26717. }),
  26718. (n.prototype.tourInterlude = function (e, t) {
  26719. this.history.invalidate()
  26720. this.path.discardSlow()
  26721. //xzw:
  26722. var defaultRotTime = DATA.tourRotTime * 1000
  26723. var timeEachItem = (2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed)) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
  26724. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)
  26725. var currentLocation0 = this.model.heroLocations[this.director.currentItem[0]]
  26726. //zeg 标注一下
  26727. //var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  26728. var rotTime
  26729. if (currentLocation.rotTime == void 0 || currentLocation.rotTime == '') {
  26730. var restChildCount = currentLocation0.heroLocations
  26731. ? currentLocation0.heroLocations.length - this.director.currentItem[1] - 1
  26732. : 0
  26733. var hasMusic = currentLocation0 && currentLocation0.musicInfo.music
  26734. if (hasMusic) {
  26735. var audioObj = SoundManager.list.find(e => e.name == 'tour')
  26736. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  26737. rotTime = currentLocation0.musicInfo.time - current
  26738. if (restChildCount) {
  26739. //如果当前folder中还有剩下的item,平分一下时间
  26740. rotTime = (rotTime - timeEachItem * restChildCount) / (restChildCount + 1)
  26741. }
  26742. } else {
  26743. rotTime = defaultRotTime
  26744. }
  26745. rotTime = Math.max(0, rotTime)
  26746. Log(
  26747. 'rotTime ' +
  26748. rotTime +
  26749. ' at item ' +
  26750. this.director.currentItem +
  26751. (hasMusic
  26752. ? ',musicCurrentTime:' +
  26753. current +
  26754. '音乐总长:' +
  26755. currentLocation0.musicInfo.time
  26756. : ''),
  26757. '#E8E'
  26758. )
  26759. } else {
  26760. rotTime = currentLocation.rotTime * 1000
  26761. Log('rotTime ' + rotTime + ' at item ' + this.director.currentItem, '#E8E')
  26762. }
  26763. this.path.waitNextStep(
  26764. e,
  26765. function () {
  26766. t && t()
  26767. }.bind(this),
  26768. rotTime
  26769. )
  26770. }),
  26771. (n.prototype.stopInterlude = function () {
  26772. this.interruptAndFastForward(null, 0)
  26773. }),
  26774. (n.prototype.interruptAndFastForward = function (e, t) {
  26775. //Log('interruptAndFastForward' , '#f00')
  26776. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  26777. this.flying && this.emit(w.FlyingInterrupted),
  26778. this.path.interruptAndFastForward(e, t)
  26779. }),
  26780. (n.prototype.setSize = function (e, t) {
  26781. var i = e / t
  26782. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t)
  26783. var n = B.getHFOVFromVFOV(f.insideFOV, e, t)
  26784. n > f.insideFOVMax
  26785. ? (this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t))
  26786. : (this.baseFov = f.insideFOV)
  26787. for (var r in this.cameraControls.cameras) {
  26788. var o = this.cameraControls.cameras[r]
  26789. ;(o.fov = this.baseFov * (1 / this.zoomLevel)), o.updateAspect(i)
  26790. }
  26791. }),
  26792. (n.prototype.toJSON = function () {
  26793. var e = {}
  26794. return this.cameraControls.activeControl
  26795. ? ((e = this.cameraControls.activeControl.toJSON()),
  26796. (e.camera_mode = u.toInt(this.mode)),
  26797. this.isOutsideMode()
  26798. ? this.model.allFloorsVisible
  26799. ? (e.floor_visibility = [])
  26800. : (e.floor_visibility = this.model.floors.list.map(function (e) {
  26801. return e.hidden ? 0 : 1
  26802. }))
  26803. : u.PANORAMA && (e.scan_id = this.currentPano.id),
  26804. e)
  26805. : e
  26806. }),
  26807. (n.prototype.getCurrentNodePanos = function (e) {
  26808. this.model.panos.map
  26809. if (((e.length = 0), this.path.nodes)) {
  26810. var momentTour = this.director.getMomentTour(this.director.destinationItem)
  26811. if (momentTour == 'black') {
  26812. //改 upcomingPanos如果是black的只需要起点和终点
  26813. if (this.path.nodes.length) {
  26814. e.push(this.model.panos.get(this.path.nodes[0]))
  26815. }
  26816. if (this.path.nodes.length > 1) {
  26817. e.push(this.model.panos.get(this.path.nodes[this.path.nodes.length - 1]))
  26818. }
  26819. } else {
  26820. for (var t = 0; t < this.path.nodes.length; t++) {
  26821. var i = this.path.nodes[t]
  26822. e.push(this.model.panos.get(i))
  26823. }
  26824. }
  26825. }
  26826. }),
  26827. (n.prototype.zoomIncrementally = function (e) {
  26828. var t = this.zoomLevel
  26829. this.zoomTo(this.zoomLevel + e),
  26830. t !== this.zoomLevel &&
  26831. this.currentPano &&
  26832. this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  26833. }),
  26834. (n.prototype.zoomInIncrementally = function (e) {
  26835. ;(e = e || this.defaultZoomIncrement), this.zoomIncrementally(e)
  26836. }),
  26837. (n.prototype.zoomOutIncrementally = function (e) {
  26838. ;(e = e || -this.defaultZoomIncrement), this.zoomIncrementally(e)
  26839. }),
  26840. (n.prototype.zoomBy = function (e) {
  26841. this.zoomTo(this.zoomLevel * e)
  26842. }),
  26843. (n.prototype.zoomIn = function () {
  26844. this.zoomBy(1 + this.zoomSpeed)
  26845. }),
  26846. (n.prototype.zoomOut = function () {
  26847. this.zoomBy(1 - this.zoomSpeed)
  26848. }),
  26849. (n.prototype.zoomTo = function (e, t) {
  26850. if (t || (f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled)) {
  26851. if (
  26852. (e < f.zoom.min && (e = f.zoom.min),
  26853. e > f.zoom.max && (e = f.zoom.max),
  26854. e > this.zoomLevel
  26855. ? (this.emit(O.ZoomIn), e === f.zoom.max && this.emit(O.ZoomMax))
  26856. : e < this.zoomLevel &&
  26857. (this.emit(O.ZoomOut), e === f.zoom.min && this.emit(O.ZoomMin)),
  26858. this.cameraControls.activeControl)
  26859. ) {
  26860. var i = this.cameraControls.activeControl.camera
  26861. ;(this.zoomLevel = e),
  26862. (i.fov = this.baseFov * (1 / this.zoomLevel)),
  26863. i.updateProjectionMatrix(),
  26864. (this.zoomFov = i.fov)
  26865. }
  26866. }
  26867. }),
  26868. (n.prototype.increaseZoomSpeed = function () {
  26869. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  26870. }),
  26871. (n.prototype.decreaseZoomSpeed = function () {
  26872. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  26873. }),
  26874. (n.prototype.clampZoomSpeed = function (e) {
  26875. return e < 0 ? 0 : e
  26876. }),
  26877. (n.prototype.activatePersistentZooming = function (e) {
  26878. this.zooming = e ? 1 : -1
  26879. }),
  26880. (n.prototype.deactivatePersistentZooming = function () {
  26881. this.zooming = 0
  26882. }),
  26883. (n.prototype.zoomDefault = function () {
  26884. this.zoomTo(1, !0)
  26885. }),
  26886. (window.fovTranId = 333) //add
  26887. n.prototype.smoothZoomToDefault = function (e, t) {
  26888. y.cancelById(window.fovTranId)
  26889. var i,
  26890. n = this.zoomLevel,
  26891. r = function (e) {
  26892. e > 1 && (e = 1), (i = n * (1 - e) + e), this.zoomTo(i, !0)
  26893. }.bind(this),
  26894. o = function () {
  26895. this.zoomDefault(), t && window.setTimeout(t, 50)
  26896. }.bind(this)
  26897. y.start(r, e, o, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  26898. }
  26899. n.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {
  26900. //add
  26901. y.cancelById(window.fovTranId)
  26902. console.log('smoothZoomFovTo ' + zoomLevel)
  26903. var i,
  26904. n = this.zoomLevel,
  26905. aimLevel = zoomLevel || this.baseFov / fov
  26906. if (n == aimLevel) return
  26907. var fun = function (e) {
  26908. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0)
  26909. }.bind(this)
  26910. y.start(
  26911. fun,
  26912. dur,
  26913. callback,
  26914. null,
  26915. 0,
  26916. A[f.transition.blendEasing],
  26917. null,
  26918. window.fovTranId
  26919. )
  26920. }
  26921. n.prototype.updateZoomPano = function () {
  26922. if (
  26923. !this.panoRenderer.zoomPanoRenderingDisabled &&
  26924. this.mode === u.PANORAMA &&
  26925. this.currentPano
  26926. ) {
  26927. let navTileClass = this.qualityManager.getNavZoomClass()
  26928. let tileClass = this.qualityManager.getMaxZoomClass()
  26929. if (navTileClass == '4k') {
  26930. var r = true
  26931. } else {
  26932. var levelThreshold1 = navTileClass == '1k' ? 1.1 : 1.5,
  26933. levelThreshold2 = 1.8 //levelThreshold2不能比zoom.max大也就是不能超过2,否则zoom.max将无法提升到3
  26934. var t = this.zoomLevel > levelThreshold1,
  26935. i = this.flying && this.nextPano && this.nextPano !== this.currentPano,
  26936. n = !i && !this.isWarping(),
  26937. r = t //&& n ; // 允许flying状态下加载4K图
  26938. }
  26939. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  26940. this.panoRenderer.setZoomingActive(r, this.currentPano, !0)
  26941. var o = function (pano, ifZoom) {
  26942. this.panoRenderer.resetRenderStatus(
  26943. pano.id,
  26944. !1,
  26945. !0,
  26946. this.qualityManager.getMaxNavPanoSize()
  26947. ),
  26948. this.panoRenderer.clearAllQueuedUploadsForPano(pano.id),
  26949. this.panoRenderer.renderPanoTiles(pano.id, null, !1, !1),
  26950. pano.setZoomed(ifZoom)
  26951. }.bind(this)
  26952. if (navTileClass == '4k') {
  26953. if (!this.currentPano.zoomed) {
  26954. o(this.currentPano, !0)
  26955. this.panoRenderer.enableUltraHighQualityMode(
  26956. function () {
  26957. //开启4k getMaxZoomPanoSize
  26958. this.qualityManager.useUltraHighResolutionPanos &&
  26959. (f.zoom.max = D.ultraHighQualityMaxZoom)
  26960. o(this.currentPano, !0)
  26961. }.bind(this)
  26962. )
  26963. }
  26964. } else {
  26965. let zoomLevelRes = this.qualityManager.zoomLevelResolution
  26966. if (r && (!this.currentPano.zoomed || (zoomLevelRes && zoomLevelRes != '4k'))) {
  26967. //needZoom
  26968. this.currentPano.zoomed || o(this.currentPano, !0)
  26969. if (
  26970. navTileClass == '1k' &&
  26971. tileClass != '1k' &&
  26972. this.zoomLevel < levelThreshold2
  26973. ) {
  26974. this.panoRenderer.enableHighQuality(
  26975. function () {
  26976. //开启2k
  26977. if (tileClass != '4k') {
  26978. o(this.currentPano, !0)
  26979. }
  26980. }.bind(this)
  26981. )
  26982. } else {
  26983. this.panoRenderer.enableUltraHighQualityMode(
  26984. function () {
  26985. //开启4k getMaxZoomPanoSize
  26986. this.qualityManager.useUltraHighResolutionPanos &&
  26987. !f.zoom.overridemax &&
  26988. (f.zoom.max = D.ultraHighQualityMaxZoom)
  26989. o(this.currentPano, !0)
  26990. }.bind(this)
  26991. )
  26992. }
  26993. } else {
  26994. !t && this.currentPano.zoomed && o(this.currentPano, !1)
  26995. }
  26996. //有三个级别的话,需要标记zoomLevelResolution,以便更新maxZoomPanoSize判断能下载的最高级别
  26997. if (r && navTileClass == '1k' && tileClass == '4k') {
  26998. //目前只有手机端navTileClass == '1k'
  26999. var change = zoomedFlag => {
  27000. this.qualityManager.updateMaximums() //更新maxZoomPanoSize
  27001. this.panoRenderer.setupZoomRenderTarget() //更新renderTarget
  27002. //this.currentPano.setZoomed(t);//更新uniforms贴图
  27003. if (this.qualityManager.zoomLevelResolution == '4k') {
  27004. this.model.showHighMap()
  27005. } else {
  27006. this.model.hideHighMap()
  27007. }
  27008. }
  27009. this.qualityManager.zoomLevelResolution =
  27010. this.zoomLevel >= levelThreshold2
  27011. ? '4k'
  27012. : this.zoomLevel > levelThreshold1
  27013. ? '2k'
  27014. : '1k'
  27015. if (this.oldZoomLevel < levelThreshold2 && this.zoomLevel >= levelThreshold2) {
  27016. //1k/2k-4k
  27017. change()
  27018. o(this.currentPano, t)
  27019. } else if (
  27020. this.oldZoomLevel <= levelThreshold1 &&
  27021. this.zoomLevel > levelThreshold1
  27022. ) {
  27023. //1k-2k
  27024. change()
  27025. } else if (
  27026. this.oldZoomLevel > levelThreshold2 &&
  27027. this.zoomLevel <= levelThreshold2
  27028. ) {
  27029. //4k-2k/1k
  27030. change()
  27031. o(this.currentPano, t)
  27032. } else if (
  27033. this.oldZoomLevel > levelThreshold1 &&
  27034. this.zoomLevel <= levelThreshold1
  27035. ) {
  27036. //2k-1k
  27037. change()
  27038. }
  27039. this.oldZoomLevel = this.zoomLevel
  27040. }
  27041. }
  27042. }
  27043. }
  27044. ;(n.prototype.checkHasNeighbor = function (pano) {
  27045. //add
  27046. for (var i in pano.neighbourPanos) {
  27047. if (i == pano.id) continue
  27048. if (pano.neighbourPanos[i]) {
  27049. return true
  27050. }
  27051. }
  27052. }),
  27053. (t.exports = n)
  27054. }).call(this, '/js/player.js')
  27055. },
  27056. {
  27057. './constants': 8,
  27058. './enum/AlignmentType': 17,
  27059. './enum/BlackoutStyle': 18,
  27060. './enum/ControlEvents': 21,
  27061. './enum/Keys': 30,
  27062. './enum/ModelManagerEvents': 33,
  27063. './enum/PanoSizeClass': 36,
  27064. './enum/PanoramaEvents': 37,
  27065. './enum/PathDiscardMode': 38,
  27066. './enum/PathDisplayMode': 39,
  27067. './enum/PlayerEvents': 40,
  27068. './enum/TagStates': 44,
  27069. './enum/Vectors': 50,
  27070. './enum/Viewmode': 51,
  27071. './enum/WarpStyle': 52,
  27072. './enum/ZoomEvents': 53,
  27073. './exception/BasicException': 55,
  27074. './model/ModelManager': 140,
  27075. './objects/NSpider': 147,
  27076. './objects/Panorama': 148,
  27077. './objects/Reticule': 149,
  27078. './objects/ShowPath': 151,
  27079. './objects/Snapshot': 153,
  27080. './objects/View': 154,
  27081. './settings': 166,
  27082. './shaders': 167,
  27083. './tile/TileDownloader': 171,
  27084. './tile/TilePrioritizer': 172,
  27085. './util/ZoomStats': 179,
  27086. './util/browser': 182,
  27087. './util/camera': 183,
  27088. './util/cameraLight': 184,
  27089. './util/common': 185,
  27090. './util/easing': 186,
  27091. './util/history': 187,
  27092. './util/lerp': 188,
  27093. './util/logger': 189,
  27094. './util/math': 190,
  27095. './util/transitions': 195,
  27096. hot: 'hot',
  27097. scaleImg: 'scaleImg',
  27098. events: 202,
  27099. three: 217
  27100. }
  27101. ],
  27102. scaleImg: [
  27103. function (t, e) {
  27104. // xzw
  27105. var OUTPUT = e
  27106. ;(function () {
  27107. function t(t, a, i, r) {
  27108. function h() {
  27109. ;(B = 'object' == typeof i ? i : a.src || r ? u : document.createElement('canvas')),
  27110. (B.width = s),
  27111. (B.height = f),
  27112. (G = B.getContext('2d'))
  27113. }
  27114. function n(t) {
  27115. if (t) {
  27116. var e,
  27117. a = G.getImageData(0, 0, s, f),
  27118. i = a.data
  27119. for (e = 0; at > e; e += 4)
  27120. (i[e] = (t[e] * it) | 0),
  27121. (i[e + 1] = (t[e + 1] * it) | 0),
  27122. (i[e + 2] = (t[e + 2] * it) | 0),
  27123. (i[e + 3] = (t[e + 3] * it) | 0)
  27124. return delete t, a
  27125. }
  27126. return G.getImageData(0, 0, s, f)
  27127. }
  27128. function o(t, e, a, i, r) {
  27129. return (
  27130. 0.5 * (i - e + (2 * e - 5 * a + 4 * i - r + (3 * (a - i) + r - e) * t) * t) * t + a
  27131. )
  27132. }
  27133. a || ((a = t.input), (i = t.output), (r = t.inputRemovable), t.scale && (t = t.scale))
  27134. var u, d
  27135. if (a.src)
  27136. if (((u = document.createElement('canvas')), null != a.naturalWidth))
  27137. (u.width = a.naturalWidth), (u.height = a.naturalHeight)
  27138. else if (null != a.runtimeStyle) {
  27139. var l = a.runtimeStyle,
  27140. c = l.width,
  27141. g = l.height
  27142. ;(l.width = 'auto'),
  27143. (l.height = 'auto'),
  27144. (u.width = a.width),
  27145. (u.height = a.height),
  27146. (l.width = c),
  27147. (l.height = g)
  27148. } else {
  27149. var c = a.width,
  27150. g = a.height
  27151. a.removeAttribute && (a.removeAttribute('width'), a.removeAttribute('height')),
  27152. (u.width = a.width),
  27153. (u.height = a.height),
  27154. (a.width = c),
  27155. (a.height = g)
  27156. }
  27157. else u = a
  27158. ;(d = u.getContext('2d')), a.src && d.drawImage(a, 0, 0)
  27159. var s,
  27160. f,
  27161. m = u.width,
  27162. w = u.height,
  27163. p = d.getImageData(0, 0, m, w).data
  27164. if (!m || !w) return !1
  27165. ;(a.src || r) && u.clearRect(0, 0, m, w),
  27166. 'object' == typeof t
  27167. ? t.width
  27168. ? ((s = (t.width + 0.5) | 0), (f = (t.height + 0.5) | 0))
  27169. : ((s = (m * t.scaleX + 0.5) | 0), (f = (w * t.scaleY + 0.5) | 0))
  27170. : ((s = (t * m + 0.5) | 0), (f = (t * w + 0.5) | 0))
  27171. var v,
  27172. b,
  27173. y,
  27174. x,
  27175. D,
  27176. I,
  27177. A,
  27178. j,
  27179. R,
  27180. k,
  27181. C,
  27182. E,
  27183. F,
  27184. L,
  27185. S,
  27186. U,
  27187. W,
  27188. H,
  27189. alpha,
  27190. X,
  27191. Y,
  27192. q,
  27193. z,
  27194. B,
  27195. G,
  27196. J,
  27197. K,
  27198. M,
  27199. N,
  27200. O,
  27201. P,
  27202. Q,
  27203. T,
  27204. V,
  27205. Z,
  27206. $ = s << 2,
  27207. _ = m << 2,
  27208. tt = 0,
  27209. et = 0,
  27210. at = $ * f,
  27211. it = 255.99 / 255,
  27212. rt = s / m,
  27213. ht = f / w,
  27214. nt = rt * ht
  27215. if (rt > 1 || ht > 1)
  27216. for (h(), J = n(), K = J.data, x = 0; f > x; x++)
  27217. for (
  27218. b = x / ht,
  27219. R = 0 | b,
  27220. q = b - R,
  27221. N = R * _,
  27222. M = 1 > R ? N : N - _,
  27223. w - 2 > R ? ((O = N + _), (P = (R + 2) * _)) : (O = P = R > w - 2 ? N : N + _),
  27224. y = 0;
  27225. s > y;
  27226. y++, et += 4
  27227. )
  27228. (v = y / rt),
  27229. (j = 0 | v),
  27230. (z = v - j),
  27231. (T = j << 2),
  27232. (Q = 1 > j ? T : T - 4),
  27233. m - 2 > j ? ((V = T + 4), (Z = T + 8)) : (V = Z = j > m - 2 ? T : T + 4),
  27234. (H =
  27235. (o(
  27236. q,
  27237. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  27238. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  27239. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  27240. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  27241. ) *
  27242. it) |
  27243. 0),
  27244. ++Q,
  27245. ++T,
  27246. ++V,
  27247. ++Z,
  27248. (X =
  27249. (o(
  27250. q,
  27251. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  27252. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  27253. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  27254. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  27255. ) *
  27256. it) |
  27257. 0),
  27258. ++Q,
  27259. ++T,
  27260. ++V,
  27261. ++Z,
  27262. (Y =
  27263. (o(
  27264. q,
  27265. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  27266. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  27267. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  27268. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  27269. ) *
  27270. it) |
  27271. 0),
  27272. ++Q,
  27273. ++T,
  27274. ++V,
  27275. ++Z,
  27276. (alpha =
  27277. (o(
  27278. q,
  27279. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  27280. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  27281. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  27282. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  27283. ) *
  27284. it) |
  27285. 0),
  27286. (K[et] = H >= 0 ? (256 > H ? H : 255) : 0),
  27287. (K[et + 1] = X >= 0 ? (256 > X ? X : 255) : 0),
  27288. (K[et + 2] = Y >= 0 ? (256 > Y ? Y : 255) : 0),
  27289. (K[et + 3] = alpha >= 0 ? (256 > alpha ? alpha : 255) : 0)
  27290. else {
  27291. if (e.Float32Array) W = new Float32Array(at)
  27292. else for (W = [], et = 0; at > et; ++et) W[et] = 0
  27293. for (b = 0; w > b; b++)
  27294. for (
  27295. x = b * ht,
  27296. A = 0 | x,
  27297. D = A * $,
  27298. U = !!((A - ((x + ht) | 0)) * (w - 1 - b)) << 1,
  27299. U && ((F = A + 1 - x), (L = x + ht - A - 1)),
  27300. v = 0;
  27301. m > v;
  27302. v++, tt += 4
  27303. )
  27304. switch (
  27305. ((y = v * rt),
  27306. (I = 0 | y),
  27307. (et = D + (I << 2)),
  27308. (S = !!((I - ((y + rt) | 0)) * (m - 1 - v))),
  27309. S && ((C = I + 1 - y), (E = y + rt - I - 1)),
  27310. (H = p[tt]),
  27311. (X = p[tt + 1]),
  27312. (Y = p[tt + 2]),
  27313. (alpha = p[tt + 3]),
  27314. S + U)
  27315. ) {
  27316. case 0:
  27317. ;(W[et] += H * nt),
  27318. (W[et + 1] += X * nt),
  27319. (W[et + 2] += Y * nt),
  27320. (W[et + 3] += alpha * nt)
  27321. break
  27322. case 1:
  27323. ;(k = C * ht),
  27324. (W[et] += H * k),
  27325. (W[et + 1] += X * k),
  27326. (W[et + 2] += Y * k),
  27327. (W[et + 3] += alpha * k),
  27328. (k = E * ht),
  27329. (W[et + 4] += H * k),
  27330. (W[et + 5] += X * k),
  27331. (W[et + 6] += Y * k),
  27332. (W[et + 7] += alpha * k)
  27333. break
  27334. case 2:
  27335. ;(k = rt * F),
  27336. (W[et] += H * k),
  27337. (W[et + 1] += X * k),
  27338. (W[et + 2] += Y * k),
  27339. (W[et + 3] += alpha * k),
  27340. (k = rt * L),
  27341. (et += $),
  27342. (W[et] += H * k),
  27343. (W[et + 1] += X * k),
  27344. (W[et + 2] += Y * k),
  27345. (W[et + 3] += alpha * k)
  27346. break
  27347. default:
  27348. ;(k = C * F),
  27349. (W[et] += H * k),
  27350. (W[et + 1] += X * k),
  27351. (W[et + 2] += Y * k),
  27352. (W[et + 3] += alpha * k),
  27353. (k = E * F),
  27354. (W[et + 4] += H * k),
  27355. (W[et + 5] += X * k),
  27356. (W[et + 6] += Y * k),
  27357. (W[et + 7] += alpha * k),
  27358. (k = C * L),
  27359. (et += $),
  27360. (W[et] += H * k),
  27361. (W[et + 1] += X * k),
  27362. (W[et + 2] += Y * k),
  27363. (W[et + 3] += alpha * k),
  27364. (k = E * L),
  27365. (W[et + 4] += H * k),
  27366. (W[et + 5] += X * k),
  27367. (W[et + 6] += Y * k),
  27368. (W[et + 7] += alpha * k)
  27369. }
  27370. delete p, h(), (J = n(W))
  27371. }
  27372. if ((G.putImageData(J, 0, 0), 'string' == typeof i)) {
  27373. if ('png' === i || 'jpeg' === i) {
  27374. var ot
  27375. return (
  27376. (ot = r && a.src ? a : new Image()),
  27377. (ot.width = s),
  27378. (ot.height = f),
  27379. (ot.src = B.toDataURL('image/' + i, 0.85)),
  27380. ot
  27381. )
  27382. }
  27383. if ('png-src' === i || 'jpeg-src' === i)
  27384. return B.toDataURL('image/' + i.split('-')[0], 0.85)
  27385. }
  27386. return B
  27387. }
  27388. var e = this
  27389. 'undefined' != typeof exports
  27390. ? ('undefined' != typeof module && module.exports && (exports = module.exports = t),
  27391. (exports.scale = t))
  27392. : (c = t)
  27393. }).call(this)
  27394. OUTPUT.exports = c
  27395. },
  27396. {}
  27397. ],
  27398. 156: [
  27399. function (e, t, i) {
  27400. ;(function (i) {
  27401. 'use strict'
  27402. function n(e, t) {
  27403. ;(this.model = e),
  27404. (this.panos = e.panos),
  27405. (this.player = t),
  27406. (this.imagePanos = this.listImagePanos()),
  27407. (this.retryMinimumTime = 1e4)
  27408. }
  27409. var r = (e('three'), e('./enum/Viewmode')),
  27410. o = (e('./settings'), e('./objects/Panorama')),
  27411. a = e('./util/logger'),
  27412. s = new a(i)
  27413. ;(n.prototype.start = function () {
  27414. this.loadNextPano(
  27415. function (e) {
  27416. e
  27417. ? this.start()
  27418. : (s.debug(
  27419. 'No suitable pano loaded, waiting a little while before looking again'
  27420. ),
  27421. setTimeout(
  27422. function () {
  27423. this.start()
  27424. }.bind(this),
  27425. 1e3
  27426. ))
  27427. }.bind(this)
  27428. )
  27429. }),
  27430. (n.prototype.validLoadTarget = function (e) {
  27431. return (
  27432. e && !e.isLoaded('high') && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  27433. )
  27434. }),
  27435. (n.prototype.listImagePanos = function () {
  27436. var e = [],
  27437. t = this
  27438. return (
  27439. this.model.images.forEach(function (i) {
  27440. if (i.metadata && i.metadata.scan_id) {
  27441. var n = t.model.panos.get(i.metadata.scan_id)
  27442. n && !n.isLoaded('high') && e.push(n)
  27443. }
  27444. }),
  27445. e
  27446. )
  27447. }),
  27448. (n.prototype.nextNotLoadedImage = function () {
  27449. for (; this.imagePanos.length > 0; ) {
  27450. var e = this.imagePanos[0]
  27451. if (!e.isLoaded('high')) return e
  27452. this.imagePanos.shift()
  27453. }
  27454. return null
  27455. }),
  27456. (n.prototype.loadNextPano = function (e) {
  27457. var t,
  27458. i,
  27459. n = this.model.waitQueue.filter(function (e) {
  27460. return e.object instanceof o
  27461. })
  27462. n.length > 0
  27463. ? ((t = n[0].object),
  27464. s.debug('Overrode pano selection: Flying to an unloaded pano ' + t.id))
  27465. : this.validLoadTarget(this.player.currentPano)
  27466. ? ((t = this.player.currentPano),
  27467. s.debug('Overrode pano selection: Currently at an unloaded pano ' + t.id))
  27468. : this.validLoadTarget(this.player.closestPano)
  27469. ? ((t = this.player.closestPano),
  27470. s.debug('Overrode pano selection: Hovering over an unloaded pano ' + t.id))
  27471. : this.validLoadTarget(this.nextNotLoadedImage())
  27472. ? ((i = 'high'),
  27473. (t = this.imagePanos[0]),
  27474. s.debug('Overrode pano selection: Highlight image ' + t.id))
  27475. : this.player.mode === r.PANORAMA &&
  27476. ((t = this.panos.lowestByScore(
  27477. [
  27478. this.validLoadTarget.bind(this),
  27479. o.filters.isNeighbourPanoTo(this.player.currentPano)
  27480. ],
  27481. [
  27482. o.scoreFunctions.distance(this.player.currentPano),
  27483. o.scoreFunctions.direction(this.player.position, this.player.getDirection()),
  27484. o.scoreFunctions.inFieldOfView(
  27485. this.player.position,
  27486. this.player.getDirection()
  27487. )
  27488. ]
  27489. )),
  27490. t && s.debug('Normal pano selection: neighbor ' + t.id)),
  27491. t
  27492. ? ((i = i || t.isLoaded('low') ? 'high' : 'low'),
  27493. s.debug('Preloading ' + i + '-res pano ' + t.id),
  27494. t
  27495. .loadCube(i)
  27496. .done(e)
  27497. .fail(function () {
  27498. s.warn(
  27499. 'Failed preloading pano',
  27500. t.id,
  27501. ', marking it as failed and forgetting it for a while'
  27502. ),
  27503. e()
  27504. }))
  27505. : e && e(null)
  27506. }),
  27507. (t.exports = n)
  27508. }).call(this, '/js/preloaders.js')
  27509. },
  27510. {
  27511. './enum/Viewmode': 51,
  27512. './objects/Panorama': 148,
  27513. './settings': 166,
  27514. './util/logger': 189,
  27515. three: 217
  27516. }
  27517. ],
  27518. 157: [
  27519. function (e, t, i) {
  27520. ;(function (i) {
  27521. 'use strict'
  27522. function n(e, t, i, n, r) {
  27523. ;(this.qualityManager = e),
  27524. (this.scene = t),
  27525. (this.camera = i),
  27526. (this.container = r),
  27527. (this.controls = n),
  27528. (this.controls.enabled = !0),
  27529. (this.controls.locked = !0),
  27530. (this.quickstartCamera = n.camera),
  27531. (this.quickstartCamera.fov = h.clampVFOV(
  27532. a.insideFOV,
  27533. a.insideFOVMax,
  27534. $('#player').width(),
  27535. $('#player').height()
  27536. )),
  27537. (this.skybox = null)
  27538. }
  27539. var r = e('three'),
  27540. o = e('../util/logger'),
  27541. a = e('../constants'),
  27542. s =
  27543. (e('../util/transitions'),
  27544. e('../util/lerp'),
  27545. e('../util/easing'),
  27546. e('../enum/Vectors')),
  27547. l = e('../enum/PanoSizeClass'),
  27548. c = (e('../materials/ModelTextureMaterial'), e('../materials/CubemapMaterial')),
  27549. h =
  27550. (e('../cameras/PanoramaCamera'),
  27551. e('../controls/PanoramaControls'),
  27552. e('../tile/TileUtils'),
  27553. e('../util/camera'),
  27554. e('../util/cameraLight')),
  27555. u = (e('../util/browser'), e('../settings'), e('../gui/helpManager'), new o(i))
  27556. ;(n.prototype.load = function (e) {
  27557. e.pano.shouldRedrawOnBaseLoaded = !0
  27558. var t,
  27559. i,
  27560. n = this,
  27561. r = s.FORWARD.clone().applyQuaternion(e.quaternion),
  27562. o = r.clone().negate()
  27563. this.controls.lookAt(r.add(this.quickstartCamera.position))
  27564. var a = this.qualityManager.getPanoSize(l.BASE),
  27565. c = this.qualityManager.getPanoSize(l.STANDARD)
  27566. if (e.pano.tiled) {
  27567. u.warn('Loading startPano, TILED', e.pano.id)
  27568. var d = h.getHFOVForCamera(
  27569. this.quickstartCamera,
  27570. $('#player').width(),
  27571. $('#player').height()
  27572. ),
  27573. p = this.quickstartCamera.fov
  27574. u.warn(
  27575. 'Quickstart loading tiles in frustum: [horizontal FOV: ' +
  27576. d +
  27577. ', vertical FOV: ' +
  27578. p +
  27579. ']'
  27580. ),
  27581. (t = e.pano.loadTiledPano(
  27582. c,
  27583. r,
  27584. {
  27585. hFov: d,
  27586. vFov: p
  27587. },
  27588. !1,
  27589. !1,
  27590. !0
  27591. )),
  27592. (i = e.pano.loadTiledPano(a, o, null, !1, !1, !0))
  27593. } else u.warn('Loading startPano', e.pano.id), (t = e.pano.loadCube('high'))
  27594. return $.when(t).then(
  27595. function () {
  27596. n.init(e.pano, e.quaternion),
  27597. e.pano.tiled
  27598. ? i.done(
  27599. function () {
  27600. ;(e.pano.lockUntilRenderingComplete = !1), (this.controls.locked = !1)
  27601. }.bind(this)
  27602. )
  27603. : (this.controls.locked = !1)
  27604. }.bind(this)
  27605. )
  27606. }),
  27607. (n.prototype.init = function (e, t) {
  27608. u.info('Quickstart done loading, adding scene objects'),
  27609. (e.lockUntilRenderingComplete = !0),
  27610. (this.skybox = new r.Mesh(
  27611. new r.CubeGeometry(1, 1, 1),
  27612. new c({
  27613. side: r.BackSide
  27614. })
  27615. )),
  27616. (this.skybox.material.uniforms.map.value = e.getSkyboxTexture()),
  27617. this.skybox.quaternion.copy(e.quaternion),
  27618. this.scene.add(this.skybox),
  27619. $(this.container).show()
  27620. }),
  27621. (n.prototype.update = function (e) {
  27622. this.controls.update(e), this.camera.copy(this.quickstartCamera)
  27623. }),
  27624. (n.prototype.setSize = function (e, t) {
  27625. this.quickstartCamera.updateAspect(e / t)
  27626. }),
  27627. (n.prototype.destroy = function () {
  27628. this.scene.remove(this.skybox)
  27629. }),
  27630. (t.exports = n)
  27631. }).call(this, '/js/scene/QuickstartManager.js')
  27632. },
  27633. {
  27634. '../cameras/PanoramaCamera': 7,
  27635. '../constants': 8,
  27636. '../controls/PanoramaControls': 13,
  27637. '../enum/PanoSizeClass': 36,
  27638. '../enum/Vectors': 50,
  27639. '../gui/helpManager': 68,
  27640. '../materials/CubemapMaterial': 117,
  27641. '../materials/ModelTextureMaterial': 118,
  27642. '../settings': 166,
  27643. '../tile/TileUtils': 174,
  27644. '../util/browser': 182,
  27645. '../util/camera': 183,
  27646. '../util/cameraLight': 184,
  27647. '../util/easing': 186,
  27648. '../util/lerp': 188,
  27649. '../util/logger': 189,
  27650. '../util/transitions': 195,
  27651. three: 217
  27652. }
  27653. ],
  27654. 158: [
  27655. function (e, t, i) {
  27656. 'use strict'
  27657. function n(e, t, i) {
  27658. ;(this.scene = e),
  27659. (this.camera = t),
  27660. (this.renderer = null),
  27661. (this.effects = i),
  27662. (this.animateCallback = null),
  27663. (this.composer = null),
  27664. (this.qualityManager = null),
  27665. (e.renderWidth = 0),
  27666. (e.renderHeight = 0),
  27667. (this.updateClock = new r.Clock()),
  27668. (this.components = []),
  27669. (this.updateListeners = []),
  27670. (this.resizeListeners = []),
  27671. (this.forceUpdateSize = !1),
  27672. (this.started = !1),
  27673. (this.textures = {}),
  27674. (this.suspendedObjects = [])
  27675. }
  27676. var r = e('three'),
  27677. o = e('../shaders'),
  27678. a = e('../enum/SceneRendererEvents'),
  27679. s = e('../enum/GLTextureType'),
  27680. l = e('../enum/GLCubeFaces'),
  27681. c = e('../exception/BasicException'),
  27682. h = e('../exception/RendererCreationException'),
  27683. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  27684. m = e('../util/browser'),
  27685. /**************************************************************************************************************************************************/
  27686. u = e('../settings'),
  27687. d = e('events').EventEmitter
  27688. ;(window.requestAnimationFrame =
  27689. window.requestAnimationFrame || window.webkitRequestAnimationFrame),
  27690. (n.prototype = Object.create(d.prototype)),
  27691. (n.prototype.addComponent = function (e) {
  27692. this.components.push(e),
  27693. e.update && this.updateListeners.push(e),
  27694. e.setSize && (this.resizeListeners.push(e), (this.forceUpdateSize = !0))
  27695. }),
  27696. (n.prototype.removeComponent = function (e) {
  27697. var t = function (t) {
  27698. return t !== e
  27699. }
  27700. ;(this.components = this.components.filter(t)),
  27701. (this.updateListeners = this.updateListeners.filter(t)),
  27702. (this.resizeListeners = this.resizeListeners.filter(t))
  27703. }),
  27704. (n.prototype.start = function (e) {
  27705. if (this.started) throw new c("Can't start SceneRenderer, already started")
  27706. this.createContext(e),
  27707. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  27708. m.isMobile() && this.boluoVrInit(),
  27709. /*******************************************************************************************************************************/
  27710. this.initComposer(),
  27711. (this.started = !0),
  27712. (p = p.bind(this))()
  27713. }),
  27714. (n.prototype.createContext = function (e) {
  27715. var transparent = !!(settings.transparentBg || settings.bgImg)
  27716. try {
  27717. ;(this.renderer = new r.WebGLRenderer({
  27718. antialias: !m.isMobile(),
  27719. alpha: transparent
  27720. })),
  27721. (this.renderer.autoClear = !0),
  27722. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  27723. this.renderer.setSize($('#player').width(), $('#player').height(), false), //改
  27724. transparent && this.renderer.setClearColor(0x000000, 0) //透明
  27725. this.emit(a.ContextCreated)
  27726. } catch (e) {
  27727. throw new h('Unable to create a WebGL rendering context')
  27728. }
  27729. u.profiling.enabled && this.overrideTextures(), e.appendChild(this.renderer.domElement)
  27730. /* window.stats = new Stats();
  27731. e.appendChild( stats.dom ); */
  27732. }),
  27733. (n.prototype.overrideTextures = function () {
  27734. var e = this.renderer.context,
  27735. t = 0,
  27736. i = e.createTexture
  27737. e.createTexture = function () {
  27738. var n = i.call(e)
  27739. return (n.id = t++), (this.textures[n.id] = n), n
  27740. }.bind(this)
  27741. var n = e.texImage2D
  27742. e.texImage2D = function (t, i, r, o, a, l, c, h, u) {
  27743. var d,
  27744. p = this.getTextureTypeFromTarget(e, t)
  27745. ;(d =
  27746. p === s.TextureCube
  27747. ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP)
  27748. : e.getParameter(e.TEXTURE_BINDING_2D)),
  27749. void 0 !== c
  27750. ? n.call(e, t, i, r, o, a, l, c, h, u)
  27751. : ((c = o),
  27752. (h = a),
  27753. (u = l),
  27754. (o = u.naturalWidth),
  27755. (a = u.naturalHeight),
  27756. n.call(e, t, i, r, c, h, u))
  27757. var f = this.textures[d.id]
  27758. ;(f.width = p === s.TextureCube ? 6 * o : o), (f.height = a)
  27759. }.bind(this)
  27760. var r = e.deleteTexture
  27761. e.deleteTexture = function (t) {
  27762. delete this.textures[t.id], r.call(e, t)
  27763. }.bind(this)
  27764. }),
  27765. (n.prototype.updateTextureMemory = (function () {
  27766. var e = null
  27767. return function () {
  27768. var t = 0
  27769. for (var i in this.textures) {
  27770. var n = this.textures[i]
  27771. n.width && n.height && (t += n.width * n.height * 4)
  27772. }
  27773. t !== e && this.emit(a.MemoryUsageUpdated, t), (e = t)
  27774. }
  27775. })()),
  27776. (n.prototype.getTextureTypeFromTarget = function (e, t) {
  27777. switch (t) {
  27778. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  27779. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  27780. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  27781. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  27782. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  27783. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  27784. return s.TextureCube
  27785. case e.TEXTURE_2D:
  27786. return s.Texture2D
  27787. default:
  27788. return null
  27789. }
  27790. }),
  27791. (n.prototype.initComposer = function () {
  27792. ;(this.composer = new r.EffectComposer(this.renderer)),
  27793. this.composer.addPass(new r.RenderPass(this.scene, this.camera)),
  27794. //this.composer.addPass(this.effects.hblurPass),
  27795. //this.composer.addPass(this.effects.vblurPass)
  27796. this.composer.addPass(this.effects.fastTranMaskPass) //add
  27797. }),
  27798. (n.prototype.setSize = function (e, t, devicePixelRatio) {
  27799. ;(this.renderWidth = e),
  27800. (this.renderHeight = t),
  27801. (this.effects.aspect = e / t),
  27802. /* this.renderer.setSize(e, t), -----MP */
  27803. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  27804. this.composer.setSize(e, t)
  27805. for (var i = 0; i < this.resizeListeners.length; i++)
  27806. this.resizeListeners[i].setSize(e, t)
  27807. }),
  27808. (n.prototype.render = function () {
  27809. //this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  27810. this.effects.fastTranMaskPass.enabled
  27811. ? this.composer.render()
  27812. : this.renderer.render(this.scene, this.camera)
  27813. })
  27814. /******************************************************************************************************徐世廷**********************************************************************/
  27815. var vrPermission = {}
  27816. var vrPermissionCallBack = function (info1, info2) {
  27817. if (info1 == 'reset') {
  27818. vrPermission = {}
  27819. } else {
  27820. vrPermission[info1] = info2
  27821. if (
  27822. Object.keys(vrPermission).length == 2 &&
  27823. (vrPermission.deviceMotion != 'granted' ||
  27824. vrPermission.deviceOrientation != 'granted')
  27825. ) {
  27826. alert(
  27827. '运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。'
  27828. )
  27829. }
  27830. }
  27831. }
  27832. ;(n.prototype.boluoVrInit = function () {
  27833. console.log('boluoVrInit')
  27834. //webxr.init(this.renderer)
  27835. ;(this.isHuawei5X = m.detectHUAWEI5X()),
  27836. (this.oldRenderer = this.renderer),
  27837. (this.newRenderer = new this.vrRenderer(this.renderer, this, this.camera))
  27838. window.panoCamera = this.camera
  27839. var a = this
  27840. ;(window._vrEnabled = !1),
  27841. Object.defineProperty(window, 'vrEnabled', {
  27842. get: function () {
  27843. return window._vrEnabled
  27844. },
  27845. set: function (b) {
  27846. //if(webxr.xrType)return webxr.enterVR()
  27847. b = !!b
  27848. b
  27849. ? ((a.renderer = a.newRenderer),
  27850. window.vrMarkers.forEach(function (a) {
  27851. a.visible = !0
  27852. }))
  27853. : ((a.renderer = a.oldRenderer),
  27854. window.vrMarkers.forEach(function (a) {
  27855. a.visible = !1
  27856. })),
  27857. (a.cursor.visible = b),
  27858. a.setSize(window.innerWidth, window.innerHeight),
  27859. (window._vrEnabled = b)
  27860. $('.cad').css('visibility', b ? 'hidden' : '')
  27861. if (b) {
  27862. setTimeout(function () {
  27863. console.log('orientEnable' + window.orientEnable)
  27864. if (window.vrEnabled && !window.orientEnable) {
  27865. //很可能没能触发陀螺仪事件
  27866. if (m.detectIOS() /* && m.detectSafari() */) {
  27867. var b = m.iosVersion() //{major: 10, minor: 3, patch: 1}
  27868. console.log('开始获取权限 major' + b.major)
  27869. if (b.major == 12 && b.minor >= 2) {
  27870. if (browser.detectSafari())
  27871. alert(
  27872. '浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。'
  27873. )
  27874. else {
  27875. //app??
  27876. alert(
  27877. '浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。'
  27878. )
  27879. }
  27880. } else if (b.major >= 13) {
  27881. if (!window.location.href.includes('https://')) {
  27882. console.log('需要https')
  27883. alert('当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。')
  27884. return
  27885. }
  27886. var hasFailed =
  27887. window.vrPermission &&
  27888. (window.vrPermission.deviceMotion != 'granted' ||
  27889. window.vrPermission.deviceOrientation != 'granted')
  27890. setTimeout(
  27891. () => {
  27892. //如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  27893. if (!window.vrEnabled || window.orientEnable) return
  27894. vrPermissionCallBack('reset')
  27895. console.log(window.DeviceMotionEvent)
  27896. if (
  27897. window.DeviceMotionEvent &&
  27898. window.DeviceMotionEvent.requestPermission &&
  27899. typeof window.DeviceMotionEvent.requestPermission === 'function'
  27900. ) {
  27901. console.log('开始获取权限1')
  27902. ///注意:需要https 本地服务器permissionState会得到denied
  27903. window.DeviceMotionEvent.requestPermission()
  27904. .then(permissionState => {
  27905. console.log('permissionState1: ' + permissionState)
  27906. vrPermissionCallBack('deviceMotion', permissionState)
  27907. })
  27908. .catch(function (e) {
  27909. vrPermissionCallBack('deviceMotion', false)
  27910. console.log(e)
  27911. })
  27912. } else {
  27913. console.log('window.DeviceMotionEvent undefined')
  27914. vrPermissionCallBack('deviceMotion', false)
  27915. }
  27916. if (
  27917. window.DeviceOrientationEvent &&
  27918. window.DeviceOrientationEvent.requestPermission &&
  27919. typeof window.DeviceOrientationEvent.requestPermission ===
  27920. 'function'
  27921. ) {
  27922. console.log('开始获取权限2')
  27923. window.DeviceOrientationEvent.requestPermission()
  27924. .then(permissionState => {
  27925. console.log('permissionState2: ' + permissionState)
  27926. vrPermissionCallBack('deviceOrientation', permissionState)
  27927. })
  27928. .catch(function (e) {
  27929. vrPermissionCallBack('deviceOrientation', false)
  27930. console.log(e)
  27931. })
  27932. } else {
  27933. console.log('window.DeviceOrientationEvent undefined')
  27934. vrPermissionCallBack('deviceOrientation', false)
  27935. }
  27936. },
  27937. hasFailed ? 0 : 150
  27938. )
  27939. /* /* setTimeout(function(){
  27940. if(settings.vrEnabled && !window.orientEnable){
  27941. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  27942. }
  27943. },4000) */
  27944. } else console.log('陀螺仪未能启用 ios ' + b.major + '.' + b.minor)
  27945. } else {
  27946. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  27947. }
  27948. } else {
  27949. //已经触发了
  27950. }
  27951. }, 200)
  27952. }
  27953. }
  27954. }),
  27955. this.createCursor(0.5, !1, 1, 16777215, 0)
  27956. var b = {
  27957. setSize: function (b, c) {
  27958. a.camera.aspect = b / c
  27959. }
  27960. }
  27961. this.resizeListeners.push(b), this.vrLoadingInit()
  27962. }),
  27963. (n.prototype.vrLoadingInit = function () {
  27964. var a = function (camera) {
  27965. var a = this,
  27966. b = new r.RingGeometry(1.3, 1.5, 32, 32, 0, 1.2 * Math.PI),
  27967. c = new r.MeshBasicMaterial({
  27968. color: 4967932,
  27969. side: r.DoubleSide
  27970. }),
  27971. d = new r.Mesh(b, c)
  27972. ;(this.mesh = d),
  27973. (d.position.z = -2),
  27974. d.scale.set(0.08, 0.08, 0.08),
  27975. (d.visible = !1),
  27976. camera.add(d),
  27977. //window.player.camera.add(d),
  27978. (a.enabled = !1),
  27979. (this.update = function (b) {
  27980. 1 == a.enabled && (d.rotation.z += 15 * b)
  27981. })
  27982. },
  27983. a = new a(this.camera)
  27984. ;(window.Loading = a), this.updateListeners.push(a)
  27985. }),
  27986. (n.prototype.createCursor = function (a, b, c, d, e) {
  27987. var g,
  27988. h = new r.SpriteMaterial({
  27989. opacity: c,
  27990. color: d,
  27991. transparent: b,
  27992. map: this.boluoGetTexture('images/cursor.png'),
  27993. needsUpdate: !0,
  27994. side: r.DoubleSide
  27995. })
  27996. ;(h.map.offset = new r.Vector2((1 / 17) * e, 0)),
  27997. (h.map.repeat = new r.Vector2(1 / 17, 1)),
  27998. (h.depthTest = !1),
  27999. (h.blending = r.AdditiveBlending),
  28000. (g = new r.Sprite(h)),
  28001. // g.scale.set(a, a, a),
  28002. g.scale.set(0.3, 0.3, 0.3)
  28003. ;(g.position.z = -2),
  28004. (g.visible = !1),
  28005. (g.name = 'cursor'),
  28006. this.camera.add(g),
  28007. this.scene.add(this.camera),
  28008. (this.cursor = g)
  28009. var i = new this.CursorAnimation(this.scene, g, this.camera)
  28010. ;(this.cursor.triggerTargetEvent = i.triggerTargetEvent), this.updateListeners.push(i)
  28011. }),
  28012. (window.orientEnable = 0) //是否能触发deviceorientation
  28013. ;(n.prototype.CursorAnimation = function (a, b, c) {
  28014. function d() {
  28015. g.orient = r.Math.degToRad(window.orientation || 0)
  28016. }
  28017. function e(a) {
  28018. if (!window.vrEnabled && window.orientEnable) return
  28019. window.orientEnable || (window.orientEnable = 1)
  28020. var b = r.Math.degToRad(a.alpha),
  28021. c = r.Math.degToRad(a.beta),
  28022. d = r.Math.degToRad(a.gamma)
  28023. if (
  28024. (this.isHuawei5X
  28025. ? (-1e3 === g.alpha && (g.alpha = b),
  28026. -1e3 === g.beta && (g.beta = c),
  28027. -1e3 === g.gamma && (g.gamma = d),
  28028. Math.abs(b - g.alpha) > 0.06 && (g.alpha = b),
  28029. Math.abs(c - g.beta) > 0.006 && (g.beta = c),
  28030. Math.abs(d - g.gamma) > 0.006 && (g.gamma = d))
  28031. : ((g.alpha = b), (g.beta = c), (g.gamma = d)),
  28032. n.vrDebug)
  28033. ) {
  28034. $('#info-device-orientation').css('display', 'block')
  28035. var e = ''
  28036. ;(e += 'alpha=(' + g.alpha + ')<BR/>'),
  28037. (e += 'beta=(' + g.beta + ')<BR/>'),
  28038. (e += 'gamma=' + g.gamma + '<BR/>'),
  28039. (document.getElementById('info-device-orientation').innerHTML = e)
  28040. }
  28041. }
  28042. ;(this.cursor = b),
  28043. (this.raycaster = new r.Raycaster()),
  28044. (this.targetEventObj = {}),
  28045. (this.type = 1),
  28046. (this.tweenFlag = !0)
  28047. var g = this
  28048. ;(this.target = c),
  28049. console.log(c.uuid),
  28050. (this.euler = new r.Euler()),
  28051. (this.q0 = new r.Quaternion()),
  28052. (this.q1 = new r.Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5))),
  28053. (this.zee = new r.Vector3(0, 0, 1)),
  28054. (this.alpha = -1e3),
  28055. (this.beta = -1e3),
  28056. (this.gamma = -1e3),
  28057. (this.orient = r.Math.degToRad(window.orientation || 0)),
  28058. window.addEventListener('orientationchange', d),
  28059. window.addEventListener('deviceorientation', e),
  28060. (this.setObjectQuaternion = function (a, b, d, e, f) {
  28061. g.euler.set(d, b, -e, 'YXZ'),
  28062. a.setFromEuler(g.euler),
  28063. a.multiply(g.q1),
  28064. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  28065. c.updateMatrixWorld()
  28066. }),
  28067. parent !== window &&
  28068. window.addEventListener('message', function (a) {
  28069. var b = JSON.parse(a.data),
  28070. c = -1 !== window.navigator.userAgent.indexOf('KIW-TL00H')
  28071. b &&
  28072. b.alpha &&
  28073. b.beta &&
  28074. b.gamma &&
  28075. (function (a) {
  28076. var c = r.Math.degToRad(b.alpha),
  28077. d = r.Math.degToRad(b.beta),
  28078. e = r.Math.degToRad(b.gamma)
  28079. a
  28080. ? (-1e3 === g.alpha && (g.alpha = c),
  28081. -1e3 === g.beta && (g.beta = d),
  28082. -1e3 === g.gamma && (g.gamma = e),
  28083. Math.abs(c - g.alpha) > 0.06 && (g.alpha = c),
  28084. Math.abs(d - g.beta) > 0.006 && (g.beta = d),
  28085. Math.abs(e - g.gamma) > 0.006 && (g.gamma = e))
  28086. : ((g.alpha = c), (g.beta = d), (g.gamma = e))
  28087. })(c)
  28088. }),
  28089. (this.update = function (a) {
  28090. TWEEN.update()
  28091. if (window.vrEnabled) this.triggerTargetEvent() //测试时不根据陀螺仪来转向
  28092. else
  28093. window.vrEnabled &&
  28094. (this.setObjectQuaternion(
  28095. this.target.quaternion,
  28096. this.alpha,
  28097. this.beta,
  28098. this.gamma,
  28099. this.orient
  28100. ),
  28101. this.triggerTargetEvent())
  28102. }),
  28103. (this.triggerTargetEvent = function () {
  28104. var a = this.choseObj(),
  28105. b = a ? a.object : void 0
  28106. ;(this.targetEventObj.currentObj = b),
  28107. b !== this.targetEventObj.lastObj &&
  28108. (b && this.autoCursorPosition(a),
  28109. 1 === this.type
  28110. ? (this.cursorAnimate && this.cursorAnimate.stop(),
  28111. b &&
  28112. b.enabled &&
  28113. this.startAnimate(
  28114. function () {
  28115. this.clickCallback(b)
  28116. }.bind(this)
  28117. ))
  28118. : this.type,
  28119. (this.targetEventObj.lastObj = b))
  28120. }),
  28121. (this.choseObj = function () {
  28122. this.raycaster.setFromCamera(
  28123. {
  28124. x: 0,
  28125. y: 0
  28126. },
  28127. c
  28128. )
  28129. var a = (this.raycaster.ray, window.vrMarkers),
  28130. b = this.raycaster.intersectObjects(a)
  28131. if (b.length > 0) return b[0]
  28132. }),
  28133. (this.clickCallback = function (a) {
  28134. this.runTHREEAction(a, 'onclick')
  28135. }),
  28136. (this.runTHREEAction = function (a, b) {
  28137. switch (b) {
  28138. case 'onclick':
  28139. a._listeners &&
  28140. a._listeners.click &&
  28141. a._listeners.click.forEach(function (a) {
  28142. a()
  28143. })
  28144. break
  28145. case 'onhover':
  28146. a._listeners &&
  28147. a._listeners.hover &&
  28148. a._listeners.hover.forEach(function (a) {
  28149. a()
  28150. })
  28151. break
  28152. case 'onout':
  28153. a._listeners &&
  28154. a._listeners.out &&
  28155. a._listeners.out.forEach(function (a) {
  28156. a()
  28157. })
  28158. }
  28159. }),
  28160. (this.startAnimate = function (a) {
  28161. this.tweenFlag && this.initAnimation(a)
  28162. }),
  28163. (this.initAnimation = function (a) {
  28164. var b = this,
  28165. c = this.cursor.material.map.offset,
  28166. d = function (a) {
  28167. return Math.floor(17 * a) / 17
  28168. }
  28169. ;(b.tweenFlag = !1),
  28170. (this.cursorAnimate = new TWEEN.Tween(c)
  28171. .to(
  28172. {
  28173. x: 1
  28174. },
  28175. 1e3
  28176. )
  28177. .onStart(function () {
  28178. b.tweenFlag = !1
  28179. })
  28180. .onStop(function () {
  28181. ;(b.tweenFlag = !0), (this.x = 0), (c.x = 0)
  28182. })
  28183. .onUpdate(function () {})
  28184. .onComplete(function () {
  28185. a(),
  28186. (c.x = 0),
  28187. setTimeout(function () {
  28188. b.tweenFlag = !0
  28189. }, 1500)
  28190. })),
  28191. this.cursorAnimate.easing(d),
  28192. this.cursorAnimate.start()
  28193. }),
  28194. (this.autoCursorPosition = function (a) {
  28195. // var b = Math.abs(a.distance - 10);
  28196. // this.cursor.position.z = -b,
  28197. // b /= 10;
  28198. // alert(b);
  28199. // this.cursor.scale.set(b, b, b)
  28200. this.cursor.scale.set(0.3, 0.3, 0.3)
  28201. })
  28202. }),
  28203. (n.prototype.vrRenderer = function (a, b, c) {
  28204. var d = new b.vrCamera(c)
  28205. ;(d.bananaAspect = 0.8), this.width, this.height
  28206. var b = this
  28207. ;(this.setSize = function (c, d) {
  28208. a.setSize.call(this, c, d), (b.width = c), (b.height = d)
  28209. }),
  28210. (this.render = function (b, c, e, f) {
  28211. window.cameraQua = c.quaternion.clone()
  28212. var g, h
  28213. if (c.__RESS__SKIP__STEREO__) return a.render(b, c, e, f)
  28214. if ('PerspectiveCamera' === c.type)
  28215. (g = d.cameraL),
  28216. (h = d.cameraR),
  28217. b.updateMatrixWorld(),
  28218. null === c.parent && c.updateMatrixWorld(),
  28219. d.vrCameraUpdate(c)
  28220. else {
  28221. if ('OrthographicCamera' !== c.type)
  28222. return DEBUG && console.error('Unsupported renderer: ', c.type)
  28223. g = h = c
  28224. }
  28225. a.setScissorTest(!0),
  28226. a.setScissor(0, 0, this.width / 2, this.height),
  28227. a.setViewport(0, 0, this.width / 2, this.height),
  28228. a.render.call(this, b, g, e, f),
  28229. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  28230. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  28231. a.render.call(this, b, h, e, f),
  28232. a.setScissorTest(!1)
  28233. }),
  28234. (this.__proto__ = {
  28235. __proto__: a
  28236. })
  28237. }),
  28238. (n.prototype.vrCamera = function (a) {
  28239. ;(this.type = 'StereoCamera'),
  28240. (this._aspect = 1),
  28241. (this._overlap = 0.064),
  28242. (this.cameraL = new r.PerspectiveCamera()),
  28243. this.cameraL.layers.enable(1),
  28244. (this.cameraL.near = 0.01), //xzw add
  28245. (this.cameraL.matrixAutoUpdate = !1),
  28246. (this.cameraR = new r.PerspectiveCamera()),
  28247. this.cameraR.layers.enable(2),
  28248. (this.cameraR.near = 0.01), //xzw add
  28249. (this.cameraR.matrixAutoUpdate = !1),
  28250. (this.eyeRight = new r.Matrix4()),
  28251. (this.eyeLeft = new r.Matrix4()),
  28252. (this.vrCameraNeedsUpdate = !0),
  28253. (window.vrCameraL = this.cameraL) // fyz 记录vr相机
  28254. Object.defineProperty(this, 'bananaAspect', {
  28255. get: function () {
  28256. return this._aspect
  28257. },
  28258. set: function (a) {
  28259. this._aspect !== a && (this.vrCameraNeedsUpdate = !0), (this._aspect = a)
  28260. }
  28261. }),
  28262. Object.defineProperty(this, 'overlap', {
  28263. get: function () {
  28264. return this._overlap
  28265. },
  28266. set: function (a) {
  28267. this._overlap !== a && (this.vrCameraNeedsUpdate = !0), (this._overlap = a)
  28268. }
  28269. }),
  28270. (this.vrCameraUpdate = function (a) {
  28271. this.vrCameraNeedsUpdate = true
  28272. if (
  28273. ((this.vrCameraNeedsUpdate =
  28274. this.vrCameraNeedsUpdate ||
  28275. this.bananaFov !== a.fov ||
  28276. this.bananaReal_aspect !== a.aspect * this.bananaAspect ||
  28277. this.bananaNear !== a.near ||
  28278. this.bananaFar !== a.far),
  28279. this.vrCameraNeedsUpdate)
  28280. ) {
  28281. ;(this.vrCameraNeedsUpdate = !1),
  28282. //console.debug("vrCameraUpdate"),
  28283. (this.bananaFocus = a.focus),
  28284. (this.bananaFov = a.fov),
  28285. (this.bananaReal_aspect = a.aspect * this.bananaAspect),
  28286. (this.bananaNear = a.near),
  28287. (this.bananaFar = a.far),
  28288. //console.debug(a.aspect),
  28289. (this.bananaFocus = 10)
  28290. var b,
  28291. c,
  28292. d = a.projectionMatrix.clone(),
  28293. e = this.overlap / 2,
  28294. f = (e * this.bananaNear) / this.bananaFocus,
  28295. g = this.bananaNear * Math.tan((Math.PI / 180) * this.bananaFov * 0.5)
  28296. ;(this.eyeLeft.elements[12] = -e),
  28297. (this.eyeRight.elements[12] = e),
  28298. (b = -g * this.bananaReal_aspect + f),
  28299. (c = g * this.bananaReal_aspect + f),
  28300. (d.elements[0] = (2 * this.bananaNear) / (c - b)),
  28301. (d.elements[8] = (c + b) / (c - b)),
  28302. this.cameraL.projectionMatrix.copy(d),
  28303. (b = -g * this.bananaReal_aspect - f),
  28304. (c = g * this.bananaReal_aspect - f),
  28305. (d.elements[0] = (2 * this.bananaNear) / (c - b)),
  28306. (d.elements[8] = (c + b) / (c - b)),
  28307. this.cameraR.projectionMatrix.copy(d)
  28308. }
  28309. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft),
  28310. this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight)
  28311. })
  28312. }),
  28313. (n.prototype.boluoGetTexture = function (a) {
  28314. var b = new r.TextureLoader()
  28315. return (b.crossOrigin = 'anonymous'), b.load(a)
  28316. })
  28317. /* let webxr = {
  28318. init(renderer) {
  28319. this.renderer = renderer
  28320. renderer.xr = new THREE.WebXRManager(renderer, renderer.getContext());
  28321. renderer.xr.enabled = true
  28322. if ('xr' in navigator && 'isSessionSupported' in navigator.xr) {
  28323. //pico firefox
  28324. var mode = 'immersive-vr'
  28325. navigator.xr
  28326. .isSessionSupported(mode)
  28327. .then(supported => {
  28328. if (!supported) {
  28329. this.xrNotFound('isSessionSupported not supported')
  28330. } else {
  28331. this.xrType = 'xr' //showEnterXR();
  28332. }
  28333. })
  28334. .catch(this.xrNotFound.bind(this, 'isSessionSupported error'))
  28335. } else if ('getVRDisplays' in navigator) {
  28336. //pico 的vr browser是这个
  28337. console.log('getVRDisplays')
  28338. let setDevice = device => {
  28339. this.xrType = 'vr'
  28340. this.device = device
  28341. this.renderer.xr.setDevice(device) //新版是renderer.vr
  28342. }
  28343. window.addEventListener(
  28344. 'vrdisplayconnect',
  28345. function (event) {
  28346. setDevice(event.display)
  28347. },
  28348. false
  28349. )
  28350. window.addEventListener(
  28351. 'vrdisplaydisconnect',
  28352. function ( ) {
  28353. console.log('vrdisplaydisconnect')
  28354. window.bus.dispatchEvent({type:'exitWebXR'})
  28355. },
  28356. false
  28357. )
  28358. window.addEventListener(
  28359. 'vrdisplaypresentchange',
  28360. function (event) {
  28361. console.log('vrdisplaypresentchange', event.display.isPresenting ? 'EXIT VR' : 'ENTER VR')
  28362. event.display.isPresenting || window.bus.dispatchEvent({type:'exitWebXR'})
  28363. },
  28364. false
  28365. )
  28366. window.addEventListener(
  28367. 'vrdisplayactivate',
  28368. function (event) {
  28369. event.display.requestPresent([{ source: this.renderer.domElement }])
  28370. },
  28371. false
  28372. )
  28373. navigator
  28374. .getVRDisplays()
  28375. .then(function (displays) {
  28376. if (displays.length > 0) {
  28377. setDevice(displays[0])
  28378. } else {
  28379. this.xrNotFound('no displays')
  28380. }
  28381. })
  28382. .catch(this.xrNotFound.bind(this, 'getVRDisplays error'))
  28383. } else {
  28384. this.xrNotFound('xr not supported')
  28385. }
  28386. },
  28387. enterVR() {
  28388. if (!this.xrType) return //不支持
  28389. console.log('enterVR', this.xrType)
  28390. if (this.xrType == 'vr') {
  28391. this.device.isPresenting ? this.device.exitPresent() : this.device.requestPresent([{ source: renderer.domElement }])
  28392. } else if (this.xrType == 'xr') {
  28393. if (this.currentSession == void 0) {
  28394. console.log('this.currentSession == void 0 ')
  28395. function getXRSessionInit(mode, options) {
  28396. var space = (options || {}).referenceSpaceType || 'local-floor'
  28397. var sessionInit = (options && options.sessionInit) || {}
  28398. // Nothing to do for default features.
  28399. if (space == 'viewer') return sessionInit
  28400. if (space == 'local' && mode.startsWith('immersive')) return sessionInit
  28401. // If the user already specified the space as an optional or required feature, don't do anything.
  28402. if (sessionInit.optionalFeatures && sessionInit.optionalFeatures.includes(space)) return sessionInit
  28403. if (sessionInit.requiredFeatures && sessionInit.requiredFeatures.includes(space)) return sessionInit
  28404. // The user didn't request the reference space type as a feature. Add it to a shallow copy
  28405. // of the user-supplied sessionInit requiredFeatures (if any) to ensure it's valid to
  28406. // request it later.
  28407. var newInit = Object.assign({}, sessionInit)
  28408. newInit.requiredFeatures = [space]
  28409. if (sessionInit.requiredFeatures) {
  28410. newInit.requiredFeatures = newInit.requiredFeatures.concat(sessionInit.requiredFeatures)
  28411. }
  28412. return newInit
  28413. }
  28414. let onSessionEnded = ( ) => {
  28415. console.log('onSessionEnded')
  28416. this.currentSession.removeEventListener('end', onSessionEnded)
  28417. setTimeout(()=>{
  28418. this.renderer.xr.setSession(null)
  28419. this.currentSession = null
  28420. window.bus.dispatchEvent({type:'exitWebXR'})
  28421. },1)//延迟原因:先使THREE里的onSessionEnded执行
  28422. }
  28423. let onSessionStarted = session => {
  28424. console.log('onSessionStarted')
  28425. session.addEventListener('end', onSessionEnded)
  28426. this.renderer.xr.setSession(session)
  28427. this.currentSession = session
  28428. }
  28429. var mode = 'immersive-vr'
  28430. var sessionInit = getXRSessionInit(mode)
  28431. navigator.xr.requestSession(mode, sessionInit).then(onSessionStarted)
  28432. } else {
  28433. console.log('this.currentSession.end()', this.currentSession)
  28434. this.currentSession.end()
  28435. }
  28436. }
  28437. },
  28438. xrNotFound(text) {
  28439. console.log('xrNotFound:', text)
  28440. },
  28441. } */
  28442. /***********************************************************************************************************************************************************************************/
  28443. ;(n.prototype.updateScreenSize = (function () {
  28444. //xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  28445. var W, H //当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  28446. return function (o) {
  28447. var render = false
  28448. var ratio
  28449. var w, h //记录应当render的大小
  28450. if (o && !o.resize && o.width != void 0 && o.height != void 0) {
  28451. ;(w = o.width), (h = o.height), (render = true), (ratio = 1)
  28452. } else {
  28453. w = $('#player').width()
  28454. h = $('#player').height()
  28455. o && o.resize && ((W = this.renderWidth), (H = this.renderHeight))
  28456. ;(w !== W || h !== H || this.forceUpdateSize) &&
  28457. ((W = w), (H = h), (render = true), (ratio = window.devicePixelRatio))
  28458. }
  28459. if (render) {
  28460. this.setSize(w, h, ratio)
  28461. this.forceUpdateSize = !1
  28462. }
  28463. }
  28464. })()),
  28465. (n.prototype.updateComponents = function () {
  28466. for (
  28467. var e = Math.min(1, this.updateClock.getDelta()), t = 0;
  28468. t < this.updateListeners.length;
  28469. t++
  28470. )
  28471. this.updateListeners[t].update(e)
  28472. }),
  28473. (n.prototype.suspend = function () {
  28474. ;(this.started = !1),
  28475. (this.suspendedObjects = this.scene.children.map(
  28476. function (e) {
  28477. return this.scene.remove(e), e
  28478. }.bind(this)
  28479. )),
  28480. this.render()
  28481. }),
  28482. (n.prototype.resume = function () {
  28483. this.suspendedObjects.forEach(
  28484. function (e) {
  28485. this.scene.add(e)
  28486. }.bind(this)
  28487. ),
  28488. (this.suspendedObjects = []),
  28489. (this.started = !0),
  28490. p()
  28491. })
  28492. var p = function () {
  28493. this.started &&
  28494. (window.requestAnimationFrame(p),
  28495. this.updateScreenSize(), // fyz resize
  28496. this.updateComponents(),
  28497. this.updateTextureMemory(),
  28498. this.render(),
  28499. window.stats && (window.fps = stats.update()),
  28500. this.emit(a.AfterRender))
  28501. }
  28502. ;(n.prototype.getImageData = (function () {
  28503. var e = document.createElement('canvas'),
  28504. t = e.getContext('2d')
  28505. return function (i, n, r) {
  28506. return (
  28507. (e.width === n && e.height === r) || ((e.width = n), (e.height = r)),
  28508. t.drawImage(i, 0, 0, n, r),
  28509. t.getImageData(0, 0, n, r)
  28510. )
  28511. }
  28512. })()),
  28513. (n.prototype.initSizedTexture2D = function (e, t, i) {
  28514. var n = this.renderer,
  28515. o = n.context,
  28516. a = n.state,
  28517. s = new r.Texture(null)
  28518. ;(s.flipY = !1), i !== !0 && (i = !1), (s.generateMipmaps = i)
  28519. var l = n.paramThreeToGL(s.format),
  28520. c = n.paramThreeToGL(s.type),
  28521. h = n.properties.get(s),
  28522. u = o.createTexture()
  28523. a.bindTexture(o.TEXTURE_2D, u),
  28524. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  28525. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  28526. (s.wrapS = t),
  28527. (s.wrapT = t)
  28528. var d = n.paramThreeToGL(t)
  28529. return (
  28530. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  28531. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  28532. i
  28533. ? ((s.magFilter = r.LinearFilter),
  28534. (s.minFilter = r.LinearMipMapLinearFilter),
  28535. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  28536. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  28537. o.generateMipmap(o.TEXTURE_2D))
  28538. : ((s.magFilter = r.LinearFilter),
  28539. (s.minFilter = r.LinearFilter),
  28540. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  28541. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  28542. a.bindTexture(o.TEXTURE_2D, null),
  28543. (h.__webglTexture = u),
  28544. s
  28545. )
  28546. }),
  28547. (n.prototype.initSizedCubeMap = function (e, t) {
  28548. var i = this.renderer,
  28549. n = i.context,
  28550. o = i.state,
  28551. a = new r.CubeTexture([null, null, null, null, null, null])
  28552. ;(a.flipY = !1), (a.generateMipmaps = t)
  28553. var s = i.paramThreeToGL(a.format),
  28554. l = i.paramThreeToGL(a.type),
  28555. c = i.properties.get(a),
  28556. h = n.createTexture()
  28557. o.bindTexture(n.TEXTURE_CUBE_MAP, h), n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY)
  28558. for (var u = 0; u < 6; u++)
  28559. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null)
  28560. return (
  28561. t
  28562. ? ((a.magFilter = r.LinearFilter),
  28563. (a.minFilter = r.LinearMipMapLinearFilter),
  28564. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  28565. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  28566. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  28567. n.generateMipmap(n.TEXTURE_CUBE_MAP))
  28568. : ((a.magFilter = r.LinearFilter),
  28569. (a.minFilter = r.LinearFilter),
  28570. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  28571. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  28572. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  28573. (c.__image__webglTextureCube = h),
  28574. a
  28575. )
  28576. }),
  28577. (n.prototype.deallocateCubeTexture = function (e) {
  28578. var t = this.renderer,
  28579. i = t.context,
  28580. n = t.properties.get(e)
  28581. i.deleteTexture(n.__image__webglTextureCube)
  28582. }),
  28583. (n.prototype.uploadTexture2D = function (e, t, i, n, r, o) {
  28584. var a = this.renderer,
  28585. s = a.context,
  28586. l = a.state,
  28587. c = a.properties.get(t)
  28588. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  28589. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  28590. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  28591. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  28592. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  28593. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  28594. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  28595. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  28596. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  28597. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  28598. l.bindTexture(s.TEXTURE_2D, null)
  28599. }),
  28600. (n.prototype.uploadTexture3D = function (e, t, i, n, r, o, a) {
  28601. var s = this.renderer,
  28602. l = s.context,
  28603. c = s.state,
  28604. h = s.properties.get(t)
  28605. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  28606. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  28607. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  28608. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  28609. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  28610. }),
  28611. (n.prototype.rebuildMipMaps2D = function (e) {
  28612. var t = this.renderer,
  28613. i = t.context,
  28614. n = t.state
  28615. t.properties.get(e)
  28616. i.generateMipmap(i.TEXTURE_2D), n.bindTexture(i.TEXTURE_2D, null)
  28617. }),
  28618. (n.prototype.rebuildMipMaps3D = function (e) {
  28619. var t = this.renderer,
  28620. i = t.context,
  28621. n = t.state,
  28622. r = t.properties.get(e)
  28623. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  28624. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  28625. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  28626. }),
  28627. (n.prototype.renderToCubeMap = (function () {
  28628. var e = !1,
  28629. t = null,
  28630. i = null,
  28631. n = null,
  28632. a = null,
  28633. s = null,
  28634. l = 1
  28635. return function (c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  28636. var _ = this.renderer
  28637. _.context
  28638. e ||
  28639. ((i = new r.OrthographicCamera(l / -2, l / 2, l / 2, l / -2, -200, 200)),
  28640. (i.position.z = 150),
  28641. (t = new r.Scene()),
  28642. t.add(i),
  28643. (n = new r.ShaderMaterial({
  28644. uniforms: {
  28645. tDiffuse: {
  28646. type: 't',
  28647. value: null
  28648. },
  28649. alpha: {
  28650. type: 'f',
  28651. value: 1
  28652. }
  28653. },
  28654. vertexShader: o.basicTextured.vertexShader,
  28655. fragmentShader: o.basicTextured.fragmentShader,
  28656. depthWrite: !1,
  28657. depthTest: !1,
  28658. side: r.DoubleSide
  28659. })),
  28660. (a = new r.PlaneBufferGeometry(l, l)),
  28661. (s = new r.Mesh(a, n)),
  28662. (s.position.z = 0),
  28663. t.add(s),
  28664. (e = !0))
  28665. var T = a.getAttribute('uv')
  28666. T.setDynamic(!0), (T.needsUpdate = !0)
  28667. var x = T.array,
  28668. S = p / u,
  28669. M = f / d,
  28670. R = g / u,
  28671. P = m / d
  28672. ;(x[0] = S),
  28673. (x[1] = M + P),
  28674. (x[2] = S + R),
  28675. (x[3] = M + P),
  28676. (x[4] = S),
  28677. (x[5] = M),
  28678. (x[6] = S + R),
  28679. (x[7] = M)
  28680. var O = a.getAttribute('position')
  28681. O.setDynamic(!0), (O.needsUpdate = !0)
  28682. var L = O.array,
  28683. D = v / h.width - l / 2,
  28684. N = A / h.height - l / 2,
  28685. B = y / h.width,
  28686. F = C / h.height
  28687. ;(L[0] = D),
  28688. (L[1] = N + F),
  28689. (L[3] = D + B),
  28690. (L[4] = N + F),
  28691. (L[6] = D),
  28692. (L[7] = N),
  28693. (L[9] = D + B),
  28694. (L[10] = N)
  28695. this.renderer.properties.get(c)
  28696. ;(n.uniforms.tDiffuse.value = c),
  28697. (n.blending = E || r.NoBlending),
  28698. (n.transparent = !!b),
  28699. (void 0 !== w && null !== w) || (w = 1),
  28700. (n.uniforms.alpha.value = w),
  28701. (n.needUpdate = !0),
  28702. (h.activeCubeFace = I),
  28703. h.viewport.set(0, 0, h.width, h.height)
  28704. var V = this.renderer.autoClear
  28705. ;(this.renderer.autoClear = !1),
  28706. this.renderer.render(t, i, h, !1),
  28707. (this.renderer.autoClear = V)
  28708. }
  28709. })()),
  28710. (n.prototype.copyCubeMap = (function () {
  28711. var e = !1,
  28712. t = null,
  28713. i = null,
  28714. a = null,
  28715. s = null,
  28716. l = null,
  28717. c = new r.Euler()
  28718. new r.Vector3()
  28719. return function (h, u, d, p, f, g, m, v, A) {
  28720. if (f > this.qualityManager.maxRenderTargetSize) return //add
  28721. this.renderer
  28722. if (!e) {
  28723. var y = 2
  28724. ;(i = new r.OrthographicCamera(y / -2, y / 2, y / 2, y / -2, 0, 200)),
  28725. i.position.set(0, 0, 0),
  28726. (t = new r.Scene()),
  28727. t.add(i),
  28728. (a = new r.ShaderMaterial({
  28729. uniforms: {
  28730. tDiffuse: {
  28731. type: 't',
  28732. value: null
  28733. },
  28734. alpha: {
  28735. type: 'f',
  28736. value: 1
  28737. }
  28738. },
  28739. vertexShader: o.copyCubeMap.vertexShader,
  28740. fragmentShader: o.copyCubeMap.fragmentShader,
  28741. depthWrite: !1,
  28742. depthTest: !1,
  28743. side: r.DoubleSide
  28744. })),
  28745. (s = new r.BoxGeometry(y, y, y)),
  28746. (l = new r.Mesh(s, a)),
  28747. t.add(l),
  28748. (e = !0)
  28749. }
  28750. for (var C = 0; C < 6; C++)
  28751. n.getCubeOrientationForCubeFace(C, c),
  28752. l.rotation.copy(c),
  28753. (l.matrixWorldNeedsUpdate = !0),
  28754. l.updateMatrixWorld(),
  28755. (a.uniforms.tDiffuse.value = h),
  28756. (a.blending = m || r.NoBlending),
  28757. (a.transparent = !!v),
  28758. (void 0 !== A && null !== A) || (A = 1),
  28759. (a.uniforms.alpha.value = A),
  28760. (a.needUpdate = !0),
  28761. (u.activeCubeFace = C),
  28762. u.viewport.set(0, 0, f, g),
  28763. this.renderer.render(t, i, u, !1)
  28764. }
  28765. })()),
  28766. (n.getLookAtForCubeFace = function (e, t) {
  28767. switch (e) {
  28768. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28769. t.set(1, 0, 0)
  28770. break
  28771. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28772. t.set(-1, 0, 0)
  28773. break
  28774. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28775. t.set(0, 1, 0)
  28776. break
  28777. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28778. t.set(0, -1, 0)
  28779. break
  28780. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28781. t.set(0, 0, 1)
  28782. break
  28783. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28784. t.set(0, 0, -1)
  28785. }
  28786. }),
  28787. (n.getCubeOrientationForCubeFace = function (e, t) {
  28788. switch (e) {
  28789. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28790. t.set(0, -Math.PI / 2, 0)
  28791. break
  28792. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28793. t.set(0, Math.PI / 2, 0)
  28794. break
  28795. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28796. t.set(Math.PI / 2, Math.PI, 0)
  28797. break
  28798. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28799. t.set(-Math.PI / 2, Math.PI, 0)
  28800. break
  28801. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28802. t.set(0, -Math.PI, 0)
  28803. break
  28804. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28805. t.set(0, 0, 0)
  28806. }
  28807. }),
  28808. (t.exports = n)
  28809. },
  28810. {
  28811. '../enum/GLCubeFaces': 25,
  28812. '../enum/GLTextureType': 26,
  28813. '../enum/SceneRendererEvents': 43,
  28814. '../exception/BasicException': 55,
  28815. '../exception/RendererCreationException': 57,
  28816. '../settings': 166,
  28817. '../shaders': 167,
  28818. /********************************************************************fyz改 from徐世廷**********************************************************************/
  28819. '../util/browser': 182,
  28820. /************************************************************************************************************************************************/
  28821. events: 202,
  28822. three: 217
  28823. }
  28824. ],
  28825. 159: [
  28826. function (e, t, i) {
  28827. 'use strict'
  28828. function n(e) {
  28829. ;(this.messenger = new a(e)), (this.clientKey = null)
  28830. }
  28831. var r = e('../util/ajax'),
  28832. o = e('./PostMessageType'),
  28833. a = e('./postmessage'),
  28834. s = e('./VersionInfo'),
  28835. l = e('events').EventEmitter,
  28836. c = window.location.origin + '/api/v1/user/'
  28837. ;(n.prototype = Object.create(l.prototype)),
  28838. (n.prototype.bindEvents = function () {
  28839. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  28840. }),
  28841. (n.prototype.waitForConnection = function () {
  28842. var e = new Promise(
  28843. function (e, t) {
  28844. this.messenger.on(
  28845. o.CONNECT,
  28846. function (i) {
  28847. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  28848. }.bind(this)
  28849. )
  28850. }.bind(this)
  28851. )
  28852. return e
  28853. }),
  28854. (n.prototype.onConnectionReceived = function (e) {
  28855. return (
  28856. this.messenger.setTarget(e.source, e.origin),
  28857. this.verifyConnection(e).then(
  28858. function (t, i) {
  28859. this.messenger.send({
  28860. type: o.ACCEPT,
  28861. toId: e.fromId,
  28862. warning: i
  28863. }),
  28864. (this.clientKey = t),
  28865. this.messenger.removeAllListeners(o.CONNECT),
  28866. this.bindEvents()
  28867. }.bind(this),
  28868. function (t) {
  28869. this.messenger.send({
  28870. type: o.REJECT,
  28871. toId: e.fromId,
  28872. reason: t
  28873. }),
  28874. this.messenger.setTarget()
  28875. }.bind(this)
  28876. )
  28877. )
  28878. }),
  28879. (n.prototype.verifyConnection = function (e) {
  28880. return new Promise(function (t, i) {
  28881. var n
  28882. if (s.isDeprecated(e.sdkVersion)) n = '这个版本正在被弃用'
  28883. else if (!s.isSupported(e.sdkVersion)) return i('不支持此版本的SDK')
  28884. var o = {
  28885. cache: !1,
  28886. headers: {
  28887. 'X-port-Application-Key': e.applicationKey,
  28888. 'X-port-Referrer': e.origin
  28889. }
  28890. }
  28891. r.get(c, o)
  28892. .done(t.bind(this, e.applicationKey, n))
  28893. .fail(i.bind(this, 'key/referrer mismatch'))
  28894. })
  28895. }),
  28896. (n.prototype.onMessageReceived = function (e) {
  28897. if (this.validateClientApplicationKey(e.applicationKey)) {
  28898. var t = this
  28899. ;(e.onDone = function (i) {
  28900. ;(i.toId = e.fromId), (i.uid = e.uid), (i.type = o.RESPONSE), t.messenger.send(i)
  28901. }),
  28902. this.emit(o.ACTION, e)
  28903. }
  28904. }),
  28905. (n.prototype.validateClientApplicationKey = function (e) {
  28906. return this.clientKey === e
  28907. }),
  28908. (n.prototype.sendEvent = function (e, t) {
  28909. this.messenger.send({
  28910. type: o.EVENT,
  28911. eventType: e,
  28912. eventData: t
  28913. })
  28914. }),
  28915. (t.exports = n)
  28916. },
  28917. {
  28918. '../util/ajax': 181,
  28919. './PostMessageType': 160,
  28920. './VersionInfo': 163,
  28921. './postmessage': 165,
  28922. events: 202
  28923. }
  28924. ],
  28925. 160: [
  28926. function (e, t, i) {
  28927. 'use strict'
  28928. t.exports = Object.freeze({
  28929. CONNECT: 'postmessage.connect',
  28930. ACCEPT: 'postmessage.accept',
  28931. REJECT: 'postmessage.reject',
  28932. ACTION: 'postmessage.action',
  28933. RESPONSE: 'postmessage.response',
  28934. EVENT: 'postmessage.event'
  28935. })
  28936. },
  28937. {}
  28938. ],
  28939. 161: [
  28940. function (e, t, i) {
  28941. 'use strict'
  28942. t.exports = Object.freeze({
  28943. MOVE: 'sdk.move',
  28944. ENTER_PANO: 'sdk.enterpano',
  28945. MODEL_LOADED: 'sdk.modelloaded'
  28946. })
  28947. },
  28948. {}
  28949. ],
  28950. 162: [
  28951. function (e, t, i) {
  28952. 'use strict'
  28953. t.exports = Object.freeze({
  28954. FLY: 'transition.fly',
  28955. FADEOUT: 'transition.fade',
  28956. INSTANT: 'transition.instant'
  28957. })
  28958. },
  28959. {}
  28960. ],
  28961. 163: [
  28962. function (e, t, i) {
  28963. 'use strict'
  28964. t.exports = {
  28965. current: '1.0',
  28966. supported: ['1.0'],
  28967. deprecated: [],
  28968. isSupported: function (e) {
  28969. return this.supported.indexOf(e) !== -1
  28970. },
  28971. isDeprecated: function (e) {
  28972. return this.deprecated.indexOf(e) !== -1
  28973. },
  28974. isValid: function (e) {
  28975. return this.isSupported(e) || this.isDeprecated(e)
  28976. }
  28977. }
  28978. },
  28979. {}
  28980. ],
  28981. 164: [
  28982. function (e, t, i) {
  28983. ;(function (i) {
  28984. 'use strict'
  28985. function n(e, t, i) {
  28986. e && (e = e.toLowerCase().trim())
  28987. var n = new I.UP.clone(),
  28988. r = Math.PI / 3,
  28989. o = Math.PI / 2
  28990. switch (e) {
  28991. case 'left':
  28992. i.copy(t), i.applyAxisAngle(n, o)
  28993. break
  28994. case 'right':
  28995. i.copy(t), i.applyAxisAngle(n, -o)
  28996. break
  28997. case 'forwardleft':
  28998. i.copy(t), i.applyAxisAngle(n, r)
  28999. break
  29000. case 'forwardright':
  29001. i.copy(t), i.applyAxisAngle(n, -r)
  29002. break
  29003. case 'forward':
  29004. default:
  29005. i.copy(t)
  29006. }
  29007. return i
  29008. }
  29009. function r(e, t) {
  29010. if (e) {
  29011. var i = {
  29012. pano: e,
  29013. lookAtPoint: null,
  29014. duration: null,
  29015. maxDistanceOverride: null,
  29016. skipWarpingCheck: !1
  29017. }
  29018. this.player.flyToPano(i, function () {
  29019. t &&
  29020. t({
  29021. success: !0,
  29022. message: 'Transition complete.'
  29023. })
  29024. })
  29025. } else
  29026. R.warn('Showcase -> clickPanoObject: Unable to find pano.'),
  29027. t &&
  29028. t({
  29029. success: !1,
  29030. error: 'Unable to find pano.'
  29031. })
  29032. }
  29033. function o(e, t) {
  29034. var i = this.findRankedPano(e, t)
  29035. return i >= 0
  29036. ? this.handleToObject[i]
  29037. : (R.warn('Showcase -> findRankedPanoObject: Unable to find nearby pano.'), null)
  29038. }
  29039. function a(e, t) {
  29040. var i = this.findRankedtag(e, t)
  29041. return i >= 0
  29042. ? this.handleToObject[i]
  29043. : (R.warn('Showcase -> findRankedtagObject: Unable to find nearby tag.'), null)
  29044. }
  29045. function s(e, t) {
  29046. t.copy(I.FORWARD), e.getDirection(t)
  29047. }
  29048. function l(e) {
  29049. function t(e) {
  29050. var t = new c.Euler().setFromQuaternion(e.quaternion, 'YXZ')
  29051. return {
  29052. x: c.Math.radToDeg(t._x),
  29053. y: c.Math.radToDeg(t._y),
  29054. z: c.Math.radToDeg(t._z)
  29055. }
  29056. }
  29057. var i = function (e) {
  29058. return e.alignmentType !== m.ALIGNED
  29059. ? null
  29060. : {
  29061. x: e.position.x,
  29062. y: e.position.y,
  29063. z: e.position.z
  29064. }
  29065. }
  29066. return {
  29067. panos: e.panos.list.map(function (n) {
  29068. var r = y.getCubemapUrls(e.urls, n.id, 'high')[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z]
  29069. return {
  29070. uuid: n.id,
  29071. aligned: n.alignmentType === m.ALIGNED,
  29072. neighbourUUIDs: n.neighbourUUIDs.slice(),
  29073. position: i(n),
  29074. rotation: t(n),
  29075. thumbnail: r
  29076. }
  29077. })
  29078. }
  29079. }
  29080. var c = e('three'),
  29081. h = e('./ApiHost'),
  29082. u = e('../util/logger'),
  29083. d = e('../util/common'),
  29084. p = e('../util/math'),
  29085. f = e('../enum/ModelManagerEvents'),
  29086. g = e('./PostMessageType'),
  29087. m = e('../enum/AlignmentType'),
  29088. v = e('../enum/Direction'),
  29089. A = e('./TransitionStyles'),
  29090. y = e('../util/panorama'),
  29091. C = e('../enum/GLCubeFaces'),
  29092. I = e('../enum/Vectors'),
  29093. E = e('../enum/Viewmode'),
  29094. b = e('../enum/WarpStyle'),
  29095. w = (e('../enum/Keys'), e('../enum/PlayerEvents')),
  29096. _ = e('../sdk/SdkEvents'),
  29097. I = e('../enum/Vectors'),
  29098. T = e('../enum/ControlEvents'),
  29099. x = e('../enum/RenderLayers'),
  29100. S = (e('../constants'), e('../settings')),
  29101. M = e('../lib/jpeg_encoder'),
  29102. R = new u(i),
  29103. P = (function () {
  29104. var e = function e() {
  29105. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  29106. e.player.getDirection(e.playerDirection),
  29107. e.projectVectors()
  29108. var t = e.playerDirection.angleTo(e.lastFacingDirection)
  29109. if (((e.angleTravelled += Math.abs(t)), e.angleTravelled >= Math.abs(e.angle))) {
  29110. if (((e.active = !1), e.onDone)) {
  29111. var i = e.onDone
  29112. i()
  29113. }
  29114. } else e.lastFacingDirection.copy(e.playerDirection), window.setTimeout(e, 4)
  29115. }
  29116. return (
  29117. (e.active = !1),
  29118. (e.angle = 0),
  29119. (e.angleTravelled = 0),
  29120. (e.playerDirection = new c.Vector3()),
  29121. (e.lastFacingDirection = new c.Vector3()),
  29122. (e.onDone = null),
  29123. (e.player = null),
  29124. (e.start = function (t, i, n, r) {
  29125. ;(e.active = !0),
  29126. t && i && (i = 0),
  29127. (e.angle = t || i),
  29128. (e.xAngle = t),
  29129. (e.yAngle = i),
  29130. (e.angleTravelled = 0),
  29131. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  29132. n.getDirection(e.playerDirection),
  29133. e.lastFacingDirection.copy(e.playerDirection),
  29134. e.projectVectors(),
  29135. (e.onDone = r),
  29136. (e.player = n),
  29137. e()
  29138. }),
  29139. (e.projectVectors = function () {
  29140. e.xAngle &&
  29141. (e.playerDirection.projectOnPlane(I.UP),
  29142. e.lastFacingDirection.projectOnPlane(I.UP))
  29143. }),
  29144. e
  29145. )
  29146. })(),
  29147. O = (function () {
  29148. var e = new c.Vector3()
  29149. return function (t) {
  29150. t
  29151. ? (e.copy(t.position),
  29152. e.add(t.discPosition),
  29153. p.projectPositionToCanvas(e, this.player.camera, e),
  29154. this.click(e.x, e.y))
  29155. : R.warn('Showcase -> clicktagObject: Unable to find tag.')
  29156. }
  29157. })(),
  29158. L = function () {
  29159. return this.player.mode === E.PANORAMA
  29160. ? S.insideLookLimitUp
  29161. : this.player.mode === E.DOLLHOUSE
  29162. ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle)
  29163. : null
  29164. },
  29165. D = function () {
  29166. return this.player.mode === E.PANORAMA
  29167. ? S.insideLookLimitDown
  29168. : this.player.mode === E.DOLLHOUSE
  29169. ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle)
  29170. : null
  29171. },
  29172. N = (function (e) {
  29173. var t = new c.Vector3()
  29174. return function (e) {
  29175. var i = this.player.getDirection()
  29176. t.copy(i)
  29177. var n = t.y
  29178. ;(t.y = 0), t.normalize()
  29179. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1)
  29180. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  29181. return (
  29182. 0 !== e &&
  29183. R.warn('Cannot rotate in y direction when in ' + this.player.mode + ' mode'),
  29184. 0
  29185. )
  29186. this.player.mode === E.DOLLHOUSE && (r = -r)
  29187. var o = L.call(this) - 0.1,
  29188. a = D.call(this) + 0.1,
  29189. s = r + e
  29190. s > o ? (s = o) : s < a && (s = a)
  29191. var l = s - r
  29192. return e > 0 && l < 0.01 && (l = 0), e < 0 && l > -0.01 && (l = 0), l
  29193. }
  29194. })(),
  29195. B = (function () {
  29196. var e = new c.Euler()
  29197. return function (t) {
  29198. return (
  29199. e.setFromQuaternion(t.quaternion, 'YXZ'),
  29200. {
  29201. position: {
  29202. x: t.position.x,
  29203. y: t.position.y,
  29204. z: t.position.z
  29205. },
  29206. rotation: {
  29207. x: c.Math.radToDeg(e.x),
  29208. y: c.Math.radToDeg(e.y),
  29209. z: 0
  29210. },
  29211. pano: t.currentPano ? t.currentPano.id : null,
  29212. mode: t.mode
  29213. }
  29214. )
  29215. }
  29216. })(),
  29217. F = null
  29218. t.exports = {
  29219. init: function (e, t, i, n, r) {
  29220. V.init(e, t, i, r),
  29221. (F = new Promise(
  29222. function (e, t) {
  29223. i.on(w.Ready, function () {
  29224. e()
  29225. })
  29226. }.bind(this)
  29227. ))
  29228. var o = new h(window),
  29229. a = o.waitForConnection()
  29230. a.then(function (e) {
  29231. o.on(g.ACTION, V.onMessageReceive.bind(V))
  29232. })
  29233. var s = (function () {
  29234. var e = Date.now()
  29235. return function () {
  29236. if (!(Date.now() - e < 100)) {
  29237. var t = B(i)
  29238. o.sendEvent(_.MOVE, {
  29239. state: t
  29240. }),
  29241. (e = Date.now())
  29242. }
  29243. }
  29244. })()
  29245. i.on(w.Move, s),
  29246. i.on(w.ViewChanged, s),
  29247. n.on(f.ActiveModelChanged, function (e) {
  29248. function t(e) {
  29249. var t,
  29250. i = e.newPano.id
  29251. e.oldPano && (t = e.oldPano.id),
  29252. i !== t &&
  29253. o.sendEvent(_.ENTER_PANO, {
  29254. oldPano: t,
  29255. newPano: i
  29256. })
  29257. }
  29258. var i = e.model,
  29259. n = e.oldModel
  29260. ;(V.model = i),
  29261. a.then(function () {
  29262. o.sendEvent(_.MODEL_LOADED, {
  29263. metadata: l(i)
  29264. })
  29265. }),
  29266. n &&
  29267. n.panos.forEach(function (e) {
  29268. e.removeEventListener('enter', t)
  29269. }),
  29270. i.panos.forEach(function (e) {
  29271. e.on('enter', t)
  29272. })
  29273. })
  29274. }
  29275. }
  29276. var V = {
  29277. director: null,
  29278. player: null,
  29279. controls: null,
  29280. sceneRenderer: null,
  29281. model: null,
  29282. init: function (e, t, i, n) {
  29283. ;(this.director = e), (this.player = i), (this.controls = t), (this.sceneRenderer = n)
  29284. },
  29285. handleToObject: {},
  29286. objectToHandle: {},
  29287. handleCount: 0,
  29288. onMessageReceive: function (e) {
  29289. if (e) {
  29290. var t = e.targetFunction,
  29291. i = e.params,
  29292. n = e.onDone
  29293. t && this[t] && this[t](i, n)
  29294. }
  29295. },
  29296. waitForInit: function (e, t) {
  29297. F.then(
  29298. t.bind({
  29299. success: !0,
  29300. message: 'Init complete.'
  29301. })
  29302. )
  29303. },
  29304. moveToPano: (function (e, t) {
  29305. var i = new c.Euler(0, 0, 0, 'YXZ'),
  29306. n = new c.Quaternion()
  29307. return function (e, t) {
  29308. var r = e.pano,
  29309. o = e.rotation,
  29310. a = e.transition
  29311. if (!this.model)
  29312. return t({
  29313. success: !1,
  29314. error: 'The model has not been loaded yet'
  29315. })
  29316. var s = this.model.panos.get(r)
  29317. if (!s)
  29318. return t({
  29319. success: !1,
  29320. error: r + ' does not exist in this model'
  29321. })
  29322. if (!o)
  29323. return t({
  29324. sucess: !1,
  29325. erorr: o + ' is not a valid rotation'
  29326. })
  29327. i.set(
  29328. c.Math.degToRad(o.x || 0),
  29329. c.Math.degToRad(o.y || 0),
  29330. c.Math.degToRad(o.z || 0),
  29331. 'YXZ'
  29332. ),
  29333. console.log(o.z)
  29334. var l = {
  29335. success: !0,
  29336. message: r
  29337. }
  29338. if (a === A.FADEOUT)
  29339. n.setFromEuler(i),
  29340. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l))
  29341. else {
  29342. var h, u
  29343. a === A.INSTANT && ((h = 0), (u = 0))
  29344. var d = I.FORWARD.clone().applyEuler(i).add(s.position)
  29345. this.player.flyToPano(
  29346. {
  29347. pano: s,
  29348. lookAtPoint: d,
  29349. duration: h,
  29350. aimDuration: u
  29351. },
  29352. t.bind(this, l)
  29353. )
  29354. }
  29355. }
  29356. })(),
  29357. moveInDirection: function (e, t) {
  29358. var i = e.direction
  29359. return 'undefined' == typeof v[i]
  29360. ? (R.warn('Showcase -> moveInDirection: Cannot move in invalid direction.'),
  29361. void (
  29362. t &&
  29363. t({
  29364. success: !1,
  29365. error: 'Invalid direction.'
  29366. })
  29367. ))
  29368. : void this.player.flyLocalDirection(I[i].clone()).then(function (e) {
  29369. t(
  29370. e
  29371. ? {
  29372. success: !0,
  29373. message: 'moved ' + i
  29374. }
  29375. : {
  29376. success: !1,
  29377. error: 'Cannot move in direction: ' + i
  29378. }
  29379. )
  29380. })
  29381. },
  29382. getPose: function (e, t) {
  29383. this.player.camera.position,
  29384. new c.Euler().setFromQuaternion(this.player.camera.quaternion, 'YXZ')
  29385. return t({
  29386. success: !0,
  29387. message: B(this.player)
  29388. })
  29389. },
  29390. takeScreenShot: (function () {
  29391. var e = new c.PerspectiveCamera(),
  29392. t = new c.WebGLRenderTarget()
  29393. return function (i, n) {
  29394. if (!i.resolution)
  29395. return n({
  29396. success: !1,
  29397. error: 'An invalid resolution was specified'
  29398. })
  29399. if (i.resolution.width === -1 || i.resolution.height === -1) {
  29400. var r = this.sceneRenderer.renderer.getSize()
  29401. ;(i.resolution.width = r.width), (i.resolution.height = r.height)
  29402. }
  29403. e.layers.set(x.DEFAULT),
  29404. i.visibleObjects &&
  29405. (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  29406. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  29407. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE))
  29408. var o = i.resolution.width,
  29409. a = i.resolution.height,
  29410. s = o / a
  29411. e.position.copy(this.sceneRenderer.camera.position),
  29412. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  29413. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  29414. (e.projectionMatrix.elements[0] =
  29415. this.player.camera.projectionMatrix.elements[5] / s),
  29416. t.setSize(o, a),
  29417. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t)
  29418. var l = new Uint8Array(o * a * 4)
  29419. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l)
  29420. var c = M.encode(
  29421. {
  29422. data: l,
  29423. width: o,
  29424. height: a,
  29425. heading: 180,
  29426. pitch: 0
  29427. },
  29428. {
  29429. quality: 75,
  29430. flipY: !0
  29431. }
  29432. ),
  29433. h = 'data:image/jpg;base64,' + d.uint8ToBase64(c.data)
  29434. n({
  29435. success: !0,
  29436. message: h
  29437. })
  29438. }
  29439. })(),
  29440. findRankedPano: (function (e, t) {
  29441. var i = new c.Vector3(),
  29442. r = new c.Vector3()
  29443. return function (e, t) {
  29444. s(this.player, r), n(t, r, i)
  29445. var o = this.player.rankedPanoInDirection(e, i)
  29446. if (o) {
  29447. var a = this.objectToHandle[o.id]
  29448. return (
  29449. a ||
  29450. ((this.objectToHandle[o.id] = a = this.handleCount++),
  29451. (this.handleToObject[a] = o)),
  29452. a
  29453. )
  29454. }
  29455. return R.warn('Showcase -> findRankedPano: Unable to find nearby pano.'), -1
  29456. }
  29457. })(),
  29458. findRankedtag: (function (e, t) {
  29459. var i = new c.Vector3(),
  29460. r = new c.Vector3()
  29461. return function (e, t) {
  29462. s(this.player, r), n(t, r, i)
  29463. var o = this.player.rankedtagInDirection(e, i)
  29464. if (o) {
  29465. var a = this.objectToHandle[o.sid]
  29466. return (
  29467. a ||
  29468. ((this.objectToHandle[o.sid] = a = this.handleCount++),
  29469. (this.handleToObject[a] = o)),
  29470. a
  29471. )
  29472. }
  29473. return R.warn('Showcase -> findRankedtag: Unable to find nearby tag.'), -1
  29474. }
  29475. })(),
  29476. clickNearesttag: function (e) {
  29477. this.clickRankedtag(0, e)
  29478. },
  29479. clickRankedtag: function (e, t) {
  29480. var i = a.call(this, e, t)
  29481. i && O.call(this, i)
  29482. },
  29483. clickNearestPano: function (e, t) {
  29484. this.clickRankedPano(0, e, t)
  29485. },
  29486. clickRankedPano: function (e, t, i) {
  29487. var n = o.call(this, e, t)
  29488. n ? r.call(this, n, i) : i(null)
  29489. },
  29490. clickPano: function (e, t) {
  29491. var i = this.handleTable[e]
  29492. i ? r.call(this, i, t) : t(null)
  29493. },
  29494. rotateDirection: (function () {
  29495. return function (e, t) {
  29496. var i = e.direction,
  29497. n = e.angle
  29498. if (!P.active) {
  29499. var r = 0,
  29500. o = 0,
  29501. a = 0,
  29502. s = 0
  29503. if (!n || isNaN(n))
  29504. return (
  29505. R.warn('Showcase -> rotateDirection: Invalid rotation angle.'),
  29506. void (
  29507. t &&
  29508. t({
  29509. success: !1,
  29510. error: 'Invalid rotation angle.'
  29511. })
  29512. )
  29513. )
  29514. if (this.player.mode === E.TRANSITIONING)
  29515. return (
  29516. R.warn('Automation -> rotateDirection: Cannot rotate while transitioning'),
  29517. void (
  29518. t &&
  29519. t({
  29520. success: !1,
  29521. error: 'Cannot rotate while transitioning'
  29522. })
  29523. )
  29524. )
  29525. if (i === v.RIGHT || i === v.LEFT)
  29526. i === v.RIGHT && (n = -n), (r = n > 0 ? -1 : 1), (a = n)
  29527. else {
  29528. if (i !== v.UP && i !== v.DOWN)
  29529. return (
  29530. R.warn('Showcase -> rotateDirection: Invalid direction for rotation: ' + i),
  29531. void (
  29532. t &&
  29533. t({
  29534. success: !1,
  29535. error: 'Invalid direction for rotation.'
  29536. })
  29537. )
  29538. )
  29539. if (this.player.mode === E.FLOORPLAN)
  29540. return (
  29541. R.warn(
  29542. 'Showcase -> rotateDirection: Cannot rotate ' + i + ' in floorplan mode'
  29543. ),
  29544. void (
  29545. t &&
  29546. t({
  29547. success: !1,
  29548. error: 'Cannot rotate ' + i + ' in floorplan mode'
  29549. })
  29550. )
  29551. )
  29552. if ((i === v.DOWN && (n = -n), (n = N.call(this, n)), 0 === n))
  29553. return (
  29554. R.warn(
  29555. 'Showcase -> rotateDirection: Already at maximum rotation in direction: ' +
  29556. i
  29557. ),
  29558. void (
  29559. t &&
  29560. t({
  29561. success: !1,
  29562. error: 'Already at maximum rotation in direction: ' + i
  29563. })
  29564. )
  29565. )
  29566. ;(o = n > 0 ? 1 : -1), (s = n)
  29567. }
  29568. var l = n
  29569. ;(n = c.Math.degToRad(n)), (a = c.Math.degToRad(a)), (s = c.Math.degToRad(s))
  29570. var h = this.controls.activeControl,
  29571. u = function () {
  29572. h.stopRotating(!0),
  29573. t &&
  29574. t({
  29575. success: !0,
  29576. message: 'Rotated ' + l.toFixed(2) + '° in direction: ' + e.direction
  29577. })
  29578. }
  29579. h.startRotating(r, o), P.start(a, s, this.player, u)
  29580. }
  29581. }
  29582. })(),
  29583. rotate: (function () {
  29584. var e = new c.Vector3(),
  29585. t = new c.Vector3()
  29586. return function (i, n) {
  29587. var r = i.xAngle,
  29588. o = i.yAngle
  29589. if (!P.active) {
  29590. if (((r = r || 0), (o = o || 0), isNaN(r) || isNaN(o)))
  29591. return (
  29592. R.warn('Showcase -> rotate: Invalid rotation angle.'),
  29593. void (
  29594. n &&
  29595. n({
  29596. success: !1,
  29597. error: 'Invalid rotation angle.'
  29598. })
  29599. )
  29600. )
  29601. if (this.player.mode === E.TRANSITIONING)
  29602. return (
  29603. R.warn('Automation -> rotate: Cannot rotate while transitioning'),
  29604. void (
  29605. n &&
  29606. n({
  29607. success: !1,
  29608. error: 'Cannot rotate while transitioning'
  29609. })
  29610. )
  29611. )
  29612. Math.abs(r) < 0.01 && (r = 0), Math.abs(o) < 0.01 && (o = 0)
  29613. var a = o
  29614. ;(o = N.call(this, o)), (r = -r)
  29615. var s = a > 0 ? 'UP' : 'DOWN'
  29616. if (!r && a && !o)
  29617. return (
  29618. R.warn('Showcase -> rotate: Already at maximum rotation in direction: ' + s),
  29619. void (
  29620. n &&
  29621. n({
  29622. success: !1,
  29623. error: 'Already at maximum rotation in direction: ' + s
  29624. })
  29625. )
  29626. )
  29627. a > o && R.warn('Showcase -> rotate: Reached maximum rotation in direction: ' + s)
  29628. var l = o
  29629. ;(o = c.Math.degToRad(o)),
  29630. (r = c.Math.degToRad(r)),
  29631. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  29632. this.player.getDirection(e),
  29633. t.copy(e).applyAxisAngle(I.UP, r),
  29634. t.applyAxisAngle(I.RIGHT, o)
  29635. var h = (e.angleTo(t), r > 0 ? -1 : r < 0 ? 1 : 0),
  29636. u = o > 0 ? 1 : o < 0 ? -1 : 0
  29637. Math.abs(r) > Math.abs(o)
  29638. ? (u *= Math.abs(o / r))
  29639. : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o))
  29640. var d = this.controls.activeControl,
  29641. p = function () {
  29642. d.stopRotating(!0),
  29643. n &&
  29644. n({
  29645. success: !0,
  29646. message:
  29647. 'Rotated ' +
  29648. i.xAngle.toFixed(2) +
  29649. '° horizontally, ' +
  29650. l.toFixed(2) +
  29651. '° vertically'
  29652. })
  29653. }
  29654. d.startRotating(h, u), P.start(r, o, this.player, p)
  29655. }
  29656. }
  29657. })(),
  29658. panCamera: function (e, t) {
  29659. function i(e) {
  29660. switch (
  29661. (r.removeAllListeners(T.AutoPanComplete),
  29662. r.removeAllListeners(T.AutoPanInterrupt),
  29663. r.removeAllListeners(T.AutoPanClamped),
  29664. e)
  29665. ) {
  29666. case T.AutoPanInterrupt:
  29667. t({
  29668. success: !0,
  29669. message: 'Camera panning interrupted.'
  29670. })
  29671. break
  29672. case T.AutoPanClamped:
  29673. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  29674. if (
  29675. Math.abs(this.player.position.x - r.autoPanPosition.x) < 0.01 &&
  29676. Math.abs(this.player.position.z - r.autoPanPosition.z) < 0.01
  29677. )
  29678. return void t({
  29679. success: !1,
  29680. error: 'Already at edge of current model bounds.'
  29681. })
  29682. var i = 'The view point is outside the bounds for the current model. '
  29683. ;(i += 'The view point was clamped to ' + o(r.target.x, r.target.z)),
  29684. console.warn(i)
  29685. }
  29686. case T.AutoPanComplete:
  29687. t({
  29688. success: !0,
  29689. message:
  29690. 'Panned camera to position ' + o(r.autoPanPosition.x, r.autoPanPosition.z)
  29691. })
  29692. }
  29693. }
  29694. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  29695. return t({
  29696. success: !1,
  29697. error: 'Camera panning is not available in the current mode: ' + this.player.mode
  29698. })
  29699. var n = e.position,
  29700. r = this.player.control
  29701. r.setAutoPanPosition(n.x, n.z), (r.autoPan = !0)
  29702. var o = function (e, t) {
  29703. return '(' + e.toFixed(2) + ', ' + t.toFixed(2) + ')'
  29704. }
  29705. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  29706. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  29707. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  29708. },
  29709. click: function (e, t) {
  29710. var i = e.x,
  29711. n = e.y,
  29712. r = e.percentage
  29713. r === !0 &&
  29714. ((i = (i / 100) * $('#player').width()), (n = (n / 100) * $('#player').height())),
  29715. this.player.handleInputStart(i, n),
  29716. this.player.updateIntersect(),
  29717. this.player.handleInputEnd(i, n)
  29718. },
  29719. mouseOver: function (e, t) {
  29720. var i = e.x,
  29721. n = e.y,
  29722. r = e.percentage
  29723. r === !0 &&
  29724. ((i = (i / 100) * $('#player').width()), (n = (n / 100) * $('#player').height())),
  29725. this.player.handleInputMove(i, n),
  29726. this.player.updateIntersect()
  29727. },
  29728. moveToMode: function (e, t) {
  29729. function i(e) {
  29730. t(
  29731. e
  29732. ? {
  29733. success: !1,
  29734. error: 'Failed to load new mode: ' + e
  29735. }
  29736. : {
  29737. success: !0,
  29738. message: 'Moved to new mode: ' + n
  29739. }
  29740. )
  29741. }
  29742. var n = e.mode
  29743. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN
  29744. ? this.director.changeMode(n).then(
  29745. function () {
  29746. i()
  29747. },
  29748. function (e) {
  29749. i(e)
  29750. }
  29751. )
  29752. : t({
  29753. success: !1,
  29754. error: 'Invalid mode selection'
  29755. })
  29756. }
  29757. }
  29758. }).call(this, '/js/sdk/automation.js')
  29759. },
  29760. {
  29761. '../constants': 8,
  29762. '../enum/AlignmentType': 17,
  29763. '../enum/ControlEvents': 21,
  29764. '../enum/Direction': 22,
  29765. '../enum/GLCubeFaces': 25,
  29766. '../enum/Keys': 30,
  29767. '../enum/ModelManagerEvents': 33,
  29768. '../enum/PlayerEvents': 40,
  29769. '../enum/RenderLayers': 41,
  29770. '../enum/Vectors': 50,
  29771. '../enum/Viewmode': 51,
  29772. '../enum/WarpStyle': 52,
  29773. '../lib/jpeg_encoder': 94,
  29774. '../sdk/SdkEvents': 161,
  29775. '../settings': 166,
  29776. '../util/common': 185,
  29777. '../util/logger': 189,
  29778. '../util/math': 190,
  29779. '../util/panorama': 191,
  29780. './ApiHost': 159,
  29781. './PostMessageType': 160,
  29782. './TransitionStyles': 162,
  29783. three: 217
  29784. }
  29785. ],
  29786. 165: [
  29787. function (e, t, i) {
  29788. 'use strict'
  29789. function n(e) {
  29790. ;(this.sourceWindow = e),
  29791. (this.targetWindow = null),
  29792. (this.targetOrigin = null),
  29793. (this.id = Math.floor(1e5 * Math.random())),
  29794. this.bindEvents()
  29795. }
  29796. var r = e('./PostMessageType'),
  29797. o = e('events').EventEmitter
  29798. ;(n.prototype = Object.create(o.prototype)),
  29799. (n.prototype.bindEvents = function () {
  29800. this.sourceWindow.addEventListener('message', this.onPostmessageReceived.bind(this))
  29801. }),
  29802. (n.prototype.setTarget = function (e, t) {
  29803. ;(this.targetWindow = e), (this.targetOrigin = t)
  29804. }),
  29805. (n.prototype.onPostmessageReceived = function (e) {
  29806. var t = e.origin || e.originalEvent.origin,
  29807. i = e.source
  29808. switch (e.data.type) {
  29809. case r.CONNECT:
  29810. break
  29811. case r.RESPONSE:
  29812. if (this.id !== e.data.toId) return
  29813. default:
  29814. if (!this.validateMessageOrigin(t)) return
  29815. }
  29816. var n = e.data
  29817. ;(n.source = i), (n.origin = t), (n.timestamp = Date.now()), this.emit(e.data.type, n)
  29818. }),
  29819. (n.prototype.validateMessageOrigin = function (e) {
  29820. return '*' === this.targetOrigin || e === this.targetOrigin
  29821. }),
  29822. (n.prototype.send = function (e) {
  29823. this.targetWindow &&
  29824. this.targetOrigin &&
  29825. ((e.fromId = this.id), this.targetWindow.postMessage(e, this.targetOrigin))
  29826. }),
  29827. (t.exports = n)
  29828. },
  29829. {
  29830. './PostMessageType': 160,
  29831. events: 202
  29832. }
  29833. ],
  29834. 166: [
  29835. function (e, t, i) {
  29836. 'use strict'
  29837. var n = e('three'),
  29838. r = e('./util/browser'),
  29839. o = e('./enum/Viewmode'),
  29840. a = e('./enum/VROption'),
  29841. s = e('./enum/Colors'),
  29842. l = e('./enum/WarpStyle'),
  29843. c = e('./util/easing'),
  29844. h = e('./util/common'),
  29845. u = e('./util/showcase'),
  29846. d = e('./constants'),
  29847. p = {
  29848. debug: !1,
  29849. version: '2.25.6-0-gd87e5b1',
  29850. languageTag: r.valueFromHash('lang', null),
  29851. pageTitle: '四维虚拟漫游',
  29852. authorizationHeader: u.getAuthorizationHeader(),
  29853. autoplay: r.valueFromHash('play', !1) || !r.inIframe(),
  29854. logLevel: r.valueFromHash('log', 2),
  29855. skyboxRadius: 2500,
  29856. modelBoundsPadding: 5,
  29857. showNeighbors: !1,
  29858. brand: r.valueFromHash('brand', !0),
  29859. showHighlights: r.valueFromHash('hhl', !0) && r.valueFromHash('hr', 1),
  29860. startHighlights: r.valueFromHash('hl', -1),
  29861. specialEdition: r.valueFromHash('bn', 0),
  29862. useWheel: r.valueFromHash('wh', !0),
  29863. crossOrigin: 'anonymous',
  29864. fancierTransition: !1,
  29865. wireframe: !1,
  29866. skyboxWireframe: !1,
  29867. modelAlpha: 1,
  29868. highlightPanoSelection: !1,
  29869. showSweeps: !0,
  29870. showSkyboxes: !1,
  29871. showMesh: !0,
  29872. showFloors: !1,
  29873. showFloorDuration: 300,
  29874. showFloorDelay: 300,
  29875. hideFloorDuration: 300,
  29876. hideFloorDelay: 0,
  29877. reticuleOpacityTransitionTime: 250,
  29878. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  29879. markerOpacityTransitionTime: 500,
  29880. guiAnimationSpeed: 250,
  29881. highlightAnimationDuration: 500,
  29882. modelComponentLoadSpinnerDelay: 150,
  29883. captureErrors: !1,
  29884. maxMobileTextures: 6,
  29885. minimalMemoryMode: r.valueFromHash('m3', r.isMobile()),
  29886. startupFlyinDelay: 3e3,
  29887. dollhouseDefault: {
  29888. minDistance: 15,
  29889. maxDistance: 50,
  29890. minPolarAngle: n.Math.degToRad(10),
  29891. maxPolarAngle: n.Math.degToRad(90)
  29892. },
  29893. hideReticuleTimeout: 1e3,
  29894. analytics: {
  29895. inactivityThreshold: 30,
  29896. sessionTrackingRate: 0.15,
  29897. maxTrackedErrors: 20,
  29898. sessionDurationPingFrequency: 10,
  29899. sessionDurationTimeout: 15
  29900. },
  29901. flydown: {
  29902. movementEasing: 'easeInOutQuad',
  29903. movementDelay: 0.001,
  29904. rotationEasing: 'easeInOutQuad',
  29905. rotationDelay: 0.5,
  29906. modelTextureDelay: 0.75,
  29907. skyboxDelay: 0.75
  29908. },
  29909. transition: {
  29910. flySpeed: 0.001,
  29911. flyTime: 750,
  29912. flytimeMaxDistanceThreshold: 5,
  29913. flytimeDistanceMultiplier: 150,
  29914. aimTime: 1500,
  29915. aimSlowFactor: 1.5,
  29916. blur: 0.8,
  29917. movementEasing: 'easeInOutQuad',
  29918. blendEasing: 'easeInOutQuad',
  29919. fastForwardFactor: 4 //r.valueFromHash("mfis", 3) //快速停止导览的速度,原先是3
  29920. },
  29921. show360Views: {
  29922. enabled: !0,
  29923. transitionTime: 1e3
  29924. },
  29925. quickstart: {
  29926. enabled: 1 === r.valueFromHash('qust', 0) || 1 === r.valueFromHash('qs', 0),
  29927. animation: 1400,
  29928. showTextDelay: 500,
  29929. fadeOutDelay: 3e3,
  29930. fovChange: 10
  29931. },
  29932. appConfig: {
  29933. webvr_version: null,
  29934. segment_key: null,
  29935. embedly_key: null,
  29936. branch_key: null,
  29937. keen_write_key: null,
  29938. keen_project_id: null
  29939. },
  29940. vr: {
  29941. enabled: !0,
  29942. allowWebVR: !1,
  29943. option: r.valueFromHash('vr', a.CONTEXTUAL)
  29944. },
  29945. share: {
  29946. enabled: !r.valueFromHash('mls', 0) && r.valueFromHash('brand', !0)
  29947. },
  29948. input: {
  29949. longTapThreshold: 200,
  29950. moveToleranceNDC: 0.01, //.08,
  29951. touchMoveThreshold: 25
  29952. },
  29953. help: {
  29954. modalStayDuration: 600
  29955. },
  29956. immersive: {
  29957. timeToShowAgain: 1250,
  29958. uiStayDuration: 600
  29959. },
  29960. tourInteraction: {
  29961. disabled: '0' === r.valueFromHash('tourcta', null),
  29962. showPauseButton: 1e3,
  29963. showModal: 1500,
  29964. allowNextClick: 200,
  29965. largeModal: '1' === r.valueFromHash('tourcta', null),
  29966. smallModal: '2' === r.valueFromHash('tourcta', null)
  29967. },
  29968. labels: {
  29969. enabled: !1,
  29970. hideUntilStart: !0,
  29971. fadeInDuration: 250,
  29972. fadeInDelay: 250,
  29973. fadeOutDuration: 250,
  29974. fadeOutDelay: 0,
  29975. zoomHideThreshhold: {
  29976. mobile: r.isSmallScreen() ? 0.45 : 0.6,
  29977. desktop: 2
  29978. },
  29979. zoomTruncateThreshhold: {
  29980. mobile: r.isSmallScreen() ? 0.35 : 0.45,
  29981. desktop: 0.85
  29982. },
  29983. minLengthForTruncate: 16,
  29984. truncateLength: 12,
  29985. truncateSuffix: '...'
  29986. },
  29987. tags: {
  29988. enabled: r.valueFromHash('mt', 1),
  29989. startup: {
  29990. hideUntilStart: !0,
  29991. fadeInDuration: 500,
  29992. fadeInDelay: 100
  29993. },
  29994. visibility: {
  29995. anyDistance: !0,
  29996. visibleDistance: 8,
  29997. cameraClearance: 0.1,
  29998. alphaTestLevel: 0.05,
  29999. hideViaFloor: !0,
  30000. hideOffScreenDisc: !1,
  30001. hideOffScreenObject: !1
  30002. },
  30003. disc: {
  30004. opacity: 1,
  30005. disabledOpacity: 0.5,
  30006. scale: {
  30007. nearBound: 1.5,
  30008. farBound: 4.8,
  30009. linkFarBound: !1,
  30010. linkPercent: 40,
  30011. maxSize: 80,
  30012. minSize: 40,
  30013. baseViewportSize: 800,
  30014. responsiveness: 100
  30015. }
  30016. },
  30017. pole: {
  30018. enabled: !0,
  30019. height: 0.5,
  30020. width: 2,
  30021. opacity: 0.5,
  30022. color: 'white'
  30023. },
  30024. navigate: {
  30025. nearestPano: !0,
  30026. lineOfSight: !0,
  30027. reactivate: !0,
  30028. aimAt: 'disc',
  30029. tiltTolerance: 25,
  30030. rotateSpeedFactor: 0.6
  30031. }
  30032. },
  30033. path: {
  30034. color: window.DATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  30035. colorUp: s._desat(s.newBlue, 0.5),
  30036. colorDown: s._darken(s.newBlue, 0.35),
  30037. opacity: 0.5,
  30038. style: 'ribbon',
  30039. height: 0.025,
  30040. ribbonWidth: 0.24,
  30041. outsideHeight: 0.5,
  30042. waypointRadius: 0.5,
  30043. waypointIndoorRadius: 0.24,
  30044. waypointPulse: 1e3,
  30045. typ: l.BLACK,
  30046. meshFree: r.valueFromHash('mf', 1),
  30047. mapGuides: r.valueFromHash('guides', !0),
  30048. fadeInTime: 400,
  30049. fadeOutTime: 300
  30050. },
  30051. warp: {
  30052. nearPanoDist: 0.1,
  30053. matchCam: !1,
  30054. blur: 0.33,
  30055. fastTime: 1500,
  30056. teleportTime: 1500, //瞬间过渡的时间
  30057. flytimeDistanceMultiplier: 150, //add
  30058. flyTime: 750, //add
  30059. outsideTime: 2e3,
  30060. lookAheadMax: 0.3,
  30061. lookAheadDist: 2.5,
  30062. softPushDist: 0.37,
  30063. softPushEnd: 0.3,
  30064. softBendAngle: 8,
  30065. softBendTilt: 4,
  30066. softBendEnd: 0.3,
  30067. doBurns: true, //r.valueFromHash("kb", !0),
  30068. burnsAngle: 8, //导览在每个点停留时的旋转角度
  30069. minBurnsAngle: 35,
  30070. minDownAngle: -35,
  30071. maxTurnPerSec: 280,
  30072. maxAimPerSec: 35,
  30073. minRotation: 12,
  30074. maxAimRotation: 33.2,
  30075. turnFriction: 0.2,
  30076. flySpeed: 0.01,
  30077. minWarpTime: 1200,
  30078. warpInterruptionRedirectTime: 500,
  30079. tourStepDelay: r.valueFromHash('st', 0),
  30080. walkDelay: 0,
  30081. walkMaxDist: 50,
  30082. walkMinDist: 0.8,
  30083. walkSlideShowThreshhold: 3000,
  30084. walkExtraPanosDistance: 0.4,
  30085. timePerMeter: 1200,
  30086. motionLeadTime: 5000,
  30087. movementEasing: 'easeInOutQuad',
  30088. blendEasing: 'easeInOutQuad',
  30089. showBunny: !1,
  30090. loop: r.valueFromHash('lp', !1),
  30091. auto: r.valueFromHash('ts', -1),
  30092. eOrder: 'YXZ', //"YXZ",
  30093. stepFactor: 0.25,
  30094. brakeStrength: 2,
  30095. minBrakeAngle: 0.1,
  30096. maxBrakeAngle: 1.8,
  30097. climbEffort: 4
  30098. },
  30099. rotationFriction: 0.05,
  30100. rotationAccelerationInside: 4.5,
  30101. rotationAccelerationOutside: 0.15,
  30102. rotationAfterMoveMultiplier: 40,
  30103. rotationAfterMoveHistoryCount: 5,
  30104. panFriction: 0.09,
  30105. panAccelerationOutside: 60,
  30106. onload: r.valueFromHash('onload', o.PANORAMA),
  30107. zoomNearLimit: 0.1,
  30108. zoomFarLimit: 50,
  30109. navigation: {
  30110. panoScores: !1,
  30111. mouseDirection: !0,
  30112. filterStrictness: 0.75,
  30113. angleFactor: -30,
  30114. directionFactor: 10,
  30115. distanceFactor: -1,
  30116. optionalityFactor: 3
  30117. },
  30118. sdkInit: !1,
  30119. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  30120. console: r.valueFromHash('console', !1),
  30121. noMeshFloorPositionOffset: new n.Vector3(0, -1.2, 0),
  30122. panoramaNeighbourMaxDistance: 5,
  30123. panoFloorClickRadius: 0.35,
  30124. showScreenshotLocations: !1,
  30125. showAxis: !1,
  30126. showNeighbourRaycasts: !1,
  30127. colorMarkerOnLoad: !1,
  30128. colorMarkerByFloor: !1,
  30129. tiling: {
  30130. panoPreRenderRepeatDelay: 2500,
  30131. panoPreRenderDelay: 500,
  30132. preRenderTourPanos: r.valueFromHash('tileprerender', 0),
  30133. tilingFlagNames: ['usetiles', 'tiles'],
  30134. maxNavPanoQuality: r.valueFromHash('maxtileq', null),
  30135. maxZoomPanoQuality: r.valueFromHash('maxztileq', null),
  30136. overlayStyle: r.valueFromHash('tileoverlay', 0),
  30137. uploadIntervalDelay: r.valueFromHash('tileupdelay', 10),
  30138. initialIntervalDelay: r.valueFromHash('itiledelay', 0),
  30139. maxNonBaseUploadsPerFrame: r.valueFromHash('maxnbtpf', 1 /* 2 */),
  30140. maxBaseUploadsPerFrame: r.valueFromHash('maxbtpf', 6),
  30141. customCompression: r.valueFromHash('tilecustcomp', 0),
  30142. // mobileHighQualityOverride: !1,
  30143. mobileHighQualityOverride: 1,
  30144. allowUltraHighResolution: true
  30145. },
  30146. zoom: {
  30147. enabled: true,
  30148. forceOff: r.valueFromHash('nozoom', 0),
  30149. overridemax: r.valueFromHash('maxzoom', null),
  30150. overridemin: r.valueFromHash('minzoom', null),
  30151. max: d.highQualityMaxZoom,
  30152. min: 1,
  30153. transitionStyle: r.valueFromHash('zoomtrans', 1),
  30154. activationThreshold: 1.1,
  30155. restoreTime: 500
  30156. },
  30157. profiling: {
  30158. enabled: r.valueFromHash('mem', !1)
  30159. }
  30160. }
  30161. ;(p = h.deepExtend(p, d, {
  30162. insideFOV: r.valueFromHash('fov', d.insideFOV),
  30163. insideFOVMax: r.valueFromHash('fovmax', d.insideFOVMax),
  30164. panorama: {
  30165. transitionTime: 1e3,
  30166. modelAlpha: 0,
  30167. modelAlphaDelay: p.flydown.modelTextureDelay,
  30168. modelAlphaLength: 1,
  30169. skyboxOpacity: 1,
  30170. skyboxOpacityDelay: p.flydown.skyboxDelay,
  30171. skyboxOpacityLength: 0.9,
  30172. fovLength: 1,
  30173. fovDelay: 0,
  30174. cameraMatrixDuration: 0.8,
  30175. cameraMatrixDelay: 0,
  30176. cameraMatrixEase: c.easeInCubic,
  30177. reticuleOpacity: 1,
  30178. markerOpacity: 0.3,
  30179. markerOpacityOnHover: 1
  30180. },
  30181. dollhouse: {
  30182. transitionTime: 1e3,
  30183. modelAlpha: 1,
  30184. modelAlphaDelay: 0,
  30185. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  30186. skyboxOpacity: 0,
  30187. skyboxOpacityDelay: 0,
  30188. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  30189. fovLength: 1,
  30190. fovDelay: 0,
  30191. cameraMatrixDuration: 0.8,
  30192. cameraMatrixDelay: 0.3,
  30193. cameraMatrixEase: c.easeInCubic,
  30194. reticuleOpacity: 1,
  30195. markerOpacity: 0,
  30196. markerOpacityOnHover: 0
  30197. },
  30198. floorplan: {
  30199. transitionTime: 1e3,
  30200. modelAlpha: 1,
  30201. modelAlphaDelay: 0,
  30202. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  30203. skyboxOpacity: 0,
  30204. skyboxOpacityDelay: 0,
  30205. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  30206. fovLength: 1,
  30207. fovDelay: 0,
  30208. cameraMatrixDuration: 0.5,
  30209. cameraMatrixDelay: 0,
  30210. cameraMatrixEase: c.easeOutCubic,
  30211. reticuleOpacity: 1,
  30212. markerOpacity: 0,
  30213. markerOpacityOnHover: 0,
  30214. cameraHeight: 50
  30215. },
  30216. transitioning: {
  30217. reticuleOpacity: 0,
  30218. markerOpacity: 0.3,
  30219. markerOpacityOnHover: 1
  30220. },
  30221. 'floorplan-dollhouse': {
  30222. rotationDelay: 0,
  30223. rotationDuration: 1
  30224. },
  30225. 'floorplan-panorama': {
  30226. rotationDelay: 0.5,
  30227. rotationDuration: 1
  30228. },
  30229. 'dollhouse-panorama': {
  30230. rotationDelay: 0.5,
  30231. rotationDuration: 1
  30232. },
  30233. 'dollhouse-floorplan': {
  30234. rotationDelay: 0,
  30235. rotationDuration: 1,
  30236. cameraMatrixDuration: 1.05,
  30237. cameraMatrixDelay: 0.5
  30238. },
  30239. 'panorama-dollhouse': {
  30240. rotationDelay: 0,
  30241. rotationDuration: 0.5
  30242. },
  30243. 'panorama-floorplan': {
  30244. transitionTime: 1500,
  30245. rotationDelay: 0,
  30246. rotationDuration: 0.5
  30247. }
  30248. })),
  30249. p.path.meshFree && (p.path.typ = l.WALK),
  30250. (p.zoom.max = p.zoom.overridemax || p.zoom.max),
  30251. (p.zoom.min = p.zoom.overridemin || p.zoom.min),
  30252. (window._settings = t.exports = p)
  30253. },
  30254. {
  30255. './constants': 8,
  30256. './enum/Colors': 19,
  30257. './enum/VROption': 47,
  30258. './enum/Viewmode': 51,
  30259. './enum/WarpStyle': 52,
  30260. './util/browser': 182,
  30261. './util/common': 185,
  30262. './util/easing': 186,
  30263. './util/showcase': 193,
  30264. three: 217
  30265. }
  30266. ],
  30267. 167: [
  30268. function (e, t, i) {
  30269. 'use strict'
  30270. var n = e('three'),
  30271. r = e('./settings'),
  30272. o =
  30273. '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',
  30274. a =
  30275. 'precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n'
  30276. t.exports = {
  30277. basicTextured: {
  30278. uniforms: {
  30279. tDiffuse: {
  30280. type: 't',
  30281. value: null
  30282. },
  30283. alpha: {
  30284. type: 'f',
  30285. value: 1
  30286. }
  30287. },
  30288. vertexShader:
  30289. 'varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  30290. fragmentShader:
  30291. '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}'
  30292. },
  30293. copyCubeMap: {
  30294. uniforms: {
  30295. tDiffuse: {
  30296. type: 't',
  30297. value: null
  30298. },
  30299. alpha: {
  30300. type: 'f',
  30301. value: 1
  30302. }
  30303. },
  30304. vertexShader:
  30305. 'varying vec3 vWorldPos;\nvoid main() {\n vWorldPos = vec3(-position.x, -position.y, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  30306. fragmentShader:
  30307. '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}'
  30308. },
  30309. cube: {
  30310. uniforms: {
  30311. map: {
  30312. type: 't',
  30313. value: null
  30314. },
  30315. opacity: {
  30316. type: 'f',
  30317. value: 1
  30318. }
  30319. },
  30320. vertexShader:
  30321. o +
  30322. 'varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n',
  30323. fragmentShader:
  30324. a +
  30325. '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'
  30326. },
  30327. model: {
  30328. uniforms: {
  30329. map: {
  30330. type: 't',
  30331. value: null
  30332. },
  30333. modelAlpha: {
  30334. type: 'f',
  30335. value: r.modelAlpha
  30336. },
  30337. opacity: {
  30338. type: 'f',
  30339. value: 1
  30340. },
  30341. progress: {
  30342. type: 'f',
  30343. value: 0
  30344. },
  30345. blackout: {
  30346. type: 'i',
  30347. value: 0
  30348. },
  30349. pano0Map: {
  30350. type: 't',
  30351. value: null
  30352. },
  30353. pano0Position: {
  30354. type: 'v3',
  30355. value: new n.Vector3()
  30356. },
  30357. pano0Matrix: {
  30358. type: 'm4',
  30359. value: new n.Matrix4()
  30360. },
  30361. pano1Map: {
  30362. type: 't',
  30363. value: null
  30364. },
  30365. pano1Position: {
  30366. type: 'v3',
  30367. value: new n.Vector3()
  30368. },
  30369. pano1Matrix: {
  30370. type: 'm4',
  30371. value: new n.Matrix4()
  30372. }
  30373. },
  30374. vertexShader:
  30375. o +
  30376. `uniform vec3 pano0Position;
  30377. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  30378. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  30379. varying vec3 vWorldPosition0;
  30380. varying vec3 vWorldPosition1;
  30381. uniform int blackout;
  30382. void main() {
  30383. vUv = uv;
  30384. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  30385. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  30386. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  30387. vWorldPosition0.x *= -1.0;
  30388. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  30389. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  30390. vWorldPosition1.x *= -1.0;
  30391. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  30392. }`,
  30393. fragmentShader:
  30394. a +
  30395. `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  30396. uniform 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\n
  30397. void main() {
  30398. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  30399. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  30400. vec4 colorFromPanos;
  30401. if (blackout == 5){//add for TransitionPass
  30402. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  30403. }else{
  30404. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  30405. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  30406. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  30407. else if (blackout == 1) {
  30408. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  30409. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  30410. }
  30411. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  30412. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  30413. }
  30414. //#ifdef useModelMap //起不了作用为啥
  30415. if(modelAlpha>0.0){
  30416. vec4 colorFromTexture = texture2D( map, vUv );
  30417. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  30418. }
  30419. //#endif
  30420. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  30421. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  30422. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  30423. }`
  30424. },
  30425. hot: {
  30426. uniforms: {
  30427. color: {
  30428. type: 'c',
  30429. value: new n.Color(0xff2200)
  30430. },
  30431. opac: {
  30432. type: 'f',
  30433. value: 0
  30434. },
  30435. texture1: {
  30436. type: 't',
  30437. value: null
  30438. },
  30439. texture2: {
  30440. type: 't',
  30441. value: null
  30442. }
  30443. },
  30444. vertexShader:
  30445. 'varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n',
  30446. fragmentShader:
  30447. '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'
  30448. },
  30449. modelOutside: {
  30450. uniforms: {
  30451. map: {
  30452. type: 't',
  30453. value: null
  30454. },
  30455. opacity: {
  30456. type: 'f',
  30457. value: 1
  30458. }
  30459. },
  30460. vertexShader:
  30461. o +
  30462. 'varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n',
  30463. fragmentShader:
  30464. a +
  30465. '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'
  30466. },
  30467. ribbon: {
  30468. uniforms: {
  30469. map: {
  30470. type: 't',
  30471. value: null
  30472. },
  30473. opacity: {
  30474. type: 'f',
  30475. value: 1
  30476. },
  30477. color: {
  30478. type: 'c',
  30479. value: new n.Color(r.path.color)
  30480. }
  30481. },
  30482. vertexShader:
  30483. o +
  30484. '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',
  30485. fragmentShader:
  30486. a +
  30487. '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'
  30488. },
  30489. waypoint: {
  30490. uniforms: {
  30491. map: {
  30492. type: 't',
  30493. value: null
  30494. },
  30495. opacity: {
  30496. type: 'f',
  30497. value: 1
  30498. },
  30499. pulse: {
  30500. type: 'f',
  30501. value: 1
  30502. },
  30503. nearFade: {
  30504. type: 'v2',
  30505. value: new n.Vector2(2 * r.insideNear, 2 * r.path.waypointIndoorRadius)
  30506. },
  30507. color: {
  30508. type: 'c',
  30509. value: new n.Color(r.reticuleColor)
  30510. }
  30511. },
  30512. vertexShader:
  30513. o +
  30514. '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',
  30515. fragmentShader:
  30516. a +
  30517. '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'
  30518. },
  30519. modelDebug: {
  30520. uniforms: {
  30521. map: {
  30522. type: 't',
  30523. value: null
  30524. },
  30525. modelAlpha: {
  30526. type: 'f',
  30527. value: r.modelAlpha
  30528. },
  30529. depthmapRatio: {
  30530. type: 'f',
  30531. value: 0
  30532. },
  30533. opacity: {
  30534. type: 'f',
  30535. value: 1
  30536. },
  30537. progress: {
  30538. type: 'f',
  30539. value: 0
  30540. },
  30541. considerOcclusion: {
  30542. type: 'i',
  30543. value: r.fancierTransition
  30544. },
  30545. highlightPanoSelection: {
  30546. type: 'i',
  30547. value: 0
  30548. },
  30549. useThirdPano: {
  30550. type: 'i',
  30551. value: r.useThirdPano
  30552. },
  30553. pano0Map: {
  30554. type: 't',
  30555. value: null
  30556. },
  30557. pano0Depth: {
  30558. type: 't',
  30559. value: null
  30560. },
  30561. pano0Position: {
  30562. type: 'v3',
  30563. value: new n.Vector3()
  30564. },
  30565. pano0Matrix: {
  30566. type: 'm4',
  30567. value: new n.Matrix4()
  30568. },
  30569. pano0Weight: {
  30570. type: 'f',
  30571. value: r.transition.pano0Weight
  30572. },
  30573. pano1Map: {
  30574. type: 't',
  30575. value: null
  30576. },
  30577. pano1Depth: {
  30578. type: 't',
  30579. value: null
  30580. },
  30581. pano1Position: {
  30582. type: 'v3',
  30583. value: new n.Vector3()
  30584. },
  30585. pano1Matrix: {
  30586. type: 'm4',
  30587. value: new n.Matrix4()
  30588. },
  30589. pano1Weight: {
  30590. type: 'f',
  30591. value: r.transition.pano1Weight
  30592. },
  30593. pano2Map: {
  30594. type: 't',
  30595. value: null
  30596. },
  30597. pano2Depth: {
  30598. type: 't',
  30599. value: null
  30600. },
  30601. pano2Position: {
  30602. type: 'v3',
  30603. value: new n.Vector3()
  30604. },
  30605. pano2Matrix: {
  30606. type: 'm4',
  30607. value: new n.Matrix4()
  30608. },
  30609. pano2Weight: {
  30610. type: 'f',
  30611. value: r.transition.pano2Weight
  30612. }
  30613. },
  30614. vertexShader:
  30615. o +
  30616. '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',
  30617. fragmentShader:
  30618. a +
  30619. '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'
  30620. },
  30621. customDepth: {
  30622. uniforms: {
  30623. panoPosition: {
  30624. type: 'v3',
  30625. value: new n.Vector3()
  30626. }
  30627. },
  30628. vertexShader:
  30629. o +
  30630. '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',
  30631. fragmentShader:
  30632. a +
  30633. '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'
  30634. },
  30635. skysphere: {
  30636. uniforms: {
  30637. radius: {
  30638. type: 'f',
  30639. value: 0
  30640. }
  30641. },
  30642. vertexShader:
  30643. o +
  30644. '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',
  30645. fragmentShader:
  30646. a +
  30647. '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'
  30648. },
  30649. tagDisc: {
  30650. uniforms: {
  30651. opacity: {
  30652. type: 'f',
  30653. value: 0
  30654. },
  30655. color: {
  30656. type: 'c',
  30657. value: new n.Color()
  30658. },
  30659. bg: {
  30660. type: 't',
  30661. value: null
  30662. },
  30663. mask: {
  30664. type: 't',
  30665. value: null
  30666. }
  30667. },
  30668. vertexShader:
  30669. o +
  30670. 'varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  30671. fragmentShader:
  30672. a +
  30673. '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'
  30674. }
  30675. }
  30676. },
  30677. {
  30678. './settings': 166,
  30679. three: 217
  30680. }
  30681. ],
  30682. 168: [
  30683. function (e, t, i) {
  30684. ;(function (i) {
  30685. 'use strict'
  30686. var n = e('three'),
  30687. r = (e('url'), e('./util/ajax')),
  30688. o = e('./settings'),
  30689. a = e('./util/logger'),
  30690. s = e('./util/math'),
  30691. l = e('./util/showcase'),
  30692. c = e('./objects/Panorama'),
  30693. h = new a(i),
  30694. u = e('./model/Model'),
  30695. d = e('./shaders'),
  30696. p = e('./util/transitions'),
  30697. f = e('./objects/Chunk'),
  30698. g = e('./objects/Reticule'),
  30699. m = e('./objects/Skybox'),
  30700. v = e('./objects/Floor'),
  30701. A = e('./cameras/DollhouseCamera'),
  30702. y = e('./cameras/FloorplanCamera'),
  30703. C = e('./cameras/PanoramaCamera'),
  30704. I = e('./controls/DollhouseControls'),
  30705. E = e('./controls/FloorplanControls'),
  30706. b = e('./controls/PanoramaControls')
  30707. ;(n.ImageUtils.crossOrigin = o.crossOrigin),
  30708. (t.exports = {
  30709. shaders: d,
  30710. transitions: p,
  30711. Model: u,
  30712. Chunk: f,
  30713. Floor: v,
  30714. Skybox: m,
  30715. Reticule: g,
  30716. Panorama: c,
  30717. DollhouseCamera: A,
  30718. FloorplanCamera: y,
  30719. PanoramaCamera: C,
  30720. DollhouseControls: I,
  30721. FloorplanControls: E,
  30722. PanoramaControls: b,
  30723. getModel: function (e) {
  30724. if (!e.url) throw 'getModel(): missing parameter "url"'
  30725. e.autoload = void 0 === e.autoload || e.autoload
  30726. var t = l.parseSidUrl(e.url)
  30727. ;(e.urlBase = t.urlBase), (e.urlModel = t.urlModel), (e.urlFiles = t.urlFiles)
  30728. var i = this._getPlatformError()
  30729. return i
  30730. ? $.Deferred().reject(i).promise()
  30731. : ((this.options = e), this._loadModel().then(this._buildModel.bind(this)))
  30732. },
  30733. _getPlatformError: function () {
  30734. return 'IE' === $.ua.browser.name && parseInt($.ua.browser.major) < 11
  30735. ? 'webgl-unsupported'
  30736. : 'iOS' === $.ua.os.name && /^[0-7][$\.]/.test($.ua.os.version)
  30737. ? 'webgl-ios'
  30738. : Modernizr.webgl
  30739. ? null
  30740. : 'webgl-unsupported'
  30741. },
  30742. _loadModel: function () {
  30743. return r
  30744. .get(this.options.urlModel, {
  30745. responseType: 'json',
  30746. prefetchFrom: 'model',
  30747. auth: l.getAuthorizationHeader()
  30748. })
  30749. .then(null, function () {
  30750. return h.warn('Model loading failed at initial metadata load'), 'loading-failed'
  30751. })
  30752. },
  30753. _buildModel: function (e) {
  30754. e = l.normalizeModeldata(e, s)
  30755. var t = new u(this.options, e)
  30756. return this.options.autoload ? t.load(!0) : $.when(t)
  30757. }
  30758. })
  30759. }).call(this, '/js/showcase.js')
  30760. },
  30761. {
  30762. './cameras/DollhouseCamera': 5,
  30763. './cameras/FloorplanCamera': 6,
  30764. './cameras/PanoramaCamera': 7,
  30765. './controls/DollhouseControls': 10,
  30766. './controls/FloorplanControls': 11,
  30767. './controls/PanoramaControls': 13,
  30768. './model/Model': 139,
  30769. './objects/Chunk': 144,
  30770. './objects/Floor': 146,
  30771. './objects/Panorama': 148,
  30772. './objects/Reticule': 149,
  30773. './objects/Skybox': 152,
  30774. './settings': 166,
  30775. './shaders': 167,
  30776. './util/ajax': 181,
  30777. './util/logger': 189,
  30778. './util/math': 190,
  30779. './util/showcase': 193,
  30780. './util/transitions': 195,
  30781. three: 217,
  30782. url: 208
  30783. }
  30784. ],
  30785. 169: [
  30786. function (e, t, i) {
  30787. 'use strict'
  30788. function n() {
  30789. var e = {
  30790. renderTarget: null,
  30791. inUse: !1,
  30792. size: -1,
  30793. pano: null
  30794. }
  30795. return e
  30796. }
  30797. function r(e) {
  30798. M.push(e)
  30799. }
  30800. function o(e) {
  30801. var t = n()
  30802. return (t.inUse = !0), (t.size = e), r(t), t
  30803. }
  30804. function a(e) {
  30805. for (var t = 0; t < M.length; t++) {
  30806. var i = M[t]
  30807. if (!i.inUse && i.size === e) return (i.inUse = !0), i
  30808. }
  30809. return null
  30810. }
  30811. function s(e) {
  30812. for (var t = 0; t < M.length; t++) {
  30813. var i = M[t]
  30814. if (i.renderTarget === e) return (i.inUse = !1), !0
  30815. }
  30816. return !1
  30817. }
  30818. function l() {
  30819. ;(this.tileDirectory = {}),
  30820. (this.activeRenderTargetDescriptors = {}),
  30821. (this.activePanos = []),
  30822. (this.panoLODDescriptors = {}),
  30823. (this.panoDescriptors = {}),
  30824. (this.tileTrees = {}),
  30825. (this.sceneRenderer = null),
  30826. (this.tileDownloader = null),
  30827. (this.forceQueue = []),
  30828. (this.uploadQueues = {}),
  30829. (this.uploadInterval = null),
  30830. (this.uploadIntervalCancelled = !1),
  30831. (this.usingTileOverlay = !1),
  30832. (this.overlayTilesLoaded = !1),
  30833. (this.overlayTileBase = null),
  30834. (this.overlayTilesBasic = {}),
  30835. (this.overlayTilesEnhanced = {}),
  30836. (this.zoomRenderTarget = null),
  30837. (this.zoomPano = null),
  30838. (this.zoomingActive = !1),
  30839. (this.zoomPanoId = null),
  30840. (this.zoomPanoRenderingDisabled = !1),
  30841. (this.direction = new h.Vector3()),
  30842. (this.initTime = -1),
  30843. (this.maxBaseUploadsPerFrame = x),
  30844. (this.maxNonBaseUploadsPerFrame = T)
  30845. }
  30846. function c() {
  30847. this.uploadIntervalCancelled ||
  30848. (this.overlayTilesLoaded || !this.usingTileOverlay
  30849. ? ((b = !0),
  30850. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  30851. this.peekNextFromUploadQueue()
  30852. ? this.refreshUploadInterval(w)
  30853. : (this.uploadInterval = null))
  30854. : this.refreshUploadInterval(this.uploadIntervalDelay))
  30855. }
  30856. /* function c() {
  30857. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  30858. this.updateUploadQueue(1, 2),
  30859. w = 18,
  30860. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  30861. } */
  30862. var h = e('three'),
  30863. u = e('../exception/BasicException'),
  30864. d = e('../settings'),
  30865. p = e('../enum/PanoSizeClass'),
  30866. f = (e('../objects/Panorama'), e('../enum/PanoRendererEvents')),
  30867. g = e('../enum/SceneRendererEvents'),
  30868. m = e('../enum/TileDownloaderEvents'),
  30869. v = e('../enum/Vectors'),
  30870. A = (e('../enum/GLCubeFaces'), e('../objects/Panorama'), e('./TileTree')),
  30871. y = (e('./TileDownloader'), e('./TilePrioritizer')),
  30872. C = e('./TileUtils'),
  30873. p = e('../enum/PanoSizeClass'),
  30874. I = (e('../util/browser'), e('../util/panorama')),
  30875. E = e('events').EventEmitter,
  30876. b = !1,
  30877. w = d.tiling.uploadIntervalDelay,
  30878. _ = d.tiling.initialIntervalDelay,
  30879. T = d.tiling.maxNonBaseUploadsPerFrame,
  30880. x = d.tiling.maxBaseUploadsPerFrame,
  30881. S = {
  30882. Base: 0,
  30883. Remaining: 1
  30884. },
  30885. M = []
  30886. window.targetList = M
  30887. ;(l.prototype = Object.create(E.prototype)),
  30888. (l.prototype.init = function (e, t, i) {
  30889. ;(this.sceneRenderer = e),
  30890. (this.tileDownloader = t),
  30891. (this.qualityManager = i),
  30892. this.bindEvents(),
  30893. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  30894. (this.initTime = performance.now())
  30895. }),
  30896. (l.prototype.getActivePanoTextures = function (e) {
  30897. e = e || []
  30898. for (var t = 0; t < M.length; t++) {
  30899. var i = M[t]
  30900. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  30901. }
  30902. }),
  30903. (l.prototype.hasQueuedTiles = function () {
  30904. var e = this.peekNextFromUploadQueue()
  30905. return null !== e && void 0 !== e
  30906. }),
  30907. (l.prototype.getActiveRenderTargetDescriptor = function (e) {
  30908. return this.activeRenderTargetDescriptors[e]
  30909. }),
  30910. (l.prototype.setActiveRenderTargetDescriptor = function (e, t) {
  30911. this.activeRenderTargetDescriptors[e] = t
  30912. }),
  30913. (l.prototype.loadOverlayTiles = function () {
  30914. if (0 !== d.tiling.overlayStyle) {
  30915. var e = 0,
  30916. t = function (t, n, r) {
  30917. ;(t = n
  30918. ? (t[n] = this.sceneRenderer.initSizedTexture2D(
  30919. C.TILE_SIZE,
  30920. h.ClampToEdgeWrapping
  30921. ))
  30922. : (this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(
  30923. C.TILE_SIZE,
  30924. h.ClampToEdgeWrapping
  30925. ))),
  30926. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  30927. e++,
  30928. e === i.length && (this.overlayTilesLoaded = !0)
  30929. }.bind(this),
  30930. i = [
  30931. ['images/outlineBase.png', t.bind(this, this.overlayTileBase, null)],
  30932. ['images/outlineBasic512.png', t.bind(this, this.overlayTilesBasic, 256)],
  30933. ['images/outlineBasic512.png', t.bind(this, this.overlayTilesBasic, 512)],
  30934. ['images/outlineBasic1024.png', t.bind(this, this.overlayTilesBasic, 1024)],
  30935. ['images/outlineBasic2048.png', t.bind(this, this.overlayTilesBasic, 2048)],
  30936. ['images/outlineBasic4096.png', t.bind(this, this.overlayTilesBasic, 4096)],
  30937. ['images/outlineEnhanced512.png', t.bind(this, this.overlayTilesEnhanced, 256)],
  30938. ['images/outlineEnhanced512.png', t.bind(this, this.overlayTilesEnhanced, 512)],
  30939. ['images/outlineEnhanced1024.png', t.bind(this, this.overlayTilesEnhanced, 1024)],
  30940. ['images/outlineEnhanced2048.png', t.bind(this, this.overlayTilesEnhanced, 2048)],
  30941. ['images/outlineEnhanced4096.png', t.bind(this, this.overlayTilesEnhanced, 4096)]
  30942. ]
  30943. i.forEach(
  30944. function (e) {
  30945. this.tileDownloader.loadImage(e[0], 0, e[1])
  30946. }.bind(this)
  30947. ),
  30948. (this.usingTileOverlay = !0)
  30949. } else this.usingTileOverlay = !1
  30950. }),
  30951. (l.prototype.bindEvents = function () {
  30952. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  30953. }),
  30954. (l.prototype.setupZoomRenderTarget = (function () {
  30955. var targets = {}
  30956. return function () {
  30957. if (
  30958. this.qualityManager.maxRenderTargetSize == '2k' &&
  30959. this.qualityManager.getMaxNavPanoSize() == '2k'
  30960. )
  30961. return //不使用zoomTarget 直接用pano的tiledPanoRenderTarget,防崩溃
  30962. if (
  30963. this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()
  30964. ) {
  30965. if (
  30966. this.zoomRenderTarget &&
  30967. this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize()
  30968. )
  30969. return
  30970. var e = this.zoomRenderTarget
  30971. var size = this.qualityManager.getMaxZoomPanoSize()
  30972. if (size > this.qualityManager.maxRenderTargetSize) {
  30973. return
  30974. }
  30975. if (targets[size]) {
  30976. this.zoomRenderTarget = targets[size]
  30977. } else {
  30978. this.zoomRenderTarget = this.initTiledPano(size, true) //放大后不使用抗锯齿,否则消耗更多内存
  30979. targets[size] = this.zoomRenderTarget
  30980. }
  30981. if (e) {
  30982. //将旧的zoomRenderTarget渲染到新zoomRenderTarget上
  30983. var t = e.width,
  30984. i = this.zoomRenderTarget.width
  30985. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  30986. e.texture.dispose(),
  30987. (e.texture.loaded = !1),
  30988. (e.texture.version = 0),
  30989. this.sceneRenderer.deallocateCubeTexture(e.texture),
  30990. (e.texture = null)
  30991. }
  30992. this.zoomPanoRenderingDisabled = !1
  30993. } else this.zoomPanoRenderingDisabled = !0
  30994. }
  30995. })()),
  30996. (l.prototype.enableHighQuality = function (e) {
  30997. //xzw add 如果最多只要2k图的话enableUltraHighQualityMode替换成这个
  30998. if (!this.qualityManager.highQualityModeStarted) {
  30999. this.setupZoomRenderTarget()
  31000. e()
  31001. this.qualityManager.highQualityModeStarted = true
  31002. }
  31003. }),
  31004. (l.prototype.enableUltraHighQualityMode = function (e) {
  31005. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  31006. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH)
  31007. this.tileDownloader.testDownload(
  31008. t,
  31009. C.TILE_SIZE,
  31010. function (t) {
  31011. t &&
  31012. (this.qualityManager.enableUltraHighQualityMode(),
  31013. this.setupZoomRenderTarget(),
  31014. e())
  31015. }.bind(this)
  31016. )
  31017. }
  31018. }),
  31019. (l.prototype.activateTiledPano = function (e, t, i) {
  31020. i && this.clearAllQueuedUploads()
  31021. for (var n = 0; n < C.FACES_PER_PANO; n++)
  31022. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize())
  31023. this.linkAllTilesAndNodes(e)
  31024. var r = this.getActiveRenderTargetDescriptor(e.id),
  31025. l = t
  31026. if (
  31027. (l > this.qualityManager.getMaxNavPanoSize() &&
  31028. (l = this.qualityManager.getMaxNavPanoSize()),
  31029. !r || l !== r.size)
  31030. ) {
  31031. if ((r && s(r.renderTarget), (r = a(l)), !r)) {
  31032. var c = this.initTiledPano(l, !browser.isMobile() /* !1 */)
  31033. ;(r = o(c.width)), (r.renderTarget = c)
  31034. }
  31035. ;(r.pano = e),
  31036. this.resetPanoDescriptor(e.id),
  31037. this.resetPanoLODDescriptors(e.id),
  31038. this.resetRenderStatus(e.id, !0, !0)
  31039. }
  31040. this.setActiveRenderTargetDescriptor(e.id, r)
  31041. var h = i ? 0 : 1
  31042. return this.updateActivePanos(e, h), r.renderTarget
  31043. }),
  31044. (l.prototype.deactivateTiledPano = function (e) {
  31045. var t = this.getActiveRenderTargetDescriptor(e.id)
  31046. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  31047. this.setActiveRenderTargetDescriptor(e.id, null)
  31048. var i = this.getUploadQueueForPano(e.id)
  31049. this.clearUploadQueue(i), this.updateActivePanos()
  31050. }),
  31051. (l.prototype.updateActivePanos = (function () {
  31052. var e = []
  31053. return function (t, i) {
  31054. e.length = 0
  31055. for (var n = 0; n < this.activePanos.length; n++) {
  31056. t && e.length === i && e.push(t)
  31057. var r = this.activePanos[n],
  31058. o = this.getActiveRenderTargetDescriptor(r.id)
  31059. ;(t && r.id === t.id) || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  31060. }
  31061. t && i >= e.length && e.push(t),
  31062. (this.activePanos.length = 0),
  31063. this.activePanos.push.apply(this.activePanos, e)
  31064. }
  31065. })()),
  31066. (l.prototype.getActivePanoCount = function () {
  31067. return this.activePanos.length
  31068. }),
  31069. (l.prototype.resetRenderStatus = function (e, t, i, n) {
  31070. var r = null
  31071. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1)
  31072. for (
  31073. var o = function (e, n, r, o) {
  31074. i && (n.tile.zoomUploaded = !1), t && (n.tile.uploaded = !1)
  31075. },
  31076. a = 0;
  31077. a < C.FACES_PER_PANO;
  31078. a++
  31079. ) {
  31080. var s = this.getTileTree(e, a)
  31081. s.breadthFirst({
  31082. callback: o.bind(this, a),
  31083. minLevel: r
  31084. })
  31085. }
  31086. }),
  31087. (l.prototype.copyBaseRenderStatusToZoomed = function (e) {
  31088. for (
  31089. var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()),
  31090. i = function (e, t, i, n) {
  31091. ;(t.tile.zoomUploaded = t.tile.uploaded), (t.zoomCovered = t.covered)
  31092. },
  31093. n = 0;
  31094. n < C.FACES_PER_PANO;
  31095. n++
  31096. ) {
  31097. var r = this.getTileTree(e, n)
  31098. r.breadthFirst({
  31099. callback: i.bind(this, n),
  31100. maxLevel: t
  31101. })
  31102. }
  31103. }),
  31104. (l.prototype.renderPanoTiles = (function () {
  31105. var e = []
  31106. return function (t, i, n, r) {
  31107. ;(this.zoomRenderTarget &&
  31108. this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize()) ||
  31109. this.zoomPanoRenderingDisabled ||
  31110. this.setupZoomRenderTarget(),
  31111. (i = i || this.direction || v.FORWARD)
  31112. var o = this.getActiveRenderTargetDescriptor(t)
  31113. if (!this.isRenderTargetDescriptorValid(o))
  31114. throw new u(
  31115. 'PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.'
  31116. )
  31117. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  31118. var s = this.getTileTree(t, a)
  31119. ;(e.length = 0),
  31120. s.breadthFirst({
  31121. saveVisited: e
  31122. })
  31123. for (var l = 0; l < e.length; l++) {
  31124. var c = e[l]
  31125. this.queueTileUpload(c.tile, !1, r || (0 === l && n))
  31126. }
  31127. }
  31128. this.updateDirection(i)
  31129. }
  31130. })()),
  31131. (l.prototype.isRenderTargetDescriptorValid = function (e) {
  31132. return e && e.renderTarget
  31133. }),
  31134. (l.prototype.isPanoActive = function (e) {
  31135. var t = this.getActiveRenderTargetDescriptor(e)
  31136. return this.isRenderTargetDescriptorValid(t)
  31137. }),
  31138. (l.prototype.isPanoZoomed = function (e) {
  31139. return this.zoomingActive && this.zoomPanoId === e
  31140. }),
  31141. (l.prototype.initTileTree = function (e, t, i) {
  31142. var n = this.tileTrees[e]
  31143. n || ((n = []), (this.tileTrees[e] = n))
  31144. var r = n[t]
  31145. if (!r) {
  31146. var o = A.getLevelCountForSize(C.TILE_SIZE, i)
  31147. ;(r = new A(C.TILE_SIZE, o)), (n[t] = r)
  31148. }
  31149. }),
  31150. (l.prototype.getTileTree = function (e, t) {
  31151. var i = this.tileTrees[e]
  31152. if (!i) throw new u('PanoRenderer.getTileTree() -> Tree array not yet initialized!')
  31153. var n = i[t]
  31154. if (!n) throw new u('PanoRenderer.getTileTree() -> Tree not yet initialized!')
  31155. return n
  31156. }),
  31157. (l.prototype.initTiledPano = function (e, antialias) {
  31158. var i = this.sceneRenderer.renderer,
  31159. n =
  31160. (i.context,
  31161. new h.WebGLRenderTargetCube(e, e, {
  31162. stencilBuffer: !1
  31163. })),
  31164. r = new h.CubeTexture([])
  31165. ;(n.texture = r),
  31166. (r.image = [null, null, null, null, null, null]),
  31167. (r.flipY = !0),
  31168. //antialias: 如果抗锯齿的话,采用mipmap,会增加一倍的存储消耗。原版本都是不抗锯齿的。但是抗锯齿效果更柔和
  31169. antialias
  31170. ? ((r.generateMipmaps = !0),
  31171. (r.magFilter = h.LinearFilter),
  31172. (r.minFilter = h.LinearMipMapLinearFilter))
  31173. : ((r.generateMipmaps = !1),
  31174. (r.magFilter = h.LinearFilter),
  31175. (r.minFilter = h.LinearFilter)),
  31176. (r.format = h.RGBAFormat),
  31177. i.setRenderTarget(n),
  31178. i.setRenderTarget(null)
  31179. var o = i.properties.get(r)
  31180. return (o.__image__webglTextureCube = o.__webglTexture), n
  31181. }),
  31182. (l.prototype.getUploadQueueForPano = function (e) {
  31183. var t = this.uploadQueues[e]
  31184. return t || ((t = []), (this.uploadQueues[e] = t)), t
  31185. }),
  31186. (l.prototype.isTileUploaded = function (e) {
  31187. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  31188. }),
  31189. (l.prototype.setUploaded = function (e, t) {
  31190. this.isPanoZoomed(e.panoId) ? (e.zoomUploaded = t) : (e.uploaded = t)
  31191. }),
  31192. (l.prototype.queueTileUpload = function (e, t, i) {
  31193. var n = this.getActiveRenderTargetDescriptor(e.panoId)
  31194. if (
  31195. this.isRenderTargetDescriptorValid(n) &&
  31196. e.downloaded &&
  31197. !this.isTileUploaded(e) &&
  31198. (!e.uploadQueued || i) &&
  31199. (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)
  31200. ) {
  31201. var r = this.getUploadQueueForPano(e.panoId)
  31202. i
  31203. ? this.uploadTile(e, !1)
  31204. : (this.shoulPushToFrontOfQueue(e)
  31205. ? this.forceQueue.push(e)
  31206. : t && this.direction
  31207. ? y.insertSortedPanoTile(r, e, n.pano, this.direction)
  31208. : r.push(e),
  31209. (e.uploadQueued = !0),
  31210. this.uploadInterval ||
  31211. this.uploadIntervalCancelled ||
  31212. this.refreshUploadInterval(0))
  31213. }
  31214. }),
  31215. (l.prototype.shoulPushToFrontOfQueue = function (e) {
  31216. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  31217. }),
  31218. (l.prototype.getTopUploadQueue = function () {
  31219. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  31220. for (var n = 0; n < this.activePanos.length; n++)
  31221. if (
  31222. ((e = this.activePanos[n]), (t = this.getUploadQueueForPano(e.id)), t.length > 0)
  31223. )
  31224. switch (i) {
  31225. case S.Base:
  31226. if (0 === t[0].level) return t
  31227. break
  31228. case S.Remaining:
  31229. return t
  31230. }
  31231. return null
  31232. }),
  31233. (l.prototype.getNextFromUploadQueue = (function () {
  31234. var e = function (e) {
  31235. var t = e.shift()
  31236. return (t.uploadQueued = !1), t
  31237. }
  31238. return function () {
  31239. if (this.forceQueue.length > 0) return e(this.forceQueue)
  31240. var t = this.getTopUploadQueue()
  31241. return t && t.length > 0 ? e(t) : null
  31242. }
  31243. })()),
  31244. (l.prototype.peekNextFromUploadQueue = function () {
  31245. if (this.forceQueue.length > 0) return this.forceQueue[0]
  31246. var e = this.getTopUploadQueue()
  31247. return e && e.length > 0 ? e[0] : null
  31248. }),
  31249. (l.prototype.clearAllQueuedUploads = function () {
  31250. this.clearAllUploadQueues(null, 0)
  31251. }),
  31252. (l.prototype.clearAllQueuedUploadsForPano = function (e) {
  31253. this.clearAllUploadQueues(e, 0)
  31254. }),
  31255. (l.prototype.clearAllUploadQueues = function (e, t) {
  31256. if (e)
  31257. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  31258. this.clearUploadQueue(this.forceQueue, t, e)
  31259. else {
  31260. for (var i = 0; i < this.activePanos.length; i++) {
  31261. var n = this.activePanos[i]
  31262. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  31263. }
  31264. this.clearUploadQueue(this.forceQueue, t)
  31265. }
  31266. }),
  31267. (l.prototype.clearUploadQueue = function (e, t, i) {
  31268. ;(void 0 !== t && null !== t) || (t = 0)
  31269. for (var n = 0; n < e.length; ) {
  31270. var r = e[n]
  31271. ;(!i || (i && i === r.tile.panoId)) && r.level >= t
  31272. ? ((r.uploadQueued = !1), e.splice(n, 1))
  31273. : n++
  31274. }
  31275. }),
  31276. (l.prototype.refreshUploadInterval = (function () {
  31277. var e = null
  31278. return function (t) {
  31279. this.uploadIntervalCancelled ||
  31280. (e || (e = c.bind(this)),
  31281. (null !== t && void 0 !== t) || (t = w),
  31282. b || (t = _),
  31283. (this.uploadInterval = window.setTimeout(e, t)),
  31284. (this.uploadIntervalDelay = t))
  31285. }
  31286. })()),
  31287. (l.prototype.update = (function () {
  31288. var e = performance.now(),
  31289. t = 0
  31290. return function () {
  31291. ;(this.uploadIntervalCancelled = !0),
  31292. window.clearTimeout(this.uploadInterval),
  31293. (this.uploadInterval = null)
  31294. var i = performance.now() - e
  31295. !(i > w || 0 === t) ||
  31296. (!this.overlayTilesLoaded && this.usingTileOverlay) ||
  31297. (this.updateUploadQueue(
  31298. this.maxNonBaseUploadsPerFrame,
  31299. this.maxBaseUploadsPerFrame
  31300. ),
  31301. (e = performance.now())),
  31302. t++
  31303. }
  31304. })()),
  31305. (l.prototype.updateUploadQueue = function (e, t) {
  31306. e || (e = 1)
  31307. for (var i = 0, n = 0; ; ) {
  31308. if (n >= t || i >= e) break
  31309. var r = this.getNextFromUploadQueue()
  31310. if (!r) break
  31311. if (
  31312. (0 !== r.level ? i++ : n++,
  31313. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)
  31314. ) {
  31315. var o = this.getActiveRenderTargetDescriptor(r.panoId)
  31316. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  31317. }
  31318. }
  31319. }),
  31320. (l.prototype.updateDirection = function (e) {
  31321. if ((e = e || this.direction)) {
  31322. this.direction = e
  31323. for (var t = 0; t < this.activePanos.length; t++) {
  31324. var i = this.activePanos[t],
  31325. n = this.getUploadQueueForPano(i.id)
  31326. y.sortPanoTiles(n, i, this.direction)
  31327. }
  31328. }
  31329. }),
  31330. (l.prototype.uploadTile = (function () {
  31331. var e = {},
  31332. t = (new h.Vector4(), d.tiling.overlayStyle)
  31333. //var failHistory = {};
  31334. return function (i, n) {
  31335. var r = i.panoId,
  31336. o = i.image,
  31337. a = i.tileSize,
  31338. s = i.panoSize,
  31339. l = i.tileIndex,
  31340. c = (i.faceTileIndex, i.totalTiles),
  31341. u = (i.face, i.tileX),
  31342. d = i.tileY,
  31343. p = !0,
  31344. g = !1,
  31345. m = (this.getPanoDescriptor(r), this.getPanoLODDescriptor(r, s)),
  31346. v = this.getActiveRenderTargetDescriptor(r),
  31347. A = v.renderTarget,
  31348. y = v.size
  31349. if (
  31350. (this.isPanoZoomed(r) && ((A = this.zoomRenderTarget), (y = A.width)), //this.qualityManager.getMaxZoomPanoSize()),
  31351. this.isRenderTargetDescriptorValid(v) || ((p = !1), (g = !1)),
  31352. n ||
  31353. (this.anyUploaded(i.node) && ((p = !1), (g = !0)),
  31354. this.isTileUploaded(i) && ((p = !1), (g = !1))),
  31355. p)
  31356. ) {
  31357. /* if(failHistory[''+r+s+l]){
  31358. console.log('uploadTile retry', r, s, l)
  31359. }
  31360. console.log('uploadTile 成功', r, s, l)
  31361. */
  31362. var C = u * a,
  31363. I = d * a,
  31364. E = (a / s) * y,
  31365. b = (C / s) * y,
  31366. w = (I / s) * y
  31367. if (s > this.qualityManager.maxRenderTargetSize) {
  31368. player.model.getHighImage(o, i.cubeFace, u, d)
  31369. } else {
  31370. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping))
  31371. var _ = e[a]
  31372. this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a)
  31373. if (1 === t || 2 === t) {
  31374. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced
  31375. this.sceneRenderer.renderToCubeMap(
  31376. _,
  31377. A,
  31378. a,
  31379. a,
  31380. 0,
  31381. 0,
  31382. a,
  31383. a,
  31384. b,
  31385. w,
  31386. E,
  31387. E,
  31388. i.cubeFace
  31389. ),
  31390. this.sceneRenderer.renderToCubeMap(
  31391. T[s],
  31392. A,
  31393. a,
  31394. a,
  31395. 0,
  31396. 0,
  31397. a,
  31398. a,
  31399. b,
  31400. w,
  31401. E,
  31402. E,
  31403. i.cubeFace,
  31404. h.NormalBlending,
  31405. !0,
  31406. 0.5
  31407. )
  31408. } else
  31409. this.sceneRenderer.renderToCubeMap(
  31410. _,
  31411. A,
  31412. a,
  31413. a,
  31414. 0,
  31415. 0,
  31416. a,
  31417. a,
  31418. b,
  31419. w,
  31420. E,
  31421. E,
  31422. i.cubeFace
  31423. )
  31424. }
  31425. m.uploadCount++,
  31426. this.emit(f.TileRenderSuccess, r, s, l, c),
  31427. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  31428. this.setUploaded(i, !0),
  31429. this.addCoverageForNode(i.node)
  31430. } else {
  31431. this.setUploaded(i, !1)
  31432. //console.log('uploadTile 失败', r, s, l)
  31433. //failHistory[''+r+s+l] = true;
  31434. }
  31435. return (
  31436. i.uploadAttempted ||
  31437. (m.uploadAttempts++, this.emit(f.TileUploadAttempted, r, s, l, c)),
  31438. (i.uploadAttempted = !0),
  31439. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  31440. g
  31441. )
  31442. }
  31443. })()),
  31444. (l.prototype.linkTileAndNode = function (e, t) {
  31445. ;(t.tile = e), (e.node = t)
  31446. }),
  31447. (l.prototype.linkAllTilesAndNodes = function (e) {
  31448. for (
  31449. var t = function (t, i, n, r, o) {
  31450. var a = this.getTileDirectoryEntry(e.id, i, r, o)
  31451. this.linkTileAndNode(a, n)
  31452. },
  31453. i = 0;
  31454. i < C.FACES_PER_PANO;
  31455. i++
  31456. ) {
  31457. var n = this.getTileTree(e.id, i)
  31458. n.breadthFirst({
  31459. callback: t.bind(this, n, i)
  31460. })
  31461. }
  31462. }),
  31463. (l.prototype.anyUploaded = function (e) {
  31464. if (!e) return !1
  31465. if (e.tile && this.isTileUploaded(e.tile)) return !0
  31466. if (e.children)
  31467. for (var t = 0; t < e.children.length; t++) {
  31468. var i = e.children[t]
  31469. if (this.anyUploaded(i)) return !0
  31470. }
  31471. return !1
  31472. }),
  31473. (l.prototype.setNodeCovered = function (e, t) {
  31474. this.isPanoZoomed(e.tile.panoId) ? (e.zoomCovered = t) : (e.covered = t)
  31475. }),
  31476. (l.prototype.isNodeCovered = function (e) {
  31477. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  31478. }),
  31479. (l.prototype.addCoverageForNode = function (e) {
  31480. if ((this.setNodeCovered(e, !0), e.parent && e.covered)) {
  31481. var t = e.parent
  31482. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  31483. }
  31484. }),
  31485. (l.prototype.calcFullCoverage = function (e) {
  31486. var t = !1
  31487. if (e.children)
  31488. for (var i = 0; i < e.children.length; i++) {
  31489. var n = e.children[i]
  31490. t = t || this.calcFullCoverage(n)
  31491. }
  31492. e.covered = e.tile.uploaded || t
  31493. }),
  31494. (l.prototype.nodeSubcovered = function (e) {
  31495. if (!e.children) return !1
  31496. for (var t = 0; t < e.children.length; t++)
  31497. if (!e.children[t] || !this.isNodeCovered(e.children[t])) return !1
  31498. return !0
  31499. }),
  31500. (l.prototype.resetPanoDescriptor = function (e) {
  31501. this.getPanoDescriptor(e)
  31502. }),
  31503. (l.prototype.getPanoDescriptor = function (e) {
  31504. var t = this.panoDescriptors[e]
  31505. return t || ((t = {}), (this.panoDescriptors[e] = t)), t
  31506. }),
  31507. (l.prototype.resetPanoLODDescriptors = function (e) {
  31508. var t = this.getPanoLODDescriptors(e)
  31509. for (var i in t)
  31510. if (t.hasOwnProperty(i)) {
  31511. var n = t[i]
  31512. ;(n.uploadCount = 0), (n.uploadAttempts = 0)
  31513. }
  31514. }),
  31515. (l.prototype.getPanoLODDescriptor = function (e, t) {
  31516. var i = this.getPanoLODDescriptors(e),
  31517. n = i[t]
  31518. return (
  31519. n ||
  31520. ((n = {
  31521. uploadCount: 0,
  31522. uploadAttempts: 0
  31523. }),
  31524. (i[t] = n)),
  31525. n
  31526. )
  31527. }),
  31528. (l.prototype.getPanoLODDescriptors = function (e) {
  31529. var t = this.panoLODDescriptors[e]
  31530. return t || ((t = {}), (this.panoLODDescriptors[e] = t)), t
  31531. }),
  31532. (l.prototype.onTileDownloaded = function (e) {
  31533. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize),
  31534. i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex)
  31535. if (
  31536. ((i.downloaded = !0),
  31537. (i.image = e.image),
  31538. (i.panoSize = e.panoSize),
  31539. (i.tileX = e.tileX),
  31540. (i.tileY = e.tileY),
  31541. (i.totalTiles = e.totalTiles),
  31542. (i.tileIndex = e.tileIndex),
  31543. (i.faceTileIndex = e.faceTileIndex),
  31544. (i.face = e.face),
  31545. (i.cubeFace = I.mapFaceToCubemapFace(e.face)),
  31546. (i.panoId = e.panoId),
  31547. (i.tileSize = e.tileSize),
  31548. (i.direction = new h.Vector3().copy(e.direction)),
  31549. (i.node = null),
  31550. (i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize)),
  31551. this.isPanoActive(i.panoId))
  31552. ) {
  31553. var n = this.getTileTree(i.panoId, i.face),
  31554. r = n.getSubNode(i.panoSize, i.tileX, i.tileY)
  31555. this.linkTileAndNode(i, r), this.queueTileUpload(i, !0)
  31556. }
  31557. }),
  31558. (l.prototype.getTileDirectoryEntry = function (e, t, i, n) {
  31559. var r = this.tileDirectory[e]
  31560. r || ((r = {}), (this.tileDirectory[e] = r))
  31561. var o = 16384 * t + 1024 * i + n,
  31562. a = r[o]
  31563. return (
  31564. a ||
  31565. ((a = {
  31566. downloaded: !1,
  31567. uploaded: !1,
  31568. zoomUploaded: !1
  31569. }),
  31570. (r[o] = a)),
  31571. (a._key = e + ':' + t + ':' + i + ':' + n),
  31572. (a._tileKey = o),
  31573. a
  31574. )
  31575. }),
  31576. (l.prototype.setZoomingActive = function (e, t, i) {
  31577. this.zoomPanoRenderingDisabled ||
  31578. (e === this.zoomingActive && this.zoomPanoId === t.id) ||
  31579. ((this.zoomingActive = e),
  31580. (this.zoomPanoId = t.id),
  31581. this.zoomingActive &&
  31582. (this.zoomPanoId !== t.id || i) &&
  31583. this.updateZoomedPanoFromBase(t))
  31584. }),
  31585. (l.prototype.updateZoomedPanoFromBase = function (e) {
  31586. if (!this.zoomPanoRenderingDisabled) {
  31587. var t = this.getActiveRenderTargetDescriptor(e.id)
  31588. if (t && t.renderTarget) {
  31589. var i = Math.min(
  31590. this.qualityManager.maxRenderTargetSize,
  31591. this.qualityManager.getMaxZoomPanoSize()
  31592. ), //this.qualityManager.getMaxZoomPanoSize()
  31593. n = t.renderTarget,
  31594. r = t.size
  31595. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  31596. this.copyBaseRenderStatusToZoomed(e.id)
  31597. }
  31598. }
  31599. }),
  31600. (t.exports = l)
  31601. },
  31602. {
  31603. '../enum/GLCubeFaces': 25,
  31604. '../enum/PanoRendererEvents': 35,
  31605. '../enum/PanoSizeClass': 36,
  31606. '../enum/SceneRendererEvents': 43,
  31607. '../enum/TileDownloaderEvents': 45,
  31608. '../enum/Vectors': 50,
  31609. '../exception/BasicException': 55,
  31610. '../objects/Panorama': 148,
  31611. '../settings': 166,
  31612. '../util/browser': 182,
  31613. '../util/panorama': 191,
  31614. './TileDownloader': 171,
  31615. './TilePrioritizer': 172,
  31616. './TileTree': 173,
  31617. './TileUtils': 174,
  31618. events: 202,
  31619. three: 217
  31620. }
  31621. ],
  31622. 170: [
  31623. function (e, t, i) {
  31624. 'use strict'
  31625. function n(e, t, i) {
  31626. ;(this.maxNavPanoSize = -1),
  31627. (this.maxZoomPanoSize = -1),
  31628. (this.devicePixelDensity = e),
  31629. (this.deviceScreenSize = t),
  31630. (this.clientBandwidth = i),
  31631. (this.panoSizeClassMap = {}),
  31632. (this.useHighResolutionPanos = !0),
  31633. (this.useUltraHighResolutionPanos = !1),
  31634. (this.modelHasUltraHighPanos = !1)
  31635. this.maxRenderTargetSize = a.isMobile() ? 2048 : 4096 //add
  31636. }
  31637. var r = e('../enum/PanoSizeClass'),
  31638. o = e('../settings'),
  31639. a = e('../util/browser'),
  31640. s = e('../constants'),
  31641. l = e('../util/showcase'),
  31642. c = e('../enum/ModelManagerEvents')
  31643. ;(n.prototype.init = function (e) {
  31644. this.buildPanoSizeClassMap(
  31645. this.devicePixelDensity,
  31646. this.deviceScreenSize,
  31647. this.clientBandwidth
  31648. ),
  31649. (this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH)),
  31650. (this.highSize = this.getPanoSize(r.HIGH)),
  31651. (this.standardSize = this.getPanoSize(r.STANDARD)),
  31652. (this.baseSize = this.getPanoSize(r.BASE)),
  31653. o.tiling.maxZoomPanoQuality &&
  31654. this.ultraHighSize <= o.tiling.maxZoomPanoQuality &&
  31655. (o.tiling.allowUltraHighResolution = !0),
  31656. (this.highQualityThreshold = a.valueFromHash(
  31657. 'threshold2k',
  31658. s.windowHeightHighQualityThreshold
  31659. )),
  31660. this.updateMaximums(),
  31661. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  31662. }),
  31663. (n.prototype.updateFromModel = function (e) {
  31664. this.updateHighResolutionSettings(e), this.updateUltraHighResolutionSettings(e)
  31665. }),
  31666. (n.prototype.updateHighResolutionSettings = function (e) {
  31667. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  31668. l.modelDataPromisesTiles(e.data)
  31669. ? (this.useHighResolutionPanos = !0)
  31670. : (this.useHighResolutionPanos = !1),
  31671. //this.useHighResolutionPanos = !0;
  31672. //----------------------e n d -----------------------------------------------------------------
  31673. this.updateMaximums()
  31674. }),
  31675. (n.prototype.updateUltraHighResolutionSettings = function (e) {
  31676. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos
  31677. ? (this.useUltraHighResolutionPanos = !0)
  31678. : (this.useUltraHighResolutionPanos = !1),
  31679. this.updateMaximums()
  31680. }),
  31681. (n.prototype.enableUltraHighQualityMode = function () {
  31682. ;(this.modelHasUltraHighPanos = !0), this.updateUltraHighResolutionSettings(null)
  31683. }),
  31684. (n.prototype.ultraHighQualityModeEnabled = function () {
  31685. return this.modelHasUltraHighPanos
  31686. }),
  31687. (n.prototype.onModelChanged = function (e) {
  31688. this.updateFromModel(e.model), this.updateMaximums()
  31689. }),
  31690. (n.prototype.updateMaximums = function () {
  31691. ;(this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize()),
  31692. (this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize()),
  31693. this.maxZoomPanoSize < this.maxNavPanoSize &&
  31694. (this.maxNavPanoSize = this.maxZoomPanoSize)
  31695. }),
  31696. (n.prototype.buildPanoSizeClassMap = function () {
  31697. ;(this.panoSizeClassMap[r.BASE] = 512),
  31698. (this.panoSizeClassMap[r.STANDARD] = 1024),
  31699. (this.panoSizeClassMap[r.HIGH] = 2048),
  31700. (this.panoSizeClassMap[r.ULTRAHIGH] = 4096)
  31701. }),
  31702. (n.prototype.getPanoSize = function (e) {
  31703. return this.panoSizeClassMap[e]
  31704. }),
  31705. (n.prototype.getMaxPossiblePanoSize = function () {
  31706. return this.getPanoSize(r.ULTRAHIGH)
  31707. }),
  31708. (n.prototype.getMaxPanoSize = function () {
  31709. return this.maxZoomPanoSize
  31710. }),
  31711. (n.prototype.getMaxNavPanoSize = function () {
  31712. return this.maxNavPanoSize
  31713. }),
  31714. (n.prototype.getMaxZoomPanoSize = function () {
  31715. return this.maxZoomPanoSize
  31716. }),
  31717. /* n.prototype.detectMaxNavPanoSizeClass = function() {
  31718. if(settings.mobileNavHigh)return r.HIGH //改
  31719. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  31720. } */
  31721. (n.prototype.detectDevice = function () {
  31722. //add
  31723. if (a.isMobile()) {
  31724. let area = $('#player').width() * $('#player').height()
  31725. if (area < 768 * 1024) {
  31726. //ipad mini full screen 大场景拍的质量很好默认不需要很高清
  31727. return 'mobile'
  31728. } else {
  31729. return 'bigMobile'
  31730. }
  31731. } else {
  31732. return 'pc'
  31733. }
  31734. })
  31735. ;(n.prototype.detectMaxNavPanoSizeClass = function () {
  31736. //xzw 改
  31737. switch (this.getNavZoomClass()) {
  31738. case '1k':
  31739. return r.STANDARD
  31740. break
  31741. case '2k':
  31742. default:
  31743. return r.HIGH
  31744. case '4k':
  31745. return r.ULTRAHIGH
  31746. }
  31747. }),
  31748. (n.prototype.detectMaxNavPanoSize = function () {
  31749. var e = this.detectMaxNavPanoSizeClass()
  31750. return this.getPanoSize(e)
  31751. }),
  31752. (n.prototype.getMaxZoomClass = function () {
  31753. //add
  31754. let type = this.detectDevice()
  31755. let setting = settings.tileClass[type] //见manage.js的settings
  31756. return setting.max
  31757. })
  31758. ;(n.prototype.getNavZoomClass = function () {
  31759. //add
  31760. let type = this.detectDevice()
  31761. let setting = settings.tileClass[type]
  31762. return setting.nav
  31763. }),
  31764. (n.prototype.detectMaxZoomPanoSize = function () {
  31765. //获取当前zoomRenderTarget应下载的最高级别
  31766. //若是有三个级别,每次只需要加载到当前的zoomLevel;而两级时因为有zoomed来判断是使用基本贴图还是zoomRenderTarget,所以只需要返回最大的即可
  31767. if (this.zoomLevelResolution) {
  31768. //有三个级别
  31769. if (this.zoomLevelResolution == '4k' && this.useUltraHighResolutionPanos) {
  31770. return this.getPanoSize(r.ULTRAHIGH)
  31771. } else if (this.zoomLevelResolution == '1k' || !this.useHighResolutionPanos) {
  31772. return this.getPanoSize(r.STANDARD)
  31773. } else {
  31774. return this.getPanoSize(r.HIGH)
  31775. }
  31776. } else {
  31777. let tileClass = this.getMaxZoomClass()
  31778. if (tileClass == '1k') return this.getPanoSize(r.STANDARD)
  31779. if (tileClass == '4k' && this.useUltraHighResolutionPanos) {
  31780. return this.getPanoSize(r.ULTRAHIGH)
  31781. } else {
  31782. //'2k'
  31783. return this.getPanoSize(r.HIGH)
  31784. }
  31785. }
  31786. }),
  31787. /* n.prototype.detectMaxZoomPanoSize = function() {
  31788. 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)
  31789. } */
  31790. (t.exports = n)
  31791. },
  31792. {
  31793. '../constants': 8,
  31794. '../enum/ModelManagerEvents': 33,
  31795. '../enum/PanoSizeClass': 36,
  31796. '../settings': 166,
  31797. '../util/browser': 182,
  31798. '../util/showcase': 193
  31799. }
  31800. ],
  31801. 171: [
  31802. function (e, t, i) {
  31803. ;(function (i) {
  31804. 'use strict'
  31805. function n(e) {
  31806. ;(this.panos = null),
  31807. (this.retryMinimumTime = 1e4),
  31808. (this.urls = null),
  31809. (this.panoLoadCallbacks = {}),
  31810. (this.downloadDescriptors = {}),
  31811. (this.priorityQueue = []),
  31812. (this.forceQueue = []),
  31813. (this.activeDownloads = []),
  31814. (this.qualityManager = null),
  31815. (this.tilePrioritizer = null),
  31816. (this.refreshInterval = null),
  31817. (this.processPriorityQueue = !1),
  31818. (this.concurrentDownloads = e.concurrentDownloads || 1),
  31819. (this.downloadTestResults = {})
  31820. }
  31821. var r = e('three'),
  31822. o = (e('../enum/Viewmode'), e('../settings')),
  31823. a = (e('../objects/Panorama'), e('../util/logger')),
  31824. s =
  31825. (e('../enum/Vectors'), e('../enum/PanoSizeClass'), e('../enum/TileDownloaderEvents')),
  31826. l = e('./TilePrioritizer'),
  31827. c = e('./TileUtils'),
  31828. h = (e('../enum/GLCubeFaces'), e('../enum/DownloadStatus')),
  31829. u = e('../util/panorama'),
  31830. d = e('../util/ajax'),
  31831. p = e('../ab'),
  31832. f = e('events').EventEmitter,
  31833. g =
  31834. (new a(i),
  31835. Object.freeze({
  31836. Testing: 1,
  31837. Success: 2,
  31838. Fail: 3
  31839. }))
  31840. ;(n.prototype = Object.create(f.prototype)),
  31841. (n.IDLE_REFRESH_DELAY = 500),
  31842. (n.ACTIVE_REFRESH_DELAY = 16),
  31843. (n.DOWNLOAD_RETRIES = 4),
  31844. (n.prototype.init = function (e) {
  31845. this.qualityManager = e
  31846. }),
  31847. (n.prototype.setUrls = function (e) {
  31848. this.urls = e
  31849. }),
  31850. (n.prototype.setPanoData = function (e, t, i) {
  31851. ;(this.panos = e), (this.imagePanos = t), (this.panoGroupId = i)
  31852. }),
  31853. (n.prototype.start = function () {
  31854. this.refreshUpdateInterval(0)
  31855. }),
  31856. (n.prototype.stop = function () {
  31857. window.cancel(this.refreshInterval)
  31858. }),
  31859. (n.prototype.refreshUpdateInterval = function (e) {
  31860. e || (e = 0),
  31861. (this.refreshInterval = window.setTimeout(
  31862. function () {
  31863. var e = this.update()
  31864. e
  31865. ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY)
  31866. : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  31867. }.bind(this),
  31868. e
  31869. ))
  31870. }),
  31871. (n.prototype.update = function () {
  31872. var e = this.forceQueue.length > 0
  31873. return (
  31874. this.processQueueForDownloading(this.forceQueue),
  31875. this.processPriorityQueue &&
  31876. (this.queuePrioritizedTilesForPanos(this.panos),
  31877. this.priorityQueue.length > 0 && (e = !0),
  31878. this.processQueueForDownloading(this.priorityQueue)),
  31879. e
  31880. )
  31881. }),
  31882. (n.prototype.forceQueueTilesForPano = (function () {
  31883. var e = [],
  31884. t = []
  31885. return function (i, n, r, o, a, s) {
  31886. e.length = 0
  31887. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  31888. var p = u[d]
  31889. ;(p.status !== h.None && p.status !== h.Queued) || e.push(p)
  31890. }
  31891. if (r && e.length > 0) {
  31892. l.sortPanoTiles(e, i, r),
  31893. (t.length = 0),
  31894. c.matchingTilesInDirection(i, n, r, o, a, t)
  31895. for (
  31896. var f = 0,
  31897. g = function (e) {
  31898. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  31899. };
  31900. f < e.length;
  31901. ) {
  31902. var m = e[f],
  31903. v = t.findIndex(g)
  31904. v < 0 ? e.splice(f, 1) : f++
  31905. }
  31906. }
  31907. for (var A = 0; A < e.length; A++) this.forceQueue.push(e[A])
  31908. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  31909. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  31910. s && this.processQueueForDownloading(this.forceQueue, !0)
  31911. }
  31912. })()),
  31913. (n.prototype.clearForceQueue = function () {
  31914. this.clearQueue(this.forceQueue)
  31915. }),
  31916. (n.prototype.queuePrioritizedTilesForPanos = function (e) {
  31917. this.tilePrioritizer &&
  31918. (this.clearQueue(this.priorityQueue),
  31919. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  31920. this.clearFromQueue(this.priorityQueue, h.None, !0),
  31921. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  31922. }),
  31923. (n.prototype.clearQueue = function (e) {
  31924. this.setStatusForAllDescriptors(e, h.None), (e.length = 0)
  31925. }),
  31926. (n.prototype.clearFromQueue = function (e, t, i) {
  31927. for (var n = 0; n < e.length; n++) {
  31928. var r = e[n]
  31929. r && ((t === r.status && !i) || (t !== r.status && i)) && (e[n] = null)
  31930. }
  31931. }),
  31932. (n.prototype.setStatusForAllDescriptors = function (e, t) {
  31933. for (var i = 0; i < e.length; i++) {
  31934. var n = e[i]
  31935. n && (n.status = t)
  31936. }
  31937. }),
  31938. (n.prototype.setStatusOrRemoveForAllDescriptors = function (e, t) {
  31939. for (var i = 0; i < e.length; i++) {
  31940. var n = e[i]
  31941. n && (n.status !== t ? (n.status = t) : (e[i] = null))
  31942. }
  31943. }),
  31944. (n.prototype.getTileDownloadDescriptors = function (e, t) {
  31945. var i = this.getAllTileDownloadDescriptorsForPano(e),
  31946. n = i[t]
  31947. return (
  31948. n ||
  31949. ((n = this.buildDownloadDescriptorArray(t)),
  31950. (i[t] = n),
  31951. this.initTileDownloadDescriptors(n, e, t)),
  31952. n
  31953. )
  31954. }),
  31955. (n.prototype.getAllTileDownloadDescriptorsForPano = function (e) {
  31956. var t = this.downloadDescriptors[e.id]
  31957. return t || ((t = {}), (this.downloadDescriptors[e.id] = t)), t
  31958. }),
  31959. (n.prototype.processQueueForDownloading = function (e, t) {
  31960. if (
  31961. (this.cleanupActiveDownloads(),
  31962. this.activeDownloads.length < this.concurrentDownloads || t)
  31963. )
  31964. for (
  31965. var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length,
  31966. n = 0,
  31967. r = 0;
  31968. n < i && e.length > 0;
  31969. r++
  31970. ) {
  31971. var o = e.shift()
  31972. o && (this.startDownload(o), n++)
  31973. }
  31974. }),
  31975. (n.prototype.testDownload = function (e, t, i) {
  31976. var n = this.downloadTestResults[e]
  31977. if (n) return void (n === g.Success ? i(!0) : n === g.Fail && i(!1))
  31978. this.downloadTestResults[e] = g.Testing
  31979. var r = this.panos.list[0],
  31980. o = this.getTileUrl(r.id, e, t, 0),
  31981. a = function (t) {
  31982. ;(this.downloadTestResults[e] = g.Success), i(!0)
  31983. }.bind(this),
  31984. s = function () {
  31985. ;(this.downloadTestResults[e] = g.Fail), i(!1)
  31986. }.bind(this)
  31987. this.loadImage(o, 0, a, s)
  31988. }),
  31989. (n.prototype.startDownload = function (e) {
  31990. e.status = h.Downloading
  31991. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex)
  31992. this.activeDownloads.push(e),
  31993. this.loadImage(
  31994. t,
  31995. n.DOWNLOAD_RETRIES,
  31996. this.downloadComplete.bind(this, e),
  31997. this.downloadFailed.bind(this, e)
  31998. )
  31999. }),
  32000. (n.prototype.downloadFailed = function (e, t) {}),
  32001. (n.prototype.downloadComplete = function (e, t) {
  32002. if (e.panoGroupId === this.panoGroupId) {
  32003. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize)
  32004. ;(e.status = h.Downloaded), i && i.onProgress && i.onProgress(e.pano, e.panoSize)
  32005. var n = {
  32006. panoId: e.pano.id,
  32007. image: t,
  32008. tileSize: e.tileSize,
  32009. panoSize: e.panoSize,
  32010. tileIndex: e.tileIndex,
  32011. faceTileIndex: e.faceTileIndex,
  32012. totalTiles: e.totalTiles,
  32013. face: e.face,
  32014. tileX: e.tileX,
  32015. tileY: e.tileY,
  32016. direction: e.direction
  32017. }
  32018. ;(e.image = t),
  32019. this.emit(s.TileDownloadSuccess, n),
  32020. this.isPanoDownloaded(e.pano, e.panoSize) &&
  32021. ((n = {
  32022. panoId: e.pano.id,
  32023. tileSize: e.tileSize,
  32024. panoSize: e.panoSize
  32025. }),
  32026. this.emit(s.PanoDownloadComplete, n),
  32027. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  32028. }
  32029. }),
  32030. (n.prototype.cleanupActiveDownloads = (function () {
  32031. var e = []
  32032. return function () {
  32033. e.length = 0
  32034. for (var t = 0; t < this.activeDownloads.length; t++) {
  32035. var i = this.activeDownloads[t]
  32036. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  32037. }
  32038. ;(this.activeDownloads.length = 0),
  32039. this.activeDownloads.push.apply(this.activeDownloads, e)
  32040. }
  32041. })()),
  32042. (n.prototype.isPanoDownloaded = function (e, t) {
  32043. var i = this.getTileDownloadDescriptors(e, t)
  32044. if (i.length <= 0) return !1
  32045. for (var n = 0; n < i.length; n++) {
  32046. var r = i[n]
  32047. if (r.status !== h.Downloaded) return !1
  32048. }
  32049. return !0
  32050. }),
  32051. (n.prototype.setPanoLoadCallbacks = function (e, t, i, n, r) {
  32052. var o = e.id + ':' + this.qualityManager.getPanoSize(t)
  32053. this.panoLoadCallbacks[o] = {
  32054. onLoad: i,
  32055. onFail: n,
  32056. onProgress: r
  32057. }
  32058. }),
  32059. (n.prototype.getPanoLoadCallbacks = function (e, t) {
  32060. var i = e.id + ':' + t
  32061. return this.panoLoadCallbacks[i]
  32062. }),
  32063. (n.prototype.buildDownloadDescriptorArray = function (e) {
  32064. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  32065. var r = this.buildDownloadDescriptor()
  32066. i.push(r)
  32067. }
  32068. return i
  32069. }),
  32070. (n.prototype.buildDownloadDescriptor = function () {
  32071. var e = {
  32072. panoGroupId: null,
  32073. pano: null,
  32074. panoSize: -1,
  32075. tileSize: -1,
  32076. tileIndex: -1,
  32077. totalTiles: -1,
  32078. faceTileIndex: -1,
  32079. status: h.None,
  32080. url: null,
  32081. image: null,
  32082. direction: new r.Vector3(),
  32083. face: -1,
  32084. cubeFace: -1,
  32085. tileX: -1,
  32086. tileY: -1
  32087. }
  32088. return e
  32089. }),
  32090. (n.prototype.initTileDownloadDescriptors = function (e, t, i) {
  32091. for (var n = 0; n < e.length; n++) {
  32092. var r = e[n]
  32093. this.initTileDownloadDescriptor(r, t, i, n)
  32094. }
  32095. }),
  32096. (n.prototype.initTileDownloadDescriptor = function (e, t, i, n) {
  32097. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i
  32098. ;(e.face = c.getFaceForTile(i, n)),
  32099. (e.cubeFace = u.mapFaceToCubemapFace(e.face)),
  32100. (e.panoGroupId = this.panoGroupId),
  32101. (e.pano = t),
  32102. (e.panoSize = i),
  32103. (e.tileSize = r),
  32104. (e.tileIndex = n),
  32105. (e.totalTiles = c.getTileCountForSize(i)),
  32106. (e.status = h.None),
  32107. (e.image = null),
  32108. c.getTileLocation(e.panoSize, e.tileIndex, e),
  32109. c.getTileVector(
  32110. e.panoSize,
  32111. e.tileSize,
  32112. e.cubeFace,
  32113. e.tileX,
  32114. e.tileY,
  32115. c.LocationOnTile.Center,
  32116. 0,
  32117. e.direction
  32118. )
  32119. }),
  32120. (n.prototype.getTileUrl = (function () {
  32121. var e = {
  32122. 256: '256',
  32123. 512: '512',
  32124. 1024: '1k',
  32125. 2048: '2k',
  32126. 4096: '4k'
  32127. },
  32128. t = {
  32129. face: -1,
  32130. faceTileIndex: -1,
  32131. tileX: -1,
  32132. tileY: -1
  32133. }
  32134. return function (i, n, r, a) {
  32135. c.getTileLocation(n, a, t)
  32136. var s = Math.floor(n / r),
  32137. l = s * s,
  32138. h = Math.floor(a / l),
  32139. u = ''
  32140. 1 === o.tiling.customCompression && (u = '_' + o.tiling['q' + e[n]])
  32141. var d = this.urls.get(
  32142. 'tiles/' +
  32143. i +
  32144. '/' +
  32145. e[n] +
  32146. u +
  32147. '_face' +
  32148. h +
  32149. '_' +
  32150. t.tileX +
  32151. '_' +
  32152. t.tileY +
  32153. '.jpg'
  32154. )
  32155. return (d = p.changeIfTileGenerating(d))
  32156. }
  32157. })()),
  32158. (n.prototype.loadImage = function (e, t, i, n) {
  32159. d.getImage(e, t)
  32160. .then(function (e) {
  32161. i(e)
  32162. })
  32163. .fail(n)
  32164. }),
  32165. (t.exports = n)
  32166. }).call(this, '/js/tile/TileDownloader.js')
  32167. },
  32168. {
  32169. '../ab': 3,
  32170. '../enum/DownloadStatus': 24,
  32171. '../enum/GLCubeFaces': 25,
  32172. '../enum/PanoSizeClass': 36,
  32173. '../enum/TileDownloaderEvents': 45,
  32174. '../enum/Vectors': 50,
  32175. '../enum/Viewmode': 51,
  32176. '../objects/Panorama': 148,
  32177. '../settings': 166,
  32178. '../util/ajax': 181,
  32179. '../util/logger': 189,
  32180. '../util/panorama': 191,
  32181. './TilePrioritizer': 172,
  32182. './TileUtils': 174,
  32183. events: 202,
  32184. three: 217
  32185. }
  32186. ],
  32187. 172: [
  32188. function (e, t, i) {
  32189. ;(function (i) {
  32190. 'use strict'
  32191. function n(e, t, i, o, a) {
  32192. ;(this.qualityManager = e),
  32193. (this.maxNavQuality = this.qualityManager.getMaxNavPanoSize()),
  32194. (this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()),
  32195. (this.baseSize = t),
  32196. (this.standardSize = i),
  32197. (this.highSize = o),
  32198. (this.ultraHighSize = a),
  32199. (this.priorityCriteria = new n.PriorityCriteria(
  32200. null,
  32201. new r.Vector3(0, 0, 0),
  32202. new r.Vector3(0, 0, -1),
  32203. new r.Vector3(0, 0, -1)
  32204. ))
  32205. }
  32206. var r = e('three'),
  32207. o =
  32208. (e('../enum/Viewmode'), e('../settings'), e('../settings'), e('../objects/Panorama')),
  32209. a = e('../util/logger'),
  32210. s =
  32211. (e('../enum/Vectors'),
  32212. e('../enum/PanoSizeClass'),
  32213. e('../enum/ModelManagerEvents'),
  32214. e('../enum/GLCubeFaces'),
  32215. e('../enum/DownloadStatus')),
  32216. l = (e('../util/browser'), e('./TileUtils')),
  32217. c = e('../util/math'),
  32218. h =
  32219. (e('events').EventEmitter,
  32220. new a(i),
  32221. Object.freeze({
  32222. None: 0,
  32223. DirectionalFOV: 1
  32224. }))
  32225. ;(n.PriorityCriteria = function (e, t, i, n, o) {
  32226. ;(this.pano = e),
  32227. (this.cameraPosition = new r.Vector3().copy(t)),
  32228. (this.cameraDir = new r.Vector3().copy(i)),
  32229. (this.panoSpaceDir = new r.Vector3().copy(n)),
  32230. (this.upcomingPanos = o),
  32231. (this.copy = function (e) {
  32232. ;(this.pano = e.pano),
  32233. this.cameraPosition.copy(e.cameraPosition),
  32234. this.cameraDir.copy(e.cameraDir),
  32235. this.panoSpaceDir.copy(e.panoSpaceDir),
  32236. (this.upcomingPanos = o)
  32237. }),
  32238. (this.zoomingActive = !1)
  32239. }),
  32240. (n.DIRECTIONAL_FOV = 180),
  32241. (n.DIRECTIONAL_FOV_NARROW = 120),
  32242. (n.MAX_SCORED_PANOS_TOCONSIDER = 6),
  32243. (n.MAX_SCORED_PANOS_TOADD = 2),
  32244. (n.MAX_UPCOMING_PANOS_TOADD = 3),
  32245. (n.DIRECTION_SCORE_STRICTNESS = 0.75),
  32246. (n.appendQueue = function (e, t) {
  32247. if (e && t) for (var i = 0; i < t.length; i++) e.push(t[i])
  32248. }),
  32249. (n.prototype.updateCriteria = function (e, t, i, n) {
  32250. ;(this.priorityCriteria.pano = e),
  32251. this.priorityCriteria.cameraPosition.copy(t),
  32252. this.priorityCriteria.cameraDir.copy(i),
  32253. (this.priorityCriteria.upcomingPanos = n),
  32254. (this.maxNavQuality = this.qualityManager.getMaxNavPanoSize())
  32255. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  32256. if (!player.panoRenderer.isPanoZoomed(e.id)) {
  32257. //xzw add,直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  32258. this.maxNavQuality = Math.min(2048, this.maxNavQuality)
  32259. this.maxZoomQuality = Math.min(2048, this.maxZoomQuality)
  32260. }
  32261. }),
  32262. (n.prototype.filterAndPrioritize = (function () {
  32263. var e = [],
  32264. t = [],
  32265. i = []
  32266. return function (r, o, a) {
  32267. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  32268. this.populateScoredPanos(
  32269. this.priorityCriteria.pano,
  32270. o,
  32271. t,
  32272. this.priorityCriteria.cameraDir,
  32273. n.MAX_SCORED_PANOS_TOCONSIDER
  32274. )
  32275. var s = this.baseSize,
  32276. l = this.standardSize,
  32277. c = this.highSize,
  32278. h = this.ultraHighSize
  32279. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  32280. this.priorityCriteria.upcomingPanos &&
  32281. this.queueTilesForPanos(
  32282. r,
  32283. this.priorityCriteria.upcomingPanos,
  32284. a,
  32285. s,
  32286. n.MAX_UPCOMING_PANOS_TOADD
  32287. ),
  32288. this.priorityCriteria.upcomingPanos &&
  32289. this.queueTilesForPanos(
  32290. r,
  32291. this.priorityCriteria.upcomingPanos,
  32292. a,
  32293. 1024,
  32294. n.MAX_UPCOMING_PANOS_TOADD
  32295. ), //更清晰些
  32296. (i.length = 0),
  32297. this.canDownloadSize(l) &&
  32298. this.queueTilesInDirectionForPano(
  32299. i,
  32300. a,
  32301. this.priorityCriteria.pano,
  32302. l,
  32303. this.priorityCriteria.cameraPosition,
  32304. this.priorityCriteria.cameraDir,
  32305. n.DIRECTIONAL_FOV_NARROW
  32306. ),
  32307. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  32308. n.appendQueue(r, i),
  32309. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  32310. (i.length = 0),
  32311. this.canDownloadSize(c) &&
  32312. this.queueTilesInDirectionForPano(
  32313. i,
  32314. a,
  32315. this.priorityCriteria.pano,
  32316. c,
  32317. this.priorityCriteria.cameraPosition,
  32318. this.priorityCriteria.cameraDir,
  32319. n.DIRECTIONAL_FOV_NARROW
  32320. ),
  32321. this.canDownloadSize(h) &&
  32322. this.queueTilesInDirectionForPano(
  32323. i,
  32324. a,
  32325. this.priorityCriteria.pano,
  32326. h,
  32327. this.priorityCriteria.cameraPosition,
  32328. this.priorityCriteria.cameraDir,
  32329. n.DIRECTIONAL_FOV_NARROW
  32330. ),
  32331. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  32332. n.appendQueue(r, i),
  32333. (i.length = 0),
  32334. this.canDownloadSize(l) &&
  32335. this.queueTilesInDirectionForPano(
  32336. i,
  32337. a,
  32338. this.priorityCriteria.pano,
  32339. l,
  32340. this.priorityCriteria.cameraPosition,
  32341. this.priorityCriteria.cameraDir,
  32342. n.DIRECTIONAL_FOV
  32343. ),
  32344. this.canDownloadSize(c) &&
  32345. this.queueTilesInDirectionForPano(
  32346. i,
  32347. a,
  32348. this.priorityCriteria.pano,
  32349. c,
  32350. this.priorityCriteria.cameraPosition,
  32351. this.priorityCriteria.cameraDir,
  32352. n.DIRECTIONAL_FOV
  32353. ),
  32354. this.canDownloadSize(h) &&
  32355. this.queueTilesInDirectionForPano(
  32356. i,
  32357. a,
  32358. this.priorityCriteria.pano,
  32359. h,
  32360. this.priorityCriteria.cameraPosition,
  32361. this.priorityCriteria.cameraDir,
  32362. n.DIRECTIONAL_FOV
  32363. ),
  32364. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  32365. n.appendQueue(r, i),
  32366. this.queueTilesForPanos(r, e, a, s)
  32367. }
  32368. })()),
  32369. (n.prototype.canDownloadSize = function (e) {
  32370. return this.maxNavQuality >= e || (this.maxZoomQuality >= e && this.zoomingActive)
  32371. }),
  32372. (n.prototype.populateNeighborPanos = function (e, t, i) {
  32373. ;(i = i || []), (i.length = 0)
  32374. var n = t.getNeighbours(e)
  32375. for (var r in n)
  32376. if (n.hasOwnProperty(r)) {
  32377. var o = t.get(r)
  32378. i.push(o)
  32379. }
  32380. return i
  32381. }),
  32382. (n.prototype.populateScoredPanos = function (e, t, i, r, a) {
  32383. ;(i = i || []), (i.length = 0)
  32384. var s = [
  32385. o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS),
  32386. o.filters.not(e)
  32387. ],
  32388. l = [
  32389. o.scoreFunctions.distanceSquared(e),
  32390. o.scoreFunctions.direction(e.position, r)
  32391. ],
  32392. c = t.sortByScore(s, l)
  32393. if (c)
  32394. for (var h = 0; h < c.length && h < a; h++) {
  32395. var u = c[h].item
  32396. i.push(u)
  32397. }
  32398. return i
  32399. }),
  32400. (n.prototype.queueTilesForPanos = function (e, t, i, n, r) {
  32401. for (var o = 0, a = 0; a < t.length; a++) {
  32402. var s = t[a],
  32403. l = this.queueTilesForPano(e, i, s, n)
  32404. if (((o += l > 0 ? 1 : 0), r && o >= r)) break
  32405. }
  32406. return o
  32407. }),
  32408. (n.prototype.queueTilesForPano = (function () {
  32409. var e = {
  32410. filter: h.None
  32411. }
  32412. return function (t, i, n, r) {
  32413. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  32414. }
  32415. })()),
  32416. (n.prototype.queueTilesForPanosInDirection = (function () {
  32417. var e = new r.Vector3()
  32418. return function (t, i, n, r, o, a, s, l) {
  32419. for (var h = 0, u = 0; u < n.length; u++) {
  32420. var d = n[u]
  32421. e.copy(d.position), e.sub(o), e.normalize()
  32422. var p = Math.max(Math.min(a.dot(e), 1), -1),
  32423. f = c.getFOVDotThreshold(s)
  32424. if (p >= f) {
  32425. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s)
  32426. if (((h += g > 0 ? 1 : 0), l && h >= l)) break
  32427. }
  32428. }
  32429. return h
  32430. }
  32431. })()),
  32432. (n.prototype.queueTilesInDirectionForPanos = function (e, t, i, n, r, o, a, s) {
  32433. for (var l = 0, c = 0; c < i.length; c++) {
  32434. var h = i[c],
  32435. u = this.queueTilesInDirectionForPano(e, t, h, n, o, a)
  32436. if (((l += u > 0 ? 1 : 0), s && l >= s)) break
  32437. }
  32438. return l
  32439. }),
  32440. (n.prototype.queueTilesInDirectionForPano = (function () {
  32441. var e = {
  32442. filter: h.DirectionalFOV,
  32443. direction: new r.Vector3(),
  32444. fov: 60
  32445. },
  32446. t = new r.Vector3()
  32447. return function (i, n, r, o, a, s, c) {
  32448. return (
  32449. t.copy(s),
  32450. l.getRelativeDirection(r.quaternion, t),
  32451. e.direction.copy(t),
  32452. (e.fov = c),
  32453. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  32454. )
  32455. }
  32456. })()),
  32457. (n.prototype.filterAndQueueTileDownloadDescriptors = (function () {
  32458. var e = []
  32459. return function (t, i, n, r, o) {
  32460. var a = i.getTileDownloadDescriptors(n, r)
  32461. ;(e.length = 0), this.filterTileDownloadDescriptors(n, a, e, o)
  32462. for (var s = 0, l = 0; l < e.length; l++) {
  32463. var c = e[l]
  32464. c && (t.push(c), s++)
  32465. }
  32466. return s
  32467. }
  32468. })()),
  32469. (n.prototype.filterTileDownloadDescriptors = (function () {
  32470. new r.Vector3()
  32471. return function (e, t, i, n) {
  32472. var r, o
  32473. switch (n.filter) {
  32474. case h.DirectionalFOV:
  32475. for (r = 0; r < t.length; r++)
  32476. (o = t[r]),
  32477. l.isTileWithinFOV(
  32478. o.panoSize,
  32479. o.tileSize,
  32480. o.face,
  32481. o.tileX,
  32482. o.tileY,
  32483. n.direction,
  32484. n.fov
  32485. ) && i.push(o)
  32486. break
  32487. default:
  32488. for (r = 0; r < t.length; r++) (o = t[r]), i.push(o)
  32489. }
  32490. for (r = 0; r < i.length; r++)
  32491. (o = i[r]), this.canIncludeDescriptor(o) || (i[r] = null)
  32492. }
  32493. })()),
  32494. (n.prototype.canIncludeDescriptor = function (e) {
  32495. return e.status !== s.Downloading && e.status !== s.Downloaded
  32496. }),
  32497. (n.prototype.canIncludePano = function (e, t) {
  32498. return !e.isLoaded(t)
  32499. }),
  32500. (n.getFOVDotThreshold = function (e) {
  32501. return Math.cos(r.Math.degToRad(e / 2))
  32502. })
  32503. var u = (function () {
  32504. var e = function e(t, i) {
  32505. var n = e._panoSpaceDir,
  32506. r = e._fovThreshold,
  32507. o = e._fovThresholdNarrow,
  32508. a = Math.max(Math.min(n.dot(t.direction), 1), -1),
  32509. s = Math.max(Math.min(n.dot(i.direction), 1), -1)
  32510. return (
  32511. (t._dot = a),
  32512. (i._dot = s),
  32513. a >= r && s < r
  32514. ? -1
  32515. : a < r && s >= r
  32516. ? 1
  32517. : a >= o && s < o
  32518. ? -1
  32519. : a < o && s >= o
  32520. ? 1
  32521. : t.panoSize > i.panoSize
  32522. ? 1
  32523. : i.panoSize > t.panoSize
  32524. ? -1
  32525. : -(a - s)
  32526. )
  32527. }
  32528. return (
  32529. (e._panoSpaceDir = new r.Vector3()),
  32530. (e._fovThreshold = -1),
  32531. (e._fovThresholdNarrow = -1),
  32532. e
  32533. )
  32534. })()
  32535. ;(n.sortPanoTiles = function (e, t, i) {
  32536. u._panoSpaceDir.copy(i),
  32537. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  32538. (u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW)),
  32539. (u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV)),
  32540. e.sort(u)
  32541. }),
  32542. (n.insertSortedPanoTile = function (e, t, i, r) {
  32543. u._panoSpaceDir.copy(r),
  32544. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  32545. (u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW)),
  32546. (u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV))
  32547. for (var o = -1, a = 0; a < e.length; a++) {
  32548. var s = u(t, e[a])
  32549. if (s <= 0) {
  32550. o = a
  32551. break
  32552. }
  32553. }
  32554. if (o === -1) e[e.length] = t
  32555. else {
  32556. for (var h = e.length; h > o; h--) e[h] = e[h - 1]
  32557. e[o] = t
  32558. }
  32559. }),
  32560. (n.prototype.setZoomingActive = function (e) {
  32561. e !== this.zoomingActive && (this.zoomingActive = e)
  32562. }),
  32563. (t.exports = n)
  32564. }).call(this, '/js/tile/TilePrioritizer.js')
  32565. },
  32566. {
  32567. '../enum/DownloadStatus': 24,
  32568. '../enum/GLCubeFaces': 25,
  32569. '../enum/ModelManagerEvents': 33,
  32570. '../enum/PanoSizeClass': 36,
  32571. '../enum/Vectors': 50,
  32572. '../enum/Viewmode': 51,
  32573. '../objects/Panorama': 148,
  32574. '../settings': 166,
  32575. '../util/browser': 182,
  32576. '../util/logger': 189,
  32577. '../util/math': 190,
  32578. './TileUtils': 174,
  32579. events: 202,
  32580. three: 217
  32581. }
  32582. ],
  32583. 173: [
  32584. function (e, t, i) {
  32585. 'use strict'
  32586. function n(e, t) {
  32587. ;(this.levels = t), (this.tileSize = e), (this.root = null), (this.allNodes = []), a(this)
  32588. }
  32589. function r(e, t) {
  32590. ;(this.tree = e), (this.parent = t), (this.children = []), (this.id = ++u)
  32591. }
  32592. function o(e, t, i, r, a, s, l, h) {
  32593. if (e) {
  32594. l = l || n.TraversalType.PreOrder
  32595. var u = r * c + i
  32596. if (
  32597. (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r), s && s.push(e)),
  32598. e.children && 0 !== e.children.length)
  32599. ) {
  32600. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  32601. for (var g = 0; g < c; g++)
  32602. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h)
  32603. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r), s && s.push(e))
  32604. }
  32605. }
  32606. }
  32607. function a(e) {
  32608. e.root = s(e, null, 0)
  32609. }
  32610. function s(e, t, i) {
  32611. if (i > e.levels) return null
  32612. var n = new r(e, t)
  32613. e.allNodes.push(n)
  32614. for (var o = 0; o < h; o++) n.children[o] = s(e, n, i + 1)
  32615. return n
  32616. }
  32617. function l(e, t, i, n, r) {
  32618. if (!e) return null
  32619. if (0 === i) return e
  32620. if (!e.children || 0 === e.children.length) return null
  32621. var o = Math.pow(c, i),
  32622. a = o / c,
  32623. s = n % a,
  32624. h = r % a,
  32625. u = Math.floor(r / a),
  32626. d = Math.floor(n / a),
  32627. p = u * c + d,
  32628. f = e.children[p]
  32629. return l(f, t + 1, i - 1, s, h)
  32630. }
  32631. var c =
  32632. (e('three'),
  32633. e('./TileUtils'),
  32634. e('../objects/Panorama'),
  32635. e('../util/panorama'),
  32636. e('events').EventEmitter,
  32637. 2),
  32638. h = c * c
  32639. n.TraversalType = Object.freeze({
  32640. PreOrder: 0,
  32641. PostOrder: 1
  32642. })
  32643. var u = 0
  32644. ;(n.getLevelCountForSize = function (e, t) {
  32645. var i = 0
  32646. for (t < e && (t = e); ; ) {
  32647. if (((t /= c), t < e)) break
  32648. i++
  32649. }
  32650. return i
  32651. }),
  32652. (n.getSizeForLevel = function (e, t) {
  32653. return Math.pow(c, t) * e
  32654. }),
  32655. (n.prototype.getSubNode = function (e, t, i) {
  32656. ;(!t || e < this.tileSize) && (t = 0),
  32657. (!i || e < this.tileSize) && (i = 0),
  32658. e < this.tileSize && (e = this.tileSize)
  32659. var r = n.getLevelCountForSize(this.tileSize, e),
  32660. o = l(this.root, 0, r, t, i)
  32661. return o
  32662. }),
  32663. (n.prototype.breadthFirst = function (e) {
  32664. e = e || {}
  32665. var t = !!e.nullLevelEnd,
  32666. i = e.maxLevel,
  32667. n = e.minLevel,
  32668. r = e.callback,
  32669. o = e.saveVisited,
  32670. a = [],
  32671. s = {},
  32672. l = 0,
  32673. c = 0
  32674. for (a.push(this.root), a.push(s); a.length > 0 && !(i && l > i); ) {
  32675. var h = a.shift()
  32676. if (h === s)
  32677. (!n || l >= n) && (r && t && r(null), o && t && o.push(null)),
  32678. a.length > 0 && a.push(s),
  32679. l++,
  32680. (c = 0)
  32681. else {
  32682. if (h.children)
  32683. for (var u = 0; u < h.children.length; u++) {
  32684. var d = h.children[u]
  32685. d && a.push(h.children[u])
  32686. }
  32687. var p = this.getFaceIndexFromNode(h)
  32688. ;(!n || l >= n) && (r && r(h, l, p), o && o.push(h)), c++
  32689. }
  32690. }
  32691. }),
  32692. (n.prototype.getFaceIndexFromNode = function (e) {
  32693. if (!e) return -1
  32694. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  32695. var o = i.parent
  32696. if (!o) break
  32697. for (var a = -1, s = 0; s < o.children.length; s++) o.children[s] === i && (a = s)
  32698. var l = a % c,
  32699. h = Math.floor(a / c)
  32700. ;(n = l * t + n), (r = h * t + r), (t *= c), (i = o)
  32701. }
  32702. return r * t + n
  32703. }),
  32704. (n.prototype.depthFirst = function (e, t, i) {
  32705. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  32706. }),
  32707. (t.exports = n)
  32708. },
  32709. {
  32710. '../objects/Panorama': 148,
  32711. '../util/panorama': 191,
  32712. './TileUtils': 174,
  32713. events: 202,
  32714. three: 217
  32715. }
  32716. ],
  32717. 174: [
  32718. function (e, t, i) {
  32719. 'use strict'
  32720. var n = e('../enum/GLCubeFaces'),
  32721. r = e('../util/MathLight'),
  32722. o = {}
  32723. ;(o.TILE_SIZE = 512),
  32724. (o.FACES_PER_PANO = 6),
  32725. (o.LocationOnTile = {
  32726. Center: 0,
  32727. UpperLeft: 1,
  32728. UpperRight: 2,
  32729. LowerRight: 3,
  32730. LowerLeft: 4
  32731. }),
  32732. (o.getTileVector = (function () {
  32733. return function (e, t, i, a, s, l, c, h) {
  32734. l = l || o.LocationOnTile.Center
  32735. var u = e / t,
  32736. d = a / u
  32737. s = -s + (u - 1)
  32738. var p = s / u,
  32739. f = t / e,
  32740. g = 2 * f,
  32741. m = g / 2,
  32742. v = 2 * d - 1 + m,
  32743. A = 2 * p - 1 + m
  32744. switch (l) {
  32745. case o.LocationOnTile.UpperLeft:
  32746. ;(v -= m), (A += m), (v += c * g)
  32747. break
  32748. case o.LocationOnTile.UpperRight:
  32749. ;(v += m), (A += m), (A -= c * g)
  32750. break
  32751. case o.LocationOnTile.LowerRight:
  32752. ;(v += m), (A -= m), (v -= c * g)
  32753. break
  32754. case o.LocationOnTile.LowerLeft:
  32755. ;(v -= m), (A -= m), (A += c * g)
  32756. break
  32757. case o.LocationOnTile.Center:
  32758. }
  32759. switch (i) {
  32760. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  32761. r.setVector(h, -1, A, -v)
  32762. break
  32763. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  32764. r.setVector(h, 1, A, v)
  32765. break
  32766. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  32767. r.setVector(h, -v, 1, -A)
  32768. break
  32769. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  32770. r.setVector(h, -v, -1, A)
  32771. break
  32772. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  32773. r.setVector(h, -v, A, 1)
  32774. break
  32775. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  32776. r.setVector(h, v, A, -1)
  32777. }
  32778. r.normalize(h)
  32779. }
  32780. })()),
  32781. (o.getFaceForTile = function (e, t) {
  32782. var i = o.TILE_SIZE
  32783. e < o.TILE_SIZE && (i = e)
  32784. var n = Math.floor(e / i),
  32785. r = n * n
  32786. return Math.floor(t / r)
  32787. }),
  32788. (o.getTileLocation = function (e, t, i) {
  32789. var n = o.TILE_SIZE
  32790. e < o.TILE_SIZE && (n = e)
  32791. var r = o.getFaceForTile(e, t),
  32792. a = Math.floor(e / n),
  32793. s = a * a,
  32794. l = t - r * s
  32795. ;(i.tileX = l % a), (i.tileY = Math.floor(l / a)), (i.face = r), (i.faceTileIndex = l)
  32796. }),
  32797. (o.getTileCountForSize = function (e) {
  32798. if (e <= o.TILE_SIZE) return o.FACES_PER_PANO
  32799. var t = Math.floor(e / o.TILE_SIZE),
  32800. i = t * t,
  32801. n = i * o.FACES_PER_PANO
  32802. return n
  32803. }),
  32804. (o.getRelativeDirection = (function () {
  32805. var e = new r.Matrix4(),
  32806. t = new r.Quaternion()
  32807. return function (i, n) {
  32808. t.copy(i),
  32809. t.inverse(),
  32810. e.makeRotationFromQuaternion(t),
  32811. e.applyToVector3(n),
  32812. r.normalize(n)
  32813. }
  32814. })()),
  32815. (o.matchingTilesInDirection = (function () {
  32816. var e = new r.Vector3(),
  32817. t = new r.Vector3(0, 0, -1),
  32818. i = new r.Quaternion(),
  32819. n = function (e, t) {
  32820. e.push({
  32821. face: t.face,
  32822. faceTileIndex: t.faceTileIndex,
  32823. tileX: t.tileX,
  32824. tileY: t.tileY
  32825. })
  32826. },
  32827. a = (function () {
  32828. var e = {
  32829. face: -1,
  32830. faceTileIndex: -1,
  32831. tileX: -1,
  32832. tileY: -1
  32833. }
  32834. return function (t, i, r) {
  32835. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  32836. o.getTileLocation(t, l, e), (i && !i(e)) || (s++, r && n(r, e))
  32837. return s
  32838. }
  32839. })()
  32840. return function (n, s, l, c, h, u) {
  32841. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE
  32842. o.getTileCountForSize(s)
  32843. if (!c && !h) return a(s, null, u)
  32844. var p = !!h
  32845. if (
  32846. ((h = h || c),
  32847. (h = Math.max(0, Math.min(h, 360))),
  32848. (c = Math.max(0, Math.min(c, 360))),
  32849. r.copyVector(l, e),
  32850. o.getRelativeDirection(n.quaternion, e),
  32851. p)
  32852. ) {
  32853. i.setFromUnitVectors(e, t)
  32854. var f = function (e) {
  32855. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  32856. }
  32857. return a(s, f, u)
  32858. }
  32859. var g = function (t) {
  32860. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  32861. }
  32862. return a(s, g, u)
  32863. }
  32864. })()),
  32865. (o.isTileWithinFrustum = (function () {
  32866. var e = new r.Vector3(),
  32867. t = 1e-5
  32868. return function (i, n, a, s, l, c, h, u) {
  32869. for (
  32870. var d = Math.tan(0.5 * u * r.RADIANS_PER_DEGREE),
  32871. p = -d,
  32872. f = Math.tan(0.5 * h * r.RADIANS_PER_DEGREE),
  32873. g = -f,
  32874. m = o.mapFaceToCubemapFace(a),
  32875. v = 0,
  32876. A = 0,
  32877. y = 0,
  32878. C = 0,
  32879. I = 0,
  32880. E = 0,
  32881. b = o.LocationOnTile.Center;
  32882. b <= o.LocationOnTile.LowerLeft;
  32883. b++
  32884. )
  32885. if (
  32886. (o.getTileVector(i, n, m, s, l, b, 0, e),
  32887. r.applyQuaternionToVector(c, e),
  32888. e.z >= -t)
  32889. )
  32890. I++
  32891. else {
  32892. var w = -1 / e.z,
  32893. _ = e.x * w,
  32894. T = e.y * w
  32895. T > d ? v++ : T < p && A++, _ > f ? y++ : _ < g && C++, E++
  32896. }
  32897. return A !== E && v !== E && y !== E && C !== E
  32898. }
  32899. })()),
  32900. (o.isTileWithinFOV = (function () {
  32901. var e = new r.Vector3(),
  32902. t = new r.Vector3(0, 1, 0),
  32903. i = new r.Vector3(1, 0, 0)
  32904. return function (n, a, s, l, c, h, u) {
  32905. var d = o.mapFaceToCubemapFace(s)
  32906. if (
  32907. (r.cross(h, t, i),
  32908. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  32909. o.isWithinFOV(e, h, u, null))
  32910. )
  32911. return !0
  32912. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  32913. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  32914. if ((o.getTileVector(n, a, d, l, c, v, g, e), o.isWithinFOV(e, h, u, null)))
  32915. return !0
  32916. g += p
  32917. }
  32918. return !1
  32919. }
  32920. })()),
  32921. (o.isWithinFOV = (function () {
  32922. var e = new r.Vector3(),
  32923. t = new r.Vector3()
  32924. return function (i, n, o, a) {
  32925. if ((r.copyVector(i, t), a)) {
  32926. r.copyVector(a, e), r.normalize(e)
  32927. var s = r.dot(e, i)
  32928. ;(e.x *= s), (e.y *= s), (e.z *= s), r.subVector(t, e)
  32929. }
  32930. var l = (o / 2) * r.RADIANS_PER_DEGREE,
  32931. c = Math.cos(l),
  32932. h = r.dot(t, n)
  32933. return h >= c
  32934. }
  32935. })()),
  32936. (o.mapFaceToCubemapFace = (function () {
  32937. var e = {
  32938. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  32939. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  32940. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  32941. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  32942. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  32943. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  32944. }
  32945. return function (t) {
  32946. return e[t]
  32947. }
  32948. })()),
  32949. (t.exports = o)
  32950. },
  32951. {
  32952. '../enum/GLCubeFaces': 25,
  32953. '../util/MathLight': 176
  32954. }
  32955. ],
  32956. 175: [
  32957. function (e, t, i) {
  32958. ;(function (i) {
  32959. 'use strict'
  32960. function n() {
  32961. ;(this.list = []),
  32962. (this.index = {}),
  32963. Object.defineProperty(this, 'length', {
  32964. get: function () {
  32965. return this.list.length
  32966. }
  32967. })
  32968. }
  32969. var r = (e('./common'), e('./logger'))
  32970. new r(i)
  32971. ;(n.prototype.forEach = function (e) {
  32972. this.list.forEach(e)
  32973. }),
  32974. (n.prototype.add = function (e) {
  32975. this.list.push(e), (this.index[this.getIndex(e)] = e)
  32976. }),
  32977. (n.prototype.getIndex = function (e) {
  32978. throw new Error('IndexedCollection.getIndex not implemented in subclass.')
  32979. }),
  32980. (n.prototype.extend = function (e) {
  32981. for (var t = 0; t < e.length; t++) this.add(e[t])
  32982. }),
  32983. (n.prototype.get = function (e) {
  32984. return this.index[e]
  32985. }),
  32986. (n.prototype.first = function () {
  32987. return this.list[0]
  32988. }),
  32989. (n.prototype.last = function () {
  32990. return this.list[this.list.length - 1]
  32991. }),
  32992. (n.prototype.reIndex = function () {
  32993. this.index = {}
  32994. var e = this
  32995. this.forEach(function (t) {
  32996. e.index[e.getIndex(t)] = t
  32997. })
  32998. }),
  32999. (n.prototype.filter = function (e) {
  33000. var t = this.list.filter(e)
  33001. return this.reIndex(), t
  33002. }),
  33003. (n.prototype.reduce = function (e, t) {
  33004. return this.list.reduce(e, t)
  33005. }),
  33006. (n.prototype.sort = function (e) {
  33007. return this.list.sort(e)
  33008. }),
  33009. (n.prototype.indexOf = function (e) {
  33010. for (var t = 0; t < this.list.length; ++t) if (this.list[t] === e) return t
  33011. return -1
  33012. }),
  33013. (t.exports = n)
  33014. }).call(this, '/js/util/IndexedCollection.js')
  33015. },
  33016. {
  33017. './common': 185,
  33018. './logger': 189
  33019. }
  33020. ],
  33021. 176: [
  33022. function (e, t, i) {
  33023. 'use strict'
  33024. var n = e('../constants'),
  33025. r = {}
  33026. ;(r.RADIANS_PER_DEGREE = Math.PI / 180),
  33027. (r.DEGREES_PER_RADIAN = 180 / Math.PI),
  33028. (r.Vector3 = function (e, t, i) {
  33029. ;(this.x = e || 0), (this.y = t || 0), (this.z = i || 0)
  33030. }),
  33031. (r.Matrix4 = function () {
  33032. ;(this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])),
  33033. arguments.length > 0 &&
  33034. console.error(
  33035. 'MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.'
  33036. )
  33037. }),
  33038. (r.Matrix4.prototype = {
  33039. identity: function () {
  33040. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  33041. },
  33042. copy: function (e) {
  33043. return this.elements.set(e.elements), this
  33044. },
  33045. applyToVector3: function (e) {
  33046. var t = e.x,
  33047. i = e.y,
  33048. n = e.z,
  33049. r = this.elements
  33050. return (
  33051. (e.x = r[0] * t + r[4] * i + r[8] * n + r[12]),
  33052. (e.y = r[1] * t + r[5] * i + r[9] * n + r[13]),
  33053. (e.z = r[2] * t + r[6] * i + r[10] * n + r[14]),
  33054. this
  33055. )
  33056. },
  33057. getInverse: function (e, t) {
  33058. var i = this.elements,
  33059. n = e.elements,
  33060. r = n[0],
  33061. o = n[1],
  33062. a = n[2],
  33063. s = n[3],
  33064. l = n[4],
  33065. c = n[5],
  33066. h = n[6],
  33067. u = n[7],
  33068. d = n[8],
  33069. p = n[9],
  33070. f = n[10],
  33071. g = n[11],
  33072. m = n[12],
  33073. v = n[13],
  33074. A = n[14],
  33075. y = n[15],
  33076. C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y,
  33077. I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y,
  33078. E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y,
  33079. b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A,
  33080. w = r * C + o * I + a * E + s * b
  33081. if (0 === w) {
  33082. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0"
  33083. if (t) throw new Error(_)
  33084. return console.warn(_), this.identity()
  33085. }
  33086. var T = 1 / w
  33087. return (
  33088. (i[0] = C * T),
  33089. (i[1] =
  33090. (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T),
  33091. (i[2] =
  33092. (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T),
  33093. (i[3] =
  33094. (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T),
  33095. (i[4] = I * T),
  33096. (i[5] =
  33097. (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T),
  33098. (i[6] =
  33099. (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T),
  33100. (i[7] =
  33101. (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T),
  33102. (i[8] = E * T),
  33103. (i[9] =
  33104. (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T),
  33105. (i[10] =
  33106. (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T),
  33107. (i[11] =
  33108. (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T),
  33109. (i[12] = b * T),
  33110. (i[13] =
  33111. (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T),
  33112. (i[14] =
  33113. (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T),
  33114. (i[15] =
  33115. (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T),
  33116. this
  33117. )
  33118. },
  33119. makeRotationFromQuaternion: function (e) {
  33120. var t = this.elements,
  33121. i = e.x,
  33122. n = e.y,
  33123. r = e.z,
  33124. o = e.w,
  33125. a = i + i,
  33126. s = n + n,
  33127. l = r + r,
  33128. c = i * a,
  33129. h = i * s,
  33130. u = i * l,
  33131. d = n * s,
  33132. p = n * l,
  33133. f = r * l,
  33134. g = o * a,
  33135. m = o * s,
  33136. v = o * l
  33137. return (
  33138. (t[0] = 1 - (d + f)),
  33139. (t[4] = h - v),
  33140. (t[8] = u + m),
  33141. (t[1] = h + v),
  33142. (t[5] = 1 - (c + f)),
  33143. (t[9] = p - g),
  33144. (t[2] = u - m),
  33145. (t[6] = p + g),
  33146. (t[10] = 1 - (c + d)),
  33147. (t[3] = 0),
  33148. (t[7] = 0),
  33149. (t[11] = 0),
  33150. (t[12] = 0),
  33151. (t[13] = 0),
  33152. (t[14] = 0),
  33153. (t[15] = 1),
  33154. this
  33155. )
  33156. }
  33157. }),
  33158. (r.Quaternion = function (e, t, i, n) {
  33159. ;(this._x = e || 0),
  33160. (this._y = t || 0),
  33161. (this._z = i || 0),
  33162. (this._w = void 0 !== n ? n : 1)
  33163. }),
  33164. (r.Quaternion.prototype = {
  33165. get x() {
  33166. return this._x
  33167. },
  33168. set x(e) {
  33169. this._x = e
  33170. },
  33171. get y() {
  33172. return this._y
  33173. },
  33174. set y(e) {
  33175. this._y = e
  33176. },
  33177. get z() {
  33178. return this._z
  33179. },
  33180. set z(e) {
  33181. this._z = e
  33182. },
  33183. get w() {
  33184. return this._w
  33185. },
  33186. set w(e) {
  33187. this._w = e
  33188. },
  33189. copy: function (e) {
  33190. ;(this._x = e.x), (this._y = e.y), (this._z = e.z), (this._w = e.w)
  33191. },
  33192. inverse: function () {
  33193. return this.conjugate().normalize()
  33194. },
  33195. conjugate: function () {
  33196. return (this._x *= -1), (this._y *= -1), (this._z *= -1), this
  33197. },
  33198. length: function () {
  33199. return Math.sqrt(
  33200. this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  33201. )
  33202. },
  33203. normalize: function () {
  33204. var e = this.length()
  33205. return (
  33206. 0 === e
  33207. ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
  33208. : ((e = 1 / e),
  33209. (this._x = this._x * e),
  33210. (this._y = this._y * e),
  33211. (this._z = this._z * e),
  33212. (this._w = this._w * e)),
  33213. this
  33214. )
  33215. },
  33216. setFromAxisAngle: function (e, t) {
  33217. var i = t / 2,
  33218. n = Math.sin(i)
  33219. return (
  33220. (this._x = e.x * n),
  33221. (this._y = e.y * n),
  33222. (this._z = e.z * n),
  33223. (this._w = Math.cos(i)),
  33224. this
  33225. )
  33226. },
  33227. setFromUnitVectors: (function () {
  33228. var e,
  33229. t,
  33230. i = 1e-6
  33231. return function (n, o) {
  33232. return (
  33233. void 0 === e && (e = new r.Vector3()),
  33234. (t = r.dot(n, o) + 1),
  33235. t < i
  33236. ? ((t = 0),
  33237. Math.abs(n.x) > Math.abs(n.z)
  33238. ? r.setVector(e, -n.y, n.x, 0)
  33239. : r.setVector(e, 0, -n.z, n.y))
  33240. : r.cross(n, o, e),
  33241. (this._x = e.x),
  33242. (this._y = e.y),
  33243. (this._z = e.z),
  33244. (this._w = t),
  33245. this.normalize()
  33246. )
  33247. }
  33248. })(),
  33249. multiply: function (e) {
  33250. return this.multiplyQuaternions(this, e)
  33251. },
  33252. premultiply: function (e) {
  33253. return this.multiplyQuaternions(e, this)
  33254. },
  33255. multiplyQuaternions: function (e, t) {
  33256. var i = e._x,
  33257. n = e._y,
  33258. r = e._z,
  33259. o = e._w,
  33260. a = t._x,
  33261. s = t._y,
  33262. l = t._z,
  33263. c = t._w
  33264. return (
  33265. (this._x = i * c + o * a + n * l - r * s),
  33266. (this._y = n * c + o * s + r * a - i * l),
  33267. (this._z = r * c + o * l + i * s - n * a),
  33268. (this._w = o * c - i * a - n * s - r * l),
  33269. this
  33270. )
  33271. }
  33272. }),
  33273. (r.convertWorkshopVector = function (e) {
  33274. return new r.Vector3(-e.x, e.y, e.z)
  33275. }),
  33276. (r.convertWorkshopQuaternion = function (e) {
  33277. return new r.Quaternion(-e.x, e.y, e.z, -e.w).multiply(
  33278. new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0)
  33279. )
  33280. })
  33281. ;(r.convertWorkshopOrthoZoom = function (e) {
  33282. //xzw
  33283. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  33284. return e === -1
  33285. ? -1
  33286. : ((e * ($('#player').width() / $('#player').height())) / g_snapShotWidth) *
  33287. g_snapShotHeight
  33288. }),
  33289. (r.convertWorkshopPanoramaQuaternion = function (e) {
  33290. return new r.Quaternion(e.x, -e.y, -e.z, e.w)
  33291. .normalize()
  33292. .multiply(
  33293. new r.Quaternion().setFromAxisAngle(
  33294. new r.Vector3(0, 1, 0),
  33295. 270 * r.RADIANS_PER_DEGREE
  33296. )
  33297. )
  33298. }),
  33299. (r.normalize = function (e) {
  33300. var t = e.x * e.x + e.y * e.y + e.z * e.z,
  33301. i = Math.sqrt(t)
  33302. ;(e.x /= i), (e.y /= i), (e.z /= i)
  33303. }),
  33304. (r.dot = function (e, t) {
  33305. return e.x * t.x + e.y * t.y + e.z * t.z
  33306. }),
  33307. (r.cross = function (e, t, i) {
  33308. var n = e.x,
  33309. r = e.y,
  33310. o = e.z
  33311. ;(i.x = r * t.z - o * t.y), (i.y = o * t.x - n * t.z), (i.z = n * t.y - r * t.x)
  33312. }),
  33313. (r.setVector = function (e, t, i, n) {
  33314. ;(e.x = t), (e.y = i), (e.z = n)
  33315. }),
  33316. (r.copyVector = function (e, t) {
  33317. ;(t.x = e.x), (t.y = e.y), (t.z = e.z)
  33318. }),
  33319. (r.addVector = function (e, t) {
  33320. ;(e.x += t.x), (e.y += t.y), (e.z += t.z)
  33321. }),
  33322. (r.subVector = function (e, t) {
  33323. ;(e.x -= t.x), (e.y -= t.y), (e.z -= t.z)
  33324. }),
  33325. (r.applyQuaternionToVector = function (e, t) {
  33326. var i = t.x,
  33327. n = t.y,
  33328. r = t.z,
  33329. o = e.x,
  33330. a = e.y,
  33331. s = e.z,
  33332. l = e.w,
  33333. c = l * i + a * r - s * n,
  33334. h = l * n + s * i - o * r,
  33335. u = l * r + o * n - a * i,
  33336. d = -o * i - a * n - s * r
  33337. ;(t.x = c * l + d * -o + h * -s - u * -a),
  33338. (t.y = h * l + d * -a + u * -o - c * -s),
  33339. (t.z = u * l + d * -s + c * -a - h * -o)
  33340. }),
  33341. (r.angleBetweenVectors = function (e, t) {
  33342. return Math.acos(r.dot(e, t))
  33343. }),
  33344. (t.exports = r)
  33345. },
  33346. {
  33347. '../constants': 8
  33348. }
  33349. ],
  33350. 177: [
  33351. function (e, t, i) {
  33352. ;(function (i) {
  33353. 'use strict'
  33354. function n(e) {
  33355. ;(this.cache = null), (this.expires = 0)
  33356. }
  33357. function r() {
  33358. ;(this.baseUrl = null), (this.cache = null), (this.expires = 0)
  33359. }
  33360. function o() {
  33361. ;(this.baseUrl = null), (this.expires = 0)
  33362. }
  33363. function a(e) {
  33364. ;(this.initialLoadingPromise = null),
  33365. (this.endpoint = e + '?type=3'),
  33366. (this.urlContainer = null),
  33367. (this.authorizationHeader = h.getAuthorizationHeader()),
  33368. (this.containerClasses = [o, r, n])
  33369. }
  33370. var s = e('./ajax'),
  33371. l = e('./logger'),
  33372. c = e('../constants'),
  33373. h = e('./showcase'),
  33374. u = (e('../ab'), new l(i))
  33375. ;(n.prototype = {
  33376. version: 1,
  33377. validate: function (e) {
  33378. return 'catalog.json' in e && Object.keys(e).length > 0
  33379. },
  33380. update: function (e) {
  33381. return (
  33382. (this.cache = e),
  33383. (this.expires = Date.now() + c.signedUrlDefaultExpireTime),
  33384. $.when()
  33385. )
  33386. },
  33387. get: function (e) {
  33388. return this.cache[e]
  33389. }
  33390. }),
  33391. (r.prototype = {
  33392. version: 2,
  33393. validate: function (e) {
  33394. return 'catalog.json' in e && 'base.url' in e && Object.keys(e).length > 1
  33395. },
  33396. update: function (e) {
  33397. return (
  33398. (this.baseUrl = e['base.url']),
  33399. (this.cache = e),
  33400. (this.expires = Date.now() + c.signedUrlDefaultExpireTime),
  33401. $.when()
  33402. )
  33403. },
  33404. get: function (e) {
  33405. var t = this.cache[e]
  33406. return t ? this.baseUrl.replace('{{filename}}', e) + t : null
  33407. }
  33408. }),
  33409. (o.prototype = {
  33410. version: 3,
  33411. validate: function (e) {
  33412. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  33413. },
  33414. update: function (e) {
  33415. return (
  33416. (this.baseUrl = e.templates[0]),
  33417. e.expires
  33418. ? (this.expires = 1e3 * e.expires)
  33419. : (this.expires = Date.now() + c.signedUrlDefaultExpireTime),
  33420. $.when()
  33421. )
  33422. },
  33423. get: function (e) {
  33424. return this.baseUrl.replace('{{filename}}', e)
  33425. }
  33426. }),
  33427. (a.prototype = {
  33428. init: function () {
  33429. return this.initialLoadingPromise
  33430. ? this.initialLoadingPromise
  33431. : (setInterval(
  33432. function () {
  33433. var e = this.urlContainer ? this.urlContainer.expires : Date.now()
  33434. Date.now() + c.signedUrlRefreshBuffer > e &&
  33435. (u.debug('Refreshing urls...'),
  33436. this.refresh()
  33437. .done(function () {
  33438. u.debug('Refreshed')
  33439. })
  33440. .fail(function () {
  33441. u.error('Failed url refresh, urls might go stale soon')
  33442. }))
  33443. }.bind(this),
  33444. c.signedUrlCheckInterval
  33445. ),
  33446. (this.initialLoadingPromise = this.refresh()),
  33447. this.initialLoadingPromise)
  33448. },
  33449. refresh: function (e) {
  33450. //已经在someData.js里加载过了 不用再加载file了吧
  33451. e = e || {}
  33452. /*var t = void 0 === e.cache || e.cache;
  33453. return s.get( this.endpoint , { //file
  33454. responseType: "json",
  33455. prefetchFrom: t ? "files" : null,
  33456. cache: t,
  33457. auth: this.authorizationHeader
  33458. }).then(function(e) {
  33459. if (this.urlContainer && this.urlContainer.validate(e))
  33460. return this.urlContainer.update(e);
  33461. for (var i = 0; i < this.containerClasses.length; i++) {
  33462. var n = this.containerClasses[i]
  33463. , r = new n;
  33464. if (r.validate(e))
  33465. return u.info("Using urls version " + r.version),
  33466. this.urlContainer = r,
  33467. this.urlContainer.update(e)
  33468. }
  33469. return t ? this.refresh({
  33470. cache: !1
  33471. }) : $.Deferred().reject("missing-urls")
  33472. }
  33473. .bind(this), function(e) {
  33474. return "loading-failed"
  33475. }) */
  33476. return $.Deferred().resolve()
  33477. },
  33478. get: function (e) {
  33479. //return this.urlContainer.get(e)
  33480. return window.DATA.files.templates[0].replace('{{filename}}', e)
  33481. }
  33482. }),
  33483. (t.exports = a)
  33484. }).call(this, '/js/util/ModelUrls.js')
  33485. },
  33486. {
  33487. '../ab': 3,
  33488. '../constants': 8,
  33489. './ajax': 181,
  33490. './logger': 189,
  33491. './showcase': 193
  33492. }
  33493. ],
  33494. 178: [
  33495. function (e, t, i) {
  33496. ;(function (i) {
  33497. 'use strict'
  33498. function n() {
  33499. u.call(this), (this.neighbourMap = {}), (this.map = null)
  33500. }
  33501. var r = e('three'),
  33502. o = e('./common'),
  33503. a = e('../settings'),
  33504. s = e('../objects/Panorama'),
  33505. a = e('../settings'),
  33506. l = e('./aStar'),
  33507. c = e('./logger'),
  33508. h = new c(i),
  33509. u = e('./IndexedCollection'),
  33510. d = e('./transitions')
  33511. o.inherit(n, u),
  33512. (n.prototype.getIndex = function (e) {
  33513. return e.id
  33514. }),
  33515. (n.prototype.find = function (e, t) {
  33516. var i = o.filterAll(this.list, e)
  33517. return 0 === i.length
  33518. ? null
  33519. : (t &&
  33520. t.forEach(function (e) {
  33521. i = o.stableSort(i, e)
  33522. }),
  33523. i[0])
  33524. }),
  33525. /* n.prototype.sortByScore = function(e, t) {
  33526. var i = o.filterAll(this.list, e);
  33527. return 0 === i.length ? null : i = i.map(function(e) {
  33528. return {
  33529. pano: e,
  33530. score: t.reduce(function(t, i) {
  33531. return t + i(e)
  33532. }, 0)
  33533. }
  33534. }).sort(function(e, t) {
  33535. return t.score - e.score;
  33536. })
  33537. } */
  33538. (n.prototype.sortByScore = function (request, rank) {
  33539. return common.sortByScore(this.list, request, rank)
  33540. }),
  33541. (n.prototype.lowestByScore = function (e, t, i) {
  33542. return this.findRankedByScore(0, e, t, i)
  33543. }),
  33544. (n.prototype.findRankedByScore = function (e, t, i, n) {
  33545. n && ((n.candidates = null), (n.pano = null)), e || (e = 0)
  33546. var r = this.sortByScore(t, i)
  33547. return !r || 0 === r.length || e >= r.length
  33548. ? null
  33549. : (n && ((n.candidates = r), (n.pano = r[e].item)), r[e].item)
  33550. }),
  33551. (n.prototype.showPanoScores = function (e) {
  33552. this.list.forEach(function (e) {
  33553. e.removeTextSprite()
  33554. })
  33555. var t = 6344768
  33556. e.forEach(function (e) {
  33557. e.pano.addTextSprite(e.score.toFixed(2), t), (t = 16428055)
  33558. })
  33559. }),
  33560. (n.prototype.isNeighbour = function (e, t) {
  33561. return this.neighbourMap[e.id][t.id]
  33562. }),
  33563. (n.prototype.getNeighbours = function (e) {
  33564. return this.neighbourMap[e.id]
  33565. }),
  33566. (n.prototype.setNeighbour = function (e, t, i) {
  33567. return (
  33568. this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  33569. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  33570. (this.neighbourMap[e.id][e.id] = !0),
  33571. (this.neighbourMap[t.id][t.id] = !0),
  33572. (this.neighbourMap[e.id][t.id] = i),
  33573. (this.neighbourMap[t.id][e.id] = i),
  33574. this.neighbourMap[e.id]
  33575. )
  33576. }),
  33577. (n.prototype.findClosest = function (e, t) {
  33578. var i = [s.filters.isPanoAligned()]
  33579. return (
  33580. t && i.push(s.filters.inDirection(e, t, 0.75)),
  33581. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  33582. )
  33583. }),
  33584. (n.prototype.dualNeighbors = function (e, t) {
  33585. var i,
  33586. n = []
  33587. for (i in this.neighbourMap[e.id]) this.neighbourMap[t.id][i] && n.push(i)
  33588. return n
  33589. }),
  33590. (n.prototype.populate_path_graph = function () {
  33591. var e,
  33592. t,
  33593. i,
  33594. n,
  33595. o,
  33596. a,
  33597. s,
  33598. l,
  33599. c = Date.now(),
  33600. u = {},
  33601. d = 0,
  33602. p = new r.Vector3(0, 0, 0),
  33603. f = 0,
  33604. g = 0
  33605. for (e = 0; e < this.list.length; e += 1) {
  33606. ;(o = this.list[e]),
  33607. (s = {}),
  33608. (l = !1),
  33609. (i = o.neighbourPanos || o.findNeighourPanos())
  33610. for (t in i)
  33611. if (i[t]) {
  33612. ;(a = this.index[t]), p.copy(o.floorPosition), p.sub(a.floorPosition)
  33613. var m = Math.sqrt(p.x * p.x + p.z * p.z),
  33614. v = (Math.abs(p.y) / Math.max(m, 0.01), Math.max(0, Math.abs(p.y) - 0.2))
  33615. v > 0
  33616. ? ((f += 1),
  33617. (v = Math.pow(4 * v, 2)),
  33618. (m = Math.pow(m, 2)),
  33619. (n = Math.sqrt(v * v + m * m)))
  33620. : ((g += 1), (n = p.length())),
  33621. (s[a.id] = n),
  33622. (l = !0)
  33623. }
  33624. l ? (u[o.id] = s) : (d += 1)
  33625. }
  33626. ;(this.map = u),
  33627. h.info('graph ready in ' + (Date.now() - c) + 'ms, ' + d + ' had no neighbors')
  33628. }),
  33629. (n.prototype.aStarSearch = function (e, t) {
  33630. var i = Date.now(),
  33631. n = new l({
  33632. start: e,
  33633. isEnd: function (e) {
  33634. return e === t
  33635. },
  33636. neighbor: function (e) {
  33637. var t = e.neighbourPanos || e.findNeighourPanos(),
  33638. i = []
  33639. for (var n in t) t[n] && i.push(this.index[n]) //add: t[n] &&
  33640. return i
  33641. }.bind(this),
  33642. distance: function (e, t) {
  33643. var i = this.map[e.id],
  33644. n = i[t.id]
  33645. return n
  33646. }.bind(this),
  33647. heuristic: function (e, t) {
  33648. return 1
  33649. }.bind(this),
  33650. hash: function (e) {
  33651. return e.id
  33652. },
  33653. timeout: 5e3
  33654. })
  33655. if ((h.debug('A* search in ' + (Date.now() - i) + 'ms'), 'success' !== n.status))
  33656. return h.debug('Did not find A* path from ' + e + ' to ' + t), null
  33657. h.debug('Total cost ' + n.cost.toPrecision(3) + ', ' + n.path.length + ' steps')
  33658. var r = []
  33659. return (
  33660. n.path.forEach(function (e) {
  33661. r.push(e.id)
  33662. }),
  33663. r
  33664. )
  33665. }),
  33666. (n.prototype.includeNodesNearPath = (function () {
  33667. var e = new r.Vector3(),
  33668. t = new r.Vector3(),
  33669. i = new r.Vector3(),
  33670. n = new r.Vector3(),
  33671. o = new r.Vector3(),
  33672. a = new r.Vector3(),
  33673. s = new r.Vector3(),
  33674. l = new r.Vector3(),
  33675. c = [],
  33676. h = new r.Vector3(),
  33677. u = new r.Vector3()
  33678. return function (r, d) {
  33679. if (r)
  33680. for (
  33681. var p = function (e, t, i) {
  33682. return o.copy(t).sub(e), o.dot(i)
  33683. },
  33684. f = function (e, t) {
  33685. return p(h, e.position, i) - p(h, t.position, i)
  33686. },
  33687. g = 0;
  33688. g < r.length - 1;
  33689. ) {
  33690. var m = r[g],
  33691. v = r[g + 1],
  33692. A = this.index[m],
  33693. y = this.index[v]
  33694. h.copy(A.position),
  33695. u.copy(y.position),
  33696. (c.length = 0),
  33697. e.copy(u).sub(h),
  33698. i.copy(e).normalize()
  33699. for (var C = 0; C < this.list.length; C++) {
  33700. var I = this.list[C]
  33701. o.copy(I.position).sub(h)
  33702. var E = o.dot(i)
  33703. if (E > 0) {
  33704. s.copy(i), s.multiplyScalar(E), a.copy(o), a.sub(s)
  33705. var b = a.length()
  33706. if (b < d) {
  33707. t.copy(e).negate(), n.copy(t).normalize(), l.copy(I.position).sub(u)
  33708. var w = l.dot(n)
  33709. w > 0 && c.push(I)
  33710. }
  33711. }
  33712. }
  33713. if (c.length > 0) {
  33714. c.sort(f)
  33715. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  33716. r[_] = r[_ - c.length]
  33717. for (var T = 0; T < c.length; T++) r[T + g + 1] = c[T].id
  33718. }
  33719. g += c.length + 1
  33720. }
  33721. }
  33722. })()),
  33723. /* n.prototype. = function(e, t) {
  33724. var i = void 0 === e ? a.panorama.markerOpacity : e
  33725. , n = this.list.findIndex(function(e) {
  33726. return e.marker
  33727. });
  33728. if (!(n < 0)) {
  33729. var r = this.list[n].marker.material.opacity;
  33730. if (r !== e) {
  33731. var o = i - r;
  33732. d.trigger({
  33733. func: function(e, t) {
  33734. var i = r + e * o;
  33735. this.forEach(function(e) {
  33736. e.marker && (e.marker.material.opacity = i)
  33737. })
  33738. }
  33739. .bind(this),
  33740. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  33741. name: "_fpm"
  33742. })
  33743. }
  33744. }
  33745. } */
  33746. (n.prototype.fadeMarkerOpacity = function (e, t, gr) {
  33747. d.cancelById('fadeMarkerOpacity')
  33748. var n = this.list.findIndex(function (e) {
  33749. //why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  33750. return e.marker
  33751. })
  33752. if (n < 0) {
  33753. //logger.info('marker findIndex<0')
  33754. return
  33755. }
  33756. var group
  33757. var tran = function (list, index) {
  33758. list.member = list.member.filter(function (m) {
  33759. return m.marker && m.marker.material.opacity != list.toOp
  33760. })
  33761. transitions.trigger({
  33762. func: function (e, t) {
  33763. //e:0-1
  33764. list.member.forEach(function (m) {
  33765. var o = m.marker.oldOpacity
  33766. var i = o + e * (list.toOp - o)
  33767. m.marker && (m.marker.material.opacity = i)
  33768. })
  33769. }.bind(this),
  33770. duration: void 0 == t ? a.markerOpacityTransitionTime : t,
  33771. name: '_fpm_' + index,
  33772. id: 'fadeMarkerOpacity'
  33773. })
  33774. }
  33775. this.forEach(function (e) {
  33776. //先记录旧的opacity
  33777. e.marker && (e.marker.oldOpacity = e.marker.material.opacity)
  33778. })
  33779. group = gr
  33780. /* if (e > 0 && gr) {
  33781. group = gr
  33782. } else {
  33783. group = [
  33784. {
  33785. member: this.list,
  33786. toOp: 0,
  33787. },
  33788. ]
  33789. } */
  33790. for (var i = 0; i < group.length; i++) {
  33791. tran(group[i], i)
  33792. }
  33793. }),
  33794. (t.exports = n)
  33795. }).call(this, '/js/util/PanoramaCollection.js')
  33796. },
  33797. {
  33798. '../objects/Panorama': 148,
  33799. '../settings': 166,
  33800. './IndexedCollection': 175,
  33801. './aStar': 180,
  33802. './common': 185,
  33803. './logger': 189,
  33804. './transitions': 195,
  33805. three: 217
  33806. }
  33807. ],
  33808. 179: [
  33809. function (e, t, i) {
  33810. 'use strict'
  33811. function n() {
  33812. ;(this.actionSequence = []), (this.actionSequenceInProgress = !1)
  33813. }
  33814. function r(e, t, i, n) {
  33815. s.trackAlways('zoom_' + e, {
  33816. from: t,
  33817. to: i,
  33818. pano: n
  33819. })
  33820. }
  33821. function o(e, t) {
  33822. r('initial', 1, e, t)
  33823. }
  33824. function a(e, t, i) {
  33825. r('followup', e, t, i)
  33826. }
  33827. var s = e('../analytics')
  33828. ;(n.prototype.reset = function (e) {
  33829. ;(this.actionSequenceInProgress = !1), (this.actionSequence.length = 0)
  33830. }),
  33831. (n.prototype.addZoomAction = (function () {
  33832. var e = null,
  33833. t = null,
  33834. i = !1,
  33835. n = function () {
  33836. if (((e = null), this.actionSequence.length > 0)) {
  33837. var i = this.actionSequence[0].start,
  33838. n = this.actionSequence[this.actionSequence.length - 1].end
  33839. 1 === i ? o(n, t) : a(i, n, t)
  33840. }
  33841. this.reset()
  33842. }
  33843. return function (r, o, a) {
  33844. if (r !== o) {
  33845. i || ((n = n.bind(this)), (i = !0)),
  33846. e && (window.clearTimeout(e), (e = null)),
  33847. (a === t && this.actionSequenceInProgress) || (this.reset(), (t = a)),
  33848. (this.actionSequenceInProgress = !0)
  33849. var s = {
  33850. start: r,
  33851. end: o
  33852. }
  33853. this.actionSequence.push(s), (e = window.setTimeout(n, 150))
  33854. }
  33855. }
  33856. })()),
  33857. (t.exports = n)
  33858. },
  33859. {
  33860. '../analytics': 4
  33861. }
  33862. ],
  33863. 180: [
  33864. function (e, t, i) {
  33865. 'use strict'
  33866. function n(e) {
  33867. void 0 === e.timeout && (e.timeout = 1 / 0)
  33868. var t = e.hash || o,
  33869. i = {
  33870. data: e.start,
  33871. g: 0,
  33872. h: e.heuristic(e.start)
  33873. },
  33874. n = i
  33875. i.f = i.h
  33876. var h = new s(),
  33877. u = new l(a),
  33878. d = c()
  33879. u.push(i), d.set(t(i.data), i)
  33880. for (var p = new Date(); u.size(); ) {
  33881. if (new Date() - p > e.timeout)
  33882. return {
  33883. status: 'timeout',
  33884. cost: n.g,
  33885. path: r(n)
  33886. }
  33887. var f = u.pop()
  33888. if ((d.delete(t(f.data)), e.isEnd(f.data)))
  33889. return {
  33890. status: 'success',
  33891. cost: f.g,
  33892. path: r(f)
  33893. }
  33894. h.add(t(f.data))
  33895. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  33896. var v = g[m]
  33897. if (!h.contains(t(v))) {
  33898. var A = f.g + e.distance(f.data, v),
  33899. y = d.get(t(v)),
  33900. C = !1
  33901. if (void 0 === y)
  33902. (y = {
  33903. data: v
  33904. }),
  33905. d.set(t(v), y)
  33906. else {
  33907. if (y.g < A) continue
  33908. C = !0
  33909. }
  33910. ;(y.parent = f),
  33911. (y.g = A),
  33912. (y.h = e.heuristic(v)),
  33913. (y.f = A + y.h),
  33914. y.h < n.h && (n = y),
  33915. C ? u.heapify() : u.push(y)
  33916. }
  33917. }
  33918. }
  33919. return {
  33920. status: 'noPath',
  33921. cost: n.g,
  33922. path: r(n)
  33923. }
  33924. }
  33925. function r(e) {
  33926. if (void 0 !== e.parent) {
  33927. var t = r(e.parent)
  33928. return t.push(e.data), t
  33929. }
  33930. return [e.data]
  33931. }
  33932. function o(e) {
  33933. return e.toString()
  33934. }
  33935. function a(e, t) {
  33936. return e.f - t.f
  33937. }
  33938. var s = e('Set'),
  33939. l = e('heap'),
  33940. c = e('dict')
  33941. t.exports = n
  33942. },
  33943. {
  33944. Set: 196,
  33945. dict: 210,
  33946. heap: 211
  33947. }
  33948. ],
  33949. 181: [
  33950. function (e, t, i) {
  33951. ;(function (i) {
  33952. 'use strict'
  33953. function n(e, t, i) {
  33954. var n = new XMLHttpRequest()
  33955. if (i && 'withCredentials' in n) n.open(e, t, i)
  33956. else if ('undefined' != typeof XDomainRequest) (n = new XDomainRequest()), n.open(e, t)
  33957. else {
  33958. if (i) throw 'Browser does not support CORS!'
  33959. n.open(e, t)
  33960. }
  33961. return n
  33962. }
  33963. function r(e, t, i) {
  33964. function o() {
  33965. u.warn('Retrying ', t),
  33966. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  33967. }
  33968. function a(e, t) {
  33969. var i = e.response
  33970. if ('json' === t && 'object' != typeof i)
  33971. try {
  33972. i = JSON.parse(e.responseText)
  33973. } catch (e) {
  33974. return void c.reject({
  33975. error: 'Failed parsing JSON'
  33976. })
  33977. }
  33978. else if ('image/jpeg' === t) {
  33979. var n = new Uint8Array(e.response),
  33980. r = new Blob([n], {
  33981. type: 'image/jpeg'
  33982. }),
  33983. o = URL.createObjectURL(r)
  33984. ;(i = new Image()),
  33985. (i.src = o),
  33986. (i.crossOrigin = 'Anonymous'),
  33987. (i.onload = function () {
  33988. URL.revokeObjectURL(o)
  33989. })
  33990. }
  33991. return i
  33992. }
  33993. var s = n(e, t, !1)
  33994. if (
  33995. ((i = i || {}),
  33996. (i.retries = void 0 !== i.retries ? i.retries : 0),
  33997. (i.retry = void 0 !== i.retry ? i.retry : 'get' === e.toLowerCase()),
  33998. i.responseType)
  33999. )
  34000. if (['arraybuffer', 'text', 'json'].indexOf(i.responseType) > -1)
  34001. s.responseType = i.responseType
  34002. else {
  34003. if ('image/jpeg' !== i.responseType)
  34004. throw new Error(
  34005. 'reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"'
  34006. )
  34007. s.responseType = 'arraybuffer'
  34008. }
  34009. if (
  34010. ('json' === i.responseType && s.setRequestHeader('Accept', 'application/json'),
  34011. i.auth && s.setRequestHeader('Authorization', i.auth),
  34012. 'object' == typeof i.data &&
  34013. ((i.data = JSON.stringify(i.data)),
  34014. s.setRequestHeader('Content-Type', 'application/json')),
  34015. 'object' == typeof i.headers)
  34016. )
  34017. for (var l in i.headers) s.setRequestHeader(l, i.headers[l])
  34018. var c = $.Deferred()
  34019. return (
  34020. (s.onreadystatechange = function (e) {
  34021. if (4 === this.readyState)
  34022. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  34023. i.retries++, setTimeout(o, 1e3)
  34024. else if (200 === this.status) {
  34025. var t = a(this, i.responseType)
  34026. c.resolve(t)
  34027. } else c.reject(this)
  34028. }),
  34029. (s.onprogress = function (e) {
  34030. c.notify(e)
  34031. }),
  34032. s.send(i.data),
  34033. c.promise()
  34034. )
  34035. }
  34036. function o(e) {
  34037. return Object.keys(e)
  34038. .sort()
  34039. .map(function (t) {
  34040. return {
  34041. key: t,
  34042. value: e[t]
  34043. }
  34044. })
  34045. }
  34046. function a(e, t) {
  34047. var i = t.responseType || null,
  34048. n = t.auth || null,
  34049. r = t.prefetchFrom || null,
  34050. a = e + '__' + i + '__' + n + '__' + r
  34051. return (
  34052. t.headers &&
  34053. o(t.headers).forEach(function (e) {
  34054. a += '__' + e.key + ':' + e.value
  34055. }),
  34056. a
  34057. )
  34058. }
  34059. function s(e, t) {
  34060. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  34061. }
  34062. function l(e, t, i) {
  34063. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  34064. }
  34065. var c = e('./logger'),
  34066. h = e('../ab'),
  34067. u = new c(i)
  34068. ;(window.URL = window.URL || window.webkitURL),
  34069. (window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {}),
  34070. (window.DATA = window.DATA || {}),
  34071. /* setTimeout(function() {//MP-- xzw delete
  34072. window.MP_REQUEST_CACHE = null,
  34073. window.DATA = {}
  34074. }, 6e4),
  34075. window.onpageshow = function(e) {
  34076. e.persisted && (window.MP_REQUEST_CACHE = null,
  34077. window.DATA = {})
  34078. } */
  34079. (t.exports = {
  34080. get: function (e, t) {
  34081. t = t || {}
  34082. var i = void 0 === t.cache || t.cache
  34083. if (i) {
  34084. var n = s(e, t)
  34085. if (n) return n
  34086. }
  34087. var o
  34088. return (
  34089. (o =
  34090. t.prefetchFrom && window.DATA[t.prefetchFrom]
  34091. ? $.when(window.DATA[t.prefetchFrom])
  34092. : r('GET', e, t)),
  34093. i && l(e, t, o),
  34094. o
  34095. )
  34096. },
  34097. post: function (e, t) {
  34098. return r('POST', e, t)
  34099. },
  34100. patch: function (e, t) {
  34101. return r('PATCH', e, t)
  34102. },
  34103. getImage: function (e, t) {
  34104. function i() {
  34105. u.warn('Retrying ', e),
  34106. o
  34107. .getImage(e, t - 1)
  34108. .done(n.resolve.bind(n))
  34109. .progress(n.notify.bind(n))
  34110. .fail(n.reject.bind(n))
  34111. }
  34112. var n = $.Deferred(),
  34113. r = new Image(),
  34114. o = this
  34115. return (
  34116. (e = h.changeIfImageOptimzing(e)),
  34117. (null !== t && void 0 !== t) || (t = 3),
  34118. (r.onerror = function () {
  34119. t > 0 ? setTimeout(i, 1e3) : n.reject()
  34120. }),
  34121. (r.onload = function () {
  34122. n.resolve(r)
  34123. }),
  34124. (r.crossOrigin = 'anonymous'),
  34125. (r.src = e),
  34126. n
  34127. )
  34128. }
  34129. })
  34130. }).call(this, '/js/util/ajax.js')
  34131. },
  34132. {
  34133. '../ab': 3,
  34134. './logger': 189
  34135. }
  34136. ],
  34137. 182: [
  34138. function (e, t, i) {
  34139. 'use strict'
  34140. function n(e, t) {
  34141. var i = window.navigator.userAgent,
  34142. n = i.match(e)
  34143. return (
  34144. (n = n ? n[1].split(t) : []),
  34145. {
  34146. major: parseInt(n[0]) || 0,
  34147. minor: parseInt(n[1]) || 0,
  34148. patch: parseInt(n[2]) || 0
  34149. }
  34150. )
  34151. }
  34152. var r = e('../exception/DeviceMismatchException')
  34153. t.exports = {
  34154. supportsFullscreen: function () {
  34155. return (
  34156. document.fullscreenEnabled ||
  34157. document.mozFullscreenEnabled ||
  34158. document.mozFullScreenEnabled ||
  34159. document.webkitFullscreenEnabled ||
  34160. document.msFullscreenEnabled
  34161. )
  34162. },
  34163. isPointerLocked: function () {
  34164. return (
  34165. document.pointerLockElement ||
  34166. document.mozPointerLockElement ||
  34167. document.webkitPointerLockElement
  34168. )
  34169. },
  34170. requestFullscreen: function (e, t) {
  34171. e.requestFullscreen
  34172. ? e.requestFullscreen()
  34173. : e.mozRequestFullScreen
  34174. ? e.mozRequestFullScreen()
  34175. : e.webkitRequestFullscreen
  34176. ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)
  34177. : e.msRequestFullscreen && e.msRequestFullscreen(),
  34178. t &&
  34179. $(document).on(
  34180. 'fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange',
  34181. browser.requestPointerLock
  34182. )
  34183. },
  34184. requestPointerLock: function () {
  34185. var e
  34186. if (document.fullscreenElement) e = document.fullscreenElement()
  34187. else if (document.mozFullscreenElement) e = document.mozFullscreenElement()
  34188. else if (document.mozFullScreenElement) e = document.mozFullScreenElement()
  34189. else {
  34190. if (!document.webkitFullscreenElement) return
  34191. e = document.webkitFullscreenElement()
  34192. }
  34193. ;(e.requestPointerLock =
  34194. e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock),
  34195. e.requestPointerLock(),
  34196. $(document).off(
  34197. 'fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange',
  34198. this
  34199. )
  34200. },
  34201. exitPointerLock: function () {
  34202. ;(document.exitPointerLock =
  34203. document.exitPointerLock ||
  34204. document.mozExitPointerLock ||
  34205. document.webkitExitPointerLock),
  34206. document.exitPointerLock()
  34207. },
  34208. exitFullscreen: function () {
  34209. document.exitFullscreen
  34210. ? document.exitFullscreen()
  34211. : document.msExitFullscreen
  34212. ? document.msExitFullscreen()
  34213. : document.mozCancelFullScreen
  34214. ? document.mozCancelFullScreen()
  34215. : document.webkitExitFullscreen && document.webkitExitFullscreen()
  34216. },
  34217. details: function () {
  34218. var e = navigator.userAgent.match('(Firefox|Chrome|Safari)/([\\d]+)')
  34219. return e
  34220. ? {
  34221. name: e[1],
  34222. version: parseInt(e[2]),
  34223. platform: navigator.platform
  34224. }
  34225. : {}
  34226. },
  34227. is: function (e) {
  34228. return this.details() && this.details().name === e
  34229. },
  34230. inIframe: function () {
  34231. return window.parent !== window
  34232. },
  34233. aspectRatio: function () {
  34234. var e = $('#player').width() / $('#player').height()
  34235. return isFinite(e) ? e : 0
  34236. },
  34237. userAgent: function () {
  34238. return window.navigator.userAgent
  34239. },
  34240. isLandscape: function () {
  34241. return this.isMobile && this.aspectRatio() > 1
  34242. },
  34243. isSmallScreen: function () {
  34244. var e = screen.width / window.devicePixelRatio
  34245. return e < 240
  34246. },
  34247. detectIE: function () {
  34248. var e = window.navigator.userAgent,
  34249. t = e.indexOf('MSIE ')
  34250. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  34251. },
  34252. detectSafari: function () {
  34253. var e = window.navigator.userAgent,
  34254. t = e.indexOf('Safari')
  34255. return t !== -1 && !this.detectChrome()
  34256. },
  34257. detectFirefox: function () {
  34258. var e = window.navigator.userAgent
  34259. return e.indexOf('Firefox') !== -1
  34260. },
  34261. detectChrome: function () {
  34262. var e = window.navigator.userAgent
  34263. return e.indexOf('Chrome') !== -1 && !this.detectOpera()
  34264. },
  34265. detectOpera: function () {
  34266. var e = window.navigator.userAgent
  34267. return e.indexOf('OPR') !== -1
  34268. },
  34269. detectIOS: function () {
  34270. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  34271. },
  34272. detectIPad: function () {
  34273. var e = window.navigator.userAgent,
  34274. t = /iPad/
  34275. return t.test(e)
  34276. },
  34277. detectIPod: function () {
  34278. var e = window.navigator.userAgent,
  34279. t = /iPod/
  34280. return t.test(e)
  34281. },
  34282. detectIPhone: function () {
  34283. var e = window.navigator.userAgent,
  34284. t = /iPhone/
  34285. return t.test(e)
  34286. },
  34287. detectAndroid: function () {
  34288. var e = window.navigator.userAgent
  34289. return e.indexOf('Android') !== -1
  34290. },
  34291. detectAndroidMobile: function () {
  34292. var e = window.navigator.userAgent
  34293. return this.detectAndroid() && e.indexOf('Mobile') !== -1
  34294. },
  34295. detectSamsungNative: function () {
  34296. var e = window.navigator.userAgent
  34297. return (
  34298. e.indexOf('SM-G900H') !== -1 ||
  34299. e.indexOf('GT-I9500') !== -1 ||
  34300. e.indexOf('SM-N900') !== -1
  34301. )
  34302. },
  34303. detectSamsungS6: function () {
  34304. var e = window.navigator.userAgent
  34305. return e.indexOf('SM-G92') !== -1
  34306. },
  34307. /************************************************************fyz改from徐世廷*************************************************************/
  34308. detectHUAWEI5X: function () {
  34309. return -1 !== window.navigator.userAgent.indexOf('KIW-TL00H')
  34310. },
  34311. /*******************************************************************************************************************************/
  34312. detectWebVR: function () {
  34313. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  34314. },
  34315. getVRDisplay: function () {
  34316. var e = $.Deferred()
  34317. return this.detectWebVR()
  34318. ? (navigator.getVRDisplays().then(function (t) {
  34319. t.length >= 1 && e.resolve(t[0]), e.reject(null)
  34320. }),
  34321. e)
  34322. : e.reject(null)
  34323. },
  34324. iosVersion: function () {
  34325. if (!this.detectIOS()) throw new r('Did not detect an iDevice')
  34326. var e = /((?:\d+\_?){1,3}) like Mac OS/,
  34327. t = '_'
  34328. return n(e, t)
  34329. },
  34330. androidVersion: function () {
  34331. if (!this.detectAndroid()) throw new r('Did not detect an Android based device')
  34332. var e = /Android ((?:\d+\.?){1,3})/,
  34333. t = '.'
  34334. return n(e, t)
  34335. },
  34336. valueFromCookie: function (e, t) {
  34337. var i = new RegExp(e + '=([0-9a-f]+)(; ?|$)').exec(document.cookie)
  34338. if (!i) return t
  34339. var n = i[1]
  34340. return 'boolean' == typeof t
  34341. ? 'true' === n || '1' === n
  34342. : 'number' == typeof t
  34343. ? parseFloat(n)
  34344. : n
  34345. }
  34346. }
  34347. Object.assign(window.browser, t.exports)
  34348. t.exports = window.browser
  34349. changeLog()
  34350. },
  34351. {
  34352. '../exception/DeviceMismatchException': 56
  34353. }
  34354. ],
  34355. 183: [
  34356. function (e, t, i) {
  34357. ;(function (i) {
  34358. 'use strict'
  34359. function n(e, t) {
  34360. var i = r(t)
  34361. var replaceAll = function (str, f, e) {
  34362. //f全部替换成e
  34363. var reg = new RegExp(f, 'g') //创建正则RegExp对象
  34364. return str.replace(reg, e)
  34365. }
  34366. var urlFirstView = c.valueFromHash('firstView')
  34367. if (urlFirstView) {
  34368. //&firstView=pano:e98808cfdb894f33851c3b3d7d0a2679,qua:-0.015155019941222028,0.3253822291629593,0.005215708110435864,0.945446737862511&qs=1
  34369. try {
  34370. urlFirstView = replaceAll(urlFirstView, 'pano:', '"pano":"')
  34371. if (urlFirstView.includes('qua')) {
  34372. urlFirstView = replaceAll(urlFirstView, ',qua:', '","qua":[')
  34373. urlFirstView += ']'
  34374. } else {
  34375. urlFirstView += '"'
  34376. }
  34377. urlFirstView = '{' + urlFirstView + '}'
  34378. let info = JSON.parse(urlFirstView)
  34379. i.pano = t.index[info.pano] //panos.get(info.pano)
  34380. if (!i.pano) {
  34381. urlFirstView = false
  34382. console.error('检测到firstView但是 找不到该pano')
  34383. } else {
  34384. if (info.qua) {
  34385. i.quaternion = new THREE.Quaternion().fromArray(info.qua)
  34386. } else {
  34387. i.quaternion = new THREE.Quaternion()
  34388. }
  34389. i.zoom = -1
  34390. i.mode = 'panorama'
  34391. i.setByUrl = true
  34392. }
  34393. } catch (e) {
  34394. urlFirstView = false
  34395. console.error('检测到firstView但是解析出错' + e)
  34396. }
  34397. }
  34398. if (Object.keys(i).length > 0) return i
  34399. if (e.heroImage) i = o(e, t)
  34400. else if (window.DATA.camera_start) {
  34401. var n = window.DATA.camera_start
  34402. try {
  34403. Object.keys(n).length > 0 &&
  34404. !l.isEmptyQuaternion(n.camera.quaternion) &&
  34405. ((i.mode = h.convertWorkshopModeInt(n.mode)),
  34406. (i.position = n.camera.position),
  34407. //i.quaternion = n.camera.quaternion,
  34408. (i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion)), //xzw
  34409. (i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom)),
  34410. n.pano &&
  34411. ((i.pano = t.get(n.pano.uuid) || t.findClosest(i.position)),
  34412. d.debug('Using camera_start'),
  34413. d.debug('Modeldata pano: ', i.pano.quaternion),
  34414. d.debug('Camera start pano: ', n.pano.quaternion)),
  34415. i.mode !== h.PANORAMA &&
  34416. (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  34417. } catch (e) {
  34418. d.warn(e.message)
  34419. if (i.mode == 'panorama' && !i.pano) i.pano = t.list[0]
  34420. }
  34421. }
  34422. if (
  34423. (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  34424. i.mode === h.MESH &&
  34425. i.position &&
  34426. ((i.mode = h.PANORAMA),
  34427. (i.pano = t.findClosest(i.position)),
  34428. (i.quaternion = i.pano.quaternion)),
  34429. 0 === Object.keys(i).length)
  34430. ) {
  34431. var a = t.list[0]
  34432. a &&
  34433. ((i.mode = h.PANORAMA),
  34434. (i.pano = a),
  34435. (i.position = a.position),
  34436. (i.quaternion = a.quaternion),
  34437. d.info('Starting at 1st pano ' + a.id))
  34438. }
  34439. return (i.mode = i.mode || h.DOLLHOUSE), i
  34440. }
  34441. function r(e) {
  34442. var t = c.valueFromHash('start', ''),
  34443. i = {}
  34444. if ('' !== t) {
  34445. d.debug('Start override found in parameters, trying to parse...'), (i = a(t) || {})
  34446. var n = c.valueFromHash('tag', null)
  34447. n && (i.tag = n), i.panoId && (i.pano = e.get(i.panoId))
  34448. }
  34449. return i
  34450. }
  34451. function o(e, t) {
  34452. if (!e.heroImage || !e.heroImage.metadata.camera_position) return {}
  34453. var i = {},
  34454. n = e.heroImage.metadata
  34455. d.debug('Using start position from thumbnail image'),
  34456. (i.position = n.camera_position),
  34457. (i.quaternion = n.camera_quaternion)
  34458. try {
  34459. ;(i.mode = h.convertWorkshopModeInt(n.camera_mode)),
  34460. i.mode === h.PANORAMA
  34461. ? (i.pano = t.get(n.scan_id))
  34462. : (i.floorVisibility = n.floor_visibility)
  34463. } catch (e) {
  34464. d.debug(e.message)
  34465. }
  34466. return i
  34467. }
  34468. function a(e) {
  34469. return s.deserialize(e)
  34470. }
  34471. var s = e('../controls/serializer'),
  34472. l = e('../util/math'),
  34473. c = e('./browser'),
  34474. h = e('../enum/Viewmode'),
  34475. u = e('../util/logger'),
  34476. th = e('three'), //xzw
  34477. d = new u(i)
  34478. t.exports = {
  34479. getStartCameraOptions: n
  34480. }
  34481. }).call(this, '/js/util/camera.js')
  34482. },
  34483. {
  34484. '../controls/serializer': 14,
  34485. '../enum/Viewmode': 51,
  34486. '../util/logger': 189,
  34487. '../util/math': 190,
  34488. './browser': 182,
  34489. three: 217
  34490. }
  34491. ],
  34492. 184: [
  34493. function (e, t, i) {
  34494. 'use strict'
  34495. function n(e, t, i) {
  34496. return o(e.fov, t, i)
  34497. }
  34498. var r = e('./MathLight'),
  34499. o = function (e, t, i) {
  34500. var n = t,
  34501. o = i,
  34502. a =
  34503. 2 *
  34504. Math.atan(Math.tan((e * r.RADIANS_PER_DEGREE) / 2) * (n / o)) *
  34505. r.DEGREES_PER_RADIAN
  34506. return a
  34507. },
  34508. a = function (e, t, i) {
  34509. var n = t,
  34510. o = i,
  34511. a =
  34512. 2 *
  34513. Math.atan(Math.tan((e * r.RADIANS_PER_DEGREE) / 2) * (o / n)) *
  34514. r.DEGREES_PER_RADIAN
  34515. return a
  34516. },
  34517. s = function (e, t, i, n) {
  34518. var r = o(e, i, n)
  34519. return r > t ? a(t, i, n) : e
  34520. }
  34521. t.exports = {
  34522. clampVFOV: s,
  34523. getHFOVForCamera: n,
  34524. getHFOVFromVFOV: o,
  34525. getVFOVFromHFOV: a
  34526. }
  34527. window.MathLight = t.exports
  34528. MathLight.closeTo = function (e1, e2, precision) {
  34529. //xzw add 判断e1,e2是否接近
  34530. var prec = Math.pow(10, -(precision || 4))
  34531. var s1 =
  34532. Math.abs(e1.x - e2.x) < prec &&
  34533. Math.abs(e1.y - e2.y) < prec &&
  34534. Math.abs(e1.z - e2.z) < prec
  34535. if (e1.w) {
  34536. return s1 && Math.abs(e1.w - e2.w) < prec
  34537. } else return s1
  34538. }
  34539. },
  34540. {
  34541. './MathLight': 176
  34542. }
  34543. ],
  34544. 185: [
  34545. function (e, t, i) {
  34546. 'use strict'
  34547. var n = e('three')
  34548. ;(t.exports = {
  34549. delayOneFrame: function (e) {
  34550. window.setTimeout(e, 1)
  34551. },
  34552. normalizeUrl: function (e) {
  34553. return e.replace('https://', 'http://')
  34554. },
  34555. domainFromUrl: function (e) {
  34556. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e)
  34557. return t ? t[3] : e
  34558. },
  34559. average: function (e, t) {
  34560. if (0 === e.length) return null
  34561. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  34562. var o = t ? e[r][t] : e[r]
  34563. ;(i += o), n++
  34564. }
  34565. return i / n
  34566. },
  34567. countUnique: function (e) {
  34568. for (var t = {}, i = 0; i < e.length; i++) t[e[i]] = 1 + (t[e[i]] || 0)
  34569. return Object.keys(t).length
  34570. },
  34571. averageVectors: function (e, t) {
  34572. var i = new n.Vector3()
  34573. if (0 === e.length) return i
  34574. for (var r = 0, o = 0; o < e.length; o++) {
  34575. var a = t ? e[o][t] : e[o]
  34576. i.add(a), r++
  34577. }
  34578. return i.divideScalar(r)
  34579. },
  34580. equalLists: function (e, t) {
  34581. if (e.length !== t.length) return !1
  34582. for (var i = 0; i < e.length; i++) if (e[i] !== t[i]) return !1
  34583. return !0
  34584. },
  34585. lowerMedian: function (e, t) {
  34586. if (0 === e.length) return null
  34587. ;(t = t || 2),
  34588. e.sort(function (e, t) {
  34589. return e - t
  34590. })
  34591. var i = Math.floor(e.length / t)
  34592. return e[i]
  34593. },
  34594. stableSort: function (e, t) {
  34595. return e
  34596. .map(function (e, t) {
  34597. return {
  34598. value: e,
  34599. index: t
  34600. }
  34601. })
  34602. .sort(function (e, i) {
  34603. var n = t(e.value, i.value)
  34604. return 0 !== n ? n : e.index - i.index
  34605. })
  34606. .map(function (e) {
  34607. return e.value
  34608. })
  34609. },
  34610. filterAll: function (e, t) {
  34611. return e.filter(function (e) {
  34612. return t.every(function (t) {
  34613. return t(e)
  34614. })
  34615. })
  34616. },
  34617. formatDate: function (e) {
  34618. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join('-')
  34619. },
  34620. formatDatetime: function (e) {
  34621. return [
  34622. e.getFullYear(),
  34623. e.getMonth() + 1,
  34624. e.getDate(),
  34625. e.getHours(),
  34626. e.getMinutes()
  34627. ].join('-')
  34628. },
  34629. randomString: function (e) {
  34630. for (
  34631. var t = '',
  34632. i = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
  34633. n = 0;
  34634. n < e;
  34635. n++
  34636. )
  34637. t += i.charAt(Math.floor(Math.random() * i.length))
  34638. return t
  34639. },
  34640. uint8ToBase64: function (e, t) {
  34641. ;(t && 'number' == typeof t) || (t = 8192)
  34642. for (var i = [], n = 0; n < e.length; n += t)
  34643. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)))
  34644. return btoa(i.join(''))
  34645. },
  34646. uuid4: function e(t) {
  34647. return t
  34648. ? (t ^ ((16 * Math.random()) >> (t / 4))).toString(16)
  34649. : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  34650. },
  34651. nth: function (e) {
  34652. return (
  34653. (e %= 10), 1 === e ? e + 'st' : 2 === e ? e + 'nd' : 3 === e ? e + 'rd' : e + 'th'
  34654. )
  34655. },
  34656. extendObject: function (e, t) {
  34657. return (
  34658. Object.keys(t).forEach(function (i) {
  34659. e[i] = t[i]
  34660. }),
  34661. e
  34662. )
  34663. },
  34664. deepExtend: function e(t) {
  34665. t = t || {}
  34666. for (var i = 1; i < arguments.length; i++) {
  34667. var n = arguments[i]
  34668. if (n)
  34669. for (var r in n)
  34670. n.hasOwnProperty(r) &&
  34671. ('object' == typeof n[r] ? (t[r] = e(t[r], n[r])) : (t[r] = n[r]))
  34672. }
  34673. return t
  34674. },
  34675. inherit: function (e, t) {
  34676. ;(e.prototype = Object.create(t.prototype)), (e.prototype.constructor = e)
  34677. },
  34678. extend: function (e, t) {
  34679. for (var i in t.prototype) e.prototype[i] = t.prototype[i]
  34680. },
  34681. getFileNameFromUrl: function (url) {
  34682. return url.split('/').pop()
  34683. }
  34684. }),
  34685. (Math.sign = function (e) {
  34686. return e < 0 ? -1 : 1
  34687. })
  34688. window.common = t.exports
  34689. expandCommon(common)
  34690. },
  34691. {
  34692. three: 217
  34693. }
  34694. ],
  34695. 186: [
  34696. function (e, t, i) {
  34697. 'use strict'
  34698. var n = {}
  34699. ;(n.linearTween = function (e, t, i, n) {
  34700. return (i * e) / n + t
  34701. }),
  34702. (n.easeInQuad = function (e, t, i, n) {
  34703. return (e /= n), i * e * e + t
  34704. }),
  34705. (n.easeOutQuad = function (e, t, i, n) {
  34706. return (e /= n), -i * e * (e - 2) + t
  34707. }),
  34708. (n.easeInOutQuad = function (e, t, i, n) {
  34709. return (
  34710. (e /= n / 2), e < 1 ? (i / 2) * e * e + t : (e--, (-i / 2) * (e * (e - 2) - 1) + t)
  34711. )
  34712. }),
  34713. (n.easeInCubic = function (e, t, i, n) {
  34714. return (e /= n), i * e * e * e + t
  34715. }),
  34716. (n.easeOutCubic = function (e, t, i, n) {
  34717. return (e /= n), e--, i * (e * e * e + 1) + t
  34718. }),
  34719. (n.easeInOutCubic = function (e, t, i, n) {
  34720. return (
  34721. (e /= n / 2),
  34722. e < 1 ? (i / 2) * e * e * e + t : ((e -= 2), (i / 2) * (e * e * e + 2) + t)
  34723. )
  34724. }),
  34725. (n.easeInQuart = function (e, t, i, n) {
  34726. return (e /= n), i * e * e * e * e + t
  34727. }),
  34728. (n.easeOutQuart = function (e, t, i, n) {
  34729. return (e /= n), e--, -i * (e * e * e * e - 1) + t
  34730. }),
  34731. (n.easeInOutQuart = function (e, t, i, n) {
  34732. return (
  34733. (e /= n / 2),
  34734. e < 1 ? (i / 2) * e * e * e * e + t : ((e -= 2), (-i / 2) * (e * e * e * e - 2) + t)
  34735. )
  34736. }),
  34737. (n.easeInQuint = function (e, t, i, n) {
  34738. return (e /= n), i * e * e * e * e * e + t
  34739. }),
  34740. (n.easeOutQuint = function (e, t, i, n) {
  34741. return (e /= n), e--, i * (e * e * e * e * e + 1) + t
  34742. }),
  34743. (n.easeInOutQuint = function (e, t, i, n) {
  34744. return (
  34745. (e /= n / 2),
  34746. e < 1
  34747. ? (i / 2) * e * e * e * e * e + t
  34748. : ((e -= 2), (i / 2) * (e * e * e * e * e + 2) + t)
  34749. )
  34750. }),
  34751. (n.easeInSine = function (e, t, i, n) {
  34752. return -i * Math.cos((e / n) * (Math.PI / 2)) + i + t
  34753. }),
  34754. (n.easeOutSine = function (e, t, i, n) {
  34755. return i * Math.sin((e / n) * (Math.PI / 2)) + t
  34756. }),
  34757. (n.easeInOutSine = function (e, t, i, n) {
  34758. return (-i / 2) * (Math.cos((Math.PI * e) / n) - 1) + t
  34759. }),
  34760. (n.easeInExpo = function (e, t, i, n) {
  34761. return i * Math.pow(2, 10 * (e / n - 1)) + t
  34762. }),
  34763. (n.easeOutExpo = function (e, t, i, n) {
  34764. return i * (-Math.pow(2, (-10 * e) / n) + 1) + t
  34765. }),
  34766. (n.easeInOutExpo = function (e, t, i, n) {
  34767. return (
  34768. (e /= n / 2),
  34769. e < 1
  34770. ? (i / 2) * Math.pow(2, 10 * (e - 1)) + t
  34771. : (e--, (i / 2) * (-Math.pow(2, -10 * e) + 2) + t)
  34772. )
  34773. }),
  34774. (n.easeInCirc = function (e, t, i, n) {
  34775. return (e /= n), -i * (Math.sqrt(1 - e * e) - 1) + t
  34776. }),
  34777. (n.easeOutCirc = function (e, t, i, n) {
  34778. return (e /= n), e--, i * Math.sqrt(1 - e * e) + t
  34779. }),
  34780. (n.easeInOutCirc = function (e, t, i, n) {
  34781. return (
  34782. (e /= n / 2),
  34783. e < 1
  34784. ? (-i / 2) * (Math.sqrt(1 - e * e) - 1) + t
  34785. : ((e -= 2), (i / 2) * (Math.sqrt(1 - e * e) + 1) + t)
  34786. )
  34787. }),
  34788. (n.easeInElastic = function (e, t, i, n) {
  34789. var r = 1.70158,
  34790. o = 0,
  34791. a = i
  34792. return 0 === e
  34793. ? t
  34794. : 1 === (e /= n)
  34795. ? t + i
  34796. : (o || (o = 0.3 * n),
  34797. a < Math.abs(i)
  34798. ? ((a = i), (r = o / 4))
  34799. : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  34800. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin(((e * n - r) * (2 * Math.PI)) / o)) + t)
  34801. }),
  34802. (n.easeOutElastic = function (e, t, i, n) {
  34803. var r = 1.70158,
  34804. o = 0,
  34805. a = i
  34806. return 0 === e
  34807. ? t
  34808. : 1 === (e /= n)
  34809. ? t + i
  34810. : (o || (o = 0.3 * n),
  34811. a < Math.abs(i)
  34812. ? ((a = i), (r = o / 4))
  34813. : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  34814. a * Math.pow(2, -10 * e) * Math.sin(((e * n - r) * (2 * Math.PI)) / o) + i + t)
  34815. }),
  34816. (n.easeInOutElastic = function (e, t, i, n) {
  34817. var r = 1.70158,
  34818. o = 0,
  34819. a = i
  34820. return 0 === e
  34821. ? t
  34822. : 2 === (e /= n / 2)
  34823. ? t + i
  34824. : (o || (o = n * (0.3 * 1.5)),
  34825. a < Math.abs(i)
  34826. ? ((a = i), (r = o / 4))
  34827. : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  34828. e < 1
  34829. ? -0.5 *
  34830. (a *
  34831. Math.pow(2, 10 * (e -= 1)) *
  34832. Math.sin(((e * n - r) * (2 * Math.PI)) / o)) +
  34833. t
  34834. : a *
  34835. Math.pow(2, -10 * (e -= 1)) *
  34836. Math.sin(((e * n - r) * (2 * Math.PI)) / o) *
  34837. 0.5 +
  34838. i +
  34839. t)
  34840. }),
  34841. (n.easeInBack = function (e, t, i, n, r) {
  34842. return void 0 === r && (r = 1.70158), i * (e /= n) * e * ((r + 1) * e - r) + t
  34843. }),
  34844. (n.easeOutBack = function (e, t, i, n, r) {
  34845. return (
  34846. void 0 === r && (r = 1.70158), i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  34847. )
  34848. }),
  34849. (n.easeInOutBack = function (e, t, i, n, r) {
  34850. return (
  34851. void 0 === r && (r = 1.70158),
  34852. (e /= n / 2) < 1
  34853. ? (i / 2) * (e * e * (((r *= 1.525) + 1) * e - r)) + t
  34854. : (i / 2) * ((e -= 2) * e * (((r *= 1.525) + 1) * e + r) + 2) + t
  34855. )
  34856. }),
  34857. (n.easeOutBounce = function (e, t, i, n) {
  34858. return (e /= n) < 1 / 2.75
  34859. ? i * (7.5625 * e * e) + t
  34860. : e < 2 / 2.75
  34861. ? i * (7.5625 * (e -= 1.5 / 2.75) * e + 0.75) + t
  34862. : e < 2.5 / 2.75
  34863. ? i * (7.5625 * (e -= 2.25 / 2.75) * e + 0.9375) + t
  34864. : i * (7.5625 * (e -= 2.625 / 2.75) * e + 0.984375) + t
  34865. }),
  34866. (n.easeInBounce = function (e, t, i, r) {
  34867. return i - n.easeOutBounce(r - e, 0, i, r) + t
  34868. }),
  34869. (n.easeInOutBounce = function (e, t, i, r) {
  34870. return e < r / 2
  34871. ? 0.5 * n.easeInBounce(2 * e, 0, i, r) + t
  34872. : 0.5 * n.easeOutBounce(x, 2 * e - r, 0, i, r) + 0.5 * i + t
  34873. }),
  34874. (t.exports = n)
  34875. window.easing = n
  34876. },
  34877. {}
  34878. ],
  34879. 187: [
  34880. function (e, t, i) {
  34881. 'use strict'
  34882. function n() {
  34883. ;(this.events = []), (this.valid = !1)
  34884. }
  34885. var r = e('../enum/Joystick')
  34886. ;(n.prototype.push = function (e, t) {
  34887. this.events.push({
  34888. direction: e,
  34889. pano: t
  34890. }),
  34891. (this.valid = !0)
  34892. }),
  34893. (n.prototype.pop = function (e) {
  34894. var t = this.events.pop()
  34895. return this.events.length < 1 && (this.valid = !1), t
  34896. }),
  34897. (n.prototype.peek = function () {
  34898. return this.events.length
  34899. ? this.events[this.events.length - 1]
  34900. : {
  34901. direction: null,
  34902. pano: null
  34903. }
  34904. }),
  34905. (n.prototype.invalidate = function () {
  34906. ;(this.events = []), (this.valid = !1)
  34907. }),
  34908. (n.prototype.reversePano = function (e) {
  34909. if (!this.valid) return null
  34910. var t = this.peek()
  34911. return r.opposite(e) === t.direction ? (this.pop(), t.pano) : null
  34912. }),
  34913. (t.exports = n)
  34914. },
  34915. {
  34916. '../enum/Joystick': 29
  34917. }
  34918. ],
  34919. 188: [
  34920. function (e, t, i) {
  34921. 'use strict'
  34922. window.lerp = t.exports = {
  34923. vector: function (e, t) {
  34924. var i = e.clone()
  34925. return (
  34926. (t = t.clone()),
  34927. function (n) {
  34928. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  34929. }
  34930. )
  34931. },
  34932. quaternion: function (e, t) {
  34933. var i = e.clone()
  34934. return function (n) {
  34935. e.copy(i).slerp(t, n)
  34936. }
  34937. },
  34938. property: function (e, t, i, n) {
  34939. var r = e[t]
  34940. return function (o) {
  34941. ;(e[t] = r * (1 - o) + i * o), n && n(e[t])
  34942. }
  34943. },
  34944. uniform: function (e, t, i) {
  34945. var n = e.material.uniforms[t].value
  34946. return function (r) {
  34947. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  34948. }
  34949. },
  34950. matrix4: function (e, t) {
  34951. var i = e.clone()
  34952. return function (n) {
  34953. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  34954. r[s] = o[s] * (1 - n) + a[s] * n
  34955. }
  34956. },
  34957. allUniforms: function (e, t, i) {
  34958. var n = e.map(
  34959. function (e) {
  34960. return this.uniform(e, t, i)
  34961. }.bind(this)
  34962. )
  34963. return function (e) {
  34964. n.forEach(function (t) {
  34965. t(e)
  34966. })
  34967. }
  34968. }
  34969. }
  34970. },
  34971. {}
  34972. ],
  34973. 189: [
  34974. function (e, t, i) {
  34975. 'use strict'
  34976. function n(e) {
  34977. var t,
  34978. i,
  34979. o,
  34980. a,
  34981. s = e.split('/'),
  34982. l = '[' + s[s.length - 1].replace('.js', '') + ']',
  34983. c = {}
  34984. if (n.consoleEnabled) {
  34985. var h = function (e) {
  34986. $('#debug-console').append('<p>' + e + '</p>'),
  34987. ($('#debug-console')[0].scrollTop = $('#debug-console')[0].scrollHeight)
  34988. }
  34989. ;(t = function (e) {
  34990. h(Array.prototype.slice.call(arguments).join(' '))
  34991. }),
  34992. (i = function (e) {
  34993. h(Array.prototype.slice.call(arguments).join(' '))
  34994. }),
  34995. (o = function (e) {
  34996. h('WARN: ' + Array.prototype.slice.call(arguments).join(' '))
  34997. }),
  34998. (a = function (e) {
  34999. h('ERROR: ' + Array.prototype.slice.call(arguments).join(' '))
  35000. })
  35001. } else
  35002. console.log
  35003. ? ((t = console.log),
  35004. (i = console.info ? console.info : console.log),
  35005. (o = console.warn ? console.warn : console.log),
  35006. (a = console.error ? console.error : console.log))
  35007. : (t = i = o = a = function () {})
  35008. var u = function (e) {
  35009. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  35010. },
  35011. d = function (t, i) {
  35012. if (r) {
  35013. var o = Array.prototype.slice.call(t).join(' ')
  35014. r.captureMessage(o, {
  35015. level: i,
  35016. path: e,
  35017. timestamp: n.timestamp()
  35018. })
  35019. }
  35020. },
  35021. p = function (t, i) {
  35022. if (r) {
  35023. var o = Array.prototype.slice.call(t).join(' ')
  35024. r.captureException(new Error(o), {
  35025. level: i,
  35026. path: e,
  35027. timestamp: n.timestamp()
  35028. })
  35029. }
  35030. }
  35031. return {
  35032. debug: function () {
  35033. n.level >= n.levels.debug && t.apply(console, u(arguments))
  35034. },
  35035. info: function () {
  35036. n.level >= n.levels.info && i.apply(console, u(arguments))
  35037. },
  35038. warn: function () {
  35039. d(arguments, 'warn'), n.level >= n.levels.warn && o.apply(console, u(arguments))
  35040. },
  35041. error: function () {
  35042. p(arguments, 'error'), n.level >= n.levels.error && a.apply(console, u(arguments))
  35043. },
  35044. v3str: function (e, t) {
  35045. var i = void 0 === t ? 2 : t
  35046. return (
  35047. '(' +
  35048. e.x.toPrecision(i) +
  35049. ', ' +
  35050. e.y.toPrecision(i) +
  35051. ', ' +
  35052. e.z.toPrecision(i) +
  35053. ')'
  35054. )
  35055. },
  35056. eulstr: function (e, t) {
  35057. var i = void 0 === t ? 2 : t
  35058. return (
  35059. '(' +
  35060. THREE.Math.radToDeg(e.x).toPrecision(i) +
  35061. ', ' +
  35062. THREE.Math.radToDeg(e.y).toPrecision(i) +
  35063. ', ' +
  35064. THREE.Math.radToDeg(e.z).toPrecision(i) +
  35065. ' "' +
  35066. e.order +
  35067. '")'
  35068. )
  35069. },
  35070. time: function (e) {
  35071. n.level >= n.levels.debug && (c[e] = Date.now())
  35072. },
  35073. timeEnd: function (e) {
  35074. if (n.level >= n.levels.debug) {
  35075. var t = c[e]
  35076. if (!t) return
  35077. var i = (Date.now() - t) / 1e3
  35078. this.debug(e, i + 's')
  35079. }
  35080. }
  35081. }
  35082. }
  35083. var r = window.Raven
  35084. ;(n.timestamp = function () {
  35085. return (Date.now() - window.navigationStart) / 1e3 + 's'
  35086. }),
  35087. (n.levels = {
  35088. debug: 3,
  35089. info: 2,
  35090. warn: 1,
  35091. error: 0
  35092. }),
  35093. (n.level = n.levels.info),
  35094. (t.exports = n)
  35095. },
  35096. {}
  35097. ],
  35098. 190: [
  35099. function (e, t, i) {
  35100. 'use strict'
  35101. var n = e('three'),
  35102. r = e('../enum/GLCubeFaces'),
  35103. o = e('../constants')
  35104. t.exports = {
  35105. convertVisionVector: function (e) {
  35106. return new n.Vector3(e.x, e.z, -e.y)
  35107. },
  35108. convertVisionQuaternion: function (e) {
  35109. return new n.Quaternion(e.x, e.z, -e.y, e.w).multiply(
  35110. new n.Quaternion().setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(90))
  35111. )
  35112. },
  35113. convertWorkshopVector: function (e) {
  35114. return new n.Vector3(-e.x, e.y, e.z)
  35115. },
  35116. convertWorkshopQuaternion: function (e) {
  35117. return new n.Quaternion(-e.x, e.y, e.z, -e.w).multiply(
  35118. new n.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0)
  35119. )
  35120. },
  35121. convertWorkshopPanoramaQuaternion: function (e) {
  35122. return new n.Quaternion(e.x, -e.y, -e.z, e.w)
  35123. .normalize()
  35124. .multiply(
  35125. new n.Quaternion().setFromAxisAngle(new n.Vector3(0, 1, 0), n.Math.degToRad(270))
  35126. )
  35127. },
  35128. convertWorkshopOrthoZoom: function (e) {
  35129. // xzw
  35130. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  35131. //return e;
  35132. return e === -1
  35133. ? -1
  35134. : ((e * ($('#player').width() / $('#player').height())) / g_snapShotWidth) *
  35135. g_snapShotHeight
  35136. },
  35137. toPrecision: function (e, t) {
  35138. //xzw change
  35139. var f = function (e, t) {
  35140. var i = Math.pow(10, t)
  35141. return Math.round(e * i) / i
  35142. }
  35143. if (e instanceof Array) {
  35144. for (var s = 0; s < e.length; s++) {
  35145. e[s] = f(e[s], t)
  35146. }
  35147. return e
  35148. } else return f(e, t)
  35149. },
  35150. isEmptyQuaternion: function (e) {
  35151. return (
  35152. 0 === Math.abs(e.x) &&
  35153. 0 === Math.abs(e.y) &&
  35154. 0 === Math.abs(e.z) &&
  35155. 0 === Math.abs(e.w)
  35156. )
  35157. },
  35158. projectPositionToCanvas: function (e, t, i) {
  35159. ;(i = i || new n.Vector3()), i.copy(e)
  35160. var r = 0.5 * $('#player').width(),
  35161. o = 0.5 * $('#player').height()
  35162. return i.project(t), (i.x = i.x * r + r), (i.y = -(i.y * o) + o), i
  35163. },
  35164. convertScreenPositionToNDC: function (e, t, i) {
  35165. return (
  35166. (i = i || new n.Vector2()),
  35167. (i.x = (e / $('#player').width()) * 2 - 1),
  35168. (i.y = 2 * -(t / $('#player').height()) + 1),
  35169. i
  35170. )
  35171. },
  35172. constrainedTurn: function (e) {
  35173. var t = e % (2 * Math.PI)
  35174. return (t = t > Math.PI ? (t -= 2 * Math.PI) : t < -Math.PI ? (t += 2 * Math.PI) : t)
  35175. },
  35176. getFOVDotThreshold: function (e) {
  35177. return Math.cos(n.Math.degToRad(e / 2))
  35178. },
  35179. transform2DForwardVectorByCubeFace: function (e, t, i, n) {
  35180. switch (e) {
  35181. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  35182. i.set(1, t.y, t.x)
  35183. break
  35184. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  35185. i.set(-1, t.y, -t.x)
  35186. break
  35187. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  35188. i.set(-t.x, 1, -t.y)
  35189. break
  35190. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  35191. i.set(-t.x, -1, t.y)
  35192. break
  35193. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  35194. i.set(-t.x, t.y, 1)
  35195. break
  35196. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  35197. i.set(t.x, t.y, -1)
  35198. }
  35199. n && i.normalize()
  35200. },
  35201. //add:
  35202. getPos2d: function (point, camera, dom) {
  35203. var camera = camera
  35204. var dom = dom
  35205. 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);
  35206. var x, y
  35207. x = ((pos.x + 1) / 2) * dom.clientWidth
  35208. y = (1 - (pos.y + 1) / 2) * dom.clientHeight
  35209. var inSight = x <= dom.clientWidth && x >= 0 && y <= dom.clientHeight && y >= 0
  35210. return {
  35211. pos: new THREE.Vector2(x, y),
  35212. vector: pos,
  35213. trueSide: pos.z < 1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  35214. inSight: inSight //在屏幕范围内可见
  35215. }
  35216. },
  35217. getDirByLonLat: function (lon, lat) {
  35218. var dir = new THREE.Vector3()
  35219. var phi = THREE.Math.degToRad(90 - lat)
  35220. var theta = THREE.Math.degToRad(lon)
  35221. dir.x = Math.sin(phi) * Math.cos(theta)
  35222. dir.y = Math.cos(phi)
  35223. dir.z = Math.sin(phi) * Math.sin(theta)
  35224. return dir.negate()
  35225. }
  35226. }
  35227. window.math = t.exports
  35228. expandMath(math)
  35229. },
  35230. {
  35231. '../constants': 8,
  35232. '../enum/GLCubeFaces': 25,
  35233. three: 217
  35234. }
  35235. ],
  35236. 191: [
  35237. function (e, t, i) {
  35238. 'use strict'
  35239. function n(e, t, i) {
  35240. return a.map(
  35241. function (n, o) {
  35242. return e.get('pan/' + i + '/' + t + '_skybox' + r(n) + '.jpg')
  35243. }.bind(this)
  35244. )
  35245. }
  35246. function r(e) {
  35247. return s[e]
  35248. }
  35249. var o = e('../enum/GLCubeFaces'),
  35250. a = [0, 1, 2, 3, 4, 5],
  35251. s = {
  35252. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  35253. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  35254. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  35255. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  35256. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  35257. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  35258. }
  35259. t.exports = {
  35260. mapFaceToCubemapFace: r,
  35261. getCubemapUrls: n
  35262. }
  35263. },
  35264. {
  35265. '../enum/GLCubeFaces': 25
  35266. }
  35267. ],
  35268. 192: [
  35269. function (e, t, i) {
  35270. 'use strict'
  35271. t.exports = {
  35272. captureErrors: function (e, t, i) {
  35273. if ('Raven' in window) {
  35274. Raven.config(e, t).install(), i && Raven.setTagsContext(i)
  35275. var n = console.warn,
  35276. r = console.error
  35277. ;(console.warn = function () {
  35278. var e = Array.prototype.slice.call(arguments)
  35279. Raven.captureMessage(e.join(' '), {
  35280. level: 'warning'
  35281. }),
  35282. n.apply(console, e)
  35283. }),
  35284. (console.error = function () {
  35285. var e = Array.prototype.slice.call(arguments)
  35286. Raven.captureException(new Error(e.join(' ')), {
  35287. level: 'error'
  35288. }),
  35289. r.apply(console, e)
  35290. })
  35291. } else console.error('Raven not found, not capturing errors.')
  35292. }
  35293. }
  35294. },
  35295. {}
  35296. ],
  35297. 193: [
  35298. function (e, t, i) {
  35299. ;(function (i) {
  35300. 'use strict'
  35301. var n = e('./browser'),
  35302. r = e('../constants'),
  35303. o = e('url'),
  35304. a = e('./logger'),
  35305. ss = e('three'),
  35306. s = new a(i),
  35307. l = {
  35308. getAuthorizationHeader: function () {
  35309. var e = n.valueFromHash('auth')
  35310. if (e) return e.replace(',', ' ')
  35311. var t = n.valueFromCookie('token')
  35312. return t ? 'Token ' + t : null
  35313. },
  35314. parseSidUrl: function (e) {
  35315. var t, i
  35316. t = g_Prefix
  35317. if (((e = e || ''), e.match(/^https?/))) {
  35318. var n = o.parse(e)
  35319. ;(t = g_Prefix), (i = e)
  35320. } else {
  35321. //xzw 原先的不能用
  35322. //t = window.location.protocol + "//" + window.location.host, //MP
  35323. t = g_Prefix
  35324. //i = t + "/api/player/models/" + e; //MP
  35325. i = t + 'data/' + e
  35326. }
  35327. return {
  35328. urlBase: t,
  35329. urlModel: i,
  35330. urlFiles: i + (i.match(/\/$/) ? 'files' : '/files'),
  35331. urlThumb: i + (i.match(/\/$/) ? 'thumb' : '/thumb')
  35332. }
  35333. },
  35334. getModelIDFromQueryString: function () {
  35335. return n.valueFromHash('model') || n.valueFromHash('m')
  35336. },
  35337. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  35338. e = JSON.parse(JSON.stringify(e));
  35339. var i = null;
  35340. if (e.images.forEach(function(n) {
  35341. if(!n.metadata) return;
  35342. if ("string" == typeof n.metadata)
  35343. try {
  35344. n.metadata = JSON.parse(n.metadata)
  35345. } catch (e) {
  35346. s.warn("Unable to parse image metadata"),
  35347. n.metadata = null
  35348. }
  35349. else{
  35350. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  35351. }
  35352. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  35353. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  35354. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  35355. }else{
  35356. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  35357. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  35358. n.metadata.zoom = n.metadata.zoom || 1;
  35359. }
  35360. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  35361. }),
  35362. //icon初始视角的:
  35363. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  35364. var n = {};
  35365. n.pano = {
  35366. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  35367. position: t.convertWorkshopVector(i.scan_position),
  35368. uuid: i.scan_id
  35369. },
  35370. n.camera = {
  35371. quaternion: i.camera_quaternion,
  35372. position: i.camera_position
  35373. },
  35374. e.startPano = n
  35375. }
  35376. return e
  35377. },
  35378. */
  35379. normalizeModeldata: function (e, t) {
  35380. //xzw 修改导览images数据
  35381. e = JSON.parse(JSON.stringify(e))
  35382. var i = null
  35383. var deal = function (n) {
  35384. if (!n.metadata) return
  35385. if ('string' == typeof n.metadata)
  35386. try {
  35387. n.metadata = JSON.parse(n.metadata)
  35388. } catch (e) {
  35389. s.warn('Unable to parse image metadata'), (n.metadata = null)
  35390. }
  35391. else {
  35392. 'object' == typeof n.metadata && s.debug('image.metadata already a JSON object')
  35393. }
  35394. if (n.metadata.camera_position instanceof Array) {
  35395. //xzw 改的格式
  35396. n.metadata.camera_position = new ss.Vector3().fromArray(
  35397. n.metadata.camera_position
  35398. )
  35399. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(
  35400. n.metadata.camera_quaternion
  35401. )
  35402. } else {
  35403. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position)
  35404. n.metadata.camera_quaternion = new ss.Quaternion().copy(
  35405. n.metadata.camera_quaternion
  35406. )
  35407. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  35408. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  35409. }
  35410. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  35411. }
  35412. //改
  35413. e.images.forEach(info => {
  35414. if (info.locations) {
  35415. info.locations.forEach(a => deal(a))
  35416. } else {
  35417. deal(info)
  35418. }
  35419. })
  35420. //icon初始视角的:
  35421. if (
  35422. i &&
  35423. i.camera_quaternion &&
  35424. i.camera_position &&
  35425. i.scan_position &&
  35426. i.scan_quaternion
  35427. ) {
  35428. var n = {}
  35429. ;(n.pano = {
  35430. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  35431. position: t.convertWorkshopVector(i.scan_position),
  35432. uuid: i.scan_id
  35433. }),
  35434. (n.camera = {
  35435. quaternion: i.camera_quaternion,
  35436. position: i.camera_position
  35437. }),
  35438. (e.startPano = n)
  35439. }
  35440. return e
  35441. },
  35442. visionVersionToInt: (function () {
  35443. var e = new RegExp(['(?:[0-9.]+\\.){1,4}', '([0-9]+)', '[^\\.]*$'].join(''))
  35444. return function (t) {
  35445. if (!t) throw new Error('Vision version is required')
  35446. var i = e.exec(t)
  35447. if (null === i) throw new Error('String is not a vision version: ' + t)
  35448. return parseInt(i[1])
  35449. }
  35450. })(),
  35451. modelDataPromisesTiles: function (e) {
  35452. var vision_version = e.vision_version || window.DATA.vision_version
  35453. if (vision_version)
  35454. try {
  35455. return (
  35456. l.visionVersionToInt(vision_version) >=
  35457. l.visionVersionToInt(r.visionTilingStartVersion)
  35458. )
  35459. } catch (t) {
  35460. s.warn('Invalid vision version: ' + vision_version)
  35461. }
  35462. // var t = e.created ? new Date(e.created) : null;
  35463. // return t && t >= r.visionTilingStartDate
  35464. return false
  35465. }
  35466. }
  35467. t.exports = l
  35468. }).call(this, '/js/util/showcase.js')
  35469. },
  35470. {
  35471. '../constants': 8,
  35472. './browser': 182,
  35473. './logger': 189,
  35474. three: 217,
  35475. url: 208
  35476. }
  35477. ],
  35478. 194: [
  35479. function (e, t, i) {
  35480. 'use strict'
  35481. var n = e('../util/ajax'),
  35482. r = e('three'),
  35483. o = e('../settings'),
  35484. a = {}
  35485. t.exports = {
  35486. load: function (e, t, i) {
  35487. var s = a[e]
  35488. return s
  35489. ? (t &&
  35490. setTimeout(function () {
  35491. t(s)
  35492. }, 1),
  35493. s)
  35494. : ((s = new r.Texture()),
  35495. o.minimalMemoryMode &&
  35496. ((s.minFilter = r.LinearFilter),
  35497. (s.magFilter = r.LinearFilter),
  35498. (s.generateMipmaps = !1)),
  35499. (s.sourceFile = e),
  35500. (a[e] = s),
  35501. n
  35502. .getImage(e)
  35503. .then(function (e) {
  35504. ;(s.image = e), (s.needsUpdate = !0), t && t(s)
  35505. })
  35506. .fail(i),
  35507. s)
  35508. },
  35509. loadBase64: function (e, t) {
  35510. t = t || 'png'
  35511. var i = new r.Texture()
  35512. return (
  35513. (i.image = document.createElement('img')),
  35514. i.image.setAttribute('src', 'data:image/' + t + ';base64,' + e),
  35515. o.minimalMemoryMode &&
  35516. ((i.minFilter = r.LinearFilter),
  35517. (i.magFilter = r.LinearFilter),
  35518. (i.generateMipmaps = !1)),
  35519. (i.needsUpdate = !0),
  35520. i
  35521. )
  35522. },
  35523. isLoaded: function (e) {
  35524. return !!a[e]
  35525. }
  35526. }
  35527. window.Texture = t.exports
  35528. },
  35529. {
  35530. '../settings': 166,
  35531. '../util/ajax': 181,
  35532. three: 217
  35533. }
  35534. ],
  35535. 195: [
  35536. function (e, t, i) {
  35537. 'use strict'
  35538. var n = e('./easing')
  35539. window.transitions = t.exports = {
  35540. globalDone: null,
  35541. funcs: [],
  35542. counter: 0,
  35543. uniqueID: 0,
  35544. start: function (e, t, i, r, o, a, s) {
  35545. return (
  35546. (r = r || 0),
  35547. this.funcs.push({
  35548. func: e,
  35549. current: -r * Math.abs(t),
  35550. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  35551. done: i,
  35552. easing: o || n.linearTween,
  35553. cycling: t < 0,
  35554. running: !0,
  35555. debug: r < 0,
  35556. name: a || 'T' + this.counter,
  35557. id: void 0 === s ? this.counter : s,
  35558. paused: !1
  35559. }),
  35560. e(0, 16),
  35561. (this.counter += 1),
  35562. e
  35563. )
  35564. },
  35565. trigger: function (e) {
  35566. var t = void 0 === e.delayRatio ? 0 : e.delayRatio,
  35567. i = e.func || function () {},
  35568. r = void 0 === e.duration ? 0 : e.duration
  35569. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r))
  35570. var o = e.done || null,
  35571. a = e.easing || n.linearTween,
  35572. s = e.name || 'R' + this.counter,
  35573. l = void 0 === e.id ? this.counter : e.id
  35574. return this.start(i, r, o, t, a, s, l)
  35575. },
  35576. setTimeout: function (e, t, i) {
  35577. var n = void 0 === i ? this.counter : i
  35578. return this.trigger({
  35579. done: e,
  35580. duration: void 0 === t ? 0 : t,
  35581. name: 'O' + this.counter,
  35582. id: n
  35583. })
  35584. },
  35585. pause: function () {
  35586. this.paused = !0
  35587. },
  35588. resume: function () {
  35589. this.paused = !1
  35590. },
  35591. update: function (e) {
  35592. this.funcs.forEach(function (t) {
  35593. if (!(t.paused || ((t.current += 1e3 * e), t.current < 0)))
  35594. if (t.current >= t.duration && !t.cycling) {
  35595. var i = t.easing(1, 0, 1, 1)
  35596. t.func(i, 1e3 * e), t.done && t.done(), (t.running = !1)
  35597. } else {
  35598. var n = t.easing((t.current % t.duration) / t.duration, 0, 1, 1),
  35599. r = t.func(n, 1e3 * e) || !1
  35600. r && (t.done && t.done(), (t.running = !1))
  35601. }
  35602. })
  35603. var t = this.funcs.length
  35604. this.funcs = this.funcs.filter(function (e) {
  35605. return e.running
  35606. })
  35607. var i = this.funcs.length
  35608. if (t > 0 && 0 === i && this.globalDone) {
  35609. var n = this.globalDone
  35610. ;(this.globalDone = null), n()
  35611. }
  35612. },
  35613. adjustSpeed: function (e, t) {
  35614. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  35615. var r = i[n]
  35616. ;(r.duration /= t), (r.current /= t)
  35617. }
  35618. },
  35619. getById: function (e) {
  35620. return this.funcs.filter(function (t) {
  35621. return e === t.id
  35622. })
  35623. },
  35624. get: function (e) {
  35625. for (var t = 0; t < this.funcs.length; t += 1)
  35626. if (this.funcs[t].func === e) return this.funcs[t]
  35627. return null
  35628. },
  35629. isRunning: function (e) {
  35630. var t = this.get(e)
  35631. return null !== t && t.running
  35632. },
  35633. countActive: function () {
  35634. for (var e = 0, t = 0; t < this.funcs.length; t += 1) e += this.funcs[t].running
  35635. return e
  35636. },
  35637. listActive: function () {
  35638. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  35639. this.funcs[t].running && e.push(this.funcs[t].name)
  35640. return e
  35641. },
  35642. done: function (e) {
  35643. this.globalDone = e
  35644. },
  35645. cancelById: function (e) {
  35646. var t = void 0 === e ? 0 : e
  35647. this.funcs = this.funcs.filter(function (e) {
  35648. return e.id !== t
  35649. })
  35650. },
  35651. cancel: function (e) {
  35652. this.funcs = this.funcs.filter(function (t) {
  35653. return t.func !== e
  35654. })
  35655. },
  35656. getUniqueId: function () {
  35657. return (this.uniqueID -= 1), this.uniqueID
  35658. }
  35659. }
  35660. },
  35661. {
  35662. './easing': 186
  35663. }
  35664. ],
  35665. 196: [
  35666. function (e, t, i) {
  35667. function n(e) {
  35668. if (
  35669. ((this.set = {}),
  35670. (this.infContains = function () {
  35671. return !0
  35672. }),
  35673. 'object' == typeof e)
  35674. )
  35675. if (e instanceof Array) for (var t = 0; t < e.length; t++) this.set[e[t]] = !0
  35676. else this.set = e
  35677. else if ('function' == typeof e) this.infContains = e
  35678. else if ('undefined' != typeof e)
  35679. throw new Error('set must be either an array or an object.')
  35680. }
  35681. ;(t.exports = n),
  35682. (n.prototype.contains = function (e) {
  35683. return !!this.set[e]
  35684. }),
  35685. (n.prototype.has = n.prototype.contains),
  35686. (n.prototype.add = function (e) {
  35687. if (1 == arguments.length) this.set[e] = !0
  35688. else for (var t = 0; t < arguments.length; t++) this.set[arguments[t]] = !0
  35689. }),
  35690. (n.prototype.addAll = function (e) {
  35691. if ('object' != typeof e && !(e instanceof Array))
  35692. throw new Error('arr must be an array.')
  35693. for (var t = 0; t < e.length; t++) this.add(e[t])
  35694. }),
  35695. (n.prototype.remove = function (e) {
  35696. if (1 == arguments.length) delete this.set[e]
  35697. else for (var t = 0; t < arguments.length; t++) delete this.set[arguments[t]]
  35698. }),
  35699. (n.prototype.delete = n.prototype.remove),
  35700. (n.prototype.clear = function () {
  35701. this.set = {}
  35702. }),
  35703. (n.prototype.size = function () {
  35704. return Object.keys(this.set).length
  35705. }),
  35706. (n.prototype.toString = function () {
  35707. return '{' + Object.keys(this.set).toString() + '}'
  35708. }),
  35709. (n.prototype.toArray = function () {
  35710. return 'undefined' == typeof this.set ? [] : Object.keys(this.set)
  35711. }),
  35712. (n.prototype['*values'] = n.prototype.toArray)
  35713. },
  35714. {}
  35715. ],
  35716. 197: [function (e, t, i) {}, {}],
  35717. 198: [
  35718. function (e, t, i) {
  35719. ;(function (t) {
  35720. 'use strict'
  35721. function n() {
  35722. try {
  35723. var e = new Uint8Array(1)
  35724. return (
  35725. (e.__proto__ = {
  35726. __proto__: Uint8Array.prototype,
  35727. foo: function () {
  35728. return 42
  35729. }
  35730. }),
  35731. 42 === e.foo() &&
  35732. 'function' == typeof e.subarray &&
  35733. 0 === e.subarray(1, 1).byteLength
  35734. )
  35735. } catch (e) {
  35736. return !1
  35737. }
  35738. }
  35739. function r() {
  35740. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  35741. }
  35742. function o(e, t) {
  35743. if (r() < t) throw new RangeError('Invalid typed array length')
  35744. return (
  35745. a.TYPED_ARRAY_SUPPORT
  35746. ? ((e = new Uint8Array(t)), (e.__proto__ = a.prototype))
  35747. : (null === e && (e = new a(t)), (e.length = t)),
  35748. e
  35749. )
  35750. }
  35751. function a(e, t, i) {
  35752. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a)) return new a(e, t, i)
  35753. if ('number' == typeof e) {
  35754. if ('string' == typeof t)
  35755. throw new Error('If encoding is specified then the first argument must be a string')
  35756. return h(this, e)
  35757. }
  35758. return s(this, e, t, i)
  35759. }
  35760. function s(e, t, i, n) {
  35761. if ('number' == typeof t) throw new TypeError('"value" argument must not be a number')
  35762. return 'undefined' != typeof ArrayBuffer && t instanceof ArrayBuffer
  35763. ? p(e, t, i, n)
  35764. : 'string' == typeof t
  35765. ? u(e, t, i)
  35766. : f(e, t)
  35767. }
  35768. function l(e) {
  35769. if ('number' != typeof e) throw new TypeError('"size" argument must be a number')
  35770. if (e < 0) throw new RangeError('"size" argument must not be negative')
  35771. }
  35772. function c(e, t, i, n) {
  35773. return (
  35774. l(t),
  35775. t <= 0
  35776. ? o(e, t)
  35777. : void 0 !== i
  35778. ? 'string' == typeof n
  35779. ? o(e, t).fill(i, n)
  35780. : o(e, t).fill(i)
  35781. : o(e, t)
  35782. )
  35783. }
  35784. function h(e, t) {
  35785. if ((l(t), (e = o(e, t < 0 ? 0 : 0 | g(t))), !a.TYPED_ARRAY_SUPPORT))
  35786. for (var i = 0; i < t; ++i) e[i] = 0
  35787. return e
  35788. }
  35789. function u(e, t, i) {
  35790. if ((('string' == typeof i && '' !== i) || (i = 'utf8'), !a.isEncoding(i)))
  35791. throw new TypeError('"encoding" must be a valid string encoding')
  35792. var n = 0 | v(t, i)
  35793. e = o(e, n)
  35794. var r = e.write(t, i)
  35795. return r !== n && (e = e.slice(0, r)), e
  35796. }
  35797. function d(e, t) {
  35798. var i = t.length < 0 ? 0 : 0 | g(t.length)
  35799. e = o(e, i)
  35800. for (var n = 0; n < i; n += 1) e[n] = 255 & t[n]
  35801. return e
  35802. }
  35803. function p(e, t, i, n) {
  35804. if ((t.byteLength, i < 0 || t.byteLength < i))
  35805. throw new RangeError("'offset' is out of bounds")
  35806. if (t.byteLength < i + (n || 0)) throw new RangeError("'length' is out of bounds")
  35807. return (
  35808. (t =
  35809. void 0 === i && void 0 === n
  35810. ? new Uint8Array(t)
  35811. : void 0 === n
  35812. ? new Uint8Array(t, i)
  35813. : new Uint8Array(t, i, n)),
  35814. a.TYPED_ARRAY_SUPPORT ? ((e = t), (e.__proto__ = a.prototype)) : (e = d(e, t)),
  35815. e
  35816. )
  35817. }
  35818. function f(e, t) {
  35819. if (a.isBuffer(t)) {
  35820. var i = 0 | g(t.length)
  35821. return (e = o(e, i)), 0 === e.length ? e : (t.copy(e, 0, 0, i), e)
  35822. }
  35823. if (t) {
  35824. if (
  35825. ('undefined' != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer) ||
  35826. 'length' in t
  35827. )
  35828. return 'number' != typeof t.length || K(t.length) ? o(e, 0) : d(e, t)
  35829. if ('Buffer' === t.type && $(t.data)) return d(e, t.data)
  35830. }
  35831. throw new TypeError(
  35832. 'First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.'
  35833. )
  35834. }
  35835. function g(e) {
  35836. if (e >= r())
  35837. throw new RangeError(
  35838. 'Attempt to allocate Buffer larger than maximum size: 0x' +
  35839. r().toString(16) +
  35840. ' bytes'
  35841. )
  35842. return 0 | e
  35843. }
  35844. function m(e) {
  35845. return +e != e && (e = 0), a.alloc(+e)
  35846. }
  35847. function v(e, t) {
  35848. if (a.isBuffer(e)) return e.length
  35849. if (
  35850. 'undefined' != typeof ArrayBuffer &&
  35851. 'function' == typeof ArrayBuffer.isView &&
  35852. (ArrayBuffer.isView(e) || e instanceof ArrayBuffer)
  35853. )
  35854. return e.byteLength
  35855. 'string' != typeof e && (e = '' + e)
  35856. var i = e.length
  35857. if (0 === i) return 0
  35858. for (var n = !1; ; )
  35859. switch (t) {
  35860. case 'ascii':
  35861. case 'latin1':
  35862. case 'binary':
  35863. return i
  35864. case 'utf8':
  35865. case 'utf-8':
  35866. case void 0:
  35867. return j(e).length
  35868. case 'ucs2':
  35869. case 'ucs-2':
  35870. case 'utf16le':
  35871. case 'utf-16le':
  35872. return 2 * i
  35873. case 'hex':
  35874. return i >>> 1
  35875. case 'base64':
  35876. return Z(e).length
  35877. default:
  35878. if (n) return j(e).length
  35879. ;(t = ('' + t).toLowerCase()), (n = !0)
  35880. }
  35881. }
  35882. function A(e, t, i) {
  35883. var n = !1
  35884. if (((void 0 === t || t < 0) && (t = 0), t > this.length)) return ''
  35885. if (((void 0 === i || i > this.length) && (i = this.length), i <= 0)) return ''
  35886. if (((i >>>= 0), (t >>>= 0), i <= t)) return ''
  35887. for (e || (e = 'utf8'); ; )
  35888. switch (e) {
  35889. case 'hex':
  35890. return L(this, t, i)
  35891. case 'utf8':
  35892. case 'utf-8':
  35893. return M(this, t, i)
  35894. case 'ascii':
  35895. return P(this, t, i)
  35896. case 'latin1':
  35897. case 'binary':
  35898. return O(this, t, i)
  35899. case 'base64':
  35900. return S(this, t, i)
  35901. case 'ucs2':
  35902. case 'ucs-2':
  35903. case 'utf16le':
  35904. case 'utf-16le':
  35905. return D(this, t, i)
  35906. default:
  35907. if (n) throw new TypeError('Unknown encoding: ' + e)
  35908. ;(e = (e + '').toLowerCase()), (n = !0)
  35909. }
  35910. }
  35911. function y(e, t, i) {
  35912. var n = e[t]
  35913. ;(e[t] = e[i]), (e[i] = n)
  35914. }
  35915. function C(e, t, i, n, r) {
  35916. if (0 === e.length) return -1
  35917. if (
  35918. ('string' == typeof i
  35919. ? ((n = i), (i = 0))
  35920. : i > 2147483647
  35921. ? (i = 2147483647)
  35922. : i < -2147483648 && (i = -2147483648),
  35923. (i = +i),
  35924. isNaN(i) && (i = r ? 0 : e.length - 1),
  35925. i < 0 && (i = e.length + i),
  35926. i >= e.length)
  35927. ) {
  35928. if (r) return -1
  35929. i = e.length - 1
  35930. } else if (i < 0) {
  35931. if (!r) return -1
  35932. i = 0
  35933. }
  35934. if (('string' == typeof t && (t = a.from(t, n)), a.isBuffer(t)))
  35935. return 0 === t.length ? -1 : I(e, t, i, n, r)
  35936. if ('number' == typeof t)
  35937. return (
  35938. (t &= 255),
  35939. a.TYPED_ARRAY_SUPPORT && 'function' == typeof Uint8Array.prototype.indexOf
  35940. ? r
  35941. ? Uint8Array.prototype.indexOf.call(e, t, i)
  35942. : Uint8Array.prototype.lastIndexOf.call(e, t, i)
  35943. : I(e, [t], i, n, r)
  35944. )
  35945. throw new TypeError('val must be string, number or Buffer')
  35946. }
  35947. function I(e, t, i, n, r) {
  35948. function o(e, t) {
  35949. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  35950. }
  35951. var a = 1,
  35952. s = e.length,
  35953. l = t.length
  35954. if (
  35955. void 0 !== n &&
  35956. ((n = String(n).toLowerCase()),
  35957. 'ucs2' === n || 'ucs-2' === n || 'utf16le' === n || 'utf-16le' === n)
  35958. ) {
  35959. if (e.length < 2 || t.length < 2) return -1
  35960. ;(a = 2), (s /= 2), (l /= 2), (i /= 2)
  35961. }
  35962. var c
  35963. if (r) {
  35964. var h = -1
  35965. for (c = i; c < s; c++)
  35966. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  35967. if ((h === -1 && (h = c), c - h + 1 === l)) return h * a
  35968. } else h !== -1 && (c -= c - h), (h = -1)
  35969. } else
  35970. for (i + l > s && (i = s - l), c = i; c >= 0; c--) {
  35971. for (var u = !0, d = 0; d < l; d++)
  35972. if (o(e, c + d) !== o(t, d)) {
  35973. u = !1
  35974. break
  35975. }
  35976. if (u) return c
  35977. }
  35978. return -1
  35979. }
  35980. function E(e, t, i, n) {
  35981. i = Number(i) || 0
  35982. var r = e.length - i
  35983. n ? ((n = Number(n)), n > r && (n = r)) : (n = r)
  35984. var o = t.length
  35985. if (o % 2 !== 0) throw new TypeError('Invalid hex string')
  35986. n > o / 2 && (n = o / 2)
  35987. for (var a = 0; a < n; ++a) {
  35988. var s = parseInt(t.substr(2 * a, 2), 16)
  35989. if (isNaN(s)) return a
  35990. e[i + a] = s
  35991. }
  35992. return a
  35993. }
  35994. function b(e, t, i, n) {
  35995. return q(j(t, e.length - i), e, i, n)
  35996. }
  35997. function w(e, t, i, n) {
  35998. return q(Y(t), e, i, n)
  35999. }
  36000. function _(e, t, i, n) {
  36001. return w(e, t, i, n)
  36002. }
  36003. function T(e, t, i, n) {
  36004. return q(Z(t), e, i, n)
  36005. }
  36006. function x(e, t, i, n) {
  36007. return q(X(t, e.length - i), e, i, n)
  36008. }
  36009. function S(e, t, i) {
  36010. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  36011. }
  36012. function M(e, t, i) {
  36013. i = Math.min(e.length, i)
  36014. for (var n = [], r = t; r < i; ) {
  36015. var o = e[r],
  36016. a = null,
  36017. s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1
  36018. if (r + s <= i) {
  36019. var l, c, h, u
  36020. switch (s) {
  36021. case 1:
  36022. o < 128 && (a = o)
  36023. break
  36024. case 2:
  36025. ;(l = e[r + 1]),
  36026. 128 === (192 & l) && ((u = ((31 & o) << 6) | (63 & l)), u > 127 && (a = u))
  36027. break
  36028. case 3:
  36029. ;(l = e[r + 1]),
  36030. (c = e[r + 2]),
  36031. 128 === (192 & l) &&
  36032. 128 === (192 & c) &&
  36033. ((u = ((15 & o) << 12) | ((63 & l) << 6) | (63 & c)),
  36034. u > 2047 && (u < 55296 || u > 57343) && (a = u))
  36035. break
  36036. case 4:
  36037. ;(l = e[r + 1]),
  36038. (c = e[r + 2]),
  36039. (h = e[r + 3]),
  36040. 128 === (192 & l) &&
  36041. 128 === (192 & c) &&
  36042. 128 === (192 & h) &&
  36043. ((u = ((15 & o) << 18) | ((63 & l) << 12) | ((63 & c) << 6) | (63 & h)),
  36044. u > 65535 && u < 1114112 && (a = u))
  36045. }
  36046. }
  36047. null === a
  36048. ? ((a = 65533), (s = 1))
  36049. : a > 65535 &&
  36050. ((a -= 65536), n.push(((a >>> 10) & 1023) | 55296), (a = 56320 | (1023 & a))),
  36051. n.push(a),
  36052. (r += s)
  36053. }
  36054. return R(n)
  36055. }
  36056. function R(e) {
  36057. var t = e.length
  36058. if (t <= ee) return String.fromCharCode.apply(String, e)
  36059. for (var i = '', n = 0; n < t; )
  36060. i += String.fromCharCode.apply(String, e.slice(n, (n += ee)))
  36061. return i
  36062. }
  36063. function P(e, t, i) {
  36064. var n = ''
  36065. i = Math.min(e.length, i)
  36066. for (var r = t; r < i; ++r) n += String.fromCharCode(127 & e[r])
  36067. return n
  36068. }
  36069. function O(e, t, i) {
  36070. var n = ''
  36071. i = Math.min(e.length, i)
  36072. for (var r = t; r < i; ++r) n += String.fromCharCode(e[r])
  36073. return n
  36074. }
  36075. function L(e, t, i) {
  36076. var n = e.length
  36077. ;(!t || t < 0) && (t = 0), (!i || i < 0 || i > n) && (i = n)
  36078. for (var r = '', o = t; o < i; ++o) r += W(e[o])
  36079. return r
  36080. }
  36081. function D(e, t, i) {
  36082. for (var n = e.slice(t, i), r = '', o = 0; o < n.length; o += 2)
  36083. r += String.fromCharCode(n[o] + 256 * n[o + 1])
  36084. return r
  36085. }
  36086. function N(e, t, i) {
  36087. if (e % 1 !== 0 || e < 0) throw new RangeError('offset is not uint')
  36088. if (e + t > i) throw new RangeError('Trying to access beyond buffer length')
  36089. }
  36090. function B(e, t, i, n, r, o) {
  36091. if (!a.isBuffer(e)) throw new TypeError('"buffer" argument must be a Buffer instance')
  36092. if (t > r || t < o) throw new RangeError('"value" argument is out of bounds')
  36093. if (i + n > e.length) throw new RangeError('Index out of range')
  36094. }
  36095. function F(e, t, i, n) {
  36096. t < 0 && (t = 65535 + t + 1)
  36097. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  36098. e[i + r] = (t & (255 << (8 * (n ? r : 1 - r)))) >>> (8 * (n ? r : 1 - r))
  36099. }
  36100. function V(e, t, i, n) {
  36101. t < 0 && (t = 4294967295 + t + 1)
  36102. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  36103. e[i + r] = (t >>> (8 * (n ? r : 3 - r))) & 255
  36104. }
  36105. function U(e, t, i, n, r, o) {
  36106. if (i + n > e.length) throw new RangeError('Index out of range')
  36107. if (i < 0) throw new RangeError('Index out of range')
  36108. }
  36109. function k(e, t, i, n, r) {
  36110. return (
  36111. r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  36112. J.write(e, t, i, n, 23, 4),
  36113. i + 4
  36114. )
  36115. }
  36116. function H(e, t, i, n, r) {
  36117. return (
  36118. r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  36119. J.write(e, t, i, n, 52, 8),
  36120. i + 8
  36121. )
  36122. }
  36123. function G(e) {
  36124. if (((e = z(e).replace(te, '')), e.length < 2)) return ''
  36125. for (; e.length % 4 !== 0; ) e += '='
  36126. return e
  36127. }
  36128. function z(e) {
  36129. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, '')
  36130. }
  36131. function W(e) {
  36132. return e < 16 ? '0' + e.toString(16) : e.toString(16)
  36133. }
  36134. function j(e, t) {
  36135. t = t || 1 / 0
  36136. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  36137. if (((i = e.charCodeAt(a)), i > 55295 && i < 57344)) {
  36138. if (!r) {
  36139. if (i > 56319) {
  36140. ;(t -= 3) > -1 && o.push(239, 191, 189)
  36141. continue
  36142. }
  36143. if (a + 1 === n) {
  36144. ;(t -= 3) > -1 && o.push(239, 191, 189)
  36145. continue
  36146. }
  36147. r = i
  36148. continue
  36149. }
  36150. if (i < 56320) {
  36151. ;(t -= 3) > -1 && o.push(239, 191, 189), (r = i)
  36152. continue
  36153. }
  36154. i = (((r - 55296) << 10) | (i - 56320)) + 65536
  36155. } else r && (t -= 3) > -1 && o.push(239, 191, 189)
  36156. if (((r = null), i < 128)) {
  36157. if ((t -= 1) < 0) break
  36158. o.push(i)
  36159. } else if (i < 2048) {
  36160. if ((t -= 2) < 0) break
  36161. o.push((i >> 6) | 192, (63 & i) | 128)
  36162. } else if (i < 65536) {
  36163. if ((t -= 3) < 0) break
  36164. o.push((i >> 12) | 224, ((i >> 6) & 63) | 128, (63 & i) | 128)
  36165. } else {
  36166. if (!(i < 1114112)) throw new Error('Invalid code point')
  36167. if ((t -= 4) < 0) break
  36168. o.push(
  36169. (i >> 18) | 240,
  36170. ((i >> 12) & 63) | 128,
  36171. ((i >> 6) & 63) | 128,
  36172. (63 & i) | 128
  36173. )
  36174. }
  36175. }
  36176. return o
  36177. }
  36178. function Y(e) {
  36179. for (var t = [], i = 0; i < e.length; ++i) t.push(255 & e.charCodeAt(i))
  36180. return t
  36181. }
  36182. function X(e, t) {
  36183. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  36184. (i = e.charCodeAt(a)), (n = i >> 8), (r = i % 256), o.push(r), o.push(n)
  36185. return o
  36186. }
  36187. function Z(e) {
  36188. return Q.toByteArray(G(e))
  36189. }
  36190. function q(e, t, i, n) {
  36191. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r) t[r + i] = e[r]
  36192. return r
  36193. }
  36194. function K(e) {
  36195. return e !== e
  36196. }
  36197. var Q = e('base64-js'),
  36198. J = e('ieee754'),
  36199. $ = e('isarray')
  36200. ;(i.Buffer = a),
  36201. (i.SlowBuffer = m),
  36202. (i.INSPECT_MAX_BYTES = 50),
  36203. (a.TYPED_ARRAY_SUPPORT =
  36204. void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n()),
  36205. (i.kMaxLength = r()),
  36206. (a.poolSize = 8192),
  36207. (a._augment = function (e) {
  36208. return (e.__proto__ = a.prototype), e
  36209. }),
  36210. (a.from = function (e, t, i) {
  36211. return s(null, e, t, i)
  36212. }),
  36213. a.TYPED_ARRAY_SUPPORT &&
  36214. ((a.prototype.__proto__ = Uint8Array.prototype),
  36215. (a.__proto__ = Uint8Array),
  36216. 'undefined' != typeof Symbol &&
  36217. Symbol.species &&
  36218. a[Symbol.species] === a &&
  36219. Object.defineProperty(a, Symbol.species, {
  36220. value: null,
  36221. configurable: !0
  36222. })),
  36223. (a.alloc = function (e, t, i) {
  36224. return c(null, e, t, i)
  36225. }),
  36226. (a.allocUnsafe = function (e) {
  36227. return h(null, e)
  36228. }),
  36229. (a.allocUnsafeSlow = function (e) {
  36230. return h(null, e)
  36231. }),
  36232. (a.isBuffer = function (e) {
  36233. return !(null == e || !e._isBuffer)
  36234. }),
  36235. (a.compare = function (e, t) {
  36236. if (!a.isBuffer(e) || !a.isBuffer(t)) throw new TypeError('Arguments must be Buffers')
  36237. if (e === t) return 0
  36238. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  36239. if (e[r] !== t[r]) {
  36240. ;(i = e[r]), (n = t[r])
  36241. break
  36242. }
  36243. return i < n ? -1 : n < i ? 1 : 0
  36244. }),
  36245. (a.isEncoding = function (e) {
  36246. switch (String(e).toLowerCase()) {
  36247. case 'hex':
  36248. case 'utf8':
  36249. case 'utf-8':
  36250. case 'ascii':
  36251. case 'latin1':
  36252. case 'binary':
  36253. case 'base64':
  36254. case 'ucs2':
  36255. case 'ucs-2':
  36256. case 'utf16le':
  36257. case 'utf-16le':
  36258. return !0
  36259. default:
  36260. return !1
  36261. }
  36262. }),
  36263. (a.concat = function (e, t) {
  36264. if (!$(e)) throw new TypeError('"list" argument must be an Array of Buffers')
  36265. if (0 === e.length) return a.alloc(0)
  36266. var i
  36267. if (void 0 === t) for (t = 0, i = 0; i < e.length; ++i) t += e[i].length
  36268. var n = a.allocUnsafe(t),
  36269. r = 0
  36270. for (i = 0; i < e.length; ++i) {
  36271. var o = e[i]
  36272. if (!a.isBuffer(o))
  36273. throw new TypeError('"list" argument must be an Array of Buffers')
  36274. o.copy(n, r), (r += o.length)
  36275. }
  36276. return n
  36277. }),
  36278. (a.byteLength = v),
  36279. (a.prototype._isBuffer = !0),
  36280. (a.prototype.swap16 = function () {
  36281. var e = this.length
  36282. if (e % 2 !== 0) throw new RangeError('Buffer size must be a multiple of 16-bits')
  36283. for (var t = 0; t < e; t += 2) y(this, t, t + 1)
  36284. return this
  36285. }),
  36286. (a.prototype.swap32 = function () {
  36287. var e = this.length
  36288. if (e % 4 !== 0) throw new RangeError('Buffer size must be a multiple of 32-bits')
  36289. for (var t = 0; t < e; t += 4) y(this, t, t + 3), y(this, t + 1, t + 2)
  36290. return this
  36291. }),
  36292. (a.prototype.swap64 = function () {
  36293. var e = this.length
  36294. if (e % 8 !== 0) throw new RangeError('Buffer size must be a multiple of 64-bits')
  36295. for (var t = 0; t < e; t += 8)
  36296. y(this, t, t + 7),
  36297. y(this, t + 1, t + 6),
  36298. y(this, t + 2, t + 5),
  36299. y(this, t + 3, t + 4)
  36300. return this
  36301. }),
  36302. (a.prototype.toString = function () {
  36303. var e = 0 | this.length
  36304. return 0 === e
  36305. ? ''
  36306. : 0 === arguments.length
  36307. ? M(this, 0, e)
  36308. : A.apply(this, arguments)
  36309. }),
  36310. (a.prototype.equals = function (e) {
  36311. if (!a.isBuffer(e)) throw new TypeError('Argument must be a Buffer')
  36312. return this === e || 0 === a.compare(this, e)
  36313. }),
  36314. (a.prototype.inspect = function () {
  36315. var e = '',
  36316. t = i.INSPECT_MAX_BYTES
  36317. return (
  36318. this.length > 0 &&
  36319. ((e = this.toString('hex', 0, t).match(/.{2}/g).join(' ')),
  36320. this.length > t && (e += ' ... ')),
  36321. '<Buffer ' + e + '>'
  36322. )
  36323. }),
  36324. (a.prototype.compare = function (e, t, i, n, r) {
  36325. if (!a.isBuffer(e)) throw new TypeError('Argument must be a Buffer')
  36326. if (
  36327. (void 0 === t && (t = 0),
  36328. void 0 === i && (i = e ? e.length : 0),
  36329. void 0 === n && (n = 0),
  36330. void 0 === r && (r = this.length),
  36331. t < 0 || i > e.length || n < 0 || r > this.length)
  36332. )
  36333. throw new RangeError('out of range index')
  36334. if (n >= r && t >= i) return 0
  36335. if (n >= r) return -1
  36336. if (t >= i) return 1
  36337. if (((t >>>= 0), (i >>>= 0), (n >>>= 0), (r >>>= 0), this === e)) return 0
  36338. for (
  36339. var o = r - n,
  36340. s = i - t,
  36341. l = Math.min(o, s),
  36342. c = this.slice(n, r),
  36343. h = e.slice(t, i),
  36344. u = 0;
  36345. u < l;
  36346. ++u
  36347. )
  36348. if (c[u] !== h[u]) {
  36349. ;(o = c[u]), (s = h[u])
  36350. break
  36351. }
  36352. return o < s ? -1 : s < o ? 1 : 0
  36353. }),
  36354. (a.prototype.includes = function (e, t, i) {
  36355. return this.indexOf(e, t, i) !== -1
  36356. }),
  36357. (a.prototype.indexOf = function (e, t, i) {
  36358. return C(this, e, t, i, !0)
  36359. }),
  36360. (a.prototype.lastIndexOf = function (e, t, i) {
  36361. return C(this, e, t, i, !1)
  36362. }),
  36363. (a.prototype.write = function (e, t, i, n) {
  36364. if (void 0 === t) (n = 'utf8'), (i = this.length), (t = 0)
  36365. else if (void 0 === i && 'string' == typeof t) (n = t), (i = this.length), (t = 0)
  36366. else {
  36367. if (!isFinite(t))
  36368. throw new Error(
  36369. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  36370. )
  36371. ;(t |= 0),
  36372. isFinite(i) ? ((i |= 0), void 0 === n && (n = 'utf8')) : ((n = i), (i = void 0))
  36373. }
  36374. var r = this.length - t
  36375. if (
  36376. ((void 0 === i || i > r) && (i = r),
  36377. (e.length > 0 && (i < 0 || t < 0)) || t > this.length)
  36378. )
  36379. throw new RangeError('Attempt to write outside buffer bounds')
  36380. n || (n = 'utf8')
  36381. for (var o = !1; ; )
  36382. switch (n) {
  36383. case 'hex':
  36384. return E(this, e, t, i)
  36385. case 'utf8':
  36386. case 'utf-8':
  36387. return b(this, e, t, i)
  36388. case 'ascii':
  36389. return w(this, e, t, i)
  36390. case 'latin1':
  36391. case 'binary':
  36392. return _(this, e, t, i)
  36393. case 'base64':
  36394. return T(this, e, t, i)
  36395. case 'ucs2':
  36396. case 'ucs-2':
  36397. case 'utf16le':
  36398. case 'utf-16le':
  36399. return x(this, e, t, i)
  36400. default:
  36401. if (o) throw new TypeError('Unknown encoding: ' + n)
  36402. ;(n = ('' + n).toLowerCase()), (o = !0)
  36403. }
  36404. }),
  36405. (a.prototype.toJSON = function () {
  36406. return {
  36407. type: 'Buffer',
  36408. data: Array.prototype.slice.call(this._arr || this, 0)
  36409. }
  36410. })
  36411. var ee = 4096
  36412. ;(a.prototype.slice = function (e, t) {
  36413. var i = this.length
  36414. ;(e = ~~e),
  36415. (t = void 0 === t ? i : ~~t),
  36416. e < 0 ? ((e += i), e < 0 && (e = 0)) : e > i && (e = i),
  36417. t < 0 ? ((t += i), t < 0 && (t = 0)) : t > i && (t = i),
  36418. t < e && (t = e)
  36419. var n
  36420. if (a.TYPED_ARRAY_SUPPORT) (n = this.subarray(e, t)), (n.__proto__ = a.prototype)
  36421. else {
  36422. var r = t - e
  36423. n = new a(r, void 0)
  36424. for (var o = 0; o < r; ++o) n[o] = this[o + e]
  36425. }
  36426. return n
  36427. }),
  36428. (a.prototype.readUIntLE = function (e, t, i) {
  36429. ;(e |= 0), (t |= 0), i || N(e, t, this.length)
  36430. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); ) n += this[e + o] * r
  36431. return n
  36432. }),
  36433. (a.prototype.readUIntBE = function (e, t, i) {
  36434. ;(e |= 0), (t |= 0), i || N(e, t, this.length)
  36435. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); ) n += this[e + --t] * r
  36436. return n
  36437. }),
  36438. (a.prototype.readUInt8 = function (e, t) {
  36439. return t || N(e, 1, this.length), this[e]
  36440. }),
  36441. (a.prototype.readUInt16LE = function (e, t) {
  36442. return t || N(e, 2, this.length), this[e] | (this[e + 1] << 8)
  36443. }),
  36444. (a.prototype.readUInt16BE = function (e, t) {
  36445. return t || N(e, 2, this.length), (this[e] << 8) | this[e + 1]
  36446. }),
  36447. (a.prototype.readUInt32LE = function (e, t) {
  36448. return (
  36449. t || N(e, 4, this.length),
  36450. (this[e] | (this[e + 1] << 8) | (this[e + 2] << 16)) + 16777216 * this[e + 3]
  36451. )
  36452. }),
  36453. (a.prototype.readUInt32BE = function (e, t) {
  36454. return (
  36455. t || N(e, 4, this.length),
  36456. 16777216 * this[e] + ((this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3])
  36457. )
  36458. }),
  36459. (a.prototype.readIntLE = function (e, t, i) {
  36460. ;(e |= 0), (t |= 0), i || N(e, t, this.length)
  36461. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); ) n += this[e + o] * r
  36462. return (r *= 128), n >= r && (n -= Math.pow(2, 8 * t)), n
  36463. }),
  36464. (a.prototype.readIntBE = function (e, t, i) {
  36465. ;(e |= 0), (t |= 0), i || N(e, t, this.length)
  36466. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  36467. o += this[e + --n] * r
  36468. return (r *= 128), o >= r && (o -= Math.pow(2, 8 * t)), o
  36469. }),
  36470. (a.prototype.readInt8 = function (e, t) {
  36471. return t || N(e, 1, this.length), 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  36472. }),
  36473. (a.prototype.readInt16LE = function (e, t) {
  36474. t || N(e, 2, this.length)
  36475. var i = this[e] | (this[e + 1] << 8)
  36476. return 32768 & i ? 4294901760 | i : i
  36477. }),
  36478. (a.prototype.readInt16BE = function (e, t) {
  36479. t || N(e, 2, this.length)
  36480. var i = this[e + 1] | (this[e] << 8)
  36481. return 32768 & i ? 4294901760 | i : i
  36482. }),
  36483. (a.prototype.readInt32LE = function (e, t) {
  36484. return (
  36485. t || N(e, 4, this.length),
  36486. this[e] | (this[e + 1] << 8) | (this[e + 2] << 16) | (this[e + 3] << 24)
  36487. )
  36488. }),
  36489. (a.prototype.readInt32BE = function (e, t) {
  36490. return (
  36491. t || N(e, 4, this.length),
  36492. (this[e] << 24) | (this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3]
  36493. )
  36494. }),
  36495. (a.prototype.readFloatLE = function (e, t) {
  36496. return t || N(e, 4, this.length), J.read(this, e, !0, 23, 4)
  36497. }),
  36498. (a.prototype.readFloatBE = function (e, t) {
  36499. return t || N(e, 4, this.length), J.read(this, e, !1, 23, 4)
  36500. }),
  36501. (a.prototype.readDoubleLE = function (e, t) {
  36502. return t || N(e, 8, this.length), J.read(this, e, !0, 52, 8)
  36503. }),
  36504. (a.prototype.readDoubleBE = function (e, t) {
  36505. return t || N(e, 8, this.length), J.read(this, e, !1, 52, 8)
  36506. }),
  36507. (a.prototype.writeUIntLE = function (e, t, i, n) {
  36508. if (((e = +e), (t |= 0), (i |= 0), !n)) {
  36509. var r = Math.pow(2, 8 * i) - 1
  36510. B(this, e, t, i, r, 0)
  36511. }
  36512. var o = 1,
  36513. a = 0
  36514. for (this[t] = 255 & e; ++a < i && (o *= 256); ) this[t + a] = (e / o) & 255
  36515. return t + i
  36516. }),
  36517. (a.prototype.writeUIntBE = function (e, t, i, n) {
  36518. if (((e = +e), (t |= 0), (i |= 0), !n)) {
  36519. var r = Math.pow(2, 8 * i) - 1
  36520. B(this, e, t, i, r, 0)
  36521. }
  36522. var o = i - 1,
  36523. a = 1
  36524. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); ) this[t + o] = (e / a) & 255
  36525. return t + i
  36526. }),
  36527. (a.prototype.writeUInt8 = function (e, t, i) {
  36528. return (
  36529. (e = +e),
  36530. (t |= 0),
  36531. i || B(this, e, t, 1, 255, 0),
  36532. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  36533. (this[t] = 255 & e),
  36534. t + 1
  36535. )
  36536. }),
  36537. (a.prototype.writeUInt16LE = function (e, t, i) {
  36538. return (
  36539. (e = +e),
  36540. (t |= 0),
  36541. i || B(this, e, t, 2, 65535, 0),
  36542. a.TYPED_ARRAY_SUPPORT
  36543. ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8))
  36544. : F(this, e, t, !0),
  36545. t + 2
  36546. )
  36547. }),
  36548. (a.prototype.writeUInt16BE = function (e, t, i) {
  36549. return (
  36550. (e = +e),
  36551. (t |= 0),
  36552. i || B(this, e, t, 2, 65535, 0),
  36553. a.TYPED_ARRAY_SUPPORT
  36554. ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e))
  36555. : F(this, e, t, !1),
  36556. t + 2
  36557. )
  36558. }),
  36559. (a.prototype.writeUInt32LE = function (e, t, i) {
  36560. return (
  36561. (e = +e),
  36562. (t |= 0),
  36563. i || B(this, e, t, 4, 4294967295, 0),
  36564. a.TYPED_ARRAY_SUPPORT
  36565. ? ((this[t + 3] = e >>> 24),
  36566. (this[t + 2] = e >>> 16),
  36567. (this[t + 1] = e >>> 8),
  36568. (this[t] = 255 & e))
  36569. : V(this, e, t, !0),
  36570. t + 4
  36571. )
  36572. }),
  36573. (a.prototype.writeUInt32BE = function (e, t, i) {
  36574. return (
  36575. (e = +e),
  36576. (t |= 0),
  36577. i || B(this, e, t, 4, 4294967295, 0),
  36578. a.TYPED_ARRAY_SUPPORT
  36579. ? ((this[t] = e >>> 24),
  36580. (this[t + 1] = e >>> 16),
  36581. (this[t + 2] = e >>> 8),
  36582. (this[t + 3] = 255 & e))
  36583. : V(this, e, t, !1),
  36584. t + 4
  36585. )
  36586. }),
  36587. (a.prototype.writeIntLE = function (e, t, i, n) {
  36588. if (((e = +e), (t |= 0), !n)) {
  36589. var r = Math.pow(2, 8 * i - 1)
  36590. B(this, e, t, i, r - 1, -r)
  36591. }
  36592. var o = 0,
  36593. a = 1,
  36594. s = 0
  36595. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  36596. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  36597. (this[t + o] = (((e / a) >> 0) - s) & 255)
  36598. return t + i
  36599. }),
  36600. (a.prototype.writeIntBE = function (e, t, i, n) {
  36601. if (((e = +e), (t |= 0), !n)) {
  36602. var r = Math.pow(2, 8 * i - 1)
  36603. B(this, e, t, i, r - 1, -r)
  36604. }
  36605. var o = i - 1,
  36606. a = 1,
  36607. s = 0
  36608. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  36609. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  36610. (this[t + o] = (((e / a) >> 0) - s) & 255)
  36611. return t + i
  36612. }),
  36613. (a.prototype.writeInt8 = function (e, t, i) {
  36614. return (
  36615. (e = +e),
  36616. (t |= 0),
  36617. i || B(this, e, t, 1, 127, -128),
  36618. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  36619. e < 0 && (e = 255 + e + 1),
  36620. (this[t] = 255 & e),
  36621. t + 1
  36622. )
  36623. }),
  36624. (a.prototype.writeInt16LE = function (e, t, i) {
  36625. return (
  36626. (e = +e),
  36627. (t |= 0),
  36628. i || B(this, e, t, 2, 32767, -32768),
  36629. a.TYPED_ARRAY_SUPPORT
  36630. ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8))
  36631. : F(this, e, t, !0),
  36632. t + 2
  36633. )
  36634. }),
  36635. (a.prototype.writeInt16BE = function (e, t, i) {
  36636. return (
  36637. (e = +e),
  36638. (t |= 0),
  36639. i || B(this, e, t, 2, 32767, -32768),
  36640. a.TYPED_ARRAY_SUPPORT
  36641. ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e))
  36642. : F(this, e, t, !1),
  36643. t + 2
  36644. )
  36645. }),
  36646. (a.prototype.writeInt32LE = function (e, t, i) {
  36647. return (
  36648. (e = +e),
  36649. (t |= 0),
  36650. i || B(this, e, t, 4, 2147483647, -2147483648),
  36651. a.TYPED_ARRAY_SUPPORT
  36652. ? ((this[t] = 255 & e),
  36653. (this[t + 1] = e >>> 8),
  36654. (this[t + 2] = e >>> 16),
  36655. (this[t + 3] = e >>> 24))
  36656. : V(this, e, t, !0),
  36657. t + 4
  36658. )
  36659. }),
  36660. (a.prototype.writeInt32BE = function (e, t, i) {
  36661. return (
  36662. (e = +e),
  36663. (t |= 0),
  36664. i || B(this, e, t, 4, 2147483647, -2147483648),
  36665. e < 0 && (e = 4294967295 + e + 1),
  36666. a.TYPED_ARRAY_SUPPORT
  36667. ? ((this[t] = e >>> 24),
  36668. (this[t + 1] = e >>> 16),
  36669. (this[t + 2] = e >>> 8),
  36670. (this[t + 3] = 255 & e))
  36671. : V(this, e, t, !1),
  36672. t + 4
  36673. )
  36674. }),
  36675. (a.prototype.writeFloatLE = function (e, t, i) {
  36676. return k(this, e, t, !0, i)
  36677. }),
  36678. (a.prototype.writeFloatBE = function (e, t, i) {
  36679. return k(this, e, t, !1, i)
  36680. }),
  36681. (a.prototype.writeDoubleLE = function (e, t, i) {
  36682. return H(this, e, t, !0, i)
  36683. }),
  36684. (a.prototype.writeDoubleBE = function (e, t, i) {
  36685. return H(this, e, t, !1, i)
  36686. }),
  36687. (a.prototype.copy = function (e, t, i, n) {
  36688. if (
  36689. (i || (i = 0),
  36690. n || 0 === n || (n = this.length),
  36691. t >= e.length && (t = e.length),
  36692. t || (t = 0),
  36693. n > 0 && n < i && (n = i),
  36694. n === i)
  36695. )
  36696. return 0
  36697. if (0 === e.length || 0 === this.length) return 0
  36698. if (t < 0) throw new RangeError('targetStart out of bounds')
  36699. if (i < 0 || i >= this.length) throw new RangeError('sourceStart out of bounds')
  36700. if (n < 0) throw new RangeError('sourceEnd out of bounds')
  36701. n > this.length && (n = this.length), e.length - t < n - i && (n = e.length - t + i)
  36702. var r,
  36703. o = n - i
  36704. if (this === e && i < t && t < n) for (r = o - 1; r >= 0; --r) e[r + t] = this[r + i]
  36705. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  36706. for (r = 0; r < o; ++r) e[r + t] = this[r + i]
  36707. else Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t)
  36708. return o
  36709. }),
  36710. (a.prototype.fill = function (e, t, i, n) {
  36711. if ('string' == typeof e) {
  36712. if (
  36713. ('string' == typeof t
  36714. ? ((n = t), (t = 0), (i = this.length))
  36715. : 'string' == typeof i && ((n = i), (i = this.length)),
  36716. 1 === e.length)
  36717. ) {
  36718. var r = e.charCodeAt(0)
  36719. r < 256 && (e = r)
  36720. }
  36721. if (void 0 !== n && 'string' != typeof n)
  36722. throw new TypeError('encoding must be a string')
  36723. if ('string' == typeof n && !a.isEncoding(n))
  36724. throw new TypeError('Unknown encoding: ' + n)
  36725. } else 'number' == typeof e && (e &= 255)
  36726. if (t < 0 || this.length < t || this.length < i)
  36727. throw new RangeError('Out of range index')
  36728. if (i <= t) return this
  36729. ;(t >>>= 0), (i = void 0 === i ? this.length : i >>> 0), e || (e = 0)
  36730. var o
  36731. if ('number' == typeof e) for (o = t; o < i; ++o) this[o] = e
  36732. else {
  36733. var s = a.isBuffer(e) ? e : j(new a(e, n).toString()),
  36734. l = s.length
  36735. for (o = 0; o < i - t; ++o) this[o + t] = s[o % l]
  36736. }
  36737. return this
  36738. })
  36739. var te = /[^+\/0-9A-Za-z-_]/g
  36740. }).call(
  36741. this,
  36742. 'undefined' != typeof global
  36743. ? global
  36744. : 'undefined' != typeof self
  36745. ? self
  36746. : 'undefined' != typeof window
  36747. ? window
  36748. : {}
  36749. )
  36750. },
  36751. {
  36752. 'base64-js': 199,
  36753. ieee754: 200,
  36754. isarray: 201
  36755. }
  36756. ],
  36757. 199: [
  36758. function (e, t, i) {
  36759. 'use strict'
  36760. function n(e) {
  36761. var t = e.length
  36762. if (t % 4 > 0) throw new Error('Invalid string. Length must be a multiple of 4')
  36763. return '=' === e[t - 2] ? 2 : '=' === e[t - 1] ? 1 : 0
  36764. }
  36765. function r(e) {
  36766. return (3 * e.length) / 4 - n(e)
  36767. }
  36768. function o(e) {
  36769. var t,
  36770. i,
  36771. r,
  36772. o,
  36773. a,
  36774. s,
  36775. l = e.length
  36776. ;(a = n(e)), (s = new u((3 * l) / 4 - a)), (r = a > 0 ? l - 4 : l)
  36777. var c = 0
  36778. for (t = 0, i = 0; t < r; t += 4, i += 3)
  36779. (o =
  36780. (h[e.charCodeAt(t)] << 18) |
  36781. (h[e.charCodeAt(t + 1)] << 12) |
  36782. (h[e.charCodeAt(t + 2)] << 6) |
  36783. h[e.charCodeAt(t + 3)]),
  36784. (s[c++] = (o >> 16) & 255),
  36785. (s[c++] = (o >> 8) & 255),
  36786. (s[c++] = 255 & o)
  36787. return (
  36788. 2 === a
  36789. ? ((o = (h[e.charCodeAt(t)] << 2) | (h[e.charCodeAt(t + 1)] >> 4)),
  36790. (s[c++] = 255 & o))
  36791. : 1 === a &&
  36792. ((o =
  36793. (h[e.charCodeAt(t)] << 10) |
  36794. (h[e.charCodeAt(t + 1)] << 4) |
  36795. (h[e.charCodeAt(t + 2)] >> 2)),
  36796. (s[c++] = (o >> 8) & 255),
  36797. (s[c++] = 255 & o)),
  36798. s
  36799. )
  36800. }
  36801. function a(e) {
  36802. return c[(e >> 18) & 63] + c[(e >> 12) & 63] + c[(e >> 6) & 63] + c[63 & e]
  36803. }
  36804. function s(e, t, i) {
  36805. for (var n, r = [], o = t; o < i; o += 3)
  36806. (n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2]), r.push(a(n))
  36807. return r.join('')
  36808. }
  36809. function l(e) {
  36810. for (
  36811. var t, i = e.length, n = i % 3, r = '', o = [], a = 16383, l = 0, h = i - n;
  36812. l < h;
  36813. l += a
  36814. )
  36815. o.push(s(e, l, l + a > h ? h : l + a))
  36816. return (
  36817. 1 === n
  36818. ? ((t = e[i - 1]), (r += c[t >> 2]), (r += c[(t << 4) & 63]), (r += '=='))
  36819. : 2 === n &&
  36820. ((t = (e[i - 2] << 8) + e[i - 1]),
  36821. (r += c[t >> 10]),
  36822. (r += c[(t >> 4) & 63]),
  36823. (r += c[(t << 2) & 63]),
  36824. (r += '=')),
  36825. o.push(r),
  36826. o.join('')
  36827. )
  36828. }
  36829. ;(i.byteLength = r), (i.toByteArray = o), (i.fromByteArray = l)
  36830. for (
  36831. var c = [],
  36832. h = [],
  36833. u = 'undefined' != typeof Uint8Array ? Uint8Array : Array,
  36834. d = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
  36835. p = 0,
  36836. f = d.length;
  36837. p < f;
  36838. ++p
  36839. )
  36840. (c[p] = d[p]), (h[d.charCodeAt(p)] = p)
  36841. ;(h['-'.charCodeAt(0)] = 62), (h['_'.charCodeAt(0)] = 63)
  36842. },
  36843. {}
  36844. ],
  36845. 200: [
  36846. function (e, t, i) {
  36847. ;(i.read = function (e, t, i, n, r) {
  36848. var o,
  36849. a,
  36850. s = 8 * r - n - 1,
  36851. l = (1 << s) - 1,
  36852. c = l >> 1,
  36853. h = -7,
  36854. u = i ? r - 1 : 0,
  36855. d = i ? -1 : 1,
  36856. p = e[t + u]
  36857. for (
  36858. u += d, o = p & ((1 << -h) - 1), p >>= -h, h += s;
  36859. h > 0;
  36860. o = 256 * o + e[t + u], u += d, h -= 8
  36861. );
  36862. for (
  36863. a = o & ((1 << -h) - 1), o >>= -h, h += n;
  36864. h > 0;
  36865. a = 256 * a + e[t + u], u += d, h -= 8
  36866. );
  36867. if (0 === o) o = 1 - c
  36868. else {
  36869. if (o === l) return a ? NaN : (p ? -1 : 1) * (1 / 0)
  36870. ;(a += Math.pow(2, n)), (o -= c)
  36871. }
  36872. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  36873. }),
  36874. (i.write = function (e, t, i, n, r, o) {
  36875. var a,
  36876. s,
  36877. l,
  36878. c = 8 * o - r - 1,
  36879. h = (1 << c) - 1,
  36880. u = h >> 1,
  36881. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  36882. p = n ? 0 : o - 1,
  36883. f = n ? 1 : -1,
  36884. g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0
  36885. for (
  36886. t = Math.abs(t),
  36887. isNaN(t) || t === 1 / 0
  36888. ? ((s = isNaN(t) ? 1 : 0), (a = h))
  36889. : ((a = Math.floor(Math.log(t) / Math.LN2)),
  36890. t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)),
  36891. (t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u)),
  36892. t * l >= 2 && (a++, (l /= 2)),
  36893. a + u >= h
  36894. ? ((s = 0), (a = h))
  36895. : a + u >= 1
  36896. ? ((s = (t * l - 1) * Math.pow(2, r)), (a += u))
  36897. : ((s = t * Math.pow(2, u - 1) * Math.pow(2, r)), (a = 0)));
  36898. r >= 8;
  36899. e[i + p] = 255 & s, p += f, s /= 256, r -= 8
  36900. );
  36901. for (a = (a << r) | s, c += r; c > 0; e[i + p] = 255 & a, p += f, a /= 256, c -= 8);
  36902. e[i + p - f] |= 128 * g
  36903. })
  36904. },
  36905. {}
  36906. ],
  36907. 201: [
  36908. function (e, t, i) {
  36909. var n = {}.toString
  36910. t.exports =
  36911. Array.isArray ||
  36912. function (e) {
  36913. return '[object Array]' == n.call(e)
  36914. }
  36915. },
  36916. {}
  36917. ],
  36918. 202: [
  36919. function (e, t, i) {
  36920. function n() {
  36921. ;(this._events = this._events || {}), (this._maxListeners = this._maxListeners || void 0)
  36922. }
  36923. function r(e) {
  36924. return 'function' == typeof e
  36925. }
  36926. function o(e) {
  36927. return 'number' == typeof e
  36928. }
  36929. function a(e) {
  36930. return 'object' == typeof e && null !== e
  36931. }
  36932. function s(e) {
  36933. return void 0 === e
  36934. }
  36935. ;(t.exports = n),
  36936. (n.EventEmitter = n),
  36937. (n.prototype._events = void 0),
  36938. (n.prototype._maxListeners = void 0),
  36939. (n.defaultMaxListeners = 10),
  36940. (n.prototype.setMaxListeners = function (e) {
  36941. if (!o(e) || e < 0 || isNaN(e)) throw TypeError('n must be a positive number')
  36942. return (this._maxListeners = e), this
  36943. }),
  36944. (n.prototype.emit = function (e) {
  36945. var t, i, n, o, l, c
  36946. if (
  36947. (this._events || (this._events = {}),
  36948. 'error' === e &&
  36949. (!this._events.error || (a(this._events.error) && !this._events.error.length)))
  36950. ) {
  36951. if (((t = arguments[1]), t instanceof Error)) throw t
  36952. var h = new Error('Uncaught, unspecified "error" event. (' + t + ')')
  36953. throw ((h.context = t), h)
  36954. }
  36955. if (((i = this._events[e]), s(i))) return !1
  36956. if (r(i))
  36957. switch (arguments.length) {
  36958. case 1:
  36959. i.call(this)
  36960. break
  36961. case 2:
  36962. i.call(this, arguments[1])
  36963. break
  36964. case 3:
  36965. i.call(this, arguments[1], arguments[2])
  36966. break
  36967. default:
  36968. ;(o = Array.prototype.slice.call(arguments, 1)), i.apply(this, o)
  36969. }
  36970. else if (a(i))
  36971. for (
  36972. o = Array.prototype.slice.call(arguments, 1), c = i.slice(), n = c.length, l = 0;
  36973. l < n;
  36974. l++
  36975. )
  36976. c[l].apply(this, o)
  36977. return !0
  36978. }),
  36979. (n.prototype.addListener = function (e, t) {
  36980. var i
  36981. if (!r(t)) throw TypeError('listener must be a function')
  36982. return (
  36983. this._events || (this._events = {}),
  36984. this._events.newListener &&
  36985. this.emit('newListener', e, r(t.listener) ? t.listener : t),
  36986. this._events[e]
  36987. ? a(this._events[e])
  36988. ? this._events[e].push(t)
  36989. : (this._events[e] = [this._events[e], t])
  36990. : (this._events[e] = t),
  36991. a(this._events[e]) &&
  36992. !this._events[e].warned &&
  36993. ((i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners),
  36994. i &&
  36995. i > 0 &&
  36996. this._events[e].length > i &&
  36997. ((this._events[e].warned = !0),
  36998. console.error(
  36999. '(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.',
  37000. this._events[e].length
  37001. ),
  37002. 'function' == typeof console.trace && console.trace())),
  37003. this
  37004. )
  37005. }),
  37006. (n.prototype.on = n.prototype.addListener),
  37007. (n.prototype.once = function (e, t) {
  37008. function i() {
  37009. this.removeListener(e, i), n || ((n = !0), t.apply(this, arguments))
  37010. }
  37011. if (!r(t)) throw TypeError('listener must be a function')
  37012. var n = !1
  37013. return (i.listener = t), this.on(e, i), this
  37014. }),
  37015. (n.prototype.removeListener = function (e, t) {
  37016. var i, n, o, s
  37017. if (!r(t)) throw TypeError('listener must be a function')
  37018. if (!this._events || !this._events[e]) return this
  37019. if (
  37020. ((i = this._events[e]),
  37021. (o = i.length),
  37022. (n = -1),
  37023. i === t || (r(i.listener) && i.listener === t))
  37024. )
  37025. delete this._events[e],
  37026. this._events.removeListener && this.emit('removeListener', e, t)
  37027. else if (a(i)) {
  37028. for (s = o; s-- > 0; )
  37029. if (i[s] === t || (i[s].listener && i[s].listener === t)) {
  37030. n = s
  37031. break
  37032. }
  37033. if (n < 0) return this
  37034. 1 === i.length ? ((i.length = 0), delete this._events[e]) : i.splice(n, 1),
  37035. this._events.removeListener && this.emit('removeListener', e, t)
  37036. }
  37037. return this
  37038. }),
  37039. (n.prototype.removeAllListeners = function (e) {
  37040. var t, i
  37041. if (!this._events) return this
  37042. if (!this._events.removeListener)
  37043. return (
  37044. 0 === arguments.length
  37045. ? (this._events = {})
  37046. : this._events[e] && delete this._events[e],
  37047. this
  37048. )
  37049. if (0 === arguments.length) {
  37050. for (t in this._events) 'removeListener' !== t && this.removeAllListeners(t)
  37051. return this.removeAllListeners('removeListener'), (this._events = {}), this
  37052. }
  37053. if (((i = this._events[e]), r(i))) this.removeListener(e, i)
  37054. else if (i) for (; i.length; ) this.removeListener(e, i[i.length - 1])
  37055. return delete this._events[e], this
  37056. }),
  37057. (n.prototype.listeners = function (e) {
  37058. var t
  37059. return (t =
  37060. this._events && this._events[e]
  37061. ? r(this._events[e])
  37062. ? [this._events[e]]
  37063. : this._events[e].slice()
  37064. : [])
  37065. }),
  37066. (n.prototype.listenerCount = function (e) {
  37067. if (this._events) {
  37068. var t = this._events[e]
  37069. if (r(t)) return 1
  37070. if (t) return t.length
  37071. }
  37072. return 0
  37073. }),
  37074. (n.listenerCount = function (e, t) {
  37075. return e.listenerCount(t)
  37076. })
  37077. },
  37078. {}
  37079. ],
  37080. 203: [
  37081. function (e, t, i) {
  37082. function n() {
  37083. throw new Error('setTimeout has not been defined')
  37084. }
  37085. function r() {
  37086. throw new Error('clearTimeout has not been defined')
  37087. }
  37088. function o(e) {
  37089. if (u === setTimeout) return setTimeout(e, 0)
  37090. if ((u === n || !u) && setTimeout) return (u = setTimeout), setTimeout(e, 0)
  37091. try {
  37092. return u(e, 0)
  37093. } catch (t) {
  37094. try {
  37095. return u.call(null, e, 0)
  37096. } catch (t) {
  37097. return u.call(this, e, 0)
  37098. }
  37099. }
  37100. }
  37101. function a(e) {
  37102. if (d === clearTimeout) return clearTimeout(e)
  37103. if ((d === r || !d) && clearTimeout) return (d = clearTimeout), clearTimeout(e)
  37104. try {
  37105. return d(e)
  37106. } catch (t) {
  37107. try {
  37108. return d.call(null, e)
  37109. } catch (t) {
  37110. return d.call(this, e)
  37111. }
  37112. }
  37113. }
  37114. function s() {
  37115. m && f && ((m = !1), f.length ? (g = f.concat(g)) : (v = -1), g.length && l())
  37116. }
  37117. function l() {
  37118. if (!m) {
  37119. var e = o(s)
  37120. m = !0
  37121. for (var t = g.length; t; ) {
  37122. for (f = g, g = []; ++v < t; ) f && f[v].run()
  37123. ;(v = -1), (t = g.length)
  37124. }
  37125. ;(f = null), (m = !1), a(e)
  37126. }
  37127. }
  37128. function c(e, t) {
  37129. ;(this.fun = e), (this.array = t)
  37130. }
  37131. function h() {}
  37132. var u,
  37133. d,
  37134. p = (t.exports = {})
  37135. !(function () {
  37136. try {
  37137. u = 'function' == typeof setTimeout ? setTimeout : n
  37138. } catch (e) {
  37139. u = n
  37140. }
  37141. try {
  37142. d = 'function' == typeof clearTimeout ? clearTimeout : r
  37143. } catch (e) {
  37144. d = r
  37145. }
  37146. })()
  37147. var f,
  37148. g = [],
  37149. m = !1,
  37150. v = -1
  37151. ;(p.nextTick = function (e) {
  37152. var t = new Array(arguments.length - 1)
  37153. if (arguments.length > 1)
  37154. for (var i = 1; i < arguments.length; i++) t[i - 1] = arguments[i]
  37155. g.push(new c(e, t)), 1 !== g.length || m || o(l)
  37156. }),
  37157. (c.prototype.run = function () {
  37158. this.fun.apply(null, this.array)
  37159. }),
  37160. (p.title = 'browser'),
  37161. (p.browser = !0),
  37162. (p.env = {}),
  37163. (p.argv = []),
  37164. (p.version = ''),
  37165. (p.versions = {}),
  37166. (p.on = h),
  37167. (p.addListener = h),
  37168. (p.once = h),
  37169. (p.off = h),
  37170. (p.removeListener = h),
  37171. (p.removeAllListeners = h),
  37172. (p.emit = h),
  37173. (p.binding = function (e) {
  37174. throw new Error('process.binding is not supported')
  37175. }),
  37176. (p.cwd = function () {
  37177. return '/'
  37178. }),
  37179. (p.chdir = function (e) {
  37180. throw new Error('process.chdir is not supported')
  37181. }),
  37182. (p.umask = function () {
  37183. return 0
  37184. })
  37185. },
  37186. {}
  37187. ],
  37188. 204: [
  37189. function (e, t, i) {
  37190. ;(function (e) {
  37191. !(function (n) {
  37192. function r(e) {
  37193. throw new RangeError(L[e])
  37194. }
  37195. function o(e, t) {
  37196. for (var i = e.length, n = []; i--; ) n[i] = t(e[i])
  37197. return n
  37198. }
  37199. function a(e, t) {
  37200. var i = e.split('@'),
  37201. n = ''
  37202. i.length > 1 && ((n = i[0] + '@'), (e = i[1])), (e = e.replace(O, '.'))
  37203. var r = e.split('.'),
  37204. a = o(r, t).join('.')
  37205. return n + a
  37206. }
  37207. function s(e) {
  37208. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  37209. (t = e.charCodeAt(r++)),
  37210. t >= 55296 && t <= 56319 && r < o
  37211. ? ((i = e.charCodeAt(r++)),
  37212. 56320 == (64512 & i)
  37213. ? n.push(((1023 & t) << 10) + (1023 & i) + 65536)
  37214. : (n.push(t), r--))
  37215. : n.push(t)
  37216. return n
  37217. }
  37218. function l(e) {
  37219. return o(e, function (e) {
  37220. var t = ''
  37221. return (
  37222. e > 65535 &&
  37223. ((e -= 65536), (t += B(((e >>> 10) & 1023) | 55296)), (e = 56320 | (1023 & e))),
  37224. (t += B(e))
  37225. )
  37226. }).join('')
  37227. }
  37228. function c(e) {
  37229. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  37230. }
  37231. function h(e, t) {
  37232. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  37233. }
  37234. function u(e, t, i) {
  37235. var n = 0
  37236. for (e = i ? N(e / T) : e >> 1, e += N(e / t); e > (D * w) >> 1; n += E) e = N(e / D)
  37237. return N(n + ((D + 1) * e) / (e + _))
  37238. }
  37239. function d(e) {
  37240. var t,
  37241. i,
  37242. n,
  37243. o,
  37244. a,
  37245. s,
  37246. h,
  37247. d,
  37248. p,
  37249. f,
  37250. g = [],
  37251. m = e.length,
  37252. v = 0,
  37253. A = S,
  37254. y = x
  37255. for (i = e.lastIndexOf(M), i < 0 && (i = 0), n = 0; n < i; ++n)
  37256. e.charCodeAt(n) >= 128 && r('not-basic'), g.push(e.charCodeAt(n))
  37257. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  37258. for (
  37259. a = v, s = 1, h = E;
  37260. o >= m && r('invalid-input'),
  37261. (d = c(e.charCodeAt(o++))),
  37262. (d >= E || d > N((I - v) / s)) && r('overflow'),
  37263. (v += d * s),
  37264. (p = h <= y ? b : h >= y + w ? w : h - y),
  37265. !(d < p);
  37266. h += E
  37267. )
  37268. (f = E - p), s > N(I / f) && r('overflow'), (s *= f)
  37269. ;(t = g.length + 1),
  37270. (y = u(v - a, t, 0 == a)),
  37271. N(v / t) > I - A && r('overflow'),
  37272. (A += N(v / t)),
  37273. (v %= t),
  37274. g.splice(v++, 0, A)
  37275. }
  37276. return l(g)
  37277. }
  37278. function p(e) {
  37279. var t,
  37280. i,
  37281. n,
  37282. o,
  37283. a,
  37284. l,
  37285. c,
  37286. d,
  37287. p,
  37288. f,
  37289. g,
  37290. m,
  37291. v,
  37292. A,
  37293. y,
  37294. C = []
  37295. for (e = s(e), m = e.length, t = S, i = 0, a = x, l = 0; l < m; ++l)
  37296. (g = e[l]), g < 128 && C.push(B(g))
  37297. for (n = o = C.length, o && C.push(M); n < m; ) {
  37298. for (c = I, l = 0; l < m; ++l) (g = e[l]), g >= t && g < c && (c = g)
  37299. for (
  37300. v = n + 1,
  37301. c - t > N((I - i) / v) && r('overflow'),
  37302. i += (c - t) * v,
  37303. t = c,
  37304. l = 0;
  37305. l < m;
  37306. ++l
  37307. )
  37308. if (((g = e[l]), g < t && ++i > I && r('overflow'), g == t)) {
  37309. for (d = i, p = E; (f = p <= a ? b : p >= a + w ? w : p - a), !(d < f); p += E)
  37310. (y = d - f), (A = E - f), C.push(B(h(f + (y % A), 0))), (d = N(y / A))
  37311. C.push(B(h(d, 0))), (a = u(i, v, n == o)), (i = 0), ++n
  37312. }
  37313. ++i, ++t
  37314. }
  37315. return C.join('')
  37316. }
  37317. function f(e) {
  37318. return a(e, function (e) {
  37319. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  37320. })
  37321. }
  37322. function g(e) {
  37323. return a(e, function (e) {
  37324. return P.test(e) ? 'xn--' + p(e) : e
  37325. })
  37326. }
  37327. var m = 'object' == typeof i && i && !i.nodeType && i,
  37328. v = 'object' == typeof t && t && !t.nodeType && t,
  37329. A = 'object' == typeof e && e
  37330. ;(A.global !== A && A.window !== A && A.self !== A) || (n = A)
  37331. var y,
  37332. C,
  37333. I = 2147483647,
  37334. E = 36,
  37335. b = 1,
  37336. w = 26,
  37337. _ = 38,
  37338. T = 700,
  37339. x = 72,
  37340. S = 128,
  37341. M = '-',
  37342. R = /^xn--/,
  37343. P = /[^\x20-\x7E]/,
  37344. O = /[\x2E\u3002\uFF0E\uFF61]/g,
  37345. L = {
  37346. overflow: 'Overflow: input needs wider integers to process',
  37347. 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
  37348. 'invalid-input': 'Invalid input'
  37349. },
  37350. D = E - b,
  37351. N = Math.floor,
  37352. B = String.fromCharCode
  37353. if (
  37354. ((y = {
  37355. version: '1.4.1',
  37356. ucs2: {
  37357. decode: s,
  37358. encode: l
  37359. },
  37360. decode: d,
  37361. encode: p,
  37362. toASCII: g,
  37363. toUnicode: f
  37364. }),
  37365. 'function' == typeof define && 'object' == typeof define.amd && define.amd)
  37366. )
  37367. define('punycode', function () {
  37368. return y
  37369. })
  37370. else if (m && v)
  37371. if (t.exports == m) v.exports = y
  37372. else for (C in y) y.hasOwnProperty(C) && (m[C] = y[C])
  37373. else n.punycode = y
  37374. })(this)
  37375. }).call(
  37376. this,
  37377. 'undefined' != typeof global
  37378. ? global
  37379. : 'undefined' != typeof self
  37380. ? self
  37381. : 'undefined' != typeof window
  37382. ? window
  37383. : {}
  37384. )
  37385. },
  37386. {}
  37387. ],
  37388. 205: [
  37389. function (e, t, i) {
  37390. 'use strict'
  37391. function n(e, t) {
  37392. return Object.prototype.hasOwnProperty.call(e, t)
  37393. }
  37394. t.exports = function (e, t, i, o) {
  37395. ;(t = t || '&'), (i = i || '=')
  37396. var a = {}
  37397. if ('string' != typeof e || 0 === e.length) return a
  37398. var s = /\+/g
  37399. e = e.split(t)
  37400. var l = 1e3
  37401. o && 'number' == typeof o.maxKeys && (l = o.maxKeys)
  37402. var c = e.length
  37403. l > 0 && c > l && (c = l)
  37404. for (var h = 0; h < c; ++h) {
  37405. var u,
  37406. d,
  37407. p,
  37408. f,
  37409. g = e[h].replace(s, '%20'),
  37410. m = g.indexOf(i)
  37411. m >= 0 ? ((u = g.substr(0, m)), (d = g.substr(m + 1))) : ((u = g), (d = '')),
  37412. (p = decodeURIComponent(u)),
  37413. (f = decodeURIComponent(d)),
  37414. n(a, p) ? (r(a[p]) ? a[p].push(f) : (a[p] = [a[p], f])) : (a[p] = f)
  37415. }
  37416. return a
  37417. }
  37418. var r =
  37419. Array.isArray ||
  37420. function (e) {
  37421. return '[object Array]' === Object.prototype.toString.call(e)
  37422. }
  37423. },
  37424. {}
  37425. ],
  37426. 206: [
  37427. function (e, t, i) {
  37428. 'use strict'
  37429. function n(e, t) {
  37430. if (e.map) return e.map(t)
  37431. for (var i = [], n = 0; n < e.length; n++) i.push(t(e[n], n))
  37432. return i
  37433. }
  37434. var r = function (e) {
  37435. switch (typeof e) {
  37436. case 'string':
  37437. return e
  37438. case 'boolean':
  37439. return e ? 'true' : 'false'
  37440. case 'number':
  37441. return isFinite(e) ? e : ''
  37442. default:
  37443. return ''
  37444. }
  37445. }
  37446. t.exports = function (e, t, i, s) {
  37447. return (
  37448. (t = t || '&'),
  37449. (i = i || '='),
  37450. null === e && (e = void 0),
  37451. 'object' == typeof e
  37452. ? n(a(e), function (a) {
  37453. var s = encodeURIComponent(r(a)) + i
  37454. return o(e[a])
  37455. ? n(e[a], function (e) {
  37456. return s + encodeURIComponent(r(e))
  37457. }).join(t)
  37458. : s + encodeURIComponent(r(e[a]))
  37459. }).join(t)
  37460. : s
  37461. ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e))
  37462. : ''
  37463. )
  37464. }
  37465. var o =
  37466. Array.isArray ||
  37467. function (e) {
  37468. return '[object Array]' === Object.prototype.toString.call(e)
  37469. },
  37470. a =
  37471. Object.keys ||
  37472. function (e) {
  37473. var t = []
  37474. for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && t.push(i)
  37475. return t
  37476. }
  37477. },
  37478. {}
  37479. ],
  37480. 207: [
  37481. function (e, t, i) {
  37482. 'use strict'
  37483. ;(i.decode = i.parse = e('./decode')), (i.encode = i.stringify = e('./encode'))
  37484. },
  37485. {
  37486. './decode': 205,
  37487. './encode': 206
  37488. }
  37489. ],
  37490. 208: [
  37491. function (e, t, i) {
  37492. 'use strict'
  37493. function n() {
  37494. ;(this.protocol = null),
  37495. (this.slashes = null),
  37496. (this.auth = null),
  37497. (this.host = null),
  37498. (this.port = null),
  37499. (this.hostname = null),
  37500. (this.hash = null),
  37501. (this.search = null),
  37502. (this.query = null),
  37503. (this.pathname = null),
  37504. (this.path = null),
  37505. (this.href = null)
  37506. }
  37507. function r(e, t, i) {
  37508. if (e && c.isObject(e) && e instanceof n) return e
  37509. var r = new n()
  37510. return r.parse(e, t, i), r
  37511. }
  37512. function o(e) {
  37513. return (
  37514. c.isString(e) && (e = r(e)), e instanceof n ? e.format() : n.prototype.format.call(e)
  37515. )
  37516. }
  37517. function a(e, t) {
  37518. return r(e, !1, !0).resolve(t)
  37519. }
  37520. function s(e, t) {
  37521. return e ? r(e, !1, !0).resolveObject(t) : t
  37522. }
  37523. var l = e('punycode'),
  37524. c = e('./util')
  37525. ;(i.parse = r), (i.resolve = a), (i.resolveObject = s), (i.format = o), (i.Url = n)
  37526. var h = /^([a-z0-9.+-]+:)/i,
  37527. u = /:[0-9]*$/,
  37528. d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  37529. p = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'],
  37530. f = ['{', '}', '|', '\\', '^', '`'].concat(p),
  37531. g = ["'"].concat(f),
  37532. m = ['%', '/', '?', ';', '#'].concat(g),
  37533. v = ['/', '?', '#'],
  37534. A = 255,
  37535. y = /^[+a-z0-9A-Z_-]{0,63}$/,
  37536. C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  37537. I = {
  37538. javascript: !0,
  37539. 'javascript:': !0
  37540. },
  37541. E = {
  37542. javascript: !0,
  37543. 'javascript:': !0
  37544. },
  37545. b = {
  37546. http: !0,
  37547. https: !0,
  37548. ftp: !0,
  37549. gopher: !0,
  37550. file: !0,
  37551. 'http:': !0,
  37552. 'https:': !0,
  37553. 'ftp:': !0,
  37554. 'gopher:': !0,
  37555. 'file:': !0
  37556. },
  37557. w = e('querystring')
  37558. ;(n.prototype.parse = function (e, t, i) {
  37559. if (!c.isString(e))
  37560. throw new TypeError("Parameter 'url' must be a string, not " + typeof e)
  37561. var n = e.indexOf('?'),
  37562. r = n !== -1 && n < e.indexOf('#') ? '?' : '#',
  37563. o = e.split(r),
  37564. a = /\\/g
  37565. ;(o[0] = o[0].replace(a, '/')), (e = o.join(r))
  37566. var s = e
  37567. if (((s = s.trim()), !i && 1 === e.split('#').length)) {
  37568. var u = d.exec(s)
  37569. if (u)
  37570. return (
  37571. (this.path = s),
  37572. (this.href = s),
  37573. (this.pathname = u[1]),
  37574. u[2]
  37575. ? ((this.search = u[2]),
  37576. t
  37577. ? (this.query = w.parse(this.search.substr(1)))
  37578. : (this.query = this.search.substr(1)))
  37579. : t && ((this.search = ''), (this.query = {})),
  37580. this
  37581. )
  37582. }
  37583. var p = h.exec(s)
  37584. if (p) {
  37585. p = p[0]
  37586. var f = p.toLowerCase()
  37587. ;(this.protocol = f), (s = s.substr(p.length))
  37588. }
  37589. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  37590. var _ = '//' === s.substr(0, 2)
  37591. !_ || (p && E[p]) || ((s = s.substr(2)), (this.slashes = !0))
  37592. }
  37593. if (!E[p] && (_ || (p && !b[p]))) {
  37594. for (var T = -1, x = 0; x < v.length; x++) {
  37595. var S = s.indexOf(v[x])
  37596. S !== -1 && (T === -1 || S < T) && (T = S)
  37597. }
  37598. var M, R
  37599. ;(R = T === -1 ? s.lastIndexOf('@') : s.lastIndexOf('@', T)),
  37600. R !== -1 &&
  37601. ((M = s.slice(0, R)), (s = s.slice(R + 1)), (this.auth = decodeURIComponent(M))),
  37602. (T = -1)
  37603. for (var x = 0; x < m.length; x++) {
  37604. var S = s.indexOf(m[x])
  37605. S !== -1 && (T === -1 || S < T) && (T = S)
  37606. }
  37607. T === -1 && (T = s.length),
  37608. (this.host = s.slice(0, T)),
  37609. (s = s.slice(T)),
  37610. this.parseHost(),
  37611. (this.hostname = this.hostname || '')
  37612. var P = '[' === this.hostname[0] && ']' === this.hostname[this.hostname.length - 1]
  37613. if (!P)
  37614. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  37615. var D = O[x]
  37616. if (D && !D.match(y)) {
  37617. for (var N = '', B = 0, F = D.length; B < F; B++)
  37618. N += D.charCodeAt(B) > 127 ? 'x' : D[B]
  37619. if (!N.match(y)) {
  37620. var V = O.slice(0, x),
  37621. U = O.slice(x + 1),
  37622. k = D.match(C)
  37623. k && (V.push(k[1]), U.unshift(k[2])),
  37624. U.length && (s = '/' + U.join('.') + s),
  37625. (this.hostname = V.join('.'))
  37626. break
  37627. }
  37628. }
  37629. }
  37630. this.hostname.length > A
  37631. ? (this.hostname = '')
  37632. : (this.hostname = this.hostname.toLowerCase()),
  37633. P || (this.hostname = l.toASCII(this.hostname))
  37634. var H = this.port ? ':' + this.port : '',
  37635. G = this.hostname || ''
  37636. ;(this.host = G + H),
  37637. (this.href += this.host),
  37638. P &&
  37639. ((this.hostname = this.hostname.substr(1, this.hostname.length - 2)),
  37640. '/' !== s[0] && (s = '/' + s))
  37641. }
  37642. if (!I[f])
  37643. for (var x = 0, L = g.length; x < L; x++) {
  37644. var z = g[x]
  37645. if (s.indexOf(z) !== -1) {
  37646. var W = encodeURIComponent(z)
  37647. W === z && (W = escape(z)), (s = s.split(z).join(W))
  37648. }
  37649. }
  37650. var j = s.indexOf('#')
  37651. j !== -1 && ((this.hash = s.substr(j)), (s = s.slice(0, j)))
  37652. var Y = s.indexOf('?')
  37653. if (
  37654. (Y !== -1
  37655. ? ((this.search = s.substr(Y)),
  37656. (this.query = s.substr(Y + 1)),
  37657. t && (this.query = w.parse(this.query)),
  37658. (s = s.slice(0, Y)))
  37659. : t && ((this.search = ''), (this.query = {})),
  37660. s && (this.pathname = s),
  37661. b[f] && this.hostname && !this.pathname && (this.pathname = '/'),
  37662. this.pathname || this.search)
  37663. ) {
  37664. var H = this.pathname || '',
  37665. X = this.search || ''
  37666. this.path = H + X
  37667. }
  37668. return (this.href = this.format()), this
  37669. }),
  37670. (n.prototype.format = function () {
  37671. var e = this.auth || ''
  37672. e && ((e = encodeURIComponent(e)), (e = e.replace(/%3A/i, ':')), (e += '@'))
  37673. var t = this.protocol || '',
  37674. i = this.pathname || '',
  37675. n = this.hash || '',
  37676. r = !1,
  37677. o = ''
  37678. this.host
  37679. ? (r = e + this.host)
  37680. : this.hostname &&
  37681. ((r =
  37682. e +
  37683. (this.hostname.indexOf(':') === -1 ? this.hostname : '[' + this.hostname + ']')),
  37684. this.port && (r += ':' + this.port)),
  37685. this.query &&
  37686. c.isObject(this.query) &&
  37687. Object.keys(this.query).length &&
  37688. (o = w.stringify(this.query))
  37689. var a = this.search || (o && '?' + o) || ''
  37690. return (
  37691. t && ':' !== t.substr(-1) && (t += ':'),
  37692. this.slashes || ((!t || b[t]) && r !== !1)
  37693. ? ((r = '//' + (r || '')), i && '/' !== i.charAt(0) && (i = '/' + i))
  37694. : r || (r = ''),
  37695. n && '#' !== n.charAt(0) && (n = '#' + n),
  37696. a && '?' !== a.charAt(0) && (a = '?' + a),
  37697. (i = i.replace(/[?#]/g, function (e) {
  37698. return encodeURIComponent(e)
  37699. })),
  37700. (a = a.replace('#', '%23')),
  37701. t + r + i + a + n
  37702. )
  37703. }),
  37704. (n.prototype.resolve = function (e) {
  37705. return this.resolveObject(r(e, !1, !0)).format()
  37706. }),
  37707. (n.prototype.resolveObject = function (e) {
  37708. if (c.isString(e)) {
  37709. var t = new n()
  37710. t.parse(e, !1, !0), (e = t)
  37711. }
  37712. for (var i = new n(), r = Object.keys(this), o = 0; o < r.length; o++) {
  37713. var a = r[o]
  37714. i[a] = this[a]
  37715. }
  37716. if (((i.hash = e.hash), '' === e.href)) return (i.href = i.format()), i
  37717. if (e.slashes && !e.protocol) {
  37718. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  37719. var h = s[l]
  37720. 'protocol' !== h && (i[h] = e[h])
  37721. }
  37722. return (
  37723. b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = '/'),
  37724. (i.href = i.format()),
  37725. i
  37726. )
  37727. }
  37728. if (e.protocol && e.protocol !== i.protocol) {
  37729. if (!b[e.protocol]) {
  37730. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  37731. var p = u[d]
  37732. i[p] = e[p]
  37733. }
  37734. return (i.href = i.format()), i
  37735. }
  37736. if (((i.protocol = e.protocol), e.host || E[e.protocol])) i.pathname = e.pathname
  37737. else {
  37738. for (var f = (e.pathname || '').split('/'); f.length && !(e.host = f.shift()); );
  37739. e.host || (e.host = ''),
  37740. e.hostname || (e.hostname = ''),
  37741. '' !== f[0] && f.unshift(''),
  37742. f.length < 2 && f.unshift(''),
  37743. (i.pathname = f.join('/'))
  37744. }
  37745. if (
  37746. ((i.search = e.search),
  37747. (i.query = e.query),
  37748. (i.host = e.host || ''),
  37749. (i.auth = e.auth),
  37750. (i.hostname = e.hostname || e.host),
  37751. (i.port = e.port),
  37752. i.pathname || i.search)
  37753. ) {
  37754. var g = i.pathname || '',
  37755. m = i.search || ''
  37756. i.path = g + m
  37757. }
  37758. return (i.slashes = i.slashes || e.slashes), (i.href = i.format()), i
  37759. }
  37760. var v = i.pathname && '/' === i.pathname.charAt(0),
  37761. A = e.host || (e.pathname && '/' === e.pathname.charAt(0)),
  37762. y = A || v || (i.host && e.pathname),
  37763. C = y,
  37764. I = (i.pathname && i.pathname.split('/')) || [],
  37765. f = (e.pathname && e.pathname.split('/')) || [],
  37766. w = i.protocol && !b[i.protocol]
  37767. if (
  37768. (w &&
  37769. ((i.hostname = ''),
  37770. (i.port = null),
  37771. i.host && ('' === I[0] ? (I[0] = i.host) : I.unshift(i.host)),
  37772. (i.host = ''),
  37773. e.protocol &&
  37774. ((e.hostname = null),
  37775. (e.port = null),
  37776. e.host && ('' === f[0] ? (f[0] = e.host) : f.unshift(e.host)),
  37777. (e.host = null)),
  37778. (y = y && ('' === f[0] || '' === I[0]))),
  37779. A)
  37780. )
  37781. (i.host = e.host || '' === e.host ? e.host : i.host),
  37782. (i.hostname = e.hostname || '' === e.hostname ? e.hostname : i.hostname),
  37783. (i.search = e.search),
  37784. (i.query = e.query),
  37785. (I = f)
  37786. else if (f.length)
  37787. I || (I = []), I.pop(), (I = I.concat(f)), (i.search = e.search), (i.query = e.query)
  37788. else if (!c.isNullOrUndefined(e.search)) {
  37789. if (w) {
  37790. i.hostname = i.host = I.shift()
  37791. var _ = !!(i.host && i.host.indexOf('@') > 0) && i.host.split('@')
  37792. _ && ((i.auth = _.shift()), (i.host = i.hostname = _.shift()))
  37793. }
  37794. return (
  37795. (i.search = e.search),
  37796. (i.query = e.query),
  37797. (c.isNull(i.pathname) && c.isNull(i.search)) ||
  37798. (i.path = (i.pathname ? i.pathname : '') + (i.search ? i.search : '')),
  37799. (i.href = i.format()),
  37800. i
  37801. )
  37802. }
  37803. if (!I.length)
  37804. return (
  37805. (i.pathname = null),
  37806. i.search ? (i.path = '/' + i.search) : (i.path = null),
  37807. (i.href = i.format()),
  37808. i
  37809. )
  37810. for (
  37811. var T = I.slice(-1)[0],
  37812. x = ((i.host || e.host || I.length > 1) && ('.' === T || '..' === T)) || '' === T,
  37813. S = 0,
  37814. M = I.length;
  37815. M >= 0;
  37816. M--
  37817. )
  37818. (T = I[M]),
  37819. '.' === T
  37820. ? I.splice(M, 1)
  37821. : '..' === T
  37822. ? (I.splice(M, 1), S++)
  37823. : S && (I.splice(M, 1), S--)
  37824. if (!y && !C) for (; S--; S) I.unshift('..')
  37825. !y || '' === I[0] || (I[0] && '/' === I[0].charAt(0)) || I.unshift(''),
  37826. x && '/' !== I.join('/').substr(-1) && I.push('')
  37827. var R = '' === I[0] || (I[0] && '/' === I[0].charAt(0))
  37828. if (w) {
  37829. i.hostname = i.host = R ? '' : I.length ? I.shift() : ''
  37830. var _ = !!(i.host && i.host.indexOf('@') > 0) && i.host.split('@')
  37831. _ && ((i.auth = _.shift()), (i.host = i.hostname = _.shift()))
  37832. }
  37833. return (
  37834. (y = y || (i.host && I.length)),
  37835. y && !R && I.unshift(''),
  37836. I.length ? (i.pathname = I.join('/')) : ((i.pathname = null), (i.path = null)),
  37837. (c.isNull(i.pathname) && c.isNull(i.search)) ||
  37838. (i.path = (i.pathname ? i.pathname : '') + (i.search ? i.search : '')),
  37839. (i.auth = e.auth || i.auth),
  37840. (i.slashes = i.slashes || e.slashes),
  37841. (i.href = i.format()),
  37842. i
  37843. )
  37844. }),
  37845. (n.prototype.parseHost = function () {
  37846. var e = this.host,
  37847. t = u.exec(e)
  37848. t &&
  37849. ((t = t[0]),
  37850. ':' !== t && (this.port = t.substr(1)),
  37851. (e = e.substr(0, e.length - t.length))),
  37852. e && (this.hostname = e)
  37853. })
  37854. },
  37855. {
  37856. './util': 209,
  37857. punycode: 204,
  37858. querystring: 207
  37859. }
  37860. ],
  37861. 209: [
  37862. function (e, t, i) {
  37863. 'use strict'
  37864. t.exports = {
  37865. isString: function (e) {
  37866. return 'string' == typeof e
  37867. },
  37868. isObject: function (e) {
  37869. return 'object' == typeof e && null !== e
  37870. },
  37871. isNull: function (e) {
  37872. return null === e
  37873. },
  37874. isNullOrUndefined: function (e) {
  37875. return null == e
  37876. }
  37877. }
  37878. },
  37879. {}
  37880. ],
  37881. 210: [
  37882. function (e, t, i) {
  37883. 'use strict'
  37884. function n(e) {
  37885. return l + e
  37886. }
  37887. function r(e) {
  37888. return e.substring(l.length)
  37889. }
  37890. function o(e, t) {
  37891. for (var i in t)
  37892. Object.defineProperty(e, i, {
  37893. value: t[i],
  37894. configurable: !0,
  37895. writable: !0
  37896. })
  37897. }
  37898. function a(e) {
  37899. if ('string' != typeof e) throw new TypeError('key must be a string.')
  37900. }
  37901. var s = Object.prototype.hasOwnProperty,
  37902. l = '~'
  37903. t.exports = function (e) {
  37904. var t = Object.create(null),
  37905. i = 0,
  37906. l = {}
  37907. return (
  37908. o(l, {
  37909. get: function (e, i) {
  37910. a(e)
  37911. var r = n(e)
  37912. return r in t ? t[r] : i
  37913. },
  37914. set: function (e, r) {
  37915. a(e)
  37916. var o = n(e)
  37917. return o in t || ++i, (t[o] = r)
  37918. },
  37919. has: function (e) {
  37920. return a(e), n(e) in t
  37921. },
  37922. delete: function (e) {
  37923. a(e)
  37924. var r = n(e)
  37925. return r in t && (--i, delete t[r], !0)
  37926. },
  37927. clear: function () {
  37928. ;(t = Object.create(null)), (i = 0)
  37929. },
  37930. forEach: function (e, i) {
  37931. if ('function' != typeof e) throw new TypeError('`callback` must be a function')
  37932. for (var n in t)
  37933. if (s.call(t, n)) {
  37934. var o = r(n),
  37935. a = t[n]
  37936. e.call(i, a, o, l)
  37937. }
  37938. }
  37939. }),
  37940. Object.defineProperty(l, 'size', {
  37941. get: function () {
  37942. return i
  37943. },
  37944. configurable: !0
  37945. }),
  37946. 'object' == typeof e &&
  37947. null !== e &&
  37948. Object.keys(e).forEach(function (t) {
  37949. l.set(t, e[t])
  37950. }),
  37951. l
  37952. )
  37953. }
  37954. },
  37955. {}
  37956. ],
  37957. 211: [
  37958. function (e, t, i) {
  37959. t.exports = e('./lib/heap')
  37960. },
  37961. {
  37962. './lib/heap': 212
  37963. }
  37964. ],
  37965. 212: [
  37966. function (e, t, i) {
  37967. ;(function () {
  37968. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m
  37969. ;(r = Math.floor),
  37970. (u = Math.min),
  37971. (n = function (e, t) {
  37972. return e < t ? -1 : e > t ? 1 : 0
  37973. }),
  37974. (h = function (e, t, i, o, a) {
  37975. var s
  37976. if ((null == i && (i = 0), null == a && (a = n), i < 0))
  37977. throw new Error('lo must be non-negative')
  37978. for (null == o && (o = e.length); i < o; )
  37979. (s = r((i + o) / 2)), a(t, e[s]) < 0 ? (o = s) : (i = s + 1)
  37980. return [].splice.apply(e, [i, i - i].concat(t)), t
  37981. }),
  37982. (s = function (e, t, i) {
  37983. return null == i && (i = n), e.push(t), g(e, 0, e.length - 1, i)
  37984. }),
  37985. (a = function (e, t) {
  37986. var i, r
  37987. return (
  37988. null == t && (t = n),
  37989. (i = e.pop()),
  37990. e.length ? ((r = e[0]), (e[0] = i), m(e, 0, t)) : (r = i),
  37991. r
  37992. )
  37993. }),
  37994. (c = function (e, t, i) {
  37995. var r
  37996. return null == i && (i = n), (r = e[0]), (e[0] = t), m(e, 0, i), r
  37997. }),
  37998. (l = function (e, t, i) {
  37999. var r
  38000. return (
  38001. null == i && (i = n),
  38002. e.length &&
  38003. i(e[0], t) < 0 &&
  38004. ((r = [e[0], t]), (t = r[0]), (e[0] = r[1]), m(e, 0, i)),
  38005. t
  38006. )
  38007. }),
  38008. (o = function (e, t) {
  38009. var i, o, a, s, l, c
  38010. for (
  38011. null == t && (t = n),
  38012. s = function () {
  38013. c = []
  38014. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  38015. c.push(t)
  38016. return c
  38017. }
  38018. .apply(this)
  38019. .reverse(),
  38020. l = [],
  38021. o = 0,
  38022. a = s.length;
  38023. o < a;
  38024. o++
  38025. )
  38026. (i = s[o]), l.push(m(e, i, t))
  38027. return l
  38028. }),
  38029. (f = function (e, t, i) {
  38030. var r
  38031. if ((null == i && (i = n), (r = e.indexOf(t)), r !== -1))
  38032. return g(e, 0, r, i), m(e, r, i)
  38033. }),
  38034. (d = function (e, t, i) {
  38035. var r, a, s, c, h
  38036. if ((null == i && (i = n), (a = e.slice(0, t)), !a.length)) return a
  38037. for (o(a, i), h = e.slice(t), s = 0, c = h.length; s < c; s++) (r = h[s]), l(a, r, i)
  38038. return a.sort(i).reverse()
  38039. }),
  38040. (p = function (e, t, i) {
  38041. var r, s, l, c, d, p, f, g, m, v
  38042. if ((null == i && (i = n), 10 * t <= e.length)) {
  38043. if (((c = e.slice(0, t).sort(i)), !c.length)) return c
  38044. for (l = c[c.length - 1], g = e.slice(t), d = 0, f = g.length; d < f; d++)
  38045. (r = g[d]), i(r, l) < 0 && (h(c, r, 0, null, i), c.pop(), (l = c[c.length - 1]))
  38046. return c
  38047. }
  38048. for (
  38049. o(e, i), v = [], s = p = 0, m = u(t, e.length);
  38050. 0 <= m ? p < m : p > m;
  38051. s = 0 <= m ? ++p : --p
  38052. )
  38053. v.push(a(e, i))
  38054. return v
  38055. }),
  38056. (g = function (e, t, i, r) {
  38057. var o, a, s
  38058. for (
  38059. null == r && (r = n), o = e[i];
  38060. i > t && ((s = (i - 1) >> 1), (a = e[s]), r(o, a) < 0);
  38061. )
  38062. (e[i] = a), (i = s)
  38063. return (e[i] = o)
  38064. }),
  38065. (m = function (e, t, i) {
  38066. var r, o, a, s, l
  38067. for (null == i && (i = n), o = e.length, l = t, a = e[t], r = 2 * t + 1; r < o; )
  38068. (s = r + 1),
  38069. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  38070. (e[t] = e[r]),
  38071. (t = r),
  38072. (r = 2 * t + 1)
  38073. return (e[t] = a), g(e, l, t, i)
  38074. }),
  38075. (e = (function () {
  38076. function e(e) {
  38077. ;(this.cmp = null != e ? e : n), (this.nodes = [])
  38078. }
  38079. return (
  38080. (e.push = s),
  38081. (e.pop = a),
  38082. (e.replace = c),
  38083. (e.pushpop = l),
  38084. (e.heapify = o),
  38085. (e.updateItem = f),
  38086. (e.nlargest = d),
  38087. (e.nsmallest = p),
  38088. (e.prototype.push = function (e) {
  38089. return s(this.nodes, e, this.cmp)
  38090. }),
  38091. (e.prototype.pop = function () {
  38092. return a(this.nodes, this.cmp)
  38093. }),
  38094. (e.prototype.peek = function () {
  38095. return this.nodes[0]
  38096. }),
  38097. (e.prototype.contains = function (e) {
  38098. return this.nodes.indexOf(e) !== -1
  38099. }),
  38100. (e.prototype.replace = function (e) {
  38101. return c(this.nodes, e, this.cmp)
  38102. }),
  38103. (e.prototype.pushpop = function (e) {
  38104. return l(this.nodes, e, this.cmp)
  38105. }),
  38106. (e.prototype.heapify = function () {
  38107. return o(this.nodes, this.cmp)
  38108. }),
  38109. (e.prototype.updateItem = function (e) {
  38110. return f(this.nodes, e, this.cmp)
  38111. }),
  38112. (e.prototype.clear = function () {
  38113. return (this.nodes = [])
  38114. }),
  38115. (e.prototype.empty = function () {
  38116. return 0 === this.nodes.length
  38117. }),
  38118. (e.prototype.size = function () {
  38119. return this.nodes.length
  38120. }),
  38121. (e.prototype.clone = function () {
  38122. var t
  38123. return (t = new e()), (t.nodes = this.nodes.slice(0)), t
  38124. }),
  38125. (e.prototype.toArray = function () {
  38126. return this.nodes.slice(0)
  38127. }),
  38128. (e.prototype.insert = e.prototype.push),
  38129. (e.prototype.top = e.prototype.peek),
  38130. (e.prototype.front = e.prototype.peek),
  38131. (e.prototype.has = e.prototype.contains),
  38132. (e.prototype.copy = e.prototype.clone),
  38133. e
  38134. )
  38135. })()),
  38136. (function (e, n) {
  38137. return 'function' == typeof define && define.amd
  38138. ? define([], n)
  38139. : 'object' == typeof i
  38140. ? (t.exports = n())
  38141. : (e.Heap = n())
  38142. })(this, function () {
  38143. return e
  38144. })
  38145. }).call(this)
  38146. },
  38147. {}
  38148. ],
  38149. 213: [
  38150. function (e, t, i) {
  38151. !(function (e) {
  38152. function i() {}
  38153. function n(e, t) {
  38154. return function () {
  38155. e.apply(t, arguments)
  38156. }
  38157. }
  38158. function r(e) {
  38159. if ('object' != typeof this) throw new TypeError('Promises must be constructed via new')
  38160. if ('function' != typeof e) throw new TypeError('not a function')
  38161. ;(this._state = 0),
  38162. (this._handled = !1),
  38163. (this._value = void 0),
  38164. (this._deferreds = []),
  38165. h(e, this)
  38166. }
  38167. function o(e, t) {
  38168. for (; 3 === e._state; ) e = e._value
  38169. return 0 === e._state
  38170. ? void e._deferreds.push(t)
  38171. : ((e._handled = !0),
  38172. void r._immediateFn(function () {
  38173. var i = 1 === e._state ? t.onFulfilled : t.onRejected
  38174. if (null === i) return void (1 === e._state ? a : s)(t.promise, e._value)
  38175. var n
  38176. try {
  38177. n = i(e._value)
  38178. } catch (e) {
  38179. return void s(t.promise, e)
  38180. }
  38181. a(t.promise, n)
  38182. }))
  38183. }
  38184. function a(e, t) {
  38185. try {
  38186. if (t === e) throw new TypeError('A promise cannot be resolved with itself.')
  38187. if (t && ('object' == typeof t || 'function' == typeof t)) {
  38188. var i = t.then
  38189. if (t instanceof r) return (e._state = 3), (e._value = t), void l(e)
  38190. if ('function' == typeof i) return void h(n(i, t), e)
  38191. }
  38192. ;(e._state = 1), (e._value = t), l(e)
  38193. } catch (t) {
  38194. s(e, t)
  38195. }
  38196. }
  38197. function s(e, t) {
  38198. ;(e._state = 2), (e._value = t), l(e)
  38199. }
  38200. function l(e) {
  38201. 2 === e._state &&
  38202. 0 === e._deferreds.length &&
  38203. r._immediateFn(function () {
  38204. e._handled || r._unhandledRejectionFn(e._value)
  38205. })
  38206. for (var t = 0, i = e._deferreds.length; t < i; t++) o(e, e._deferreds[t])
  38207. e._deferreds = null
  38208. }
  38209. function c(e, t, i) {
  38210. ;(this.onFulfilled = 'function' == typeof e ? e : null),
  38211. (this.onRejected = 'function' == typeof t ? t : null),
  38212. (this.promise = i)
  38213. }
  38214. function h(e, t) {
  38215. var i = !1
  38216. try {
  38217. e(
  38218. function (e) {
  38219. i || ((i = !0), a(t, e))
  38220. },
  38221. function (e) {
  38222. i || ((i = !0), s(t, e))
  38223. }
  38224. )
  38225. } catch (e) {
  38226. if (i) return
  38227. ;(i = !0), s(t, e)
  38228. }
  38229. }
  38230. var u = setTimeout
  38231. ;(r.prototype.catch = function (e) {
  38232. return this.then(null, e)
  38233. }),
  38234. (r.prototype.then = function (e, t) {
  38235. var n = new this.constructor(i)
  38236. return o(this, new c(e, t, n)), n
  38237. }),
  38238. (r.all = function (e) {
  38239. var t = Array.prototype.slice.call(e)
  38240. return new r(function (e, i) {
  38241. function n(o, a) {
  38242. try {
  38243. if (a && ('object' == typeof a || 'function' == typeof a)) {
  38244. var s = a.then
  38245. if ('function' == typeof s)
  38246. return void s.call(
  38247. a,
  38248. function (e) {
  38249. n(o, e)
  38250. },
  38251. i
  38252. )
  38253. }
  38254. ;(t[o] = a), 0 === --r && e(t)
  38255. } catch (e) {
  38256. i(e)
  38257. }
  38258. }
  38259. if (0 === t.length) return e([])
  38260. for (var r = t.length, o = 0; o < t.length; o++) n(o, t[o])
  38261. })
  38262. }),
  38263. (r.resolve = function (e) {
  38264. return e && 'object' == typeof e && e.constructor === r
  38265. ? e
  38266. : new r(function (t) {
  38267. t(e)
  38268. })
  38269. }),
  38270. (r.reject = function (e) {
  38271. return new r(function (t, i) {
  38272. i(e)
  38273. })
  38274. }),
  38275. (r.race = function (e) {
  38276. return new r(function (t, i) {
  38277. for (var n = 0, r = e.length; n < r; n++) e[n].then(t, i)
  38278. })
  38279. }),
  38280. (r._immediateFn =
  38281. ('function' == typeof setImmediate &&
  38282. function (e) {
  38283. setImmediate(e)
  38284. }) ||
  38285. function (e) {
  38286. u(e, 0)
  38287. }),
  38288. (r._unhandledRejectionFn = function (e) {
  38289. 'undefined' != typeof console &&
  38290. console &&
  38291. console.warn('Possible Unhandled Promise Rejection:', e)
  38292. }),
  38293. (r._setImmediateFn = function (e) {
  38294. r._immediateFn = e
  38295. }),
  38296. (r._setUnhandledRejectionFn = function (e) {
  38297. r._unhandledRejectionFn = e
  38298. }),
  38299. 'undefined' != typeof t && t.exports ? (t.exports = r) : e.Promise || (e.Promise = r)
  38300. })(this)
  38301. },
  38302. {}
  38303. ],
  38304. 214: [
  38305. function (e, t, i) {
  38306. ;(function (i) {
  38307. !(function (i, n) {
  38308. 'function' == typeof define && define.amd
  38309. ? define(['bytebuffer'], n)
  38310. : 'function' == typeof e && 'object' == typeof t && t && t.exports
  38311. ? (t.exports = n(e('bytebuffer'), !0))
  38312. : ((i.dcodeIO = i.dcodeIO || {}).ProtoBuf = n(i.dcodeIO.ByteBuffer))
  38313. })(this, function (t, n) {
  38314. 'use strict'
  38315. var r = {}
  38316. return (
  38317. (r.ByteBuffer = t),
  38318. (r.Long = t.Long || null),
  38319. (r.VERSION = '5.0.1'),
  38320. (r.WIRE_TYPES = {}),
  38321. (r.WIRE_TYPES.VARINT = 0),
  38322. (r.WIRE_TYPES.BITS64 = 1),
  38323. (r.WIRE_TYPES.LDELIM = 2),
  38324. (r.WIRE_TYPES.STARTGROUP = 3),
  38325. (r.WIRE_TYPES.ENDGROUP = 4),
  38326. (r.WIRE_TYPES.BITS32 = 5),
  38327. (r.PACKABLE_WIRE_TYPES = [
  38328. r.WIRE_TYPES.VARINT,
  38329. r.WIRE_TYPES.BITS64,
  38330. r.WIRE_TYPES.BITS32
  38331. ]),
  38332. (r.TYPES = {
  38333. int32: {
  38334. name: 'int32',
  38335. wireType: r.WIRE_TYPES.VARINT,
  38336. defaultValue: 0
  38337. },
  38338. uint32: {
  38339. name: 'uint32',
  38340. wireType: r.WIRE_TYPES.VARINT,
  38341. defaultValue: 0
  38342. },
  38343. sint32: {
  38344. name: 'sint32',
  38345. wireType: r.WIRE_TYPES.VARINT,
  38346. defaultValue: 0
  38347. },
  38348. int64: {
  38349. name: 'int64',
  38350. wireType: r.WIRE_TYPES.VARINT,
  38351. defaultValue: r.Long ? r.Long.ZERO : void 0
  38352. },
  38353. uint64: {
  38354. name: 'uint64',
  38355. wireType: r.WIRE_TYPES.VARINT,
  38356. defaultValue: r.Long ? r.Long.UZERO : void 0
  38357. },
  38358. sint64: {
  38359. name: 'sint64',
  38360. wireType: r.WIRE_TYPES.VARINT,
  38361. defaultValue: r.Long ? r.Long.ZERO : void 0
  38362. },
  38363. bool: {
  38364. name: 'bool',
  38365. wireType: r.WIRE_TYPES.VARINT,
  38366. defaultValue: !1
  38367. },
  38368. double: {
  38369. name: 'double',
  38370. wireType: r.WIRE_TYPES.BITS64,
  38371. defaultValue: 0
  38372. },
  38373. string: {
  38374. name: 'string',
  38375. wireType: r.WIRE_TYPES.LDELIM,
  38376. defaultValue: ''
  38377. },
  38378. bytes: {
  38379. name: 'bytes',
  38380. wireType: r.WIRE_TYPES.LDELIM,
  38381. defaultValue: null
  38382. },
  38383. fixed32: {
  38384. name: 'fixed32',
  38385. wireType: r.WIRE_TYPES.BITS32,
  38386. defaultValue: 0
  38387. },
  38388. sfixed32: {
  38389. name: 'sfixed32',
  38390. wireType: r.WIRE_TYPES.BITS32,
  38391. defaultValue: 0
  38392. },
  38393. fixed64: {
  38394. name: 'fixed64',
  38395. wireType: r.WIRE_TYPES.BITS64,
  38396. defaultValue: r.Long ? r.Long.UZERO : void 0
  38397. },
  38398. sfixed64: {
  38399. name: 'sfixed64',
  38400. wireType: r.WIRE_TYPES.BITS64,
  38401. defaultValue: r.Long ? r.Long.ZERO : void 0
  38402. },
  38403. float: {
  38404. name: 'float',
  38405. wireType: r.WIRE_TYPES.BITS32,
  38406. defaultValue: 0
  38407. },
  38408. enum: {
  38409. name: 'enum',
  38410. wireType: r.WIRE_TYPES.VARINT,
  38411. defaultValue: 0
  38412. },
  38413. message: {
  38414. name: 'message',
  38415. wireType: r.WIRE_TYPES.LDELIM,
  38416. defaultValue: null
  38417. },
  38418. group: {
  38419. name: 'group',
  38420. wireType: r.WIRE_TYPES.STARTGROUP,
  38421. defaultValue: null
  38422. }
  38423. }),
  38424. (r.MAP_KEY_TYPES = [
  38425. r.TYPES.int32,
  38426. r.TYPES.sint32,
  38427. r.TYPES.sfixed32,
  38428. r.TYPES.uint32,
  38429. r.TYPES.fixed32,
  38430. r.TYPES.int64,
  38431. r.TYPES.sint64,
  38432. r.TYPES.sfixed64,
  38433. r.TYPES.uint64,
  38434. r.TYPES.fixed64,
  38435. r.TYPES.bool,
  38436. r.TYPES.string,
  38437. r.TYPES.bytes
  38438. ]),
  38439. (r.ID_MIN = 1),
  38440. (r.ID_MAX = 536870911),
  38441. (r.convertFieldsToCamelCase = !1),
  38442. (r.populateAccessors = !0),
  38443. (r.populateDefaults = !0),
  38444. (r.Util = (function () {
  38445. var t = {}
  38446. return (
  38447. (t.IS_NODE = !(
  38448. 'object' != typeof i ||
  38449. i + '' != '[object process]' ||
  38450. i.browser
  38451. )),
  38452. (t.XHR = function () {
  38453. for (
  38454. var e = [
  38455. function () {
  38456. return new XMLHttpRequest()
  38457. },
  38458. function () {
  38459. return new ActiveXObject('Msxml2.XMLHTTP')
  38460. },
  38461. function () {
  38462. return new ActiveXObject('Msxml3.XMLHTTP')
  38463. },
  38464. function () {
  38465. return new ActiveXObject('Microsoft.XMLHTTP')
  38466. }
  38467. ],
  38468. t = null,
  38469. i = 0;
  38470. i < e.length;
  38471. i++
  38472. ) {
  38473. try {
  38474. t = e[i]()
  38475. } catch (e) {
  38476. continue
  38477. }
  38478. break
  38479. }
  38480. if (!t) throw Error('XMLHttpRequest is not supported')
  38481. return t
  38482. }),
  38483. (t.fetch = function (i, n) {
  38484. if ((n && 'function' != typeof n && (n = null), t.IS_NODE)) {
  38485. var r = e('fs')
  38486. if (n)
  38487. r.readFile(i, function (e, t) {
  38488. n(e ? null : '' + t)
  38489. })
  38490. else
  38491. try {
  38492. return r.readFileSync(i)
  38493. } catch (e) {
  38494. return null
  38495. }
  38496. } else {
  38497. var o = t.XHR()
  38498. if (
  38499. (o.open('GET', i, !!n),
  38500. o.setRequestHeader('Accept', 'text/plain'),
  38501. 'function' == typeof o.overrideMimeType && o.overrideMimeType('text/plain'),
  38502. !n)
  38503. )
  38504. return (
  38505. o.send(null),
  38506. 200 == o.status || (0 == o.status && 'string' == typeof o.responseText)
  38507. ? o.responseText
  38508. : null
  38509. )
  38510. if (
  38511. ((o.onreadystatechange = function () {
  38512. 4 == o.readyState &&
  38513. n(
  38514. 200 == o.status ||
  38515. (0 == o.status && 'string' == typeof o.responseText)
  38516. ? o.responseText
  38517. : null
  38518. )
  38519. }),
  38520. 4 == o.readyState)
  38521. )
  38522. return
  38523. o.send(null)
  38524. }
  38525. }),
  38526. (t.toCamelCase = function (e) {
  38527. return e.replace(/_([a-zA-Z])/g, function (e, t) {
  38528. return t.toUpperCase()
  38529. })
  38530. }),
  38531. t
  38532. )
  38533. })()),
  38534. (r.Lang = {
  38535. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  38536. RULE: /^(?:required|optional|repeated|map)$/,
  38537. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  38538. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  38539. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  38540. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  38541. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  38542. NUMBER:
  38543. /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  38544. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  38545. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  38546. NUMBER_OCT: /^0[0-7]+$/,
  38547. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  38548. BOOL: /^(?:true|false)$/i,
  38549. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  38550. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  38551. WHITESPACE: /\s/,
  38552. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  38553. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  38554. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  38555. }),
  38556. (r.DotProto = (function (e, t) {
  38557. function i(e, i) {
  38558. var n = -1,
  38559. r = 1
  38560. if (
  38561. ('-' == e.charAt(0) && ((r = -1), (e = e.substring(1))), t.NUMBER_DEC.test(e))
  38562. )
  38563. n = parseInt(e)
  38564. else if (t.NUMBER_HEX.test(e)) n = parseInt(e.substring(2), 16)
  38565. else {
  38566. if (!t.NUMBER_OCT.test(e))
  38567. throw Error('illegal id value: ' + (r < 0 ? '-' : '') + e)
  38568. n = parseInt(e.substring(1), 8)
  38569. }
  38570. if (((n = (r * n) | 0), !i && n < 0))
  38571. throw Error('illegal id value: ' + (r < 0 ? '-' : '') + e)
  38572. return n
  38573. }
  38574. function n(e) {
  38575. var i = 1
  38576. if (
  38577. ('-' == e.charAt(0) && ((i = -1), (e = e.substring(1))), t.NUMBER_DEC.test(e))
  38578. )
  38579. return i * parseInt(e, 10)
  38580. if (t.NUMBER_HEX.test(e)) return i * parseInt(e.substring(2), 16)
  38581. if (t.NUMBER_OCT.test(e)) return i * parseInt(e.substring(1), 8)
  38582. if ('inf' === e) return i * (1 / 0)
  38583. if ('nan' === e) return NaN
  38584. if (t.NUMBER_FLT.test(e)) return i * parseFloat(e)
  38585. throw Error('illegal number value: ' + (i < 0 ? '-' : '') + e)
  38586. }
  38587. function r(e, t, i) {
  38588. 'undefined' == typeof e[t]
  38589. ? (e[t] = i)
  38590. : (Array.isArray(e[t]) || (e[t] = [e[t]]), e[t].push(i))
  38591. }
  38592. var o = {},
  38593. a = function (e) {
  38594. ;(this.source = e + ''),
  38595. (this.index = 0),
  38596. (this.line = 1),
  38597. (this.stack = []),
  38598. (this._stringOpen = null)
  38599. },
  38600. s = a.prototype
  38601. ;(s._readString = function () {
  38602. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ
  38603. e.lastIndex = this.index - 1
  38604. var i = e.exec(this.source)
  38605. if (!i) throw Error('unterminated string')
  38606. return (
  38607. (this.index = e.lastIndex),
  38608. this.stack.push(this._stringOpen),
  38609. (this._stringOpen = null),
  38610. i[1]
  38611. )
  38612. }),
  38613. (s.next = function () {
  38614. if (this.stack.length > 0) return this.stack.shift()
  38615. if (this.index >= this.source.length) return null
  38616. if (null !== this._stringOpen) return this._readString()
  38617. var e, i, n
  38618. do {
  38619. for (e = !1; t.WHITESPACE.test((n = this.source.charAt(this.index))); )
  38620. if (('\n' === n && ++this.line, ++this.index === this.source.length))
  38621. return null
  38622. if ('/' === this.source.charAt(this.index))
  38623. if ((++this.index, '/' === this.source.charAt(this.index))) {
  38624. for (; '\n' !== this.source.charAt(++this.index); )
  38625. if (this.index == this.source.length) return null
  38626. ++this.index, ++this.line, (e = !0)
  38627. } else {
  38628. if ('*' !== (n = this.source.charAt(this.index))) return '/'
  38629. do {
  38630. if (('\n' === n && ++this.line, ++this.index === this.source.length))
  38631. return null
  38632. ;(i = n), (n = this.source.charAt(this.index))
  38633. } while ('*' !== i || '/' !== n)
  38634. ++this.index, (e = !0)
  38635. }
  38636. } while (e)
  38637. if (this.index === this.source.length) return null
  38638. var r = this.index
  38639. t.DELIM.lastIndex = 0
  38640. var o = t.DELIM.test(this.source.charAt(r++))
  38641. if (!o)
  38642. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); ) ++r
  38643. var a = this.source.substring(this.index, (this.index = r))
  38644. return ('"' !== a && "'" !== a) || (this._stringOpen = a), a
  38645. }),
  38646. (s.peek = function () {
  38647. if (0 === this.stack.length) {
  38648. var e = this.next()
  38649. if (null === e) return null
  38650. this.stack.push(e)
  38651. }
  38652. return this.stack[0]
  38653. }),
  38654. (s.skip = function (e) {
  38655. var t = this.next()
  38656. if (t !== e) throw Error("illegal '" + t + "', '" + e + "' expected")
  38657. }),
  38658. (s.omit = function (e) {
  38659. return this.peek() === e && (this.next(), !0)
  38660. }),
  38661. (s.toString = function () {
  38662. return (
  38663. 'Tokenizer (' +
  38664. this.index +
  38665. '/' +
  38666. this.source.length +
  38667. ' at line ' +
  38668. this.line +
  38669. ')'
  38670. )
  38671. }),
  38672. (o.Tokenizer = a)
  38673. var l = function (e) {
  38674. ;(this.tn = new a(e)), (this.proto3 = !1)
  38675. },
  38676. c = l.prototype
  38677. return (
  38678. (c.parse = function () {
  38679. var e,
  38680. i,
  38681. n = {
  38682. name: '[ROOT]',
  38683. package: null,
  38684. messages: [],
  38685. enums: [],
  38686. imports: [],
  38687. options: {},
  38688. services: []
  38689. },
  38690. r = !0
  38691. try {
  38692. for (; (e = this.tn.next()); )
  38693. switch (e) {
  38694. case 'package':
  38695. if (!r || null !== n.package) throw Error("unexpected 'package'")
  38696. if (((e = this.tn.next()), !t.TYPEREF.test(e)))
  38697. throw Error('illegal package name: ' + e)
  38698. this.tn.skip(';'), (n.package = e)
  38699. break
  38700. case 'import':
  38701. if (!r) throw Error("unexpected 'import'")
  38702. ;(e = this.tn.peek()),
  38703. ('public' === e || (i = 'weak' === e)) && this.tn.next(),
  38704. (e = this._readString()),
  38705. this.tn.skip(';'),
  38706. i || n.imports.push(e)
  38707. break
  38708. case 'syntax':
  38709. if (!r) throw Error("unexpected 'syntax'")
  38710. this.tn.skip('='),
  38711. 'proto3' === (n.syntax = this._readString()) && (this.proto3 = !0),
  38712. this.tn.skip(';')
  38713. break
  38714. case 'message':
  38715. this._parseMessage(n, null), (r = !1)
  38716. break
  38717. case 'enum':
  38718. this._parseEnum(n), (r = !1)
  38719. break
  38720. case 'option':
  38721. this._parseOption(n)
  38722. break
  38723. case 'service':
  38724. this._parseService(n)
  38725. break
  38726. case 'extend':
  38727. this._parseExtend(n)
  38728. break
  38729. default:
  38730. throw Error("unexpected '" + e + "'")
  38731. }
  38732. } catch (e) {
  38733. throw (
  38734. ((e.message = 'Parse error at line ' + this.tn.line + ': ' + e.message), e)
  38735. )
  38736. }
  38737. return delete n.name, n
  38738. }),
  38739. (l.parse = function (e) {
  38740. return new l(e).parse()
  38741. }),
  38742. (c._readString = function () {
  38743. var e,
  38744. t,
  38745. i = ''
  38746. do {
  38747. if (((t = this.tn.next()), "'" !== t && '"' !== t))
  38748. throw Error('illegal string delimiter: ' + t)
  38749. ;(i += this.tn.next()), this.tn.skip(t), (e = this.tn.peek())
  38750. } while ('"' === e || '"' === e)
  38751. return i
  38752. }),
  38753. (c._readValue = function (e) {
  38754. var i = this.tn.peek()
  38755. if ('"' === i || "'" === i) return this._readString()
  38756. if ((this.tn.next(), t.NUMBER.test(i))) return n(i)
  38757. if (t.BOOL.test(i)) return 'true' === i.toLowerCase()
  38758. if (e && t.TYPEREF.test(i)) return i
  38759. throw Error('illegal value: ' + i)
  38760. }),
  38761. (c._parseOption = function (e, i) {
  38762. var n = this.tn.next(),
  38763. r = !1
  38764. if (('(' === n && ((r = !0), (n = this.tn.next())), !t.TYPEREF.test(n)))
  38765. throw Error('illegal option name: ' + n)
  38766. var o = n
  38767. r &&
  38768. (this.tn.skip(')'),
  38769. (o = '(' + o + ')'),
  38770. (n = this.tn.peek()),
  38771. t.FQTYPEREF.test(n) && ((o += n), this.tn.next())),
  38772. this.tn.skip('='),
  38773. this._parseOptionValue(e, o),
  38774. i || this.tn.skip(';')
  38775. }),
  38776. (c._parseOptionValue = function (e, i) {
  38777. var n = this.tn.peek()
  38778. if ('{' !== n) r(e.options, i, this._readValue(!0))
  38779. else
  38780. for (this.tn.skip('{'); '}' !== (n = this.tn.next()); ) {
  38781. if (!t.NAME.test(n)) throw Error('illegal option name: ' + i + '.' + n)
  38782. this.tn.omit(':')
  38783. ? r(e.options, i + '.' + n, this._readValue(!0))
  38784. : this._parseOptionValue(e, i + '.' + n)
  38785. }
  38786. }),
  38787. (c._parseService = function (e) {
  38788. var i = this.tn.next()
  38789. if (!t.NAME.test(i))
  38790. throw Error('illegal service name at line ' + this.tn.line + ': ' + i)
  38791. var n = i,
  38792. r = {
  38793. name: n,
  38794. rpc: {},
  38795. options: {}
  38796. }
  38797. for (this.tn.skip('{'); '}' !== (i = this.tn.next()); )
  38798. if ('option' === i) this._parseOption(r)
  38799. else {
  38800. if ('rpc' !== i) throw Error('illegal service token: ' + i)
  38801. this._parseServiceRPC(r)
  38802. }
  38803. this.tn.omit(';'), e.services.push(r)
  38804. }),
  38805. (c._parseServiceRPC = function (e) {
  38806. var i = 'rpc',
  38807. n = this.tn.next()
  38808. if (!t.NAME.test(n)) throw Error('illegal rpc service method name: ' + n)
  38809. var r = n,
  38810. o = {
  38811. request: null,
  38812. response: null,
  38813. request_stream: !1,
  38814. response_stream: !1,
  38815. options: {}
  38816. }
  38817. if (
  38818. (this.tn.skip('('),
  38819. (n = this.tn.next()),
  38820. 'stream' === n.toLowerCase() &&
  38821. ((o.request_stream = !0), (n = this.tn.next())),
  38822. !t.TYPEREF.test(n))
  38823. )
  38824. throw Error('illegal rpc service request type: ' + n)
  38825. if (
  38826. ((o.request = n),
  38827. this.tn.skip(')'),
  38828. (n = this.tn.next()),
  38829. 'returns' !== n.toLowerCase())
  38830. )
  38831. throw Error('illegal rpc service request type delimiter: ' + n)
  38832. if (
  38833. (this.tn.skip('('),
  38834. (n = this.tn.next()),
  38835. 'stream' === n.toLowerCase() &&
  38836. ((o.response_stream = !0), (n = this.tn.next())),
  38837. (o.response = n),
  38838. this.tn.skip(')'),
  38839. (n = this.tn.peek()),
  38840. '{' === n)
  38841. ) {
  38842. for (this.tn.next(); '}' !== (n = this.tn.next()); ) {
  38843. if ('option' !== n) throw Error('illegal rpc service token: ' + n)
  38844. this._parseOption(o)
  38845. }
  38846. this.tn.omit(';')
  38847. } else this.tn.skip(';')
  38848. 'undefined' == typeof e[i] && (e[i] = {}), (e[i][r] = o)
  38849. }),
  38850. (c._parseMessage = function (e, n) {
  38851. var r = !!n,
  38852. o = this.tn.next(),
  38853. a = {
  38854. name: '',
  38855. fields: [],
  38856. enums: [],
  38857. messages: [],
  38858. options: {},
  38859. services: [],
  38860. oneofs: {}
  38861. }
  38862. if (!t.NAME.test(o))
  38863. throw Error('illegal ' + (r ? 'group' : 'message') + ' name: ' + o)
  38864. for (
  38865. a.name = o,
  38866. r && (this.tn.skip('='), (n.id = i(this.tn.next())), (a.isGroup = !0)),
  38867. o = this.tn.peek(),
  38868. '[' === o && n && this._parseFieldOptions(n),
  38869. this.tn.skip('{');
  38870. '}' !== (o = this.tn.next());
  38871. )
  38872. if (t.RULE.test(o)) this._parseMessageField(a, o)
  38873. else if ('oneof' === o) this._parseMessageOneOf(a)
  38874. else if ('enum' === o) this._parseEnum(a)
  38875. else if ('message' === o) this._parseMessage(a)
  38876. else if ('option' === o) this._parseOption(a)
  38877. else if ('service' === o) this._parseService(a)
  38878. else if ('extensions' === o) a.extensions = this._parseExtensionRanges()
  38879. else if ('reserved' === o) this._parseIgnored()
  38880. else if ('extend' === o) this._parseExtend(a)
  38881. else {
  38882. if (!t.TYPEREF.test(o)) throw Error('illegal message token: ' + o)
  38883. if (!this.proto3) throw Error('illegal field rule: ' + o)
  38884. this._parseMessageField(a, 'optional', o)
  38885. }
  38886. return this.tn.omit(';'), e.messages.push(a), a
  38887. }),
  38888. (c._parseIgnored = function () {
  38889. for (; ';' !== this.tn.peek(); ) this.tn.next()
  38890. this.tn.skip(';')
  38891. }),
  38892. (c._parseMessageField = function (e, n, r) {
  38893. if (!t.RULE.test(n)) throw Error('illegal message field rule: ' + n)
  38894. var o,
  38895. a = {
  38896. rule: n,
  38897. type: '',
  38898. name: '',
  38899. options: {},
  38900. id: 0
  38901. }
  38902. if ('map' === n) {
  38903. if (r) throw Error('illegal type: ' + r)
  38904. if (
  38905. (this.tn.skip('<'),
  38906. (o = this.tn.next()),
  38907. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  38908. )
  38909. throw Error('illegal message field type: ' + o)
  38910. if (
  38911. ((a.keytype = o),
  38912. this.tn.skip(','),
  38913. (o = this.tn.next()),
  38914. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  38915. )
  38916. throw Error('illegal message field: ' + o)
  38917. if (((a.type = o), this.tn.skip('>'), (o = this.tn.next()), !t.NAME.test(o)))
  38918. throw Error('illegal message field name: ' + o)
  38919. ;(a.name = o),
  38920. this.tn.skip('='),
  38921. (a.id = i(this.tn.next())),
  38922. (o = this.tn.peek()),
  38923. '[' === o && this._parseFieldOptions(a),
  38924. this.tn.skip(';')
  38925. } else if (
  38926. ((r = 'undefined' != typeof r ? r : this.tn.next()), 'group' === r)
  38927. ) {
  38928. var s = this._parseMessage(e, a)
  38929. if (!/^[A-Z]/.test(s.name)) throw Error('illegal group name: ' + s.name)
  38930. ;(a.type = s.name), (a.name = s.name.toLowerCase()), this.tn.omit(';')
  38931. } else {
  38932. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  38933. throw Error('illegal message field type: ' + r)
  38934. if (((a.type = r), (o = this.tn.next()), !t.NAME.test(o)))
  38935. throw Error('illegal message field name: ' + o)
  38936. ;(a.name = o),
  38937. this.tn.skip('='),
  38938. (a.id = i(this.tn.next())),
  38939. (o = this.tn.peek()),
  38940. '[' === o && this._parseFieldOptions(a),
  38941. this.tn.skip(';')
  38942. }
  38943. return e.fields.push(a), a
  38944. }),
  38945. (c._parseMessageOneOf = function (e) {
  38946. var i = this.tn.next()
  38947. if (!t.NAME.test(i)) throw Error('illegal oneof name: ' + i)
  38948. var n,
  38949. r = i,
  38950. o = []
  38951. for (this.tn.skip('{'); '}' !== (i = this.tn.next()); )
  38952. (n = this._parseMessageField(e, 'optional', i)), (n.oneof = r), o.push(n.id)
  38953. this.tn.omit(';'), (e.oneofs[r] = o)
  38954. }),
  38955. (c._parseFieldOptions = function (e) {
  38956. this.tn.skip('[')
  38957. for (var t, i = !0; ']' !== (t = this.tn.peek()); )
  38958. i || this.tn.skip(','), this._parseOption(e, !0), (i = !1)
  38959. this.tn.next()
  38960. }),
  38961. (c._parseEnum = function (e) {
  38962. var n = {
  38963. name: '',
  38964. values: [],
  38965. options: {}
  38966. },
  38967. r = this.tn.next()
  38968. if (!t.NAME.test(r)) throw Error('illegal name: ' + r)
  38969. for (n.name = r, this.tn.skip('{'); '}' !== (r = this.tn.next()); )
  38970. if ('option' === r) this._parseOption(n)
  38971. else {
  38972. if (!t.NAME.test(r)) throw Error('illegal name: ' + r)
  38973. this.tn.skip('=')
  38974. var o = {
  38975. name: r,
  38976. id: i(this.tn.next(), !0)
  38977. }
  38978. ;(r = this.tn.peek()),
  38979. '[' === r &&
  38980. this._parseFieldOptions({
  38981. options: {}
  38982. }),
  38983. this.tn.skip(';'),
  38984. n.values.push(o)
  38985. }
  38986. this.tn.omit(';'), e.enums.push(n)
  38987. }),
  38988. (c._parseExtensionRanges = function () {
  38989. var t,
  38990. i,
  38991. r,
  38992. o = []
  38993. do {
  38994. for (i = []; ; ) {
  38995. switch ((t = this.tn.next())) {
  38996. case 'min':
  38997. r = e.ID_MIN
  38998. break
  38999. case 'max':
  39000. r = e.ID_MAX
  39001. break
  39002. default:
  39003. r = n(t)
  39004. }
  39005. if ((i.push(r), 2 === i.length)) break
  39006. if ('to' !== this.tn.peek()) {
  39007. i.push(r)
  39008. break
  39009. }
  39010. this.tn.next()
  39011. }
  39012. o.push(i)
  39013. } while (this.tn.omit(','))
  39014. return this.tn.skip(';'), o
  39015. }),
  39016. (c._parseExtend = function (e) {
  39017. var i = this.tn.next()
  39018. if (!t.TYPEREF.test(i)) throw Error('illegal extend reference: ' + i)
  39019. var n = {
  39020. ref: i,
  39021. fields: []
  39022. }
  39023. for (this.tn.skip('{'); '}' !== (i = this.tn.next()); )
  39024. if (t.RULE.test(i)) this._parseMessageField(n, i)
  39025. else {
  39026. if (!t.TYPEREF.test(i)) throw Error('illegal extend token: ' + i)
  39027. if (!this.proto3) throw Error('illegal field rule: ' + i)
  39028. this._parseMessageField(n, 'optional', i)
  39029. }
  39030. return this.tn.omit(';'), e.messages.push(n), n
  39031. }),
  39032. (c.toString = function () {
  39033. return 'Parser at line ' + this.tn.line
  39034. }),
  39035. (o.Parser = l),
  39036. o
  39037. )
  39038. })(r, r.Lang)),
  39039. (r.Reflect = (function (e) {
  39040. function i(i) {
  39041. if (
  39042. ('string' == typeof i && (i = e.TYPES[i]), 'undefined' == typeof i.defaultValue)
  39043. )
  39044. throw Error('default value for type ' + i.name + ' is not supported')
  39045. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  39046. }
  39047. function n(t, i) {
  39048. if (
  39049. t &&
  39050. 'number' == typeof t.low &&
  39051. 'number' == typeof t.high &&
  39052. 'boolean' == typeof t.unsigned &&
  39053. t.low === t.low &&
  39054. t.high === t.high
  39055. )
  39056. return new e.Long(t.low, t.high, 'undefined' == typeof i ? t.unsigned : i)
  39057. if ('string' == typeof t) return e.Long.fromString(t, i || !1, 10)
  39058. if ('number' == typeof t) return e.Long.fromNumber(t, i || !1)
  39059. throw Error('not convertible to Long')
  39060. }
  39061. function r(t, i) {
  39062. var n = i.readVarint32(),
  39063. o = 7 & n,
  39064. a = n >>> 3
  39065. switch (o) {
  39066. case e.WIRE_TYPES.VARINT:
  39067. do n = i.readUint8()
  39068. while (128 === (128 & n))
  39069. break
  39070. case e.WIRE_TYPES.BITS64:
  39071. i.offset += 8
  39072. break
  39073. case e.WIRE_TYPES.LDELIM:
  39074. ;(n = i.readVarint32()), (i.offset += n)
  39075. break
  39076. case e.WIRE_TYPES.STARTGROUP:
  39077. r(a, i)
  39078. break
  39079. case e.WIRE_TYPES.ENDGROUP:
  39080. if (a === t) return !1
  39081. throw Error(
  39082. 'Illegal GROUPEND after unknown group: ' + a + ' (' + t + ' expected)'
  39083. )
  39084. case e.WIRE_TYPES.BITS32:
  39085. i.offset += 4
  39086. break
  39087. default:
  39088. throw Error('Illegal wire type in unknown group ' + t + ': ' + o)
  39089. }
  39090. return !0
  39091. }
  39092. var o = {},
  39093. a = function (e, t, i) {
  39094. ;(this.builder = e), (this.parent = t), (this.name = i), this.className
  39095. },
  39096. s = a.prototype
  39097. ;(s.fqn = function () {
  39098. for (var e = this.name, t = this; ; ) {
  39099. if (((t = t.parent), null == t)) break
  39100. e = t.name + '.' + e
  39101. }
  39102. return e
  39103. }),
  39104. (s.toString = function (e) {
  39105. return (e ? this.className + ' ' : '') + this.fqn()
  39106. }),
  39107. (s.build = function () {
  39108. throw Error(this.toString(!0) + ' cannot be built directly')
  39109. }),
  39110. (o.T = a)
  39111. var l = function (e, t, i, n, r) {
  39112. a.call(this, e, t, i),
  39113. (this.className = 'Namespace'),
  39114. (this.children = []),
  39115. (this.options = n || {}),
  39116. (this.syntax = r || 'proto2')
  39117. },
  39118. c = (l.prototype = Object.create(a.prototype))
  39119. ;(c.getChildren = function (e) {
  39120. if (((e = e || null), null == e)) return this.children.slice()
  39121. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  39122. this.children[i] instanceof e && t.push(this.children[i])
  39123. return t
  39124. }),
  39125. (c.addChild = function (e) {
  39126. var t
  39127. if ((t = this.getChild(e.name)))
  39128. if (
  39129. t instanceof d.Field &&
  39130. t.name !== t.originalName &&
  39131. null === this.getChild(t.originalName)
  39132. )
  39133. t.name = t.originalName
  39134. else {
  39135. if (
  39136. !(
  39137. e instanceof d.Field &&
  39138. e.name !== e.originalName &&
  39139. null === this.getChild(e.originalName)
  39140. )
  39141. )
  39142. throw Error(
  39143. 'Duplicate name in namespace ' + this.toString(!0) + ': ' + e.name
  39144. )
  39145. e.name = e.originalName
  39146. }
  39147. this.children.push(e)
  39148. }),
  39149. (c.getChild = function (e) {
  39150. for (
  39151. var t = 'number' == typeof e ? 'id' : 'name', i = 0, n = this.children.length;
  39152. i < n;
  39153. ++i
  39154. )
  39155. if (this.children[i][t] === e) return this.children[i]
  39156. return null
  39157. }),
  39158. (c.resolve = function (e, t) {
  39159. var i = 'string' == typeof e ? e.split('.') : e,
  39160. n = this,
  39161. r = 0
  39162. if ('' === i[r]) {
  39163. for (; null !== n.parent; ) n = n.parent
  39164. r++
  39165. }
  39166. var a
  39167. do {
  39168. do {
  39169. if (!(n instanceof o.Namespace)) {
  39170. n = null
  39171. break
  39172. }
  39173. if (
  39174. ((a = n.getChild(i[r])),
  39175. !a || !(a instanceof o.T) || (t && !(a instanceof o.Namespace)))
  39176. ) {
  39177. n = null
  39178. break
  39179. }
  39180. ;(n = a), r++
  39181. } while (r < i.length)
  39182. if (null != n) break
  39183. if (null !== this.parent) return this.parent.resolve(e, t)
  39184. } while (null != n)
  39185. return n
  39186. }),
  39187. (c.qn = function (e) {
  39188. var t = [],
  39189. i = e
  39190. do t.unshift(i.name), (i = i.parent)
  39191. while (null !== i)
  39192. for (var n = 1; n <= t.length; n++) {
  39193. var r = t.slice(t.length - n)
  39194. if (e === this.resolve(r, e instanceof o.Namespace)) return r.join('.')
  39195. }
  39196. return e.fqn()
  39197. }),
  39198. (c.build = function () {
  39199. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  39200. (e = i[n]), e instanceof l && (t[e.name] = e.build())
  39201. return (
  39202. Object.defineProperty &&
  39203. Object.defineProperty(t, '$options', {
  39204. value: this.buildOpt()
  39205. }),
  39206. t
  39207. )
  39208. }),
  39209. (c.buildOpt = function () {
  39210. for (
  39211. var e = {}, t = Object.keys(this.options), i = 0, n = t.length;
  39212. i < n;
  39213. ++i
  39214. ) {
  39215. var r = t[i],
  39216. o = this.options[t[i]]
  39217. e[r] = o
  39218. }
  39219. return e
  39220. }),
  39221. (c.getOption = function (e) {
  39222. return 'undefined' == typeof e
  39223. ? this.options
  39224. : 'undefined' != typeof this.options[e]
  39225. ? this.options[e]
  39226. : null
  39227. }),
  39228. (o.Namespace = l)
  39229. var h = function (t, i, n, r) {
  39230. if (
  39231. ((this.type = t),
  39232. (this.resolvedType = i),
  39233. (this.isMapKey = n),
  39234. (this.syntax = r),
  39235. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  39236. )
  39237. throw Error('Invalid map key type: ' + t.name)
  39238. },
  39239. u = h.prototype
  39240. ;(h.defaultFieldValue = i),
  39241. (u.verifyValue = function (i) {
  39242. function r(e, t) {
  39243. throw Error(
  39244. 'Illegal value for ' +
  39245. o.toString(!0) +
  39246. ' of type ' +
  39247. o.type.name +
  39248. ': ' +
  39249. e +
  39250. ' (' +
  39251. t +
  39252. ')'
  39253. )
  39254. }
  39255. var o = this
  39256. switch (this.type) {
  39257. case e.TYPES.int32:
  39258. case e.TYPES.sint32:
  39259. case e.TYPES.sfixed32:
  39260. return (
  39261. ('number' != typeof i || (i === i && i % 1 !== 0)) &&
  39262. r(typeof i, 'not an integer'),
  39263. i > 4294967295 ? 0 | i : i
  39264. )
  39265. case e.TYPES.uint32:
  39266. case e.TYPES.fixed32:
  39267. return (
  39268. ('number' != typeof i || (i === i && i % 1 !== 0)) &&
  39269. r(typeof i, 'not an integer'),
  39270. i < 0 ? i >>> 0 : i
  39271. )
  39272. case e.TYPES.int64:
  39273. case e.TYPES.sint64:
  39274. case e.TYPES.sfixed64:
  39275. if (e.Long)
  39276. try {
  39277. return n(i, !1)
  39278. } catch (e) {
  39279. r(typeof i, e.message)
  39280. }
  39281. else r(typeof i, 'requires Long.js')
  39282. case e.TYPES.uint64:
  39283. case e.TYPES.fixed64:
  39284. if (e.Long)
  39285. try {
  39286. return n(i, !0)
  39287. } catch (e) {
  39288. r(typeof i, e.message)
  39289. }
  39290. else r(typeof i, 'requires Long.js')
  39291. case e.TYPES.bool:
  39292. return 'boolean' != typeof i && r(typeof i, 'not a boolean'), i
  39293. case e.TYPES.float:
  39294. case e.TYPES.double:
  39295. return 'number' != typeof i && r(typeof i, 'not a number'), i
  39296. case e.TYPES.string:
  39297. return (
  39298. 'string' == typeof i ||
  39299. (i && i instanceof String) ||
  39300. r(typeof i, 'not a string'),
  39301. '' + i
  39302. )
  39303. case e.TYPES.bytes:
  39304. return t.isByteBuffer(i) ? i : t.wrap(i, 'base64')
  39305. case e.TYPES.enum:
  39306. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value)
  39307. for (l = 0; l < a.length; l++) {
  39308. if (a[l].name == i) return a[l].id
  39309. if (a[l].id == i) return a[l].id
  39310. }
  39311. if ('proto3' === this.syntax)
  39312. return (
  39313. ('number' != typeof i || (i === i && i % 1 !== 0)) &&
  39314. r(typeof i, 'not an integer'),
  39315. (i > 4294967295 || i < 0) && r(typeof i, 'not in range for uint32'),
  39316. i
  39317. )
  39318. r(i, 'not a valid enum value')
  39319. case e.TYPES.group:
  39320. case e.TYPES.message:
  39321. if (
  39322. ((i && 'object' == typeof i) || r(typeof i, 'object expected'),
  39323. i instanceof this.resolvedType.clazz)
  39324. )
  39325. return i
  39326. if (i instanceof e.Builder.Message) {
  39327. var s = {}
  39328. for (var l in i) i.hasOwnProperty(l) && (s[l] = i[l])
  39329. i = s
  39330. }
  39331. return new this.resolvedType.clazz(i)
  39332. }
  39333. throw Error(
  39334. '[INTERNAL] Illegal value for ' +
  39335. this.toString(!0) +
  39336. ': ' +
  39337. i +
  39338. ' (undefined type ' +
  39339. this.type +
  39340. ')'
  39341. )
  39342. }),
  39343. (u.calculateLength = function (i, n) {
  39344. if (null === n) return 0
  39345. var r
  39346. switch (this.type) {
  39347. case e.TYPES.int32:
  39348. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n)
  39349. case e.TYPES.uint32:
  39350. return t.calculateVarint32(n)
  39351. case e.TYPES.sint32:
  39352. return t.calculateVarint32(t.zigZagEncode32(n))
  39353. case e.TYPES.fixed32:
  39354. case e.TYPES.sfixed32:
  39355. case e.TYPES.float:
  39356. return 4
  39357. case e.TYPES.int64:
  39358. case e.TYPES.uint64:
  39359. return t.calculateVarint64(n)
  39360. case e.TYPES.sint64:
  39361. return t.calculateVarint64(t.zigZagEncode64(n))
  39362. case e.TYPES.fixed64:
  39363. case e.TYPES.sfixed64:
  39364. return 8
  39365. case e.TYPES.bool:
  39366. return 1
  39367. case e.TYPES.enum:
  39368. return t.calculateVarint32(n)
  39369. case e.TYPES.double:
  39370. return 8
  39371. case e.TYPES.string:
  39372. return (r = t.calculateUTF8Bytes(n)), t.calculateVarint32(r) + r
  39373. case e.TYPES.bytes:
  39374. if (n.remaining() < 0)
  39375. throw Error(
  39376. 'Illegal value for ' +
  39377. this.toString(!0) +
  39378. ': ' +
  39379. n.remaining() +
  39380. ' bytes remaining'
  39381. )
  39382. return t.calculateVarint32(n.remaining()) + n.remaining()
  39383. case e.TYPES.message:
  39384. return (r = this.resolvedType.calculate(n)), t.calculateVarint32(r) + r
  39385. case e.TYPES.group:
  39386. return (
  39387. (r = this.resolvedType.calculate(n)),
  39388. r + t.calculateVarint32((i << 3) | e.WIRE_TYPES.ENDGROUP)
  39389. )
  39390. }
  39391. throw Error(
  39392. '[INTERNAL] Illegal value to encode in ' +
  39393. this.toString(!0) +
  39394. ': ' +
  39395. n +
  39396. ' (unknown type)'
  39397. )
  39398. }),
  39399. (u.encodeValue = function (i, n, r) {
  39400. if (null === n) return r
  39401. switch (this.type) {
  39402. case e.TYPES.int32:
  39403. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n)
  39404. break
  39405. case e.TYPES.uint32:
  39406. r.writeVarint32(n)
  39407. break
  39408. case e.TYPES.sint32:
  39409. r.writeVarint32ZigZag(n)
  39410. break
  39411. case e.TYPES.fixed32:
  39412. r.writeUint32(n)
  39413. break
  39414. case e.TYPES.sfixed32:
  39415. r.writeInt32(n)
  39416. break
  39417. case e.TYPES.int64:
  39418. case e.TYPES.uint64:
  39419. r.writeVarint64(n)
  39420. break
  39421. case e.TYPES.sint64:
  39422. r.writeVarint64ZigZag(n)
  39423. break
  39424. case e.TYPES.fixed64:
  39425. r.writeUint64(n)
  39426. break
  39427. case e.TYPES.sfixed64:
  39428. r.writeInt64(n)
  39429. break
  39430. case e.TYPES.bool:
  39431. 'string' == typeof n
  39432. ? r.writeVarint32('false' === n.toLowerCase() ? 0 : !!n)
  39433. : r.writeVarint32(n ? 1 : 0)
  39434. break
  39435. case e.TYPES.enum:
  39436. r.writeVarint32(n)
  39437. break
  39438. case e.TYPES.float:
  39439. r.writeFloat32(n)
  39440. break
  39441. case e.TYPES.double:
  39442. r.writeFloat64(n)
  39443. break
  39444. case e.TYPES.string:
  39445. r.writeVString(n)
  39446. break
  39447. case e.TYPES.bytes:
  39448. if (n.remaining() < 0)
  39449. throw Error(
  39450. 'Illegal value for ' +
  39451. this.toString(!0) +
  39452. ': ' +
  39453. n.remaining() +
  39454. ' bytes remaining'
  39455. )
  39456. var o = n.offset
  39457. r.writeVarint32(n.remaining()), r.append(n), (n.offset = o)
  39458. break
  39459. case e.TYPES.message:
  39460. var a = new t().LE()
  39461. this.resolvedType.encode(n, a),
  39462. r.writeVarint32(a.offset),
  39463. r.append(a.flip())
  39464. break
  39465. case e.TYPES.group:
  39466. this.resolvedType.encode(n, r),
  39467. r.writeVarint32((i << 3) | e.WIRE_TYPES.ENDGROUP)
  39468. break
  39469. default:
  39470. throw Error(
  39471. '[INTERNAL] Illegal value to encode in ' +
  39472. this.toString(!0) +
  39473. ': ' +
  39474. n +
  39475. ' (unknown type)'
  39476. )
  39477. }
  39478. return r
  39479. }),
  39480. (u.decode = function (t, i, n) {
  39481. if (i != this.type.wireType) throw Error('Unexpected wire type for element')
  39482. var r, o
  39483. switch (this.type) {
  39484. case e.TYPES.int32:
  39485. return 0 | t.readVarint32()
  39486. case e.TYPES.uint32:
  39487. return t.readVarint32() >>> 0
  39488. case e.TYPES.sint32:
  39489. return 0 | t.readVarint32ZigZag()
  39490. case e.TYPES.fixed32:
  39491. return t.readUint32() >>> 0
  39492. case e.TYPES.sfixed32:
  39493. return 0 | t.readInt32()
  39494. case e.TYPES.int64:
  39495. return t.readVarint64()
  39496. case e.TYPES.uint64:
  39497. return t.readVarint64().toUnsigned()
  39498. case e.TYPES.sint64:
  39499. return t.readVarint64ZigZag()
  39500. case e.TYPES.fixed64:
  39501. return t.readUint64()
  39502. case e.TYPES.sfixed64:
  39503. return t.readInt64()
  39504. case e.TYPES.bool:
  39505. return !!t.readVarint32()
  39506. case e.TYPES.enum:
  39507. return t.readVarint32()
  39508. case e.TYPES.float:
  39509. return t.readFloat()
  39510. case e.TYPES.double:
  39511. return t.readDouble()
  39512. case e.TYPES.string:
  39513. return t.readVString()
  39514. case e.TYPES.bytes:
  39515. if (((o = t.readVarint32()), t.remaining() < o))
  39516. throw Error(
  39517. 'Illegal number of bytes for ' +
  39518. this.toString(!0) +
  39519. ': ' +
  39520. o +
  39521. ' required but got only ' +
  39522. t.remaining()
  39523. )
  39524. return (r = t.clone()), (r.limit = r.offset + o), (t.offset += o), r
  39525. case e.TYPES.message:
  39526. return (o = t.readVarint32()), this.resolvedType.decode(t, o)
  39527. case e.TYPES.group:
  39528. return this.resolvedType.decode(t, -1, n)
  39529. }
  39530. throw Error('[INTERNAL] Illegal decode type')
  39531. }),
  39532. (u.valueFromString = function (i) {
  39533. if (!this.isMapKey)
  39534. throw Error('valueFromString() called on non-map-key element')
  39535. switch (this.type) {
  39536. case e.TYPES.int32:
  39537. case e.TYPES.sint32:
  39538. case e.TYPES.sfixed32:
  39539. case e.TYPES.uint32:
  39540. case e.TYPES.fixed32:
  39541. return this.verifyValue(parseInt(i))
  39542. case e.TYPES.int64:
  39543. case e.TYPES.sint64:
  39544. case e.TYPES.sfixed64:
  39545. case e.TYPES.uint64:
  39546. case e.TYPES.fixed64:
  39547. return this.verifyValue(i)
  39548. case e.TYPES.bool:
  39549. return 'true' === i
  39550. case e.TYPES.string:
  39551. return this.verifyValue(i)
  39552. case e.TYPES.bytes:
  39553. return t.fromBinary(i)
  39554. }
  39555. }),
  39556. (u.valueToString = function (t) {
  39557. if (!this.isMapKey) throw Error('valueToString() called on non-map-key element')
  39558. return this.type === e.TYPES.bytes ? t.toString('binary') : t.toString()
  39559. }),
  39560. (o.Element = h)
  39561. var d = function (e, t, i, n, r, o) {
  39562. l.call(this, e, t, i, n, o),
  39563. (this.className = 'Message'),
  39564. (this.extensions = void 0),
  39565. (this.clazz = null),
  39566. (this.isGroup = !!r),
  39567. (this._fields = null),
  39568. (this._fieldsById = null),
  39569. (this._fieldsByName = null)
  39570. },
  39571. p = (d.prototype = Object.create(l.prototype))
  39572. ;(p.build = function (i) {
  39573. if (this.clazz && !i) return this.clazz
  39574. var n = (function (e, i) {
  39575. function n(i, r, o, a) {
  39576. if (null === i || 'object' != typeof i) {
  39577. if (a && a instanceof e.Reflect.Enum) {
  39578. var s = e.Reflect.Enum.getName(a.object, i)
  39579. if (null !== s) return s
  39580. }
  39581. return i
  39582. }
  39583. if (t.isByteBuffer(i)) return r ? i.toBase64() : i.toBuffer()
  39584. if (e.Long.isLong(i)) return o ? i.toString() : e.Long.fromValue(i)
  39585. var l
  39586. if (Array.isArray(i))
  39587. return (
  39588. (l = []),
  39589. i.forEach(function (e, t) {
  39590. l[t] = n(e, r, o, a)
  39591. }),
  39592. l
  39593. )
  39594. if (((l = {}), i instanceof e.Map)) {
  39595. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  39596. l[i.keyElem.valueToString(h.value[0])] = n(
  39597. h.value[1],
  39598. r,
  39599. o,
  39600. i.valueElem.resolvedType
  39601. )
  39602. return l
  39603. }
  39604. var u = i.$type,
  39605. d = void 0
  39606. for (var p in i)
  39607. i.hasOwnProperty(p) &&
  39608. (u && (d = u.getChild(p))
  39609. ? (l[p] = n(i[p], r, o, d.resolvedType))
  39610. : (l[p] = n(i[p], r, o)))
  39611. return l
  39612. }
  39613. var r = i.getChildren(e.Reflect.Message.Field),
  39614. o = i.getChildren(e.Reflect.Message.OneOf),
  39615. a = function (n, s) {
  39616. e.Builder.Message.call(this)
  39617. for (var l = 0, c = o.length; l < c; ++l) this[o[l].name] = null
  39618. for (l = 0, c = r.length; l < c; ++l) {
  39619. var h = r[l]
  39620. ;(this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null),
  39621. (!h.required && 'proto3' !== i.syntax) ||
  39622. null === h.defaultValue ||
  39623. (this[h.name] = h.defaultValue)
  39624. }
  39625. if (arguments.length > 0) {
  39626. var u
  39627. if (
  39628. 1 !== arguments.length ||
  39629. null === n ||
  39630. 'object' != typeof n ||
  39631. !('function' != typeof n.encode || n instanceof a) ||
  39632. Array.isArray(n) ||
  39633. n instanceof e.Map ||
  39634. t.isByteBuffer(n) ||
  39635. n instanceof ArrayBuffer ||
  39636. (e.Long && n instanceof e.Long)
  39637. )
  39638. for (l = 0, c = arguments.length; l < c; ++l)
  39639. 'undefined' != typeof (u = arguments[l]) && this.$set(r[l].name, u)
  39640. else this.$set(n)
  39641. }
  39642. },
  39643. s = (a.prototype = Object.create(e.Builder.Message.prototype))
  39644. ;(s.add = function (t, n, r) {
  39645. var o = i._fieldsByName[t]
  39646. if (!r) {
  39647. if (!o) throw Error(this + '#' + t + ' is undefined')
  39648. if (!(o instanceof e.Reflect.Message.Field))
  39649. throw Error(this + '#' + t + ' is not a field: ' + o.toString(!0))
  39650. if (!o.repeated) throw Error(this + '#' + t + ' is not a repeated field')
  39651. n = o.verifyValue(n, !0)
  39652. }
  39653. return null === this[t] && (this[t] = []), this[t].push(n), this
  39654. }),
  39655. (s.$add = s.add),
  39656. (s.set = function (t, n, r) {
  39657. if (t && 'object' == typeof t) {
  39658. r = n
  39659. for (var o in t)
  39660. t.hasOwnProperty(o) &&
  39661. 'undefined' != typeof (n = t[o]) &&
  39662. this.$set(o, n, r)
  39663. return this
  39664. }
  39665. var a = i._fieldsByName[t]
  39666. if (r) this[t] = n
  39667. else {
  39668. if (!a) throw Error(this + '#' + t + ' is not a field: undefined')
  39669. if (!(a instanceof e.Reflect.Message.Field))
  39670. throw Error(this + '#' + t + ' is not a field: ' + a.toString(!0))
  39671. this[a.name] = n = a.verifyValue(n)
  39672. }
  39673. if (a && a.oneof) {
  39674. var s = this[a.oneof.name]
  39675. null !== n
  39676. ? (null !== s && s !== a.name && (this[s] = null),
  39677. (this[a.oneof.name] = a.name))
  39678. : s === t && (this[a.oneof.name] = null)
  39679. }
  39680. return this
  39681. }),
  39682. (s.$set = s.set),
  39683. (s.get = function (t, n) {
  39684. if (n) return this[t]
  39685. var r = i._fieldsByName[t]
  39686. if (!(r && r instanceof e.Reflect.Message.Field))
  39687. throw Error(this + '#' + t + ' is not a field: undefined')
  39688. if (!(r instanceof e.Reflect.Message.Field))
  39689. throw Error(this + '#' + t + ' is not a field: ' + r.toString(!0))
  39690. return this[r.name]
  39691. }),
  39692. (s.$get = s.get)
  39693. for (var l = 0; l < r.length; l++) {
  39694. var c = r[l]
  39695. c instanceof e.Reflect.Message.ExtensionField ||
  39696. (i.builder.options.populateAccessors &&
  39697. (function (e) {
  39698. var t = e.originalName.replace(/(_[a-zA-Z])/g, function (e) {
  39699. return e.toUpperCase().replace('_', '')
  39700. })
  39701. t = t.substring(0, 1).toUpperCase() + t.substring(1)
  39702. var n = e.originalName.replace(/([A-Z])/g, function (e) {
  39703. return '_' + e
  39704. }),
  39705. r = function (t, i) {
  39706. return (this[e.name] = i ? t : e.verifyValue(t)), this
  39707. },
  39708. o = function () {
  39709. return this[e.name]
  39710. }
  39711. null === i.getChild('set' + t) && (s['set' + t] = r),
  39712. null === i.getChild('set_' + n) && (s['set_' + n] = r),
  39713. null === i.getChild('get' + t) && (s['get' + t] = o),
  39714. null === i.getChild('get_' + n) && (s['get_' + n] = o)
  39715. })(c))
  39716. }
  39717. ;(s.encode = function (e, n) {
  39718. 'boolean' == typeof e && ((n = e), (e = void 0))
  39719. var r = !1
  39720. e || ((e = new t()), (r = !0))
  39721. var o = e.littleEndian
  39722. try {
  39723. return i.encode(this, e.LE(), n), (r ? e.flip() : e).LE(o)
  39724. } catch (t) {
  39725. throw (e.LE(o), t)
  39726. }
  39727. }),
  39728. (a.encode = function (e, t, i) {
  39729. return new a(e).encode(t, i)
  39730. }),
  39731. (s.calculate = function () {
  39732. return i.calculate(this)
  39733. }),
  39734. (s.encodeDelimited = function (e, n) {
  39735. var r = !1
  39736. e || ((e = new t()), (r = !0))
  39737. var o = new t().LE()
  39738. return (
  39739. i.encode(this, o, n).flip(),
  39740. e.writeVarint32(o.remaining()),
  39741. e.append(o),
  39742. r ? e.flip() : e
  39743. )
  39744. }),
  39745. (s.encodeAB = function () {
  39746. try {
  39747. return this.encode().toArrayBuffer()
  39748. } catch (e) {
  39749. throw (e.encoded && (e.encoded = e.encoded.toArrayBuffer()), e)
  39750. }
  39751. }),
  39752. (s.toArrayBuffer = s.encodeAB),
  39753. (s.encodeNB = function () {
  39754. try {
  39755. return this.encode().toBuffer()
  39756. } catch (e) {
  39757. throw (e.encoded && (e.encoded = e.encoded.toBuffer()), e)
  39758. }
  39759. }),
  39760. (s.toBuffer = s.encodeNB),
  39761. (s.encode64 = function () {
  39762. try {
  39763. return this.encode().toBase64()
  39764. } catch (e) {
  39765. throw (e.encoded && (e.encoded = e.encoded.toBase64()), e)
  39766. }
  39767. }),
  39768. (s.toBase64 = s.encode64),
  39769. (s.encodeHex = function () {
  39770. try {
  39771. return this.encode().toHex()
  39772. } catch (e) {
  39773. throw (e.encoded && (e.encoded = e.encoded.toHex()), e)
  39774. }
  39775. }),
  39776. (s.toHex = s.encodeHex),
  39777. (s.toRaw = function (e, t) {
  39778. return n(this, !!e, !!t, this.$type)
  39779. }),
  39780. (s.encodeJSON = function () {
  39781. return JSON.stringify(n(this, !0, !0, this.$type))
  39782. }),
  39783. (a.decode = function (e, n, r) {
  39784. 'string' == typeof n && ((r = n), (n = -1)),
  39785. 'string' == typeof e && (e = t.wrap(e, r ? r : 'base64')),
  39786. (e = t.isByteBuffer(e) ? e : t.wrap(e))
  39787. var o = e.littleEndian
  39788. try {
  39789. var a = i.decode(e.LE())
  39790. return e.LE(o), a
  39791. } catch (t) {
  39792. throw (e.LE(o), t)
  39793. }
  39794. }),
  39795. (a.decodeDelimited = function (e, n) {
  39796. if (
  39797. ('string' == typeof e && (e = t.wrap(e, n ? n : 'base64')),
  39798. (e = t.isByteBuffer(e) ? e : t.wrap(e)),
  39799. e.remaining() < 1)
  39800. )
  39801. return null
  39802. var r = e.offset,
  39803. o = e.readVarint32()
  39804. if (e.remaining() < o) return (e.offset = r), null
  39805. try {
  39806. var a = i.decode(e.slice(e.offset, e.offset + o).LE())
  39807. return (e.offset += o), a
  39808. } catch (t) {
  39809. throw ((e.offset += o), t)
  39810. }
  39811. }),
  39812. (a.decode64 = function (e) {
  39813. return a.decode(e, 'base64')
  39814. }),
  39815. (a.decodeHex = function (e) {
  39816. return a.decode(e, 'hex')
  39817. }),
  39818. (a.decodeJSON = function (e) {
  39819. return new a(JSON.parse(e))
  39820. }),
  39821. (s.toString = function () {
  39822. return i.toString()
  39823. })
  39824. return (
  39825. Object.defineProperty &&
  39826. (Object.defineProperty(a, '$options', {
  39827. value: i.buildOpt()
  39828. }),
  39829. Object.defineProperty(s, '$options', {
  39830. value: a.$options
  39831. }),
  39832. Object.defineProperty(a, '$type', {
  39833. value: i
  39834. }),
  39835. Object.defineProperty(s, '$type', {
  39836. value: i
  39837. })),
  39838. a
  39839. )
  39840. })(e, this)
  39841. ;(this._fields = []), (this._fieldsById = {}), (this._fieldsByName = {})
  39842. for (var r, o = 0, a = this.children.length; o < a; o++)
  39843. if (
  39844. ((r = this.children[o]), r instanceof A || r instanceof d || r instanceof E)
  39845. ) {
  39846. if (n.hasOwnProperty(r.name))
  39847. throw Error(
  39848. 'Illegal reflect child of ' +
  39849. this.toString(!0) +
  39850. ': ' +
  39851. r.toString(!0) +
  39852. " cannot override static property '" +
  39853. r.name +
  39854. "'"
  39855. )
  39856. n[r.name] = r.build()
  39857. } else if (r instanceof d.Field)
  39858. r.build(),
  39859. this._fields.push(r),
  39860. (this._fieldsById[r.id] = r),
  39861. (this._fieldsByName[r.name] = r)
  39862. else if (!(r instanceof d.OneOf || r instanceof I))
  39863. throw Error(
  39864. 'Illegal reflect child of ' +
  39865. this.toString(!0) +
  39866. ': ' +
  39867. this.children[o].toString(!0)
  39868. )
  39869. return (this.clazz = n)
  39870. }),
  39871. (p.encode = function (e, t, i) {
  39872. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  39873. (n = this._fields[a]),
  39874. (r = e[n.name]),
  39875. n.required && null === r
  39876. ? null === o && (o = n)
  39877. : n.encode(i ? r : n.verifyValue(r), t, e)
  39878. if (null !== o) {
  39879. var l = Error(
  39880. 'Missing at least one required field for ' + this.toString(!0) + ': ' + o
  39881. )
  39882. throw ((l.encoded = t), l)
  39883. }
  39884. return t
  39885. }),
  39886. (p.calculate = function (e) {
  39887. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  39888. if (((t = this._fields[r]), (i = e[t.name]), t.required && null === i))
  39889. throw Error(
  39890. 'Missing at least one required field for ' + this.toString(!0) + ': ' + t
  39891. )
  39892. n += t.calculate(i, e)
  39893. }
  39894. return n
  39895. }),
  39896. (p.decode = function (t, i, n) {
  39897. i = 'number' == typeof i ? i : -1
  39898. for (
  39899. var o, a, s, l, c = t.offset, h = new this.clazz();
  39900. t.offset < c + i || (i === -1 && t.remaining() > 0);
  39901. ) {
  39902. if (
  39903. ((o = t.readVarint32()),
  39904. (a = 7 & o),
  39905. (s = o >>> 3),
  39906. a === e.WIRE_TYPES.ENDGROUP)
  39907. ) {
  39908. if (s !== n)
  39909. throw Error(
  39910. 'Illegal group end indicator for ' +
  39911. this.toString(!0) +
  39912. ': ' +
  39913. s +
  39914. ' (' +
  39915. (n ? n + ' expected' : 'not a group') +
  39916. ')'
  39917. )
  39918. break
  39919. }
  39920. if ((l = this._fieldsById[s])) {
  39921. if (l.repeated && !l.options.packed) h[l.name].push(l.decode(a, t))
  39922. else if (l.map) {
  39923. var u = l.decode(a, t)
  39924. h[l.name].set(u[0], u[1])
  39925. } else if (((h[l.name] = l.decode(a, t)), l.oneof)) {
  39926. var d = h[l.oneof.name]
  39927. null !== d && d !== l.name && (h[d] = null), (h[l.oneof.name] = l.name)
  39928. }
  39929. } else
  39930. switch (a) {
  39931. case e.WIRE_TYPES.VARINT:
  39932. t.readVarint32()
  39933. break
  39934. case e.WIRE_TYPES.BITS32:
  39935. t.offset += 4
  39936. break
  39937. case e.WIRE_TYPES.BITS64:
  39938. t.offset += 8
  39939. break
  39940. case e.WIRE_TYPES.LDELIM:
  39941. var p = t.readVarint32()
  39942. t.offset += p
  39943. break
  39944. case e.WIRE_TYPES.STARTGROUP:
  39945. for (; r(s, t); );
  39946. break
  39947. default:
  39948. throw Error(
  39949. 'Illegal wire type for unknown field ' +
  39950. s +
  39951. ' in ' +
  39952. this.toString(!0) +
  39953. '#decode: ' +
  39954. a
  39955. )
  39956. }
  39957. }
  39958. for (var f = 0, g = this._fields.length; f < g; ++f)
  39959. if (((l = this._fields[f]), null === h[l.name]))
  39960. if ('proto3' === this.syntax) h[l.name] = l.defaultValue
  39961. else {
  39962. if (l.required) {
  39963. var m = Error(
  39964. 'Missing at least one required field for ' +
  39965. this.toString(!0) +
  39966. ': ' +
  39967. l.name
  39968. )
  39969. throw ((m.decoded = h), m)
  39970. }
  39971. e.populateDefaults &&
  39972. null !== l.defaultValue &&
  39973. (h[l.name] = l.defaultValue)
  39974. }
  39975. return h
  39976. }),
  39977. (o.Message = d)
  39978. var f = function (t, i, n, r, o, s, l, c, h, u) {
  39979. a.call(this, t, i, s),
  39980. (this.className = 'Message.Field'),
  39981. (this.required = 'required' === n),
  39982. (this.repeated = 'repeated' === n),
  39983. (this.map = 'map' === n),
  39984. (this.keyType = r || null),
  39985. (this.type = o),
  39986. (this.resolvedType = null),
  39987. (this.id = l),
  39988. (this.options = c || {}),
  39989. (this.defaultValue = null),
  39990. (this.oneof = h || null),
  39991. (this.syntax = u || 'proto2'),
  39992. (this.originalName = this.name),
  39993. (this.element = null),
  39994. (this.keyElement = null),
  39995. !this.builder.options.convertFieldsToCamelCase ||
  39996. this instanceof d.ExtensionField ||
  39997. (this.name = e.Util.toCamelCase(this.name))
  39998. },
  39999. g = (f.prototype = Object.create(a.prototype))
  40000. ;(g.build = function () {
  40001. ;(this.element = new h(this.type, this.resolvedType, !1, this.syntax)),
  40002. this.map && (this.keyElement = new h(this.keyType, void 0, !0, this.syntax)),
  40003. 'proto3' !== this.syntax || this.repeated || this.map
  40004. ? 'undefined' != typeof this.options.default &&
  40005. (this.defaultValue = this.verifyValue(this.options.default))
  40006. : (this.defaultValue = h.defaultFieldValue(this.type))
  40007. }),
  40008. (g.verifyValue = function (t, i) {
  40009. function n(e, t) {
  40010. throw Error(
  40011. 'Illegal value for ' +
  40012. r.toString(!0) +
  40013. ' of type ' +
  40014. r.type.name +
  40015. ': ' +
  40016. e +
  40017. ' (' +
  40018. t +
  40019. ')'
  40020. )
  40021. }
  40022. i = i || !1
  40023. var r = this
  40024. if (null === t)
  40025. return (
  40026. this.required && n(typeof t, 'required'),
  40027. 'proto3' === this.syntax &&
  40028. this.type !== e.TYPES.message &&
  40029. n(typeof t, 'proto3 field without field presence cannot be null'),
  40030. null
  40031. )
  40032. var o
  40033. if (this.repeated && !i) {
  40034. Array.isArray(t) || (t = [t])
  40035. var a = []
  40036. for (o = 0; o < t.length; o++) a.push(this.element.verifyValue(t[o]))
  40037. return a
  40038. }
  40039. return this.map && !i
  40040. ? t instanceof e.Map
  40041. ? t
  40042. : (t instanceof Object ||
  40043. n(typeof t, 'expected ProtoBuf.Map or raw object for map field'),
  40044. new e.Map(this, t))
  40045. : (!this.repeated && Array.isArray(t) && n(typeof t, 'no array expected'),
  40046. this.element.verifyValue(t))
  40047. }),
  40048. (g.hasWirePresence = function (t, i) {
  40049. if ('proto3' !== this.syntax) return null !== t
  40050. if (this.oneof && i[this.oneof.name] === this.name) return !0
  40051. switch (this.type) {
  40052. case e.TYPES.int32:
  40053. case e.TYPES.sint32:
  40054. case e.TYPES.sfixed32:
  40055. case e.TYPES.uint32:
  40056. case e.TYPES.fixed32:
  40057. return 0 !== t
  40058. case e.TYPES.int64:
  40059. case e.TYPES.sint64:
  40060. case e.TYPES.sfixed64:
  40061. case e.TYPES.uint64:
  40062. case e.TYPES.fixed64:
  40063. return 0 !== t.low || 0 !== t.high
  40064. case e.TYPES.bool:
  40065. return t
  40066. case e.TYPES.float:
  40067. case e.TYPES.double:
  40068. return 0 !== t
  40069. case e.TYPES.string:
  40070. return t.length > 0
  40071. case e.TYPES.bytes:
  40072. return t.remaining() > 0
  40073. case e.TYPES.enum:
  40074. return 0 !== t
  40075. case e.TYPES.message:
  40076. return null !== t
  40077. default:
  40078. return !0
  40079. }
  40080. }),
  40081. (g.encode = function (i, n, r) {
  40082. if (null === this.type || 'object' != typeof this.type)
  40083. throw Error(
  40084. '[INTERNAL] Unresolved type in ' + this.toString(!0) + ': ' + this.type
  40085. )
  40086. if (null === i || (this.repeated && 0 == i.length)) return n
  40087. try {
  40088. if (this.repeated) {
  40089. var o
  40090. if (
  40091. this.options.packed &&
  40092. e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0
  40093. ) {
  40094. n.writeVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM),
  40095. n.ensureCapacity((n.offset += 1))
  40096. var a = n.offset
  40097. for (o = 0; o < i.length; o++) this.element.encodeValue(this.id, i[o], n)
  40098. var s = n.offset - a,
  40099. l = t.calculateVarint32(s)
  40100. if (l > 1) {
  40101. var c = n.slice(a, n.offset)
  40102. ;(a += l - 1), (n.offset = a), n.append(c)
  40103. }
  40104. n.writeVarint32(s, a - l)
  40105. } else
  40106. for (o = 0; o < i.length; o++)
  40107. n.writeVarint32((this.id << 3) | this.type.wireType),
  40108. this.element.encodeValue(this.id, i[o], n)
  40109. } else
  40110. this.map
  40111. ? i.forEach(function (i, r, o) {
  40112. var a =
  40113. t.calculateVarint32(8 | this.keyType.wireType) +
  40114. this.keyElement.calculateLength(1, r) +
  40115. t.calculateVarint32(16 | this.type.wireType) +
  40116. this.element.calculateLength(2, i)
  40117. n.writeVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM),
  40118. n.writeVarint32(a),
  40119. n.writeVarint32(8 | this.keyType.wireType),
  40120. this.keyElement.encodeValue(1, r, n),
  40121. n.writeVarint32(16 | this.type.wireType),
  40122. this.element.encodeValue(2, i, n)
  40123. }, this)
  40124. : this.hasWirePresence(i, r) &&
  40125. (n.writeVarint32((this.id << 3) | this.type.wireType),
  40126. this.element.encodeValue(this.id, i, n))
  40127. } catch (e) {
  40128. throw Error(
  40129. 'Illegal value for ' + this.toString(!0) + ': ' + i + ' (' + e + ')'
  40130. )
  40131. }
  40132. return n
  40133. }),
  40134. (g.calculate = function (i, n) {
  40135. if (
  40136. ((i = this.verifyValue(i)),
  40137. null === this.type || 'object' != typeof this.type)
  40138. )
  40139. throw Error(
  40140. '[INTERNAL] Unresolved type in ' + this.toString(!0) + ': ' + this.type
  40141. )
  40142. if (null === i || (this.repeated && 0 == i.length)) return 0
  40143. var r = 0
  40144. try {
  40145. if (this.repeated) {
  40146. var o, a
  40147. if (
  40148. this.options.packed &&
  40149. e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0
  40150. ) {
  40151. for (
  40152. r += t.calculateVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM),
  40153. a = 0,
  40154. o = 0;
  40155. o < i.length;
  40156. o++
  40157. )
  40158. a += this.element.calculateLength(this.id, i[o])
  40159. ;(r += t.calculateVarint32(a)), (r += a)
  40160. } else
  40161. for (o = 0; o < i.length; o++)
  40162. (r += t.calculateVarint32((this.id << 3) | this.type.wireType)),
  40163. (r += this.element.calculateLength(this.id, i[o]))
  40164. } else
  40165. this.map
  40166. ? i.forEach(function (i, n, o) {
  40167. var a =
  40168. t.calculateVarint32(8 | this.keyType.wireType) +
  40169. this.keyElement.calculateLength(1, n) +
  40170. t.calculateVarint32(16 | this.type.wireType) +
  40171. this.element.calculateLength(2, i)
  40172. ;(r += t.calculateVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM)),
  40173. (r += t.calculateVarint32(a)),
  40174. (r += a)
  40175. }, this)
  40176. : this.hasWirePresence(i, n) &&
  40177. ((r += t.calculateVarint32((this.id << 3) | this.type.wireType)),
  40178. (r += this.element.calculateLength(this.id, i)))
  40179. } catch (e) {
  40180. throw Error(
  40181. 'Illegal value for ' + this.toString(!0) + ': ' + i + ' (' + e + ')'
  40182. )
  40183. }
  40184. return r
  40185. }),
  40186. (g.decode = function (t, i, n) {
  40187. var r,
  40188. o,
  40189. a =
  40190. (!this.map && t == this.type.wireType) ||
  40191. (!n && this.repeated && this.options.packed && t == e.WIRE_TYPES.LDELIM) ||
  40192. (this.map && t == e.WIRE_TYPES.LDELIM)
  40193. if (!a)
  40194. throw Error(
  40195. 'Illegal wire type for field ' +
  40196. this.toString(!0) +
  40197. ': ' +
  40198. t +
  40199. ' (' +
  40200. this.type.wireType +
  40201. ' expected)'
  40202. )
  40203. if (
  40204. t == e.WIRE_TYPES.LDELIM &&
  40205. this.repeated &&
  40206. this.options.packed &&
  40207. e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 &&
  40208. !n
  40209. ) {
  40210. ;(o = i.readVarint32()), (o = i.offset + o)
  40211. for (var s = []; i.offset < o; )
  40212. s.push(this.decode(this.type.wireType, i, !0))
  40213. return s
  40214. }
  40215. if (this.map) {
  40216. var l = h.defaultFieldValue(this.keyType)
  40217. if (
  40218. ((r = h.defaultFieldValue(this.type)),
  40219. (o = i.readVarint32()),
  40220. i.remaining() < o)
  40221. )
  40222. throw Error(
  40223. 'Illegal number of bytes for ' +
  40224. this.toString(!0) +
  40225. ': ' +
  40226. o +
  40227. ' required but got only ' +
  40228. i.remaining()
  40229. )
  40230. var c = i.clone()
  40231. for (c.limit = c.offset + o, i.offset += o; c.remaining() > 0; ) {
  40232. var u = c.readVarint32()
  40233. t = 7 & u
  40234. var d = u >>> 3
  40235. if (1 === d) l = this.keyElement.decode(c, t, d)
  40236. else {
  40237. if (2 !== d)
  40238. throw Error('Unexpected tag in map field key/value submessage')
  40239. r = this.element.decode(c, t, d)
  40240. }
  40241. }
  40242. return [l, r]
  40243. }
  40244. return this.element.decode(i, t, this.id)
  40245. }),
  40246. (o.Message.Field = f)
  40247. var m = function (e, t, i, n, r, o, a) {
  40248. f.call(this, e, t, i, null, n, r, o, a), this.extension
  40249. }
  40250. ;(m.prototype = Object.create(f.prototype)), (o.Message.ExtensionField = m)
  40251. var v = function (e, t, i) {
  40252. a.call(this, e, t, i), (this.fields = [])
  40253. }
  40254. o.Message.OneOf = v
  40255. var A = function (e, t, i, n, r) {
  40256. l.call(this, e, t, i, n, r), (this.className = 'Enum'), (this.object = null)
  40257. }
  40258. A.getName = function (e, t) {
  40259. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  40260. if (e[(i = n[r])] === t) return i
  40261. return null
  40262. }
  40263. var y = (A.prototype = Object.create(l.prototype))
  40264. ;(y.build = function (t) {
  40265. if (this.object && !t) return this.object
  40266. for (
  40267. var i = new e.Builder.Enum(),
  40268. n = this.getChildren(A.Value),
  40269. r = 0,
  40270. o = n.length;
  40271. r < o;
  40272. ++r
  40273. )
  40274. i[n[r].name] = n[r].id
  40275. return (
  40276. Object.defineProperty &&
  40277. Object.defineProperty(i, '$options', {
  40278. value: this.buildOpt(),
  40279. enumerable: !1
  40280. }),
  40281. (this.object = i)
  40282. )
  40283. }),
  40284. (o.Enum = A)
  40285. var C = function (e, t, i, n) {
  40286. a.call(this, e, t, i), (this.className = 'Enum.Value'), (this.id = n)
  40287. }
  40288. ;(C.prototype = Object.create(a.prototype)), (o.Enum.Value = C)
  40289. var I = function (e, t, i, n) {
  40290. a.call(this, e, t, i), (this.field = n)
  40291. }
  40292. ;(I.prototype = Object.create(a.prototype)), (o.Extension = I)
  40293. var E = function (e, t, i, n) {
  40294. l.call(this, e, t, i, n), (this.className = 'Service'), (this.clazz = null)
  40295. },
  40296. b = (E.prototype = Object.create(l.prototype))
  40297. ;(b.build = function (i) {
  40298. return this.clazz && !i
  40299. ? this.clazz
  40300. : (this.clazz = (function (e, i) {
  40301. for (
  40302. var n = function (t) {
  40303. e.Builder.Service.call(this),
  40304. (this.rpcImpl =
  40305. t ||
  40306. function (e, t, i) {
  40307. setTimeout(
  40308. i.bind(
  40309. this,
  40310. Error(
  40311. 'Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services'
  40312. )
  40313. ),
  40314. 0
  40315. )
  40316. })
  40317. },
  40318. r = (n.prototype = Object.create(e.Builder.Service.prototype)),
  40319. o = i.getChildren(e.Reflect.Service.RPCMethod),
  40320. a = 0;
  40321. a < o.length;
  40322. a++
  40323. )
  40324. !(function (e) {
  40325. ;(r[e.name] = function (n, r) {
  40326. try {
  40327. try {
  40328. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  40329. } catch (e) {
  40330. if (!(e instanceof TypeError)) throw e
  40331. }
  40332. if (null === n || 'object' != typeof n)
  40333. throw Error('Illegal arguments')
  40334. n instanceof e.resolvedRequestType.clazz ||
  40335. (n = new e.resolvedRequestType.clazz(n)),
  40336. this.rpcImpl(e.fqn(), n, function (t, n) {
  40337. if (t) return void r(t)
  40338. null === n && (n = '')
  40339. try {
  40340. n = e.resolvedResponseType.clazz.decode(n)
  40341. } catch (e) {}
  40342. return n && n instanceof e.resolvedResponseType.clazz
  40343. ? void r(null, n)
  40344. : void r(
  40345. Error(
  40346. 'Illegal response type received in service method ' +
  40347. i.name +
  40348. '#' +
  40349. e.name
  40350. )
  40351. )
  40352. })
  40353. } catch (e) {
  40354. setTimeout(r.bind(this, e), 0)
  40355. }
  40356. }),
  40357. (n[e.name] = function (t, i, r) {
  40358. new n(t)[e.name](i, r)
  40359. }),
  40360. Object.defineProperty &&
  40361. (Object.defineProperty(n[e.name], '$options', {
  40362. value: e.buildOpt()
  40363. }),
  40364. Object.defineProperty(r[e.name], '$options', {
  40365. value: n[e.name].$options
  40366. }))
  40367. })(o[a])
  40368. return (
  40369. Object.defineProperty &&
  40370. (Object.defineProperty(n, '$options', {
  40371. value: i.buildOpt()
  40372. }),
  40373. Object.defineProperty(r, '$options', {
  40374. value: n.$options
  40375. }),
  40376. Object.defineProperty(n, '$type', {
  40377. value: i
  40378. }),
  40379. Object.defineProperty(r, '$type', {
  40380. value: i
  40381. })),
  40382. n
  40383. )
  40384. })(e, this))
  40385. }),
  40386. (o.Service = E)
  40387. var w = function (e, t, i, n) {
  40388. a.call(this, e, t, i),
  40389. (this.className = 'Service.Method'),
  40390. (this.options = n || {})
  40391. },
  40392. _ = (w.prototype = Object.create(a.prototype))
  40393. ;(_.buildOpt = c.buildOpt), (o.Service.Method = w)
  40394. var T = function (e, t, i, n, r, o, a, s) {
  40395. w.call(this, e, t, i, s),
  40396. (this.className = 'Service.RPCMethod'),
  40397. (this.requestName = n),
  40398. (this.responseName = r),
  40399. (this.requestStream = o),
  40400. (this.responseStream = a),
  40401. (this.resolvedRequestType = null),
  40402. (this.resolvedResponseType = null)
  40403. }
  40404. return (T.prototype = Object.create(w.prototype)), (o.Service.RPCMethod = T), o
  40405. })(r)),
  40406. (r.Builder = (function (t, i, n) {
  40407. function r(e) {
  40408. e.messages &&
  40409. e.messages.forEach(function (t) {
  40410. ;(t.syntax = e.syntax), r(t)
  40411. }),
  40412. e.enums &&
  40413. e.enums.forEach(function (t) {
  40414. t.syntax = e.syntax
  40415. })
  40416. }
  40417. var o = function (e) {
  40418. ;(this.ns = new n.Namespace(this, null, '')),
  40419. (this.ptr = this.ns),
  40420. (this.resolved = !1),
  40421. (this.result = null),
  40422. (this.files = {}),
  40423. (this.importRoot = null),
  40424. (this.options = e || {})
  40425. },
  40426. a = o.prototype
  40427. return (
  40428. (o.isMessage = function (e) {
  40429. return (
  40430. 'string' == typeof e.name &&
  40431. 'undefined' == typeof e.values &&
  40432. 'undefined' == typeof e.rpc
  40433. )
  40434. }),
  40435. (o.isMessageField = function (e) {
  40436. return (
  40437. 'string' == typeof e.rule &&
  40438. 'string' == typeof e.name &&
  40439. 'string' == typeof e.type &&
  40440. 'undefined' != typeof e.id
  40441. )
  40442. }),
  40443. (o.isEnum = function (e) {
  40444. return (
  40445. 'string' == typeof e.name &&
  40446. !(
  40447. 'undefined' == typeof e.values ||
  40448. !Array.isArray(e.values) ||
  40449. 0 === e.values.length
  40450. )
  40451. )
  40452. }),
  40453. (o.isService = function (e) {
  40454. return !('string' != typeof e.name || 'object' != typeof e.rpc || !e.rpc)
  40455. }),
  40456. (o.isExtend = function (e) {
  40457. return 'string' == typeof e.ref
  40458. }),
  40459. (a.reset = function () {
  40460. return (this.ptr = this.ns), this
  40461. }),
  40462. (a.define = function (e) {
  40463. if ('string' != typeof e || !i.TYPEREF.test(e))
  40464. throw Error('illegal namespace: ' + e)
  40465. return (
  40466. e.split('.').forEach(function (e) {
  40467. var t = this.ptr.getChild(e)
  40468. null === t && this.ptr.addChild((t = new n.Namespace(this, this.ptr, e))),
  40469. (this.ptr = t)
  40470. }, this),
  40471. this
  40472. )
  40473. }),
  40474. (a.create = function (e) {
  40475. if (!e) return this
  40476. if (Array.isArray(e)) {
  40477. if (0 === e.length) return this
  40478. e = e.slice()
  40479. } else e = [e]
  40480. for (var i = [e]; i.length > 0; ) {
  40481. if (((e = i.pop()), !Array.isArray(e)))
  40482. throw Error('not a valid namespace: ' + JSON.stringify(e))
  40483. for (; e.length > 0; ) {
  40484. var r = e.shift()
  40485. if (o.isMessage(r)) {
  40486. var a = new n.Message(
  40487. this,
  40488. this.ptr,
  40489. r.name,
  40490. r.options,
  40491. r.isGroup,
  40492. r.syntax
  40493. ),
  40494. s = {}
  40495. r.oneofs &&
  40496. Object.keys(r.oneofs).forEach(function (e) {
  40497. a.addChild((s[e] = new n.Message.OneOf(this, a, e)))
  40498. }, this),
  40499. r.fields &&
  40500. r.fields.forEach(function (e) {
  40501. if (null !== a.getChild(0 | e.id))
  40502. throw Error(
  40503. 'duplicate or invalid field id in ' + a.name + ': ' + e.id
  40504. )
  40505. if (e.options && 'object' != typeof e.options)
  40506. throw Error('illegal field options in ' + a.name + '#' + e.name)
  40507. var t = null
  40508. if ('string' == typeof e.oneof && !(t = s[e.oneof]))
  40509. throw Error(
  40510. 'illegal oneof in ' + a.name + '#' + e.name + ': ' + e.oneof
  40511. )
  40512. ;(e = new n.Message.Field(
  40513. this,
  40514. a,
  40515. e.rule,
  40516. e.keytype,
  40517. e.type,
  40518. e.name,
  40519. e.id,
  40520. e.options,
  40521. t,
  40522. r.syntax
  40523. )),
  40524. t && t.fields.push(e),
  40525. a.addChild(e)
  40526. }, this)
  40527. var l = []
  40528. if (
  40529. (r.enums &&
  40530. r.enums.forEach(function (e) {
  40531. l.push(e)
  40532. }),
  40533. r.messages &&
  40534. r.messages.forEach(function (e) {
  40535. l.push(e)
  40536. }),
  40537. r.services &&
  40538. r.services.forEach(function (e) {
  40539. l.push(e)
  40540. }),
  40541. r.extensions &&
  40542. ('number' == typeof r.extensions[0]
  40543. ? (a.extensions = [r.extensions])
  40544. : (a.extensions = r.extensions)),
  40545. this.ptr.addChild(a),
  40546. l.length > 0)
  40547. ) {
  40548. i.push(e), (e = l), (l = null), (this.ptr = a), (a = null)
  40549. continue
  40550. }
  40551. l = null
  40552. } else if (o.isEnum(r))
  40553. (a = new n.Enum(this, this.ptr, r.name, r.options, r.syntax)),
  40554. r.values.forEach(function (e) {
  40555. a.addChild(new n.Enum.Value(this, a, e.name, e.id))
  40556. }, this),
  40557. this.ptr.addChild(a)
  40558. else if (o.isService(r))
  40559. (a = new n.Service(this, this.ptr, r.name, r.options)),
  40560. Object.keys(r.rpc).forEach(function (e) {
  40561. var t = r.rpc[e]
  40562. a.addChild(
  40563. new n.Service.RPCMethod(
  40564. this,
  40565. a,
  40566. e,
  40567. t.request,
  40568. t.response,
  40569. !!t.request_stream,
  40570. !!t.response_stream,
  40571. t.options
  40572. )
  40573. )
  40574. }, this),
  40575. this.ptr.addChild(a)
  40576. else {
  40577. if (!o.isExtend(r))
  40578. throw Error('not a valid definition: ' + JSON.stringify(r))
  40579. if ((a = this.ptr.resolve(r.ref, !0)))
  40580. r.fields.forEach(function (e) {
  40581. if (null !== a.getChild(0 | e.id))
  40582. throw Error(
  40583. 'duplicate extended field id in ' + a.name + ': ' + e.id
  40584. )
  40585. if (a.extensions) {
  40586. var i = !1
  40587. if (
  40588. (a.extensions.forEach(function (t) {
  40589. e.id >= t[0] && e.id <= t[1] && (i = !0)
  40590. }),
  40591. !i)
  40592. )
  40593. throw Error(
  40594. 'illegal extended field id in ' +
  40595. a.name +
  40596. ': ' +
  40597. e.id +
  40598. ' (not within valid ranges)'
  40599. )
  40600. }
  40601. var r = e.name
  40602. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r))
  40603. var o = new n.Message.ExtensionField(
  40604. this,
  40605. a,
  40606. e.rule,
  40607. e.type,
  40608. this.ptr.fqn() + '.' + r,
  40609. e.id,
  40610. e.options
  40611. ),
  40612. s = new n.Extension(this, this.ptr, e.name, o)
  40613. ;(o.extension = s), this.ptr.addChild(s), a.addChild(o)
  40614. }, this)
  40615. else if (!/\.?google\.protobuf\./.test(r.ref))
  40616. throw Error('extended message ' + r.ref + ' is not defined')
  40617. }
  40618. ;(r = null), (a = null)
  40619. }
  40620. ;(e = null), (this.ptr = this.ptr.parent)
  40621. }
  40622. return (this.resolved = !1), (this.result = null), this
  40623. }),
  40624. (a.import = function (i, n) {
  40625. var o = '/'
  40626. if ('string' == typeof n) {
  40627. if ((t.Util.IS_NODE && (n = e('path').resolve(n)), this.files[n] === !0))
  40628. return this.reset()
  40629. this.files[n] = !0
  40630. } else if ('object' == typeof n) {
  40631. var a = n.root
  40632. t.Util.IS_NODE && (a = e('path').resolve(a)),
  40633. (a.indexOf('\\') >= 0 || n.file.indexOf('\\') >= 0) && (o = '\\')
  40634. var s = a + o + n.file
  40635. if (this.files[s] === !0) return this.reset()
  40636. this.files[s] = !0
  40637. }
  40638. if (i.imports && i.imports.length > 0) {
  40639. var l,
  40640. c = !1
  40641. 'object' == typeof n
  40642. ? ((this.importRoot = n.root),
  40643. (c = !0),
  40644. (l = this.importRoot),
  40645. (n = n.file),
  40646. (l.indexOf('\\') >= 0 || n.indexOf('\\') >= 0) && (o = '\\'))
  40647. : 'string' == typeof n
  40648. ? this.importRoot
  40649. ? (l = this.importRoot)
  40650. : n.indexOf('/') >= 0
  40651. ? ((l = n.replace(/\/[^\/]*$/, '')), '' === l && (l = '/'))
  40652. : n.indexOf('\\') >= 0
  40653. ? ((l = n.replace(/\\[^\\]*$/, '')), (o = '\\'))
  40654. : (l = '.')
  40655. : (l = null)
  40656. for (var h = 0; h < i.imports.length; h++)
  40657. if ('string' == typeof i.imports[h]) {
  40658. if (!l) throw Error('cannot determine import root')
  40659. var u = i.imports[h]
  40660. if ('google/protobuf/descriptor.proto' === u) continue
  40661. if (((u = l + o + u), this.files[u] === !0)) continue
  40662. ;/\.proto$/i.test(u) &&
  40663. !t.DotProto &&
  40664. (u = u.replace(/\.proto$/, '.json'))
  40665. var d = t.Util.fetch(u)
  40666. if (null === d)
  40667. throw Error(
  40668. "failed to import '" + u + "' in '" + n + "': file not found"
  40669. )
  40670. ;/\.json$/i.test(u)
  40671. ? this.import(JSON.parse(d + ''), u)
  40672. : this.import(t.DotProto.Parser.parse(d), u)
  40673. } else
  40674. n
  40675. ? /\.(\w+)$/.test(n)
  40676. ? this.import(
  40677. i.imports[h],
  40678. n.replace(/^(.+)\.(\w+)$/, function (e, t, i) {
  40679. return t + '_import' + h + '.' + i
  40680. })
  40681. )
  40682. : this.import(i.imports[h], n + '_import' + h)
  40683. : this.import(i.imports[h])
  40684. c && (this.importRoot = null)
  40685. }
  40686. i.package && this.define(i.package), i.syntax && r(i)
  40687. var p = this.ptr
  40688. return (
  40689. i.options &&
  40690. Object.keys(i.options).forEach(function (e) {
  40691. p.options[e] = i.options[e]
  40692. }),
  40693. i.messages && (this.create(i.messages), (this.ptr = p)),
  40694. i.enums && (this.create(i.enums), (this.ptr = p)),
  40695. i.services && (this.create(i.services), (this.ptr = p)),
  40696. i.extends && this.create(i.extends),
  40697. this.reset()
  40698. )
  40699. }),
  40700. (a.resolveAll = function () {
  40701. var e
  40702. if (null == this.ptr || 'object' == typeof this.ptr.type) return this
  40703. if (this.ptr instanceof n.Namespace)
  40704. this.ptr.children.forEach(function (e) {
  40705. ;(this.ptr = e), this.resolveAll()
  40706. }, this)
  40707. else if (this.ptr instanceof n.Message.Field) {
  40708. if (i.TYPE.test(this.ptr.type)) this.ptr.type = t.TYPES[this.ptr.type]
  40709. else {
  40710. if (!i.TYPEREF.test(this.ptr.type))
  40711. throw Error(
  40712. 'illegal type reference in ' +
  40713. this.ptr.toString(!0) +
  40714. ': ' +
  40715. this.ptr.type
  40716. )
  40717. if (
  40718. ((e = (
  40719. this.ptr instanceof n.Message.ExtensionField
  40720. ? this.ptr.extension.parent
  40721. : this.ptr.parent
  40722. ).resolve(this.ptr.type, !0)),
  40723. !e)
  40724. )
  40725. throw Error(
  40726. 'unresolvable type reference in ' +
  40727. this.ptr.toString(!0) +
  40728. ': ' +
  40729. this.ptr.type
  40730. )
  40731. if (((this.ptr.resolvedType = e), e instanceof n.Enum)) {
  40732. if (
  40733. ((this.ptr.type = t.TYPES.enum),
  40734. 'proto3' === this.ptr.syntax && 'proto3' !== e.syntax)
  40735. )
  40736. throw Error('proto3 message cannot reference proto2 enum')
  40737. } else {
  40738. if (!(e instanceof n.Message))
  40739. throw Error(
  40740. 'illegal type reference in ' +
  40741. this.ptr.toString(!0) +
  40742. ': ' +
  40743. this.ptr.type
  40744. )
  40745. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  40746. }
  40747. }
  40748. if (this.ptr.map) {
  40749. if (!i.TYPE.test(this.ptr.keyType))
  40750. throw Error(
  40751. 'illegal key type for map field in ' +
  40752. this.ptr.toString(!0) +
  40753. ': ' +
  40754. this.ptr.keyType
  40755. )
  40756. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  40757. }
  40758. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  40759. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  40760. throw Error('illegal service type in ' + this.ptr.toString(!0))
  40761. if (
  40762. ((e = this.ptr.parent.resolve(this.ptr.requestName, !0)),
  40763. !(e && e instanceof t.Reflect.Message))
  40764. )
  40765. throw Error(
  40766. 'Illegal type reference in ' +
  40767. this.ptr.toString(!0) +
  40768. ': ' +
  40769. this.ptr.requestName
  40770. )
  40771. if (
  40772. ((this.ptr.resolvedRequestType = e),
  40773. (e = this.ptr.parent.resolve(this.ptr.responseName, !0)),
  40774. !(e && e instanceof t.Reflect.Message))
  40775. )
  40776. throw Error(
  40777. 'Illegal type reference in ' +
  40778. this.ptr.toString(!0) +
  40779. ': ' +
  40780. this.ptr.responseName
  40781. )
  40782. this.ptr.resolvedResponseType = e
  40783. } else if (
  40784. !(
  40785. this.ptr instanceof t.Reflect.Message.OneOf ||
  40786. this.ptr instanceof t.Reflect.Extension ||
  40787. this.ptr instanceof t.Reflect.Enum.Value
  40788. )
  40789. )
  40790. throw Error(
  40791. 'illegal object in namespace: ' + typeof this.ptr + ': ' + this.ptr
  40792. )
  40793. return this.reset()
  40794. }),
  40795. (a.build = function (e) {
  40796. if (
  40797. (this.reset(),
  40798. this.resolved ||
  40799. (this.resolveAll(), (this.resolved = !0), (this.result = null)),
  40800. null === this.result && (this.result = this.ns.build()),
  40801. !e)
  40802. )
  40803. return this.result
  40804. for (
  40805. var t = 'string' == typeof e ? e.split('.') : e, i = this.result, n = 0;
  40806. n < t.length;
  40807. n++
  40808. ) {
  40809. if (!i[t[n]]) {
  40810. i = null
  40811. break
  40812. }
  40813. i = i[t[n]]
  40814. }
  40815. return i
  40816. }),
  40817. (a.lookup = function (e, t) {
  40818. return e ? this.ns.resolve(e, t) : this.ns
  40819. }),
  40820. (a.toString = function () {
  40821. return 'Builder'
  40822. }),
  40823. (o.Message = function () {}),
  40824. (o.Enum = function () {}),
  40825. (o.Service = function () {}),
  40826. o
  40827. )
  40828. })(r, r.Lang, r.Reflect)),
  40829. (r.Map = (function (e, t) {
  40830. function i(e) {
  40831. var t = 0
  40832. return {
  40833. next: function () {
  40834. return t < e.length
  40835. ? {
  40836. done: !1,
  40837. value: e[t++]
  40838. }
  40839. : {
  40840. done: !0
  40841. }
  40842. }
  40843. }
  40844. }
  40845. var n = function (e, i) {
  40846. if (!e.map) throw Error('field is not a map')
  40847. if (
  40848. ((this.field = e),
  40849. (this.keyElem = new t.Element(e.keyType, null, !0, e.syntax)),
  40850. (this.valueElem = new t.Element(e.type, e.resolvedType, !1, e.syntax)),
  40851. (this.map = {}),
  40852. Object.defineProperty(this, 'size', {
  40853. get: function () {
  40854. return Object.keys(this.map).length
  40855. }
  40856. }),
  40857. i)
  40858. )
  40859. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  40860. var o = this.keyElem.valueFromString(n[r]),
  40861. a = this.valueElem.verifyValue(i[n[r]])
  40862. this.map[this.keyElem.valueToString(o)] = {
  40863. key: o,
  40864. value: a
  40865. }
  40866. }
  40867. },
  40868. r = n.prototype
  40869. return (
  40870. (r.clear = function () {
  40871. this.map = {}
  40872. }),
  40873. (r.delete = function (e) {
  40874. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e)),
  40875. i = t in this.map
  40876. return delete this.map[t], i
  40877. }),
  40878. (r.entries = function () {
  40879. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  40880. t.push([(e = this.map[n[r]]).key, e.value])
  40881. return i(t)
  40882. }),
  40883. (r.keys = function () {
  40884. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  40885. e.push(this.map[t[n]].key)
  40886. return i(e)
  40887. }),
  40888. (r.values = function () {
  40889. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  40890. e.push(this.map[t[n]].value)
  40891. return i(e)
  40892. }),
  40893. (r.forEach = function (e, t) {
  40894. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  40895. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  40896. }),
  40897. (r.set = function (e, t) {
  40898. var i = this.keyElem.verifyValue(e),
  40899. n = this.valueElem.verifyValue(t)
  40900. return (
  40901. (this.map[this.keyElem.valueToString(i)] = {
  40902. key: i,
  40903. value: n
  40904. }),
  40905. this
  40906. )
  40907. }),
  40908. (r.get = function (e) {
  40909. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  40910. if (t in this.map) return this.map[t].value
  40911. }),
  40912. (r.has = function (e) {
  40913. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  40914. return t in this.map
  40915. }),
  40916. n
  40917. )
  40918. })(r, r.Reflect)),
  40919. (r.loadProto = function (e, t, i) {
  40920. return (
  40921. ('string' == typeof t ||
  40922. (t && 'string' == typeof t.file && 'string' == typeof t.root)) &&
  40923. ((i = t), (t = void 0)),
  40924. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  40925. )
  40926. }),
  40927. (r.protoFromString = r.loadProto),
  40928. (r.loadProtoFile = function (e, t, i) {
  40929. if (
  40930. (t && 'object' == typeof t
  40931. ? ((i = t), (t = null))
  40932. : (t && 'function' == typeof t) || (t = null),
  40933. t)
  40934. )
  40935. return r.Util.fetch(
  40936. 'string' == typeof e ? e : e.root + '/' + e.file,
  40937. function (n) {
  40938. if (null === n) return void t(Error('Failed to fetch file'))
  40939. try {
  40940. t(null, r.loadProto(n, i, e))
  40941. } catch (e) {
  40942. t(e)
  40943. }
  40944. }
  40945. )
  40946. var n = r.Util.fetch('object' == typeof e ? e.root + '/' + e.file : e)
  40947. return null === n ? null : r.loadProto(n, i, e)
  40948. }),
  40949. (r.protoFromFile = r.loadProtoFile),
  40950. (r.newBuilder = function (e) {
  40951. return (
  40952. (e = e || {}),
  40953. 'undefined' == typeof e.convertFieldsToCamelCase &&
  40954. (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  40955. 'undefined' == typeof e.populateAccessors &&
  40956. (e.populateAccessors = r.populateAccessors),
  40957. new r.Builder(e)
  40958. )
  40959. }),
  40960. (r.loadJson = function (e, t, i) {
  40961. return (
  40962. ('string' == typeof t ||
  40963. (t && 'string' == typeof t.file && 'string' == typeof t.root)) &&
  40964. ((i = t), (t = null)),
  40965. (t && 'object' == typeof t) || (t = r.newBuilder()),
  40966. 'string' == typeof e && (e = JSON.parse(e)),
  40967. t.import(e, i),
  40968. t.resolveAll(),
  40969. t
  40970. )
  40971. }),
  40972. (r.loadJsonFile = function (e, t, i) {
  40973. if (
  40974. (t && 'object' == typeof t
  40975. ? ((i = t), (t = null))
  40976. : (t && 'function' == typeof t) || (t = null),
  40977. t)
  40978. )
  40979. return r.Util.fetch(
  40980. 'string' == typeof e ? e : e.root + '/' + e.file,
  40981. function (n) {
  40982. if (null === n) return void t(Error('Failed to fetch file'))
  40983. try {
  40984. t(null, r.loadJson(JSON.parse(n), i, e))
  40985. } catch (e) {
  40986. t(e)
  40987. }
  40988. }
  40989. )
  40990. var n = r.Util.fetch('object' == typeof e ? e.root + '/' + e.file : e)
  40991. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  40992. }),
  40993. r
  40994. )
  40995. })
  40996. }).call(this, e('_process'))
  40997. },
  40998. {
  40999. _process: 203,
  41000. bytebuffer: 215,
  41001. fs: 197,
  41002. path: 197
  41003. }
  41004. ],
  41005. 215: [
  41006. function (e, t, i) {
  41007. !(function (i, n) {
  41008. 'function' == typeof define && define.amd
  41009. ? define(['long'], n)
  41010. : 'function' == typeof e && 'object' == typeof t && t && t.exports
  41011. ? (t.exports = (function () {
  41012. var t
  41013. try {
  41014. t = e('long')
  41015. } catch (e) {}
  41016. return n(t)
  41017. })())
  41018. : ((i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long))
  41019. })(this, function (e) {
  41020. 'use strict'
  41021. function t(e) {
  41022. var t = 0
  41023. return function () {
  41024. return t < e.length ? e.charCodeAt(t++) : null
  41025. }
  41026. }
  41027. function i() {
  41028. var e = [],
  41029. t = []
  41030. return function () {
  41031. return 0 === arguments.length
  41032. ? t.join('') + l.apply(String, e)
  41033. : (e.length + arguments.length > 1024 &&
  41034. (t.push(l.apply(String, e)), (e.length = 0)),
  41035. void Array.prototype.push.apply(e, arguments))
  41036. }
  41037. }
  41038. function n(e, t, i, n, r) {
  41039. var o,
  41040. a,
  41041. s = 8 * r - n - 1,
  41042. l = (1 << s) - 1,
  41043. c = l >> 1,
  41044. h = -7,
  41045. u = i ? r - 1 : 0,
  41046. d = i ? -1 : 1,
  41047. p = e[t + u]
  41048. for (
  41049. u += d, o = p & ((1 << -h) - 1), p >>= -h, h += s;
  41050. h > 0;
  41051. o = 256 * o + e[t + u], u += d, h -= 8
  41052. );
  41053. for (
  41054. a = o & ((1 << -h) - 1), o >>= -h, h += n;
  41055. h > 0;
  41056. a = 256 * a + e[t + u], u += d, h -= 8
  41057. );
  41058. if (0 === o) o = 1 - c
  41059. else {
  41060. if (o === l) return a ? NaN : (p ? -1 : 1) * (1 / 0)
  41061. ;(a += Math.pow(2, n)), (o -= c)
  41062. }
  41063. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  41064. }
  41065. function r(e, t, i, n, r, o) {
  41066. var a,
  41067. s,
  41068. l,
  41069. c = 8 * o - r - 1,
  41070. h = (1 << c) - 1,
  41071. u = h >> 1,
  41072. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  41073. p = n ? 0 : o - 1,
  41074. f = n ? 1 : -1,
  41075. g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0
  41076. for (
  41077. t = Math.abs(t),
  41078. isNaN(t) || t === 1 / 0
  41079. ? ((s = isNaN(t) ? 1 : 0), (a = h))
  41080. : ((a = Math.floor(Math.log(t) / Math.LN2)),
  41081. t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)),
  41082. (t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u)),
  41083. t * l >= 2 && (a++, (l /= 2)),
  41084. a + u >= h
  41085. ? ((s = 0), (a = h))
  41086. : a + u >= 1
  41087. ? ((s = (t * l - 1) * Math.pow(2, r)), (a += u))
  41088. : ((s = t * Math.pow(2, u - 1) * Math.pow(2, r)), (a = 0)));
  41089. r >= 8;
  41090. e[i + p] = 255 & s, p += f, s /= 256, r -= 8
  41091. );
  41092. for (a = (a << r) | s, c += r; c > 0; e[i + p] = 255 & a, p += f, a /= 256, c -= 8);
  41093. e[i + p - f] |= 128 * g
  41094. }
  41095. var o = function (e, t, i) {
  41096. if (
  41097. ('undefined' == typeof e && (e = o.DEFAULT_CAPACITY),
  41098. 'undefined' == typeof t && (t = o.DEFAULT_ENDIAN),
  41099. 'undefined' == typeof i && (i = o.DEFAULT_NOASSERT),
  41100. !i)
  41101. ) {
  41102. if (((e |= 0), e < 0)) throw RangeError('Illegal capacity')
  41103. ;(t = !!t), (i = !!i)
  41104. }
  41105. ;(this.buffer = 0 === e ? s : new ArrayBuffer(e)),
  41106. (this.view = 0 === e ? null : new Uint8Array(this.buffer)),
  41107. (this.offset = 0),
  41108. (this.markedOffset = -1),
  41109. (this.limit = e),
  41110. (this.littleEndian = t),
  41111. (this.noAssert = i)
  41112. }
  41113. ;(o.VERSION = '5.0.1'),
  41114. (o.LITTLE_ENDIAN = !0),
  41115. (o.BIG_ENDIAN = !1),
  41116. (o.DEFAULT_CAPACITY = 16),
  41117. (o.DEFAULT_ENDIAN = o.BIG_ENDIAN),
  41118. (o.DEFAULT_NOASSERT = !1),
  41119. (o.Long = e || null)
  41120. var a = o.prototype
  41121. a.__isByteBuffer__,
  41122. Object.defineProperty(a, '__isByteBuffer__', {
  41123. value: !0,
  41124. enumerable: !1,
  41125. configurable: !1
  41126. })
  41127. var s = new ArrayBuffer(0),
  41128. l = String.fromCharCode
  41129. ;(o.accessor = function () {
  41130. return Uint8Array
  41131. }),
  41132. (o.allocate = function (e, t, i) {
  41133. return new o(e, t, i)
  41134. }),
  41135. (o.concat = function (e, t, i, n) {
  41136. ;('boolean' != typeof t && 'string' == typeof t) || ((n = i), (i = t), (t = void 0))
  41137. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  41138. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  41139. (r = e[s].limit - e[s].offset),
  41140. r > 0 && (a += r)
  41141. if (0 === a) return new o(0, i, n)
  41142. var c,
  41143. h = new o(a, i, n)
  41144. for (s = 0; s < l; )
  41145. (c = e[s++]),
  41146. (r = c.limit - c.offset),
  41147. r <= 0 ||
  41148. (h.view.set(c.view.subarray(c.offset, c.limit), h.offset), (h.offset += r))
  41149. return (h.limit = h.offset), (h.offset = 0), h
  41150. }),
  41151. (o.isByteBuffer = function (e) {
  41152. return (e && e.__isByteBuffer__) === !0
  41153. }),
  41154. (o.type = function () {
  41155. return ArrayBuffer
  41156. }),
  41157. (o.wrap = function (e, t, i, n) {
  41158. if (('string' != typeof t && ((n = i), (i = t), (t = void 0)), 'string' == typeof e))
  41159. switch (('undefined' == typeof t && (t = 'utf8'), t)) {
  41160. case 'base64':
  41161. return o.fromBase64(e, i)
  41162. case 'hex':
  41163. return o.fromHex(e, i)
  41164. case 'binary':
  41165. return o.fromBinary(e, i)
  41166. case 'utf8':
  41167. return o.fromUTF8(e, i)
  41168. case 'debug':
  41169. return o.fromDebug(e, i)
  41170. default:
  41171. throw Error('Unsupported encoding: ' + t)
  41172. }
  41173. if (null === e || 'object' != typeof e) throw TypeError('Illegal buffer')
  41174. var r
  41175. if (o.isByteBuffer(e)) return (r = a.clone.call(e)), (r.markedOffset = -1), r
  41176. if (e instanceof Uint8Array)
  41177. (r = new o(0, i, n)),
  41178. e.length > 0 &&
  41179. ((r.buffer = e.buffer),
  41180. (r.offset = e.byteOffset),
  41181. (r.limit = e.byteOffset + e.byteLength),
  41182. (r.view = new Uint8Array(e.buffer)))
  41183. else if (e instanceof ArrayBuffer)
  41184. (r = new o(0, i, n)),
  41185. e.byteLength > 0 &&
  41186. ((r.buffer = e),
  41187. (r.offset = 0),
  41188. (r.limit = e.byteLength),
  41189. (r.view = e.byteLength > 0 ? new Uint8Array(e) : null))
  41190. else {
  41191. if ('[object Array]' !== Object.prototype.toString.call(e))
  41192. throw TypeError('Illegal buffer')
  41193. ;(r = new o(e.length, i, n)), (r.limit = e.length)
  41194. for (var s = 0; s < e.length; ++s) r.view[s] = e[s]
  41195. }
  41196. return r
  41197. }),
  41198. (a.writeBitSet = function (e, t) {
  41199. var i = 'undefined' == typeof t
  41200. if ((i && (t = this.offset), !this.noAssert)) {
  41201. if (!(e instanceof Array)) throw TypeError('Illegal BitSet: Not an array')
  41202. if ('number' != typeof t || t % 1 !== 0)
  41203. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41204. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41205. throw RangeError(
  41206. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41207. )
  41208. }
  41209. var n,
  41210. r = t,
  41211. o = e.length,
  41212. a = o >> 3,
  41213. s = 0
  41214. for (t += this.writeVarint32(o, t); a--; )
  41215. (n =
  41216. (1 & !!e[s++]) |
  41217. ((1 & !!e[s++]) << 1) |
  41218. ((1 & !!e[s++]) << 2) |
  41219. ((1 & !!e[s++]) << 3) |
  41220. ((1 & !!e[s++]) << 4) |
  41221. ((1 & !!e[s++]) << 5) |
  41222. ((1 & !!e[s++]) << 6) |
  41223. ((1 & !!e[s++]) << 7)),
  41224. this.writeByte(n, t++)
  41225. if (s < o) {
  41226. var l = 0
  41227. for (n = 0; s < o; ) n |= (1 & !!e[s++]) << l++
  41228. this.writeByte(n, t++)
  41229. }
  41230. return i ? ((this.offset = t), this) : t - r
  41231. }),
  41232. (a.readBitSet = function (e) {
  41233. var t = 'undefined' == typeof e
  41234. t && (e = this.offset)
  41235. var i,
  41236. n = this.readVarint32(e),
  41237. r = n.value,
  41238. o = r >> 3,
  41239. a = 0,
  41240. s = []
  41241. for (e += n.length; o--; )
  41242. (i = this.readByte(e++)),
  41243. (s[a++] = !!(1 & i)),
  41244. (s[a++] = !!(2 & i)),
  41245. (s[a++] = !!(4 & i)),
  41246. (s[a++] = !!(8 & i)),
  41247. (s[a++] = !!(16 & i)),
  41248. (s[a++] = !!(32 & i)),
  41249. (s[a++] = !!(64 & i)),
  41250. (s[a++] = !!(128 & i))
  41251. if (a < r) {
  41252. var l = 0
  41253. for (i = this.readByte(e++); a < r; ) s[a++] = !!((i >> l++) & 1)
  41254. }
  41255. return t && (this.offset = e), s
  41256. }),
  41257. (a.readBytes = function (e, t) {
  41258. var i = 'undefined' == typeof t
  41259. if ((i && (t = this.offset), !this.noAssert)) {
  41260. if ('number' != typeof t || t % 1 !== 0)
  41261. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41262. if (((t >>>= 0), t < 0 || t + e > this.buffer.byteLength))
  41263. throw RangeError(
  41264. 'Illegal offset: 0 <= ' + t + ' (+' + e + ') <= ' + this.buffer.byteLength
  41265. )
  41266. }
  41267. var n = this.slice(t, t + e)
  41268. return i && (this.offset += e), n
  41269. }),
  41270. (a.writeBytes = a.append),
  41271. (a.writeInt8 = function (e, t) {
  41272. var i = 'undefined' == typeof t
  41273. if ((i && (t = this.offset), !this.noAssert)) {
  41274. if ('number' != typeof e || e % 1 !== 0)
  41275. throw TypeError('Illegal value: ' + e + ' (not an integer)')
  41276. if (((e |= 0), 'number' != typeof t || t % 1 !== 0))
  41277. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41278. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41279. throw RangeError(
  41280. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41281. )
  41282. }
  41283. t += 1
  41284. var n = this.buffer.byteLength
  41285. return (
  41286. t > n && this.resize((n *= 2) > t ? n : t),
  41287. (t -= 1),
  41288. (this.view[t] = e),
  41289. i && (this.offset += 1),
  41290. this
  41291. )
  41292. }),
  41293. (a.writeByte = a.writeInt8),
  41294. (a.readInt8 = function (e) {
  41295. var t = 'undefined' == typeof e
  41296. if ((t && (e = this.offset), !this.noAssert)) {
  41297. if ('number' != typeof e || e % 1 !== 0)
  41298. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  41299. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  41300. throw RangeError(
  41301. 'Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength
  41302. )
  41303. }
  41304. var i = this.view[e]
  41305. return 128 === (128 & i) && (i = -(255 - i + 1)), t && (this.offset += 1), i
  41306. }),
  41307. (a.readByte = a.readInt8),
  41308. (a.writeUint8 = function (e, t) {
  41309. var i = 'undefined' == typeof t
  41310. if ((i && (t = this.offset), !this.noAssert)) {
  41311. if ('number' != typeof e || e % 1 !== 0)
  41312. throw TypeError('Illegal value: ' + e + ' (not an integer)')
  41313. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  41314. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41315. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41316. throw RangeError(
  41317. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41318. )
  41319. }
  41320. t += 1
  41321. var n = this.buffer.byteLength
  41322. return (
  41323. t > n && this.resize((n *= 2) > t ? n : t),
  41324. (t -= 1),
  41325. (this.view[t] = e),
  41326. i && (this.offset += 1),
  41327. this
  41328. )
  41329. }),
  41330. (a.writeUInt8 = a.writeUint8),
  41331. (a.readUint8 = function (e) {
  41332. var t = 'undefined' == typeof e
  41333. if ((t && (e = this.offset), !this.noAssert)) {
  41334. if ('number' != typeof e || e % 1 !== 0)
  41335. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  41336. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  41337. throw RangeError(
  41338. 'Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength
  41339. )
  41340. }
  41341. var i = this.view[e]
  41342. return t && (this.offset += 1), i
  41343. }),
  41344. (a.readUInt8 = a.readUint8),
  41345. (a.writeInt16 = function (e, t) {
  41346. var i = 'undefined' == typeof t
  41347. if ((i && (t = this.offset), !this.noAssert)) {
  41348. if ('number' != typeof e || e % 1 !== 0)
  41349. throw TypeError('Illegal value: ' + e + ' (not an integer)')
  41350. if (((e |= 0), 'number' != typeof t || t % 1 !== 0))
  41351. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41352. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41353. throw RangeError(
  41354. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41355. )
  41356. }
  41357. t += 2
  41358. var n = this.buffer.byteLength
  41359. return (
  41360. t > n && this.resize((n *= 2) > t ? n : t),
  41361. (t -= 2),
  41362. this.littleEndian
  41363. ? ((this.view[t + 1] = (65280 & e) >>> 8), (this.view[t] = 255 & e))
  41364. : ((this.view[t] = (65280 & e) >>> 8), (this.view[t + 1] = 255 & e)),
  41365. i && (this.offset += 2),
  41366. this
  41367. )
  41368. }),
  41369. (a.writeShort = a.writeInt16),
  41370. (a.readInt16 = function (e) {
  41371. var t = 'undefined' == typeof e
  41372. if ((t && (e = this.offset), !this.noAssert)) {
  41373. if ('number' != typeof e || e % 1 !== 0)
  41374. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  41375. if (((e >>>= 0), e < 0 || e + 2 > this.buffer.byteLength))
  41376. throw RangeError(
  41377. 'Illegal offset: 0 <= ' + e + ' (+2) <= ' + this.buffer.byteLength
  41378. )
  41379. }
  41380. var i = 0
  41381. return (
  41382. this.littleEndian
  41383. ? ((i = this.view[e]), (i |= this.view[e + 1] << 8))
  41384. : ((i = this.view[e] << 8), (i |= this.view[e + 1])),
  41385. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  41386. t && (this.offset += 2),
  41387. i
  41388. )
  41389. }),
  41390. (a.readShort = a.readInt16),
  41391. (a.writeUint16 = function (e, t) {
  41392. var i = 'undefined' == typeof t
  41393. if ((i && (t = this.offset), !this.noAssert)) {
  41394. if ('number' != typeof e || e % 1 !== 0)
  41395. throw TypeError('Illegal value: ' + e + ' (not an integer)')
  41396. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  41397. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41398. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41399. throw RangeError(
  41400. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41401. )
  41402. }
  41403. t += 2
  41404. var n = this.buffer.byteLength
  41405. return (
  41406. t > n && this.resize((n *= 2) > t ? n : t),
  41407. (t -= 2),
  41408. this.littleEndian
  41409. ? ((this.view[t + 1] = (65280 & e) >>> 8), (this.view[t] = 255 & e))
  41410. : ((this.view[t] = (65280 & e) >>> 8), (this.view[t + 1] = 255 & e)),
  41411. i && (this.offset += 2),
  41412. this
  41413. )
  41414. }),
  41415. (a.writeUInt16 = a.writeUint16),
  41416. (a.readUint16 = function (e) {
  41417. var t = 'undefined' == typeof e
  41418. if ((t && (e = this.offset), !this.noAssert)) {
  41419. if ('number' != typeof e || e % 1 !== 0)
  41420. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  41421. if (((e >>>= 0), e < 0 || e + 2 > this.buffer.byteLength))
  41422. throw RangeError(
  41423. 'Illegal offset: 0 <= ' + e + ' (+2) <= ' + this.buffer.byteLength
  41424. )
  41425. }
  41426. var i = 0
  41427. return (
  41428. this.littleEndian
  41429. ? ((i = this.view[e]), (i |= this.view[e + 1] << 8))
  41430. : ((i = this.view[e] << 8), (i |= this.view[e + 1])),
  41431. t && (this.offset += 2),
  41432. i
  41433. )
  41434. }),
  41435. (a.readUInt16 = a.readUint16),
  41436. (a.writeInt32 = function (e, t) {
  41437. var i = 'undefined' == typeof t
  41438. if ((i && (t = this.offset), !this.noAssert)) {
  41439. if ('number' != typeof e || e % 1 !== 0)
  41440. throw TypeError('Illegal value: ' + e + ' (not an integer)')
  41441. if (((e |= 0), 'number' != typeof t || t % 1 !== 0))
  41442. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41443. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41444. throw RangeError(
  41445. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41446. )
  41447. }
  41448. t += 4
  41449. var n = this.buffer.byteLength
  41450. return (
  41451. t > n && this.resize((n *= 2) > t ? n : t),
  41452. (t -= 4),
  41453. this.littleEndian
  41454. ? ((this.view[t + 3] = (e >>> 24) & 255),
  41455. (this.view[t + 2] = (e >>> 16) & 255),
  41456. (this.view[t + 1] = (e >>> 8) & 255),
  41457. (this.view[t] = 255 & e))
  41458. : ((this.view[t] = (e >>> 24) & 255),
  41459. (this.view[t + 1] = (e >>> 16) & 255),
  41460. (this.view[t + 2] = (e >>> 8) & 255),
  41461. (this.view[t + 3] = 255 & e)),
  41462. i && (this.offset += 4),
  41463. this
  41464. )
  41465. }),
  41466. (a.writeInt = a.writeInt32),
  41467. (a.readInt32 = function (e) {
  41468. var t = 'undefined' == typeof e
  41469. if ((t && (e = this.offset), !this.noAssert)) {
  41470. if ('number' != typeof e || e % 1 !== 0)
  41471. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  41472. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  41473. throw RangeError(
  41474. 'Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength
  41475. )
  41476. }
  41477. var i = 0
  41478. return (
  41479. this.littleEndian
  41480. ? ((i = this.view[e + 2] << 16),
  41481. (i |= this.view[e + 1] << 8),
  41482. (i |= this.view[e]),
  41483. (i += (this.view[e + 3] << 24) >>> 0))
  41484. : ((i = this.view[e + 1] << 16),
  41485. (i |= this.view[e + 2] << 8),
  41486. (i |= this.view[e + 3]),
  41487. (i += (this.view[e] << 24) >>> 0)),
  41488. (i |= 0),
  41489. t && (this.offset += 4),
  41490. i
  41491. )
  41492. }),
  41493. (a.readInt = a.readInt32),
  41494. (a.writeUint32 = function (e, t) {
  41495. var i = 'undefined' == typeof t
  41496. if ((i && (t = this.offset), !this.noAssert)) {
  41497. if ('number' != typeof e || e % 1 !== 0)
  41498. throw TypeError('Illegal value: ' + e + ' (not an integer)')
  41499. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  41500. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41501. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41502. throw RangeError(
  41503. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41504. )
  41505. }
  41506. t += 4
  41507. var n = this.buffer.byteLength
  41508. return (
  41509. t > n && this.resize((n *= 2) > t ? n : t),
  41510. (t -= 4),
  41511. this.littleEndian
  41512. ? ((this.view[t + 3] = (e >>> 24) & 255),
  41513. (this.view[t + 2] = (e >>> 16) & 255),
  41514. (this.view[t + 1] = (e >>> 8) & 255),
  41515. (this.view[t] = 255 & e))
  41516. : ((this.view[t] = (e >>> 24) & 255),
  41517. (this.view[t + 1] = (e >>> 16) & 255),
  41518. (this.view[t + 2] = (e >>> 8) & 255),
  41519. (this.view[t + 3] = 255 & e)),
  41520. i && (this.offset += 4),
  41521. this
  41522. )
  41523. }),
  41524. (a.writeUInt32 = a.writeUint32),
  41525. (a.readUint32 = function (e) {
  41526. var t = 'undefined' == typeof e
  41527. if ((t && (e = this.offset), !this.noAssert)) {
  41528. if ('number' != typeof e || e % 1 !== 0)
  41529. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  41530. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  41531. throw RangeError(
  41532. 'Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength
  41533. )
  41534. }
  41535. var i = 0
  41536. return (
  41537. this.littleEndian
  41538. ? ((i = this.view[e + 2] << 16),
  41539. (i |= this.view[e + 1] << 8),
  41540. (i |= this.view[e]),
  41541. (i += (this.view[e + 3] << 24) >>> 0))
  41542. : ((i = this.view[e + 1] << 16),
  41543. (i |= this.view[e + 2] << 8),
  41544. (i |= this.view[e + 3]),
  41545. (i += (this.view[e] << 24) >>> 0)),
  41546. t && (this.offset += 4),
  41547. i
  41548. )
  41549. }),
  41550. (a.readUInt32 = a.readUint32),
  41551. e &&
  41552. ((a.writeInt64 = function (t, i) {
  41553. var n = 'undefined' == typeof i
  41554. if ((n && (i = this.offset), !this.noAssert)) {
  41555. if ('number' == typeof t) t = e.fromNumber(t)
  41556. else if ('string' == typeof t) t = e.fromString(t)
  41557. else if (!(t && t instanceof e))
  41558. throw TypeError('Illegal value: ' + t + ' (not an integer or Long)')
  41559. if ('number' != typeof i || i % 1 !== 0)
  41560. throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  41561. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  41562. throw RangeError(
  41563. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  41564. )
  41565. }
  41566. 'number' == typeof t
  41567. ? (t = e.fromNumber(t))
  41568. : 'string' == typeof t && (t = e.fromString(t)),
  41569. (i += 8)
  41570. var r = this.buffer.byteLength
  41571. i > r && this.resize((r *= 2) > i ? r : i), (i -= 8)
  41572. var o = t.low,
  41573. a = t.high
  41574. return (
  41575. this.littleEndian
  41576. ? ((this.view[i + 3] = (o >>> 24) & 255),
  41577. (this.view[i + 2] = (o >>> 16) & 255),
  41578. (this.view[i + 1] = (o >>> 8) & 255),
  41579. (this.view[i] = 255 & o),
  41580. (i += 4),
  41581. (this.view[i + 3] = (a >>> 24) & 255),
  41582. (this.view[i + 2] = (a >>> 16) & 255),
  41583. (this.view[i + 1] = (a >>> 8) & 255),
  41584. (this.view[i] = 255 & a))
  41585. : ((this.view[i] = (a >>> 24) & 255),
  41586. (this.view[i + 1] = (a >>> 16) & 255),
  41587. (this.view[i + 2] = (a >>> 8) & 255),
  41588. (this.view[i + 3] = 255 & a),
  41589. (i += 4),
  41590. (this.view[i] = (o >>> 24) & 255),
  41591. (this.view[i + 1] = (o >>> 16) & 255),
  41592. (this.view[i + 2] = (o >>> 8) & 255),
  41593. (this.view[i + 3] = 255 & o)),
  41594. n && (this.offset += 8),
  41595. this
  41596. )
  41597. }),
  41598. (a.writeLong = a.writeInt64),
  41599. (a.readInt64 = function (t) {
  41600. var i = 'undefined' == typeof t
  41601. if ((i && (t = this.offset), !this.noAssert)) {
  41602. if ('number' != typeof t || t % 1 !== 0)
  41603. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41604. if (((t >>>= 0), t < 0 || t + 8 > this.buffer.byteLength))
  41605. throw RangeError(
  41606. 'Illegal offset: 0 <= ' + t + ' (+8) <= ' + this.buffer.byteLength
  41607. )
  41608. }
  41609. var n = 0,
  41610. r = 0
  41611. this.littleEndian
  41612. ? ((n = this.view[t + 2] << 16),
  41613. (n |= this.view[t + 1] << 8),
  41614. (n |= this.view[t]),
  41615. (n += (this.view[t + 3] << 24) >>> 0),
  41616. (t += 4),
  41617. (r = this.view[t + 2] << 16),
  41618. (r |= this.view[t + 1] << 8),
  41619. (r |= this.view[t]),
  41620. (r += (this.view[t + 3] << 24) >>> 0))
  41621. : ((r = this.view[t + 1] << 16),
  41622. (r |= this.view[t + 2] << 8),
  41623. (r |= this.view[t + 3]),
  41624. (r += (this.view[t] << 24) >>> 0),
  41625. (t += 4),
  41626. (n = this.view[t + 1] << 16),
  41627. (n |= this.view[t + 2] << 8),
  41628. (n |= this.view[t + 3]),
  41629. (n += (this.view[t] << 24) >>> 0))
  41630. var o = new e(n, r, !1)
  41631. return i && (this.offset += 8), o
  41632. }),
  41633. (a.readLong = a.readInt64),
  41634. (a.writeUint64 = function (t, i) {
  41635. var n = 'undefined' == typeof i
  41636. if ((n && (i = this.offset), !this.noAssert)) {
  41637. if ('number' == typeof t) t = e.fromNumber(t)
  41638. else if ('string' == typeof t) t = e.fromString(t)
  41639. else if (!(t && t instanceof e))
  41640. throw TypeError('Illegal value: ' + t + ' (not an integer or Long)')
  41641. if ('number' != typeof i || i % 1 !== 0)
  41642. throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  41643. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  41644. throw RangeError(
  41645. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  41646. )
  41647. }
  41648. 'number' == typeof t
  41649. ? (t = e.fromNumber(t))
  41650. : 'string' == typeof t && (t = e.fromString(t)),
  41651. (i += 8)
  41652. var r = this.buffer.byteLength
  41653. i > r && this.resize((r *= 2) > i ? r : i), (i -= 8)
  41654. var o = t.low,
  41655. a = t.high
  41656. return (
  41657. this.littleEndian
  41658. ? ((this.view[i + 3] = (o >>> 24) & 255),
  41659. (this.view[i + 2] = (o >>> 16) & 255),
  41660. (this.view[i + 1] = (o >>> 8) & 255),
  41661. (this.view[i] = 255 & o),
  41662. (i += 4),
  41663. (this.view[i + 3] = (a >>> 24) & 255),
  41664. (this.view[i + 2] = (a >>> 16) & 255),
  41665. (this.view[i + 1] = (a >>> 8) & 255),
  41666. (this.view[i] = 255 & a))
  41667. : ((this.view[i] = (a >>> 24) & 255),
  41668. (this.view[i + 1] = (a >>> 16) & 255),
  41669. (this.view[i + 2] = (a >>> 8) & 255),
  41670. (this.view[i + 3] = 255 & a),
  41671. (i += 4),
  41672. (this.view[i] = (o >>> 24) & 255),
  41673. (this.view[i + 1] = (o >>> 16) & 255),
  41674. (this.view[i + 2] = (o >>> 8) & 255),
  41675. (this.view[i + 3] = 255 & o)),
  41676. n && (this.offset += 8),
  41677. this
  41678. )
  41679. }),
  41680. (a.writeUInt64 = a.writeUint64),
  41681. (a.readUint64 = function (t) {
  41682. var i = 'undefined' == typeof t
  41683. if ((i && (t = this.offset), !this.noAssert)) {
  41684. if ('number' != typeof t || t % 1 !== 0)
  41685. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41686. if (((t >>>= 0), t < 0 || t + 8 > this.buffer.byteLength))
  41687. throw RangeError(
  41688. 'Illegal offset: 0 <= ' + t + ' (+8) <= ' + this.buffer.byteLength
  41689. )
  41690. }
  41691. var n = 0,
  41692. r = 0
  41693. this.littleEndian
  41694. ? ((n = this.view[t + 2] << 16),
  41695. (n |= this.view[t + 1] << 8),
  41696. (n |= this.view[t]),
  41697. (n += (this.view[t + 3] << 24) >>> 0),
  41698. (t += 4),
  41699. (r = this.view[t + 2] << 16),
  41700. (r |= this.view[t + 1] << 8),
  41701. (r |= this.view[t]),
  41702. (r += (this.view[t + 3] << 24) >>> 0))
  41703. : ((r = this.view[t + 1] << 16),
  41704. (r |= this.view[t + 2] << 8),
  41705. (r |= this.view[t + 3]),
  41706. (r += (this.view[t] << 24) >>> 0),
  41707. (t += 4),
  41708. (n = this.view[t + 1] << 16),
  41709. (n |= this.view[t + 2] << 8),
  41710. (n |= this.view[t + 3]),
  41711. (n += (this.view[t] << 24) >>> 0))
  41712. var o = new e(n, r, !0)
  41713. return i && (this.offset += 8), o
  41714. }),
  41715. (a.readUInt64 = a.readUint64)),
  41716. (a.writeFloat32 = function (e, t) {
  41717. var i = 'undefined' == typeof t
  41718. if ((i && (t = this.offset), !this.noAssert)) {
  41719. if ('number' != typeof e) throw TypeError('Illegal value: ' + e + ' (not a number)')
  41720. if ('number' != typeof t || t % 1 !== 0)
  41721. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41722. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41723. throw RangeError(
  41724. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41725. )
  41726. }
  41727. t += 4
  41728. var n = this.buffer.byteLength
  41729. return (
  41730. t > n && this.resize((n *= 2) > t ? n : t),
  41731. (t -= 4),
  41732. r(this.view, e, t, this.littleEndian, 23, 4),
  41733. i && (this.offset += 4),
  41734. this
  41735. )
  41736. }),
  41737. (a.writeFloat = a.writeFloat32),
  41738. (a.readFloat32 = function (e) {
  41739. var t = 'undefined' == typeof e
  41740. if ((t && (e = this.offset), !this.noAssert)) {
  41741. if ('number' != typeof e || e % 1 !== 0)
  41742. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  41743. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  41744. throw RangeError(
  41745. 'Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength
  41746. )
  41747. }
  41748. var i = n(this.view, e, this.littleEndian, 23, 4)
  41749. return t && (this.offset += 4), i
  41750. }),
  41751. (a.readFloat = a.readFloat32),
  41752. (a.writeFloat64 = function (e, t) {
  41753. var i = 'undefined' == typeof t
  41754. if ((i && (t = this.offset), !this.noAssert)) {
  41755. if ('number' != typeof e) throw TypeError('Illegal value: ' + e + ' (not a number)')
  41756. if ('number' != typeof t || t % 1 !== 0)
  41757. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41758. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41759. throw RangeError(
  41760. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41761. )
  41762. }
  41763. t += 8
  41764. var n = this.buffer.byteLength
  41765. return (
  41766. t > n && this.resize((n *= 2) > t ? n : t),
  41767. (t -= 8),
  41768. r(this.view, e, t, this.littleEndian, 52, 8),
  41769. i && (this.offset += 8),
  41770. this
  41771. )
  41772. }),
  41773. (a.writeDouble = a.writeFloat64),
  41774. (a.readFloat64 = function (e) {
  41775. var t = 'undefined' == typeof e
  41776. if ((t && (e = this.offset), !this.noAssert)) {
  41777. if ('number' != typeof e || e % 1 !== 0)
  41778. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  41779. if (((e >>>= 0), e < 0 || e + 8 > this.buffer.byteLength))
  41780. throw RangeError(
  41781. 'Illegal offset: 0 <= ' + e + ' (+8) <= ' + this.buffer.byteLength
  41782. )
  41783. }
  41784. var i = n(this.view, e, this.littleEndian, 52, 8)
  41785. return t && (this.offset += 8), i
  41786. }),
  41787. (a.readDouble = a.readFloat64),
  41788. (o.MAX_VARINT32_BYTES = 5),
  41789. (o.calculateVarint32 = function (e) {
  41790. return (e >>>= 0), e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  41791. }),
  41792. (o.zigZagEncode32 = function (e) {
  41793. return (((e |= 0) << 1) ^ (e >> 31)) >>> 0
  41794. }),
  41795. (o.zigZagDecode32 = function (e) {
  41796. return ((e >>> 1) ^ -(1 & e)) | 0
  41797. }),
  41798. (a.writeVarint32 = function (e, t) {
  41799. var i = 'undefined' == typeof t
  41800. if ((i && (t = this.offset), !this.noAssert)) {
  41801. if ('number' != typeof e || e % 1 !== 0)
  41802. throw TypeError('Illegal value: ' + e + ' (not an integer)')
  41803. if (((e |= 0), 'number' != typeof t || t % 1 !== 0))
  41804. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41805. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength))
  41806. throw RangeError(
  41807. 'Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength
  41808. )
  41809. }
  41810. var n,
  41811. r = o.calculateVarint32(e)
  41812. t += r
  41813. var a = this.buffer.byteLength
  41814. for (t > a && this.resize((a *= 2) > t ? a : t), t -= r, e >>>= 0; e >= 128; )
  41815. (n = (127 & e) | 128), (this.view[t++] = n), (e >>>= 7)
  41816. return (this.view[t++] = e), i ? ((this.offset = t), this) : r
  41817. }),
  41818. (a.writeVarint32ZigZag = function (e, t) {
  41819. return this.writeVarint32(o.zigZagEncode32(e), t)
  41820. }),
  41821. (a.readVarint32 = function (e) {
  41822. var t = 'undefined' == typeof e
  41823. if ((t && (e = this.offset), !this.noAssert)) {
  41824. if ('number' != typeof e || e % 1 !== 0)
  41825. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  41826. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  41827. throw RangeError(
  41828. 'Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength
  41829. )
  41830. }
  41831. var i,
  41832. n = 0,
  41833. r = 0
  41834. do {
  41835. if (!this.noAssert && e > this.limit) {
  41836. var o = Error('Truncated')
  41837. throw ((o.truncated = !0), o)
  41838. }
  41839. ;(i = this.view[e++]), n < 5 && (r |= (127 & i) << (7 * n)), ++n
  41840. } while (0 !== (128 & i))
  41841. return (
  41842. (r |= 0),
  41843. t
  41844. ? ((this.offset = e), r)
  41845. : {
  41846. value: r,
  41847. length: n
  41848. }
  41849. )
  41850. }),
  41851. (a.readVarint32ZigZag = function (e) {
  41852. var t = this.readVarint32(e)
  41853. return (
  41854. 'object' == typeof t
  41855. ? (t.value = o.zigZagDecode32(t.value))
  41856. : (t = o.zigZagDecode32(t)),
  41857. t
  41858. )
  41859. }),
  41860. e &&
  41861. ((o.MAX_VARINT64_BYTES = 10),
  41862. (o.calculateVarint64 = function (t) {
  41863. 'number' == typeof t
  41864. ? (t = e.fromNumber(t))
  41865. : 'string' == typeof t && (t = e.fromString(t))
  41866. var i = t.toInt() >>> 0,
  41867. n = t.shiftRightUnsigned(28).toInt() >>> 0,
  41868. r = t.shiftRightUnsigned(56).toInt() >>> 0
  41869. return 0 == r
  41870. ? 0 == n
  41871. ? i < 16384
  41872. ? i < 128
  41873. ? 1
  41874. : 2
  41875. : i < 1 << 21
  41876. ? 3
  41877. : 4
  41878. : n < 16384
  41879. ? n < 128
  41880. ? 5
  41881. : 6
  41882. : n < 1 << 21
  41883. ? 7
  41884. : 8
  41885. : r < 128
  41886. ? 9
  41887. : 10
  41888. }),
  41889. (o.zigZagEncode64 = function (t) {
  41890. return (
  41891. 'number' == typeof t
  41892. ? (t = e.fromNumber(t, !1))
  41893. : 'string' == typeof t
  41894. ? (t = e.fromString(t, !1))
  41895. : t.unsigned !== !1 && (t = t.toSigned()),
  41896. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  41897. )
  41898. }),
  41899. (o.zigZagDecode64 = function (t) {
  41900. return (
  41901. 'number' == typeof t
  41902. ? (t = e.fromNumber(t, !1))
  41903. : 'string' == typeof t
  41904. ? (t = e.fromString(t, !1))
  41905. : t.unsigned !== !1 && (t = t.toSigned()),
  41906. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  41907. )
  41908. }),
  41909. (a.writeVarint64 = function (t, i) {
  41910. var n = 'undefined' == typeof i
  41911. if ((n && (i = this.offset), !this.noAssert)) {
  41912. if ('number' == typeof t) t = e.fromNumber(t)
  41913. else if ('string' == typeof t) t = e.fromString(t)
  41914. else if (!(t && t instanceof e))
  41915. throw TypeError('Illegal value: ' + t + ' (not an integer or Long)')
  41916. if ('number' != typeof i || i % 1 !== 0)
  41917. throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  41918. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  41919. throw RangeError(
  41920. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  41921. )
  41922. }
  41923. 'number' == typeof t
  41924. ? (t = e.fromNumber(t, !1))
  41925. : 'string' == typeof t
  41926. ? (t = e.fromString(t, !1))
  41927. : t.unsigned !== !1 && (t = t.toSigned())
  41928. var r = o.calculateVarint64(t),
  41929. a = t.toInt() >>> 0,
  41930. s = t.shiftRightUnsigned(28).toInt() >>> 0,
  41931. l = t.shiftRightUnsigned(56).toInt() >>> 0
  41932. i += r
  41933. var c = this.buffer.byteLength
  41934. switch ((i > c && this.resize((c *= 2) > i ? c : i), (i -= r), r)) {
  41935. case 10:
  41936. this.view[i + 9] = (l >>> 7) & 1
  41937. case 9:
  41938. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l
  41939. case 8:
  41940. this.view[i + 7] = 8 !== r ? (s >>> 21) | 128 : (s >>> 21) & 127
  41941. case 7:
  41942. this.view[i + 6] = 7 !== r ? (s >>> 14) | 128 : (s >>> 14) & 127
  41943. case 6:
  41944. this.view[i + 5] = 6 !== r ? (s >>> 7) | 128 : (s >>> 7) & 127
  41945. case 5:
  41946. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s
  41947. case 4:
  41948. this.view[i + 3] = 4 !== r ? (a >>> 21) | 128 : (a >>> 21) & 127
  41949. case 3:
  41950. this.view[i + 2] = 3 !== r ? (a >>> 14) | 128 : (a >>> 14) & 127
  41951. case 2:
  41952. this.view[i + 1] = 2 !== r ? (a >>> 7) | 128 : (a >>> 7) & 127
  41953. case 1:
  41954. this.view[i] = 1 !== r ? 128 | a : 127 & a
  41955. }
  41956. return n ? ((this.offset += r), this) : r
  41957. }),
  41958. (a.writeVarint64ZigZag = function (e, t) {
  41959. return this.writeVarint64(o.zigZagEncode64(e), t)
  41960. }),
  41961. (a.readVarint64 = function (t) {
  41962. var i = 'undefined' == typeof t
  41963. if ((i && (t = this.offset), !this.noAssert)) {
  41964. if ('number' != typeof t || t % 1 !== 0)
  41965. throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  41966. if (((t >>>= 0), t < 0 || t + 1 > this.buffer.byteLength))
  41967. throw RangeError(
  41968. 'Illegal offset: 0 <= ' + t + ' (+1) <= ' + this.buffer.byteLength
  41969. )
  41970. }
  41971. var n = t,
  41972. r = 0,
  41973. o = 0,
  41974. a = 0,
  41975. s = 0
  41976. if (
  41977. ((s = this.view[t++]),
  41978. (r = 127 & s),
  41979. 128 & s &&
  41980. ((s = this.view[t++]),
  41981. (r |= (127 & s) << 7),
  41982. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41983. ((s = this.view[t++]),
  41984. (r |= (127 & s) << 14),
  41985. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41986. ((s = this.view[t++]),
  41987. (r |= (127 & s) << 21),
  41988. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41989. ((s = this.view[t++]),
  41990. (o = 127 & s),
  41991. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41992. ((s = this.view[t++]),
  41993. (o |= (127 & s) << 7),
  41994. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41995. ((s = this.view[t++]),
  41996. (o |= (127 & s) << 14),
  41997. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  41998. ((s = this.view[t++]),
  41999. (o |= (127 & s) << 21),
  42000. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  42001. ((s = this.view[t++]),
  42002. (a = 127 & s),
  42003. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  42004. ((s = this.view[t++]),
  42005. (a |= (127 & s) << 7),
  42006. 128 & s || (this.noAssert && 'undefined' == typeof s)))))))))))
  42007. )
  42008. throw Error('Buffer overrun')
  42009. var l = e.fromBits(r | (o << 28), (o >>> 4) | (a << 24), !1)
  42010. return i
  42011. ? ((this.offset = t), l)
  42012. : {
  42013. value: l,
  42014. length: t - n
  42015. }
  42016. }),
  42017. (a.readVarint64ZigZag = function (t) {
  42018. var i = this.readVarint64(t)
  42019. return (
  42020. i && i.value instanceof e
  42021. ? (i.value = o.zigZagDecode64(i.value))
  42022. : (i = o.zigZagDecode64(i)),
  42023. i
  42024. )
  42025. })),
  42026. (a.writeCString = function (e, i) {
  42027. var n = 'undefined' == typeof i
  42028. n && (i = this.offset)
  42029. var r,
  42030. o = e.length
  42031. if (!this.noAssert) {
  42032. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  42033. for (r = 0; r < o; ++r)
  42034. if (0 === e.charCodeAt(r))
  42035. throw RangeError('Illegal str: Contains NULL-characters')
  42036. if ('number' != typeof i || i % 1 !== 0)
  42037. throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  42038. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  42039. throw RangeError(
  42040. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  42041. )
  42042. }
  42043. ;(o = h.calculateUTF16asUTF8(t(e))[1]), (i += o + 1)
  42044. var a = this.buffer.byteLength
  42045. return (
  42046. i > a && this.resize((a *= 2) > i ? a : i),
  42047. (i -= o + 1),
  42048. h.encodeUTF16toUTF8(
  42049. t(e),
  42050. function (e) {
  42051. this.view[i++] = e
  42052. }.bind(this)
  42053. ),
  42054. (this.view[i++] = 0),
  42055. n ? ((this.offset = i), this) : o
  42056. )
  42057. }),
  42058. (a.readCString = function (e) {
  42059. var t = 'undefined' == typeof e
  42060. if ((t && (e = this.offset), !this.noAssert)) {
  42061. if ('number' != typeof e || e % 1 !== 0)
  42062. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  42063. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  42064. throw RangeError(
  42065. 'Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength
  42066. )
  42067. }
  42068. var n,
  42069. r = e,
  42070. o = -1
  42071. return (
  42072. h.decodeUTF8toUTF16(
  42073. function () {
  42074. if (0 === o) return null
  42075. if (e >= this.limit)
  42076. throw RangeError('Illegal range: Truncated data, ' + e + ' < ' + this.limit)
  42077. return (o = this.view[e++]), 0 === o ? null : o
  42078. }.bind(this),
  42079. (n = i()),
  42080. !0
  42081. ),
  42082. t
  42083. ? ((this.offset = e), n())
  42084. : {
  42085. string: n(),
  42086. length: e - r
  42087. }
  42088. )
  42089. }),
  42090. (a.writeIString = function (e, i) {
  42091. var n = 'undefined' == typeof i
  42092. if ((n && (i = this.offset), !this.noAssert)) {
  42093. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  42094. if ('number' != typeof i || i % 1 !== 0)
  42095. throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  42096. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  42097. throw RangeError(
  42098. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  42099. )
  42100. }
  42101. var r,
  42102. o = i
  42103. ;(r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1]), (i += 4 + r)
  42104. var a = this.buffer.byteLength
  42105. if (
  42106. (i > a && this.resize((a *= 2) > i ? a : i),
  42107. (i -= 4 + r),
  42108. this.littleEndian
  42109. ? ((this.view[i + 3] = (r >>> 24) & 255),
  42110. (this.view[i + 2] = (r >>> 16) & 255),
  42111. (this.view[i + 1] = (r >>> 8) & 255),
  42112. (this.view[i] = 255 & r))
  42113. : ((this.view[i] = (r >>> 24) & 255),
  42114. (this.view[i + 1] = (r >>> 16) & 255),
  42115. (this.view[i + 2] = (r >>> 8) & 255),
  42116. (this.view[i + 3] = 255 & r)),
  42117. (i += 4),
  42118. h.encodeUTF16toUTF8(
  42119. t(e),
  42120. function (e) {
  42121. this.view[i++] = e
  42122. }.bind(this)
  42123. ),
  42124. i !== o + 4 + r)
  42125. )
  42126. throw RangeError('Illegal range: Truncated data, ' + i + ' == ' + (i + 4 + r))
  42127. return n ? ((this.offset = i), this) : i - o
  42128. }),
  42129. (a.readIString = function (e) {
  42130. var t = 'undefined' == typeof e
  42131. if ((t && (e = this.offset), !this.noAssert)) {
  42132. if ('number' != typeof e || e % 1 !== 0)
  42133. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  42134. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength))
  42135. throw RangeError(
  42136. 'Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength
  42137. )
  42138. }
  42139. var i = e,
  42140. n = this.readUint32(e),
  42141. r = this.readUTF8String(n, o.METRICS_BYTES, (e += 4))
  42142. return (
  42143. (e += r.length),
  42144. t
  42145. ? ((this.offset = e), r.string)
  42146. : {
  42147. string: r.string,
  42148. length: e - i
  42149. }
  42150. )
  42151. }),
  42152. (o.METRICS_CHARS = 'c'),
  42153. (o.METRICS_BYTES = 'b'),
  42154. (a.writeUTF8String = function (e, i) {
  42155. var n = 'undefined' == typeof i
  42156. if ((n && (i = this.offset), !this.noAssert)) {
  42157. if ('number' != typeof i || i % 1 !== 0)
  42158. throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  42159. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  42160. throw RangeError(
  42161. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  42162. )
  42163. }
  42164. var r,
  42165. o = i
  42166. ;(r = h.calculateUTF16asUTF8(t(e))[1]), (i += r)
  42167. var a = this.buffer.byteLength
  42168. return (
  42169. i > a && this.resize((a *= 2) > i ? a : i),
  42170. (i -= r),
  42171. h.encodeUTF16toUTF8(
  42172. t(e),
  42173. function (e) {
  42174. this.view[i++] = e
  42175. }.bind(this)
  42176. ),
  42177. n ? ((this.offset = i), this) : i - o
  42178. )
  42179. }),
  42180. (a.writeString = a.writeUTF8String),
  42181. (o.calculateUTF8Chars = function (e) {
  42182. return h.calculateUTF16asUTF8(t(e))[0]
  42183. }),
  42184. (o.calculateUTF8Bytes = function (e) {
  42185. return h.calculateUTF16asUTF8(t(e))[1]
  42186. }),
  42187. (o.calculateString = o.calculateUTF8Bytes),
  42188. (a.readUTF8String = function (e, t, n) {
  42189. 'number' == typeof t && ((n = t), (t = void 0))
  42190. var r = 'undefined' == typeof n
  42191. if (
  42192. (r && (n = this.offset),
  42193. 'undefined' == typeof t && (t = o.METRICS_CHARS),
  42194. !this.noAssert)
  42195. ) {
  42196. if ('number' != typeof e || e % 1 !== 0)
  42197. throw TypeError('Illegal length: ' + e + ' (not an integer)')
  42198. if (((e |= 0), 'number' != typeof n || n % 1 !== 0))
  42199. throw TypeError('Illegal offset: ' + n + ' (not an integer)')
  42200. if (((n >>>= 0), n < 0 || n + 0 > this.buffer.byteLength))
  42201. throw RangeError(
  42202. 'Illegal offset: 0 <= ' + n + ' (+0) <= ' + this.buffer.byteLength
  42203. )
  42204. }
  42205. var a,
  42206. s = 0,
  42207. l = n
  42208. if (t === o.METRICS_CHARS) {
  42209. if (
  42210. ((a = i()),
  42211. h.decodeUTF8(
  42212. function () {
  42213. return s < e && n < this.limit ? this.view[n++] : null
  42214. }.bind(this),
  42215. function (e) {
  42216. ++s, h.UTF8toUTF16(e, a)
  42217. }
  42218. ),
  42219. s !== e)
  42220. )
  42221. throw RangeError('Illegal range: Truncated data, ' + s + ' == ' + e)
  42222. return r
  42223. ? ((this.offset = n), a())
  42224. : {
  42225. string: a(),
  42226. length: n - l
  42227. }
  42228. }
  42229. if (t === o.METRICS_BYTES) {
  42230. if (!this.noAssert) {
  42231. if ('number' != typeof n || n % 1 !== 0)
  42232. throw TypeError('Illegal offset: ' + n + ' (not an integer)')
  42233. if (((n >>>= 0), n < 0 || n + e > this.buffer.byteLength))
  42234. throw RangeError(
  42235. 'Illegal offset: 0 <= ' + n + ' (+' + e + ') <= ' + this.buffer.byteLength
  42236. )
  42237. }
  42238. var c = n + e
  42239. if (
  42240. (h.decodeUTF8toUTF16(
  42241. function () {
  42242. return n < c ? this.view[n++] : null
  42243. }.bind(this),
  42244. (a = i()),
  42245. this.noAssert
  42246. ),
  42247. n !== c)
  42248. )
  42249. throw RangeError('Illegal range: Truncated data, ' + n + ' == ' + c)
  42250. return r
  42251. ? ((this.offset = n), a())
  42252. : {
  42253. string: a(),
  42254. length: n - l
  42255. }
  42256. }
  42257. throw TypeError('Unsupported metrics: ' + t)
  42258. }),
  42259. (a.readString = a.readUTF8String),
  42260. (a.writeVString = function (e, i) {
  42261. var n = 'undefined' == typeof i
  42262. if ((n && (i = this.offset), !this.noAssert)) {
  42263. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  42264. if ('number' != typeof i || i % 1 !== 0)
  42265. throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  42266. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  42267. throw RangeError(
  42268. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  42269. )
  42270. }
  42271. var r,
  42272. a,
  42273. s = i
  42274. ;(r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1]),
  42275. (a = o.calculateVarint32(r)),
  42276. (i += a + r)
  42277. var l = this.buffer.byteLength
  42278. if (
  42279. (i > l && this.resize((l *= 2) > i ? l : i),
  42280. (i -= a + r),
  42281. (i += this.writeVarint32(r, i)),
  42282. h.encodeUTF16toUTF8(
  42283. t(e),
  42284. function (e) {
  42285. this.view[i++] = e
  42286. }.bind(this)
  42287. ),
  42288. i !== s + r + a)
  42289. )
  42290. throw RangeError('Illegal range: Truncated data, ' + i + ' == ' + (i + r + a))
  42291. return n ? ((this.offset = i), this) : i - s
  42292. }),
  42293. (a.readVString = function (e) {
  42294. var t = 'undefined' == typeof e
  42295. if ((t && (e = this.offset), !this.noAssert)) {
  42296. if ('number' != typeof e || e % 1 !== 0)
  42297. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  42298. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength))
  42299. throw RangeError(
  42300. 'Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength
  42301. )
  42302. }
  42303. var i = e,
  42304. n = this.readVarint32(e),
  42305. r = this.readUTF8String(n.value, o.METRICS_BYTES, (e += n.length))
  42306. return (
  42307. (e += r.length),
  42308. t
  42309. ? ((this.offset = e), r.string)
  42310. : {
  42311. string: r.string,
  42312. length: e - i
  42313. }
  42314. )
  42315. }),
  42316. (a.append = function (e, t, i) {
  42317. ;('number' != typeof t && 'string' == typeof t) || ((i = t), (t = void 0))
  42318. var n = 'undefined' == typeof i
  42319. if ((n && (i = this.offset), !this.noAssert)) {
  42320. if ('number' != typeof i || i % 1 !== 0)
  42321. throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  42322. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  42323. throw RangeError(
  42324. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  42325. )
  42326. }
  42327. e instanceof o || (e = o.wrap(e, t))
  42328. var r = e.limit - e.offset
  42329. if (r <= 0) return this
  42330. i += r
  42331. var a = this.buffer.byteLength
  42332. return (
  42333. i > a && this.resize((a *= 2) > i ? a : i),
  42334. (i -= r),
  42335. this.view.set(e.view.subarray(e.offset, e.limit), i),
  42336. (e.offset += r),
  42337. n && (this.offset += r),
  42338. this
  42339. )
  42340. }),
  42341. (a.appendTo = function (e, t) {
  42342. return e.append(this, t), this
  42343. }),
  42344. (a.assert = function (e) {
  42345. return (this.noAssert = !e), this
  42346. }),
  42347. (a.capacity = function () {
  42348. return this.buffer.byteLength
  42349. }),
  42350. (a.clear = function () {
  42351. return (
  42352. (this.offset = 0),
  42353. (this.limit = this.buffer.byteLength),
  42354. (this.markedOffset = -1),
  42355. this
  42356. )
  42357. }),
  42358. (a.clone = function (e) {
  42359. var t = new o(0, this.littleEndian, this.noAssert)
  42360. return (
  42361. e
  42362. ? ((t.buffer = new ArrayBuffer(this.buffer.byteLength)),
  42363. (t.view = new Uint8Array(t.buffer)))
  42364. : ((t.buffer = this.buffer), (t.view = this.view)),
  42365. (t.offset = this.offset),
  42366. (t.markedOffset = this.markedOffset),
  42367. (t.limit = this.limit),
  42368. t
  42369. )
  42370. }),
  42371. (a.compact = function (e, t) {
  42372. if (
  42373. ('undefined' == typeof e && (e = this.offset),
  42374. 'undefined' == typeof t && (t = this.limit),
  42375. !this.noAssert)
  42376. ) {
  42377. if ('number' != typeof e || e % 1 !== 0)
  42378. throw TypeError('Illegal begin: Not an integer')
  42379. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42380. throw TypeError('Illegal end: Not an integer')
  42381. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42382. throw RangeError(
  42383. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42384. )
  42385. }
  42386. if (0 === e && t === this.buffer.byteLength) return this
  42387. var i = t - e
  42388. if (0 === i)
  42389. return (
  42390. (this.buffer = s),
  42391. (this.view = null),
  42392. this.markedOffset >= 0 && (this.markedOffset -= e),
  42393. (this.offset = 0),
  42394. (this.limit = 0),
  42395. this
  42396. )
  42397. var n = new ArrayBuffer(i),
  42398. r = new Uint8Array(n)
  42399. return (
  42400. r.set(this.view.subarray(e, t)),
  42401. (this.buffer = n),
  42402. (this.view = r),
  42403. this.markedOffset >= 0 && (this.markedOffset -= e),
  42404. (this.offset = 0),
  42405. (this.limit = i),
  42406. this
  42407. )
  42408. }),
  42409. (a.copy = function (e, t) {
  42410. if (
  42411. ('undefined' == typeof e && (e = this.offset),
  42412. 'undefined' == typeof t && (t = this.limit),
  42413. !this.noAssert)
  42414. ) {
  42415. if ('number' != typeof e || e % 1 !== 0)
  42416. throw TypeError('Illegal begin: Not an integer')
  42417. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42418. throw TypeError('Illegal end: Not an integer')
  42419. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42420. throw RangeError(
  42421. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42422. )
  42423. }
  42424. if (e === t) return new o(0, this.littleEndian, this.noAssert)
  42425. var i = t - e,
  42426. n = new o(i, this.littleEndian, this.noAssert)
  42427. return (
  42428. (n.offset = 0),
  42429. (n.limit = i),
  42430. n.markedOffset >= 0 && (n.markedOffset -= e),
  42431. this.copyTo(n, 0, e, t),
  42432. n
  42433. )
  42434. }),
  42435. (a.copyTo = function (e, t, i, n) {
  42436. var r, a
  42437. if (!this.noAssert && !o.isByteBuffer(e))
  42438. throw TypeError('Illegal target: Not a ByteBuffer')
  42439. if (
  42440. ((t = (a = 'undefined' == typeof t) ? e.offset : 0 | t),
  42441. (i = (r = 'undefined' == typeof i) ? this.offset : 0 | i),
  42442. (n = 'undefined' == typeof n ? this.limit : 0 | n),
  42443. t < 0 || t > e.buffer.byteLength)
  42444. )
  42445. throw RangeError('Illegal target range: 0 <= ' + t + ' <= ' + e.buffer.byteLength)
  42446. if (i < 0 || n > this.buffer.byteLength)
  42447. throw RangeError(
  42448. 'Illegal source range: 0 <= ' + i + ' <= ' + this.buffer.byteLength
  42449. )
  42450. var s = n - i
  42451. return 0 === s
  42452. ? e
  42453. : (e.ensureCapacity(t + s),
  42454. e.view.set(this.view.subarray(i, n), t),
  42455. r && (this.offset += s),
  42456. a && (e.offset += s),
  42457. this)
  42458. }),
  42459. (a.ensureCapacity = function (e) {
  42460. var t = this.buffer.byteLength
  42461. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  42462. }),
  42463. (a.fill = function (e, t, i) {
  42464. var n = 'undefined' == typeof t
  42465. if (
  42466. (n && (t = this.offset),
  42467. 'string' == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  42468. 'undefined' == typeof t && (t = this.offset),
  42469. 'undefined' == typeof i && (i = this.limit),
  42470. !this.noAssert)
  42471. ) {
  42472. if ('number' != typeof e || e % 1 !== 0)
  42473. throw TypeError('Illegal value: ' + e + ' (not an integer)')
  42474. if (((e |= 0), 'number' != typeof t || t % 1 !== 0))
  42475. throw TypeError('Illegal begin: Not an integer')
  42476. if (((t >>>= 0), 'number' != typeof i || i % 1 !== 0))
  42477. throw TypeError('Illegal end: Not an integer')
  42478. if (((i >>>= 0), t < 0 || t > i || i > this.buffer.byteLength))
  42479. throw RangeError(
  42480. 'Illegal range: 0 <= ' + t + ' <= ' + i + ' <= ' + this.buffer.byteLength
  42481. )
  42482. }
  42483. if (t >= i) return this
  42484. for (; t < i; ) this.view[t++] = e
  42485. return n && (this.offset = t), this
  42486. }),
  42487. (a.flip = function () {
  42488. return (this.limit = this.offset), (this.offset = 0), this
  42489. }),
  42490. (a.mark = function (e) {
  42491. if (((e = 'undefined' == typeof e ? this.offset : e), !this.noAssert)) {
  42492. if ('number' != typeof e || e % 1 !== 0)
  42493. throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  42494. if (((e >>>= 0), e < 0 || e + 0 > this.buffer.byteLength))
  42495. throw RangeError(
  42496. 'Illegal offset: 0 <= ' + e + ' (+0) <= ' + this.buffer.byteLength
  42497. )
  42498. }
  42499. return (this.markedOffset = e), this
  42500. }),
  42501. (a.order = function (e) {
  42502. if (!this.noAssert && 'boolean' != typeof e)
  42503. throw TypeError('Illegal littleEndian: Not a boolean')
  42504. return (this.littleEndian = !!e), this
  42505. }),
  42506. (a.LE = function (e) {
  42507. return (this.littleEndian = 'undefined' == typeof e || !!e), this
  42508. }),
  42509. (a.BE = function (e) {
  42510. return (this.littleEndian = 'undefined' != typeof e && !e), this
  42511. }),
  42512. (a.prepend = function (e, t, i) {
  42513. ;('number' != typeof t && 'string' == typeof t) || ((i = t), (t = void 0))
  42514. var n = 'undefined' == typeof i
  42515. if ((n && (i = this.offset), !this.noAssert)) {
  42516. if ('number' != typeof i || i % 1 !== 0)
  42517. throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  42518. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength))
  42519. throw RangeError(
  42520. 'Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength
  42521. )
  42522. }
  42523. e instanceof o || (e = o.wrap(e, t))
  42524. var r = e.limit - e.offset
  42525. if (r <= 0) return this
  42526. var a = r - i
  42527. if (a > 0) {
  42528. var s = new ArrayBuffer(this.buffer.byteLength + a),
  42529. l = new Uint8Array(s)
  42530. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  42531. (this.buffer = s),
  42532. (this.view = l),
  42533. (this.offset += a),
  42534. this.markedOffset >= 0 && (this.markedOffset += a),
  42535. (this.limit += a),
  42536. (i += a)
  42537. } else {
  42538. new Uint8Array(this.buffer)
  42539. }
  42540. return (
  42541. this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  42542. (e.offset = e.limit),
  42543. n && (this.offset -= r),
  42544. this
  42545. )
  42546. }),
  42547. (a.prependTo = function (e, t) {
  42548. return e.prepend(this, t), this
  42549. }),
  42550. (a.printDebug = function (e) {
  42551. 'function' != typeof e && (e = console.log.bind(console)),
  42552. e(
  42553. this.toString() +
  42554. '\n-------------------------------------------------------------------\n' +
  42555. this.toDebug(!0)
  42556. )
  42557. }),
  42558. (a.remaining = function () {
  42559. return this.limit - this.offset
  42560. }),
  42561. (a.reset = function () {
  42562. return (
  42563. this.markedOffset >= 0
  42564. ? ((this.offset = this.markedOffset), (this.markedOffset = -1))
  42565. : (this.offset = 0),
  42566. this
  42567. )
  42568. }),
  42569. (a.resize = function (e) {
  42570. if (!this.noAssert) {
  42571. if ('number' != typeof e || e % 1 !== 0)
  42572. throw TypeError('Illegal capacity: ' + e + ' (not an integer)')
  42573. if (((e |= 0), e < 0)) throw RangeError('Illegal capacity: 0 <= ' + e)
  42574. }
  42575. if (this.buffer.byteLength < e) {
  42576. var t = new ArrayBuffer(e),
  42577. i = new Uint8Array(t)
  42578. i.set(this.view), (this.buffer = t), (this.view = i)
  42579. }
  42580. return this
  42581. }),
  42582. (a.reverse = function (e, t) {
  42583. if (
  42584. ('undefined' == typeof e && (e = this.offset),
  42585. 'undefined' == typeof t && (t = this.limit),
  42586. !this.noAssert)
  42587. ) {
  42588. if ('number' != typeof e || e % 1 !== 0)
  42589. throw TypeError('Illegal begin: Not an integer')
  42590. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42591. throw TypeError('Illegal end: Not an integer')
  42592. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42593. throw RangeError(
  42594. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42595. )
  42596. }
  42597. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)), this)
  42598. }),
  42599. (a.skip = function (e) {
  42600. if (!this.noAssert) {
  42601. if ('number' != typeof e || e % 1 !== 0)
  42602. throw TypeError('Illegal length: ' + e + ' (not an integer)')
  42603. e |= 0
  42604. }
  42605. var t = this.offset + e
  42606. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  42607. throw RangeError(
  42608. 'Illegal length: 0 <= ' +
  42609. this.offset +
  42610. ' + ' +
  42611. e +
  42612. ' <= ' +
  42613. this.buffer.byteLength
  42614. )
  42615. return (this.offset = t), this
  42616. }),
  42617. (a.slice = function (e, t) {
  42618. if (
  42619. ('undefined' == typeof e && (e = this.offset),
  42620. 'undefined' == typeof t && (t = this.limit),
  42621. !this.noAssert)
  42622. ) {
  42623. if ('number' != typeof e || e % 1 !== 0)
  42624. throw TypeError('Illegal begin: Not an integer')
  42625. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42626. throw TypeError('Illegal end: Not an integer')
  42627. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42628. throw RangeError(
  42629. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42630. )
  42631. }
  42632. var i = this.clone()
  42633. return (i.offset = e), (i.limit = t), i
  42634. }),
  42635. (a.toBuffer = function (e) {
  42636. var t = this.offset,
  42637. i = this.limit
  42638. if (!this.noAssert) {
  42639. if ('number' != typeof t || t % 1 !== 0)
  42640. throw TypeError('Illegal offset: Not an integer')
  42641. if (((t >>>= 0), 'number' != typeof i || i % 1 !== 0))
  42642. throw TypeError('Illegal limit: Not an integer')
  42643. if (((i >>>= 0), t < 0 || t > i || i > this.buffer.byteLength))
  42644. throw RangeError(
  42645. 'Illegal range: 0 <= ' + t + ' <= ' + i + ' <= ' + this.buffer.byteLength
  42646. )
  42647. }
  42648. if (!e && 0 === t && i === this.buffer.byteLength) return this.buffer
  42649. if (t === i) return s
  42650. var n = new ArrayBuffer(i - t)
  42651. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0), n
  42652. }),
  42653. (a.toArrayBuffer = a.toBuffer),
  42654. (a.toString = function (e, t, i) {
  42655. if ('undefined' == typeof e)
  42656. return (
  42657. 'ByteBufferAB(offset=' +
  42658. this.offset +
  42659. ',markedOffset=' +
  42660. this.markedOffset +
  42661. ',limit=' +
  42662. this.limit +
  42663. ',capacity=' +
  42664. this.capacity() +
  42665. ')'
  42666. )
  42667. switch (('number' == typeof e && ((e = 'utf8'), (t = e), (i = t)), e)) {
  42668. case 'utf8':
  42669. return this.toUTF8(t, i)
  42670. case 'base64':
  42671. return this.toBase64(t, i)
  42672. case 'hex':
  42673. return this.toHex(t, i)
  42674. case 'binary':
  42675. return this.toBinary(t, i)
  42676. case 'debug':
  42677. return this.toDebug()
  42678. case 'columns':
  42679. return this.toColumns()
  42680. default:
  42681. throw Error('Unsupported encoding: ' + e)
  42682. }
  42683. })
  42684. var c = (function () {
  42685. for (
  42686. var e = {},
  42687. t = [
  42688. 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
  42689. 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
  42690. 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50,
  42691. 51, 52, 53, 54, 55, 56, 57, 43, 47
  42692. ],
  42693. i = [],
  42694. n = 0,
  42695. r = t.length;
  42696. n < r;
  42697. ++n
  42698. )
  42699. i[t[n]] = n
  42700. return (
  42701. (e.encode = function (e, i) {
  42702. for (var n, r; null !== (n = e()); )
  42703. i(t[(n >> 2) & 63]),
  42704. (r = (3 & n) << 4),
  42705. null !== (n = e())
  42706. ? ((r |= (n >> 4) & 15),
  42707. i(t[63 & (r | ((n >> 4) & 15))]),
  42708. (r = (15 & n) << 2),
  42709. null !== (n = e())
  42710. ? (i(t[63 & (r | ((n >> 6) & 3))]), i(t[63 & n]))
  42711. : (i(t[63 & r]), i(61)))
  42712. : (i(t[63 & r]), i(61), i(61))
  42713. }),
  42714. (e.decode = function (e, t) {
  42715. function n(e) {
  42716. throw Error('Illegal character code: ' + e)
  42717. }
  42718. for (var r, o, a; null !== (r = e()); )
  42719. if (
  42720. ((o = i[r]),
  42721. 'undefined' == typeof o && n(r),
  42722. null !== (r = e()) &&
  42723. ((a = i[r]),
  42724. 'undefined' == typeof a && n(r),
  42725. t(((o << 2) >>> 0) | ((48 & a) >> 4)),
  42726. null !== (r = e())))
  42727. ) {
  42728. if (((o = i[r]), 'undefined' == typeof o)) {
  42729. if (61 === r) break
  42730. n(r)
  42731. }
  42732. if ((t((((15 & a) << 4) >>> 0) | ((60 & o) >> 2)), null !== (r = e()))) {
  42733. if (((a = i[r]), 'undefined' == typeof a)) {
  42734. if (61 === r) break
  42735. n(r)
  42736. }
  42737. t((((3 & o) << 6) >>> 0) | a)
  42738. }
  42739. }
  42740. }),
  42741. (e.test = function (e) {
  42742. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  42743. }),
  42744. e
  42745. )
  42746. })()
  42747. ;(a.toBase64 = function (e, t) {
  42748. if (
  42749. ('undefined' == typeof e && (e = this.offset),
  42750. 'undefined' == typeof t && (t = this.limit),
  42751. (e |= 0),
  42752. (t |= 0),
  42753. e < 0 || t > this.capacity || e > t)
  42754. )
  42755. throw RangeError('begin, end')
  42756. var n
  42757. return (
  42758. c.encode(
  42759. function () {
  42760. return e < t ? this.view[e++] : null
  42761. }.bind(this),
  42762. (n = i())
  42763. ),
  42764. n()
  42765. )
  42766. }),
  42767. (o.fromBase64 = function (e, i) {
  42768. if ('string' != typeof e) throw TypeError('str')
  42769. var n = new o((e.length / 4) * 3, i),
  42770. r = 0
  42771. return (
  42772. c.decode(t(e), function (e) {
  42773. n.view[r++] = e
  42774. }),
  42775. (n.limit = r),
  42776. n
  42777. )
  42778. }),
  42779. (o.btoa = function (e) {
  42780. return o.fromBinary(e).toBase64()
  42781. }),
  42782. (o.atob = function (e) {
  42783. return o.fromBase64(e).toBinary()
  42784. }),
  42785. (a.toBinary = function (e, t) {
  42786. if (
  42787. ('undefined' == typeof e && (e = this.offset),
  42788. 'undefined' == typeof t && (t = this.limit),
  42789. (e |= 0),
  42790. (t |= 0),
  42791. e < 0 || t > this.capacity() || e > t)
  42792. )
  42793. throw RangeError('begin, end')
  42794. if (e === t) return ''
  42795. for (var i = [], n = []; e < t; )
  42796. i.push(this.view[e++]),
  42797. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)), (i = []))
  42798. return n.join('') + String.fromCharCode.apply(String, i)
  42799. }),
  42800. (o.fromBinary = function (e, t) {
  42801. if ('string' != typeof e) throw TypeError('str')
  42802. for (var i, n = 0, r = e.length, a = new o(r, t); n < r; ) {
  42803. if (((i = e.charCodeAt(n)), i > 255)) throw RangeError('illegal char code: ' + i)
  42804. a.view[n++] = i
  42805. }
  42806. return (a.limit = r), a
  42807. }),
  42808. (a.toDebug = function (e) {
  42809. for (var t, i = -1, n = this.buffer.byteLength, r = '', o = '', a = ''; i < n; ) {
  42810. if (
  42811. (i !== -1 &&
  42812. ((t = this.view[i]),
  42813. (r +=
  42814. t < 16 ? '0' + t.toString(16).toUpperCase() : t.toString(16).toUpperCase()),
  42815. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : '.')),
  42816. ++i,
  42817. e && i > 0 && i % 16 === 0 && i !== n)
  42818. ) {
  42819. for (; r.length < 51; ) r += ' '
  42820. ;(a += r + o + '\n'), (r = o = '')
  42821. }
  42822. r +=
  42823. i === this.offset && i === this.limit
  42824. ? i === this.markedOffset
  42825. ? '!'
  42826. : '|'
  42827. : i === this.offset
  42828. ? i === this.markedOffset
  42829. ? '['
  42830. : '<'
  42831. : i === this.limit
  42832. ? i === this.markedOffset
  42833. ? ']'
  42834. : '>'
  42835. : i === this.markedOffset
  42836. ? "'"
  42837. : e || (0 !== i && i !== n)
  42838. ? ' '
  42839. : ''
  42840. }
  42841. if (e && ' ' !== r) {
  42842. for (; r.length < 51; ) r += ' '
  42843. a += r + o + '\n'
  42844. }
  42845. return e ? a : r
  42846. }),
  42847. (o.fromDebug = function (e, t, i) {
  42848. for (
  42849. var n,
  42850. r,
  42851. a = e.length,
  42852. s = new o(((a + 1) / 3) | 0, t, i),
  42853. l = 0,
  42854. c = 0,
  42855. h = !1,
  42856. u = !1,
  42857. d = !1,
  42858. p = !1,
  42859. f = !1;
  42860. l < a;
  42861. ) {
  42862. switch ((n = e.charAt(l++))) {
  42863. case '!':
  42864. if (!i) {
  42865. if (u || d || p) {
  42866. f = !0
  42867. break
  42868. }
  42869. u = d = p = !0
  42870. }
  42871. ;(s.offset = s.markedOffset = s.limit = c), (h = !1)
  42872. break
  42873. case '|':
  42874. if (!i) {
  42875. if (u || p) {
  42876. f = !0
  42877. break
  42878. }
  42879. u = p = !0
  42880. }
  42881. ;(s.offset = s.limit = c), (h = !1)
  42882. break
  42883. case '[':
  42884. if (!i) {
  42885. if (u || d) {
  42886. f = !0
  42887. break
  42888. }
  42889. u = d = !0
  42890. }
  42891. ;(s.offset = s.markedOffset = c), (h = !1)
  42892. break
  42893. case '<':
  42894. if (!i) {
  42895. if (u) {
  42896. f = !0
  42897. break
  42898. }
  42899. u = !0
  42900. }
  42901. ;(s.offset = c), (h = !1)
  42902. break
  42903. case ']':
  42904. if (!i) {
  42905. if (p || d) {
  42906. f = !0
  42907. break
  42908. }
  42909. p = d = !0
  42910. }
  42911. ;(s.limit = s.markedOffset = c), (h = !1)
  42912. break
  42913. case '>':
  42914. if (!i) {
  42915. if (p) {
  42916. f = !0
  42917. break
  42918. }
  42919. p = !0
  42920. }
  42921. ;(s.limit = c), (h = !1)
  42922. break
  42923. case "'":
  42924. if (!i) {
  42925. if (d) {
  42926. f = !0
  42927. break
  42928. }
  42929. d = !0
  42930. }
  42931. ;(s.markedOffset = c), (h = !1)
  42932. break
  42933. case ' ':
  42934. h = !1
  42935. break
  42936. default:
  42937. if (!i && h) {
  42938. f = !0
  42939. break
  42940. }
  42941. if (
  42942. ((r = parseInt(n + e.charAt(l++), 16)), !i && (isNaN(r) || r < 0 || r > 255))
  42943. )
  42944. throw TypeError('Illegal str: Not a debug encoded string')
  42945. ;(s.view[c++] = r), (h = !0)
  42946. }
  42947. if (f) throw TypeError('Illegal str: Invalid symbol at ' + l)
  42948. }
  42949. if (!i) {
  42950. if (!u || !p) throw TypeError('Illegal str: Missing offset or limit')
  42951. if (c < s.buffer.byteLength)
  42952. throw TypeError(
  42953. 'Illegal str: Not a debug encoded string (is it hex?) ' + c + ' < ' + a
  42954. )
  42955. }
  42956. return s
  42957. }),
  42958. (a.toHex = function (e, t) {
  42959. if (
  42960. ((e = 'undefined' == typeof e ? this.offset : e),
  42961. (t = 'undefined' == typeof t ? this.limit : t),
  42962. !this.noAssert)
  42963. ) {
  42964. if ('number' != typeof e || e % 1 !== 0)
  42965. throw TypeError('Illegal begin: Not an integer')
  42966. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  42967. throw TypeError('Illegal end: Not an integer')
  42968. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  42969. throw RangeError(
  42970. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  42971. )
  42972. }
  42973. for (var i, n = new Array(t - e); e < t; )
  42974. (i = this.view[e++]), i < 16 ? n.push('0', i.toString(16)) : n.push(i.toString(16))
  42975. return n.join('')
  42976. }),
  42977. (o.fromHex = function (e, t, i) {
  42978. if (!i) {
  42979. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  42980. if (e.length % 2 !== 0) throw TypeError('Illegal str: Length not a multiple of 2')
  42981. }
  42982. for (var n, r = e.length, a = new o((r / 2) | 0, t), s = 0, l = 0; s < r; s += 2) {
  42983. if (
  42984. ((n = parseInt(e.substring(s, s + 2), 16)),
  42985. !i && (!isFinite(n) || n < 0 || n > 255))
  42986. )
  42987. throw TypeError('Illegal str: Contains non-hex characters')
  42988. a.view[l++] = n
  42989. }
  42990. return (a.limit = l), a
  42991. })
  42992. var h = (function () {
  42993. var e = {}
  42994. return (
  42995. (e.MAX_CODEPOINT = 1114111),
  42996. (e.encodeUTF8 = function (e, t) {
  42997. var i = null
  42998. for (
  42999. 'number' == typeof e &&
  43000. ((i = e),
  43001. (e = function () {
  43002. return null
  43003. }));
  43004. null !== i || null !== (i = e());
  43005. )
  43006. i < 128
  43007. ? t(127 & i)
  43008. : i < 2048
  43009. ? (t(((i >> 6) & 31) | 192), t((63 & i) | 128))
  43010. : i < 65536
  43011. ? (t(((i >> 12) & 15) | 224), t(((i >> 6) & 63) | 128), t((63 & i) | 128))
  43012. : (t(((i >> 18) & 7) | 240),
  43013. t(((i >> 12) & 63) | 128),
  43014. t(((i >> 6) & 63) | 128),
  43015. t((63 & i) | 128)),
  43016. (i = null)
  43017. }),
  43018. (e.decodeUTF8 = function (e, t) {
  43019. for (
  43020. var i,
  43021. n,
  43022. r,
  43023. o,
  43024. a = function (e) {
  43025. e = e.slice(0, e.indexOf(null))
  43026. var t = Error(e.toString())
  43027. throw ((t.name = 'TruncatedError'), (t.bytes = e), t)
  43028. };
  43029. null !== (i = e());
  43030. )
  43031. if (0 === (128 & i)) t(i)
  43032. else if (192 === (224 & i))
  43033. null === (n = e()) && a([i, n]), t(((31 & i) << 6) | (63 & n))
  43034. else if (224 === (240 & i))
  43035. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  43036. t(((15 & i) << 12) | ((63 & n) << 6) | (63 & r))
  43037. else {
  43038. if (240 !== (248 & i)) throw RangeError('Illegal starting byte: ' + i)
  43039. ;(null === (n = e()) || null === (r = e()) || null === (o = e())) &&
  43040. a([i, n, r, o]),
  43041. t(((7 & i) << 18) | ((63 & n) << 12) | ((63 & r) << 6) | (63 & o))
  43042. }
  43043. }),
  43044. (e.UTF16toUTF8 = function (e, t) {
  43045. for (var i, n = null; ; ) {
  43046. if (null === (i = null !== n ? n : e())) break
  43047. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343
  43048. ? (t(1024 * (i - 55296) + n - 56320 + 65536), (n = null))
  43049. : t(i)
  43050. }
  43051. null !== n && t(n)
  43052. }),
  43053. (e.UTF8toUTF16 = function (e, t) {
  43054. var i = null
  43055. for (
  43056. 'number' == typeof e &&
  43057. ((i = e),
  43058. (e = function () {
  43059. return null
  43060. }));
  43061. null !== i || null !== (i = e());
  43062. )
  43063. i <= 65535 ? t(i) : ((i -= 65536), t((i >> 10) + 55296), t((i % 1024) + 56320)),
  43064. (i = null)
  43065. }),
  43066. (e.encodeUTF16toUTF8 = function (t, i) {
  43067. e.UTF16toUTF8(t, function (t) {
  43068. e.encodeUTF8(t, i)
  43069. })
  43070. }),
  43071. (e.decodeUTF8toUTF16 = function (t, i) {
  43072. e.decodeUTF8(t, function (t) {
  43073. e.UTF8toUTF16(t, i)
  43074. })
  43075. }),
  43076. (e.calculateCodePoint = function (e) {
  43077. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  43078. }),
  43079. (e.calculateUTF8 = function (e) {
  43080. for (var t, i = 0; null !== (t = e()); )
  43081. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4
  43082. return i
  43083. }),
  43084. (e.calculateUTF16asUTF8 = function (t) {
  43085. var i = 0,
  43086. n = 0
  43087. return (
  43088. e.UTF16toUTF8(t, function (e) {
  43089. ++i, (n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4)
  43090. }),
  43091. [i, n]
  43092. )
  43093. }),
  43094. e
  43095. )
  43096. })()
  43097. return (
  43098. (a.toUTF8 = function (e, t) {
  43099. if (
  43100. ('undefined' == typeof e && (e = this.offset),
  43101. 'undefined' == typeof t && (t = this.limit),
  43102. !this.noAssert)
  43103. ) {
  43104. if ('number' != typeof e || e % 1 !== 0)
  43105. throw TypeError('Illegal begin: Not an integer')
  43106. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0))
  43107. throw TypeError('Illegal end: Not an integer')
  43108. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength))
  43109. throw RangeError(
  43110. 'Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength
  43111. )
  43112. }
  43113. var n
  43114. try {
  43115. h.decodeUTF8toUTF16(
  43116. function () {
  43117. return e < t ? this.view[e++] : null
  43118. }.bind(this),
  43119. (n = i())
  43120. )
  43121. } catch (i) {
  43122. if (e !== t) throw RangeError('Illegal range: Truncated data, ' + e + ' != ' + t)
  43123. }
  43124. return n()
  43125. }),
  43126. (o.fromUTF8 = function (e, i, n) {
  43127. if (!n && 'string' != typeof e) throw TypeError('Illegal str: Not a string')
  43128. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1], i, n),
  43129. a = 0
  43130. return (
  43131. h.encodeUTF16toUTF8(t(e), function (e) {
  43132. r.view[a++] = e
  43133. }),
  43134. (r.limit = a),
  43135. r
  43136. )
  43137. }),
  43138. o
  43139. )
  43140. })
  43141. },
  43142. {
  43143. long: 216
  43144. }
  43145. ],
  43146. 216: [
  43147. function (e, t, i) {
  43148. !(function (i, n) {
  43149. 'function' == typeof define && define.amd
  43150. ? define([], n)
  43151. : 'function' == typeof e && 'object' == typeof t && t && t.exports
  43152. ? (t.exports = n())
  43153. : ((i.dcodeIO = i.dcodeIO || {}).Long = n())
  43154. })(this, function () {
  43155. 'use strict'
  43156. function e(e, t, i) {
  43157. ;(this.low = 0 | e), (this.high = 0 | t), (this.unsigned = !!i)
  43158. }
  43159. function t(e) {
  43160. return (e && e.__isLong__) === !0
  43161. }
  43162. function i(e, t) {
  43163. var i, n, o
  43164. return t
  43165. ? ((e >>>= 0),
  43166. (o = 0 <= e && e < 256) && (n = l[e])
  43167. ? n
  43168. : ((i = r(e, (0 | e) < 0 ? -1 : 0, !0)), o && (l[e] = i), i))
  43169. : ((e |= 0),
  43170. (o = -128 <= e && e < 128) && (n = s[e])
  43171. ? n
  43172. : ((i = r(e, e < 0 ? -1 : 0, !1)), o && (s[e] = i), i))
  43173. }
  43174. function n(e, t) {
  43175. if (isNaN(e) || !isFinite(e)) return t ? m : g
  43176. if (t) {
  43177. if (e < 0) return m
  43178. if (e >= d) return I
  43179. } else {
  43180. if (e <= -p) return E
  43181. if (e + 1 >= p) return C
  43182. }
  43183. return e < 0 ? n(-e, t).neg() : r(e % u | 0, (e / u) | 0, t)
  43184. }
  43185. function r(t, i, n) {
  43186. return new e(t, i, n)
  43187. }
  43188. function o(e, t, i) {
  43189. if (0 === e.length) throw Error('empty string')
  43190. if ('NaN' === e || 'Infinity' === e || '+Infinity' === e || '-Infinity' === e) return g
  43191. if (
  43192. ('number' == typeof t ? ((i = t), (t = !1)) : (t = !!t),
  43193. (i = i || 10),
  43194. i < 2 || 36 < i)
  43195. )
  43196. throw RangeError('radix')
  43197. var r
  43198. if ((r = e.indexOf('-')) > 0) throw Error('interior hyphen')
  43199. if (0 === r) return o(e.substring(1), t, i).neg()
  43200. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  43201. var h = Math.min(8, e.length - l),
  43202. u = parseInt(e.substring(l, l + h), i)
  43203. if (h < 8) {
  43204. var d = n(c(i, h))
  43205. s = s.mul(d).add(n(u))
  43206. } else (s = s.mul(a)), (s = s.add(n(u)))
  43207. }
  43208. return (s.unsigned = t), s
  43209. }
  43210. function a(t) {
  43211. return t instanceof e
  43212. ? t
  43213. : 'number' == typeof t
  43214. ? n(t)
  43215. : 'string' == typeof t
  43216. ? o(t)
  43217. : r(t.low, t.high, t.unsigned)
  43218. }
  43219. e.prototype.__isLong__,
  43220. Object.defineProperty(e.prototype, '__isLong__', {
  43221. value: !0,
  43222. enumerable: !1,
  43223. configurable: !1
  43224. }),
  43225. (e.isLong = t)
  43226. var s = {},
  43227. l = {}
  43228. ;(e.fromInt = i), (e.fromNumber = n), (e.fromBits = r)
  43229. var c = Math.pow
  43230. ;(e.fromString = o), (e.fromValue = a)
  43231. var h = 1 << 24,
  43232. u = 4294967296,
  43233. d = 0x10000000000000000,
  43234. p = d / 2,
  43235. f = i(h),
  43236. g = i(0)
  43237. e.ZERO = g
  43238. var m = i(0, !0)
  43239. e.UZERO = m
  43240. var v = i(1)
  43241. e.ONE = v
  43242. var A = i(1, !0)
  43243. e.UONE = A
  43244. var y = i(-1)
  43245. e.NEG_ONE = y
  43246. var C = r(-1, 2147483647, !1)
  43247. e.MAX_VALUE = C
  43248. var I = r(-1, -1, !0)
  43249. e.MAX_UNSIGNED_VALUE = I
  43250. var E = r(0, -2147483648, !1)
  43251. e.MIN_VALUE = E
  43252. var b = e.prototype
  43253. return (
  43254. (b.toInt = function () {
  43255. return this.unsigned ? this.low >>> 0 : this.low
  43256. }),
  43257. (b.toNumber = function () {
  43258. return this.unsigned
  43259. ? (this.high >>> 0) * u + (this.low >>> 0)
  43260. : this.high * u + (this.low >>> 0)
  43261. }),
  43262. (b.toString = function (e) {
  43263. if (((e = e || 10), e < 2 || 36 < e)) throw RangeError('radix')
  43264. if (this.isZero()) return '0'
  43265. if (this.isNegative()) {
  43266. if (this.eq(E)) {
  43267. var t = n(e),
  43268. i = this.div(t),
  43269. r = i.mul(t).sub(this)
  43270. return i.toString(e) + r.toInt().toString(e)
  43271. }
  43272. return '-' + this.neg().toString(e)
  43273. }
  43274. for (var o = n(c(e, 6), this.unsigned), a = this, s = ''; ; ) {
  43275. var l = a.div(o),
  43276. h = a.sub(l.mul(o)).toInt() >>> 0,
  43277. u = h.toString(e)
  43278. if (((a = l), a.isZero())) return u + s
  43279. for (; u.length < 6; ) u = '0' + u
  43280. s = '' + u + s
  43281. }
  43282. }),
  43283. (b.getHighBits = function () {
  43284. return this.high
  43285. }),
  43286. (b.getHighBitsUnsigned = function () {
  43287. return this.high >>> 0
  43288. }),
  43289. (b.getLowBits = function () {
  43290. return this.low
  43291. }),
  43292. (b.getLowBitsUnsigned = function () {
  43293. return this.low >>> 0
  43294. }),
  43295. (b.getNumBitsAbs = function () {
  43296. if (this.isNegative()) return this.eq(E) ? 64 : this.neg().getNumBitsAbs()
  43297. for (
  43298. var e = 0 != this.high ? this.high : this.low, t = 31;
  43299. t > 0 && 0 == (e & (1 << t));
  43300. t--
  43301. );
  43302. return 0 != this.high ? t + 33 : t + 1
  43303. }),
  43304. (b.isZero = function () {
  43305. return 0 === this.high && 0 === this.low
  43306. }),
  43307. (b.isNegative = function () {
  43308. return !this.unsigned && this.high < 0
  43309. }),
  43310. (b.isPositive = function () {
  43311. return this.unsigned || this.high >= 0
  43312. }),
  43313. (b.isOdd = function () {
  43314. return 1 === (1 & this.low)
  43315. }),
  43316. (b.isEven = function () {
  43317. return 0 === (1 & this.low)
  43318. }),
  43319. (b.equals = function (e) {
  43320. return (
  43321. t(e) || (e = a(e)),
  43322. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) &&
  43323. this.high === e.high &&
  43324. this.low === e.low
  43325. )
  43326. }),
  43327. (b.eq = b.equals),
  43328. (b.notEquals = function (e) {
  43329. return !this.eq(e)
  43330. }),
  43331. (b.neq = b.notEquals),
  43332. (b.lessThan = function (e) {
  43333. return this.comp(e) < 0
  43334. }),
  43335. (b.lt = b.lessThan),
  43336. (b.lessThanOrEqual = function (e) {
  43337. return this.comp(e) <= 0
  43338. }),
  43339. (b.lte = b.lessThanOrEqual),
  43340. (b.greaterThan = function (e) {
  43341. return this.comp(e) > 0
  43342. }),
  43343. (b.gt = b.greaterThan),
  43344. (b.greaterThanOrEqual = function (e) {
  43345. return this.comp(e) >= 0
  43346. }),
  43347. (b.gte = b.greaterThanOrEqual),
  43348. (b.compare = function (e) {
  43349. if ((t(e) || (e = a(e)), this.eq(e))) return 0
  43350. var i = this.isNegative(),
  43351. n = e.isNegative()
  43352. return i && !n
  43353. ? -1
  43354. : !i && n
  43355. ? 1
  43356. : this.unsigned
  43357. ? e.high >>> 0 > this.high >>> 0 ||
  43358. (e.high === this.high && e.low >>> 0 > this.low >>> 0)
  43359. ? -1
  43360. : 1
  43361. : this.sub(e).isNegative()
  43362. ? -1
  43363. : 1
  43364. }),
  43365. (b.comp = b.compare),
  43366. (b.negate = function () {
  43367. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  43368. }),
  43369. (b.neg = b.negate),
  43370. (b.add = function (e) {
  43371. t(e) || (e = a(e))
  43372. var i = this.high >>> 16,
  43373. n = 65535 & this.high,
  43374. o = this.low >>> 16,
  43375. s = 65535 & this.low,
  43376. l = e.high >>> 16,
  43377. c = 65535 & e.high,
  43378. h = e.low >>> 16,
  43379. u = 65535 & e.low,
  43380. d = 0,
  43381. p = 0,
  43382. f = 0,
  43383. g = 0
  43384. return (
  43385. (g += s + u),
  43386. (f += g >>> 16),
  43387. (g &= 65535),
  43388. (f += o + h),
  43389. (p += f >>> 16),
  43390. (f &= 65535),
  43391. (p += n + c),
  43392. (d += p >>> 16),
  43393. (p &= 65535),
  43394. (d += i + l),
  43395. (d &= 65535),
  43396. r((f << 16) | g, (d << 16) | p, this.unsigned)
  43397. )
  43398. }),
  43399. (b.subtract = function (e) {
  43400. return t(e) || (e = a(e)), this.add(e.neg())
  43401. }),
  43402. (b.sub = b.subtract),
  43403. (b.multiply = function (e) {
  43404. if (this.isZero()) return g
  43405. if ((t(e) || (e = a(e)), e.isZero())) return g
  43406. if (this.eq(E)) return e.isOdd() ? E : g
  43407. if (e.eq(E)) return this.isOdd() ? E : g
  43408. if (this.isNegative())
  43409. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg()
  43410. if (e.isNegative()) return this.mul(e.neg()).neg()
  43411. if (this.lt(f) && e.lt(f)) return n(this.toNumber() * e.toNumber(), this.unsigned)
  43412. var i = this.high >>> 16,
  43413. o = 65535 & this.high,
  43414. s = this.low >>> 16,
  43415. l = 65535 & this.low,
  43416. c = e.high >>> 16,
  43417. h = 65535 & e.high,
  43418. u = e.low >>> 16,
  43419. d = 65535 & e.low,
  43420. p = 0,
  43421. m = 0,
  43422. v = 0,
  43423. A = 0
  43424. return (
  43425. (A += l * d),
  43426. (v += A >>> 16),
  43427. (A &= 65535),
  43428. (v += s * d),
  43429. (m += v >>> 16),
  43430. (v &= 65535),
  43431. (v += l * u),
  43432. (m += v >>> 16),
  43433. (v &= 65535),
  43434. (m += o * d),
  43435. (p += m >>> 16),
  43436. (m &= 65535),
  43437. (m += s * u),
  43438. (p += m >>> 16),
  43439. (m &= 65535),
  43440. (m += l * h),
  43441. (p += m >>> 16),
  43442. (m &= 65535),
  43443. (p += i * d + o * u + s * h + l * c),
  43444. (p &= 65535),
  43445. r((v << 16) | A, (p << 16) | m, this.unsigned)
  43446. )
  43447. }),
  43448. (b.mul = b.multiply),
  43449. (b.divide = function (e) {
  43450. if ((t(e) || (e = a(e)), e.isZero())) throw Error('division by zero')
  43451. if (this.isZero()) return this.unsigned ? m : g
  43452. var i, r, o
  43453. if (this.unsigned) {
  43454. if ((e.unsigned || (e = e.toUnsigned()), e.gt(this))) return m
  43455. if (e.gt(this.shru(1))) return A
  43456. o = m
  43457. } else {
  43458. if (this.eq(E)) {
  43459. if (e.eq(v) || e.eq(y)) return E
  43460. if (e.eq(E)) return v
  43461. var s = this.shr(1)
  43462. return (
  43463. (i = s.div(e).shl(1)),
  43464. i.eq(g)
  43465. ? e.isNegative()
  43466. ? v
  43467. : y
  43468. : ((r = this.sub(e.mul(i))), (o = i.add(r.div(e))))
  43469. )
  43470. }
  43471. if (e.eq(E)) return this.unsigned ? m : g
  43472. if (this.isNegative())
  43473. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg()
  43474. if (e.isNegative()) return this.div(e.neg()).neg()
  43475. o = g
  43476. }
  43477. for (r = this; r.gte(e); ) {
  43478. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()))
  43479. for (
  43480. var l = Math.ceil(Math.log(i) / Math.LN2),
  43481. h = l <= 48 ? 1 : c(2, l - 48),
  43482. u = n(i),
  43483. d = u.mul(e);
  43484. d.isNegative() || d.gt(r);
  43485. )
  43486. (i -= h), (u = n(i, this.unsigned)), (d = u.mul(e))
  43487. u.isZero() && (u = v), (o = o.add(u)), (r = r.sub(d))
  43488. }
  43489. return o
  43490. }),
  43491. (b.div = b.divide),
  43492. (b.modulo = function (e) {
  43493. return t(e) || (e = a(e)), this.sub(this.div(e).mul(e))
  43494. }),
  43495. (b.mod = b.modulo),
  43496. (b.not = function () {
  43497. return r(~this.low, ~this.high, this.unsigned)
  43498. }),
  43499. (b.and = function (e) {
  43500. return t(e) || (e = a(e)), r(this.low & e.low, this.high & e.high, this.unsigned)
  43501. }),
  43502. (b.or = function (e) {
  43503. return t(e) || (e = a(e)), r(this.low | e.low, this.high | e.high, this.unsigned)
  43504. }),
  43505. (b.xor = function (e) {
  43506. return t(e) || (e = a(e)), r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  43507. }),
  43508. (b.shiftLeft = function (e) {
  43509. return (
  43510. t(e) && (e = e.toInt()),
  43511. 0 === (e &= 63)
  43512. ? this
  43513. : e < 32
  43514. ? r(this.low << e, (this.high << e) | (this.low >>> (32 - e)), this.unsigned)
  43515. : r(0, this.low << (e - 32), this.unsigned)
  43516. )
  43517. }),
  43518. (b.shl = b.shiftLeft),
  43519. (b.shiftRight = function (e) {
  43520. return (
  43521. t(e) && (e = e.toInt()),
  43522. 0 === (e &= 63)
  43523. ? this
  43524. : e < 32
  43525. ? r((this.low >>> e) | (this.high << (32 - e)), this.high >> e, this.unsigned)
  43526. : r(this.high >> (e - 32), this.high >= 0 ? 0 : -1, this.unsigned)
  43527. )
  43528. }),
  43529. (b.shr = b.shiftRight),
  43530. (b.shiftRightUnsigned = function (e) {
  43531. if ((t(e) && (e = e.toInt()), (e &= 63), 0 === e)) return this
  43532. var i = this.high
  43533. if (e < 32) {
  43534. var n = this.low
  43535. return r((n >>> e) | (i << (32 - e)), i >>> e, this.unsigned)
  43536. }
  43537. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> (e - 32), 0, this.unsigned)
  43538. }),
  43539. (b.shru = b.shiftRightUnsigned),
  43540. (b.toSigned = function () {
  43541. return this.unsigned ? r(this.low, this.high, !1) : this
  43542. }),
  43543. (b.toUnsigned = function () {
  43544. return this.unsigned ? this : r(this.low, this.high, !0)
  43545. }),
  43546. (b.toBytes = function (e) {
  43547. return e ? this.toBytesLE() : this.toBytesBE()
  43548. }),
  43549. (b.toBytesLE = function () {
  43550. var e = this.high,
  43551. t = this.low
  43552. return [
  43553. 255 & t,
  43554. (t >>> 8) & 255,
  43555. (t >>> 16) & 255,
  43556. (t >>> 24) & 255,
  43557. 255 & e,
  43558. (e >>> 8) & 255,
  43559. (e >>> 16) & 255,
  43560. (e >>> 24) & 255
  43561. ]
  43562. }),
  43563. (b.toBytesBE = function () {
  43564. var e = this.high,
  43565. t = this.low
  43566. return [
  43567. (e >>> 24) & 255,
  43568. (e >>> 16) & 255,
  43569. (e >>> 8) & 255,
  43570. 255 & e,
  43571. (t >>> 24) & 255,
  43572. (t >>> 16) & 255,
  43573. (t >>> 8) & 255,
  43574. 255 & t
  43575. ]
  43576. }),
  43577. e
  43578. )
  43579. })
  43580. },
  43581. {}
  43582. ],
  43583. 217: [
  43584. function (e, t, i) {
  43585. var n = {
  43586. REVISION: '75'
  43587. }
  43588. 'function' == typeof define && define.amd
  43589. ? define('three', n)
  43590. : 'undefined' != typeof i && 'undefined' != typeof t && (t.exports = n),
  43591. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  43592. void 0 === Math.sign &&
  43593. (Math.sign = function (e) {
  43594. return e < 0 ? -1 : e > 0 ? 1 : +e
  43595. }),
  43596. void 0 === Function.prototype.name &&
  43597. void 0 !== Object.defineProperty &&
  43598. Object.defineProperty(Function.prototype, 'name', {
  43599. get: function () {
  43600. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  43601. }
  43602. }),
  43603. void 0 === Object.assign &&
  43604. Object.defineProperty(Object, 'assign', {
  43605. writable: !0,
  43606. configurable: !0,
  43607. value: function (e) {
  43608. 'use strict'
  43609. if (void 0 === e || null === e)
  43610. throw new TypeError('Cannot convert first argument to object')
  43611. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  43612. var r = arguments[i]
  43613. if (void 0 !== r && null !== r) {
  43614. r = Object(r)
  43615. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  43616. var l = o[a],
  43617. c = Object.getOwnPropertyDescriptor(r, l)
  43618. void 0 !== c && c.enumerable && (t[l] = r[l])
  43619. }
  43620. }
  43621. }
  43622. return t
  43623. }
  43624. }),
  43625. (n.MOUSE = {
  43626. LEFT: 0,
  43627. MIDDLE: 1,
  43628. RIGHT: 2
  43629. }),
  43630. (n.CullFaceNone = 0),
  43631. (n.CullFaceBack = 1),
  43632. (n.CullFaceFront = 2),
  43633. (n.CullFaceFrontBack = 3),
  43634. (n.FrontFaceDirectionCW = 0),
  43635. (n.FrontFaceDirectionCCW = 1),
  43636. (n.BasicShadowMap = 0),
  43637. (n.PCFShadowMap = 1),
  43638. (n.PCFSoftShadowMap = 2),
  43639. (n.FrontSide = 0),
  43640. (n.BackSide = 1),
  43641. (n.DoubleSide = 2),
  43642. (n.FlatShading = 1),
  43643. (n.SmoothShading = 2),
  43644. (n.NoColors = 0),
  43645. (n.FaceColors = 1),
  43646. (n.VertexColors = 2),
  43647. (n.NoBlending = 0),
  43648. (n.NormalBlending = 1),
  43649. (n.AdditiveBlending = 2),
  43650. (n.SubtractiveBlending = 3),
  43651. (n.MultiplyBlending = 4),
  43652. (n.CustomBlending = 5),
  43653. (n.AddEquation = 100),
  43654. (n.SubtractEquation = 101),
  43655. (n.ReverseSubtractEquation = 102),
  43656. (n.MinEquation = 103),
  43657. (n.MaxEquation = 104),
  43658. (n.ZeroFactor = 200),
  43659. (n.OneFactor = 201),
  43660. (n.SrcColorFactor = 202),
  43661. (n.OneMinusSrcColorFactor = 203),
  43662. (n.SrcAlphaFactor = 204),
  43663. (n.OneMinusSrcAlphaFactor = 205),
  43664. (n.DstAlphaFactor = 206),
  43665. (n.OneMinusDstAlphaFactor = 207),
  43666. (n.DstColorFactor = 208),
  43667. (n.OneMinusDstColorFactor = 209),
  43668. (n.SrcAlphaSaturateFactor = 210),
  43669. (n.NeverDepth = 0),
  43670. (n.AlwaysDepth = 1),
  43671. (n.LessDepth = 2),
  43672. (n.LessEqualDepth = 3),
  43673. (n.EqualDepth = 4),
  43674. (n.GreaterEqualDepth = 5),
  43675. (n.GreaterDepth = 6),
  43676. (n.NotEqualDepth = 7),
  43677. (n.MultiplyOperation = 0),
  43678. (n.MixOperation = 1),
  43679. (n.AddOperation = 2),
  43680. (n.NoToneMapping = 0),
  43681. (n.LinearToneMapping = 1),
  43682. (n.ReinhardToneMapping = 2),
  43683. (n.Uncharted2ToneMapping = 3),
  43684. (n.CineonToneMapping = 4),
  43685. (n.UVMapping = 300),
  43686. (n.CubeReflectionMapping = 301),
  43687. (n.CubeRefractionMapping = 302),
  43688. (n.EquirectangularReflectionMapping = 303),
  43689. (n.EquirectangularRefractionMapping = 304),
  43690. (n.SphericalReflectionMapping = 305),
  43691. (n.CubeUVReflectionMapping = 306),
  43692. (n.CubeUVRefractionMapping = 307),
  43693. (n.RepeatWrapping = 1e3),
  43694. (n.ClampToEdgeWrapping = 1001),
  43695. (n.MirroredRepeatWrapping = 1002),
  43696. (n.NearestFilter = 1003),
  43697. (n.NearestMipMapNearestFilter = 1004),
  43698. (n.NearestMipMapLinearFilter = 1005),
  43699. (n.LinearFilter = 1006),
  43700. (n.LinearMipMapNearestFilter = 1007),
  43701. (n.LinearMipMapLinearFilter = 1008),
  43702. (n.UnsignedByteType = 1009),
  43703. (n.ByteType = 1010),
  43704. (n.ShortType = 1011),
  43705. (n.UnsignedShortType = 1012),
  43706. (n.IntType = 1013),
  43707. (n.UnsignedIntType = 1014),
  43708. (n.FloatType = 1015),
  43709. (n.HalfFloatType = 1025),
  43710. (n.UnsignedShort4444Type = 1016),
  43711. (n.UnsignedShort5551Type = 1017),
  43712. (n.UnsignedShort565Type = 1018),
  43713. (n.AlphaFormat = 1019),
  43714. (n.RGBFormat = 1020),
  43715. (n.RGBAFormat = 1021),
  43716. (n.LuminanceFormat = 1022),
  43717. (n.LuminanceAlphaFormat = 1023),
  43718. (n.RGBEFormat = n.RGBAFormat),
  43719. (n.RGB_S3TC_DXT1_Format = 2001),
  43720. (n.RGBA_S3TC_DXT1_Format = 2002),
  43721. (n.RGBA_S3TC_DXT3_Format = 2003),
  43722. (n.RGBA_S3TC_DXT5_Format = 2004),
  43723. (n.RGB_PVRTC_4BPPV1_Format = 2100),
  43724. (n.RGB_PVRTC_2BPPV1_Format = 2101),
  43725. (n.RGBA_PVRTC_4BPPV1_Format = 2102),
  43726. (n.RGBA_PVRTC_2BPPV1_Format = 2103),
  43727. (n.RGB_ETC1_Format = 2151),
  43728. (n.LoopOnce = 2200),
  43729. (n.LoopRepeat = 2201),
  43730. (n.LoopPingPong = 2202),
  43731. (n.InterpolateDiscrete = 2300),
  43732. (n.InterpolateLinear = 2301),
  43733. (n.InterpolateSmooth = 2302),
  43734. (n.ZeroCurvatureEnding = 2400),
  43735. (n.ZeroSlopeEnding = 2401),
  43736. (n.WrapAroundEnding = 2402),
  43737. (n.TrianglesDrawMode = 0),
  43738. (n.TriangleStripDrawMode = 1),
  43739. (n.TriangleFanDrawMode = 2),
  43740. (n.LinearEncoding = 3e3),
  43741. (n.sRGBEncoding = 3001),
  43742. (n.GammaEncoding = 3007),
  43743. (n.RGBEEncoding = 3002),
  43744. (n.LogLuvEncoding = 3003),
  43745. (n.RGBM7Encoding = 3004),
  43746. (n.RGBM16Encoding = 3005),
  43747. (n.RGBDEncoding = 3006),
  43748. (n.Color = function (e) {
  43749. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  43750. }),
  43751. (n.Color.prototype = {
  43752. constructor: n.Color,
  43753. r: 1,
  43754. g: 1,
  43755. b: 1,
  43756. set: function (e) {
  43757. return (
  43758. e instanceof n.Color
  43759. ? this.copy(e)
  43760. : 'number' == typeof e
  43761. ? this.setHex(e)
  43762. : 'string' == typeof e && this.setStyle(e),
  43763. this
  43764. )
  43765. },
  43766. setScalar: function (e) {
  43767. ;(this.r = e), (this.g = e), (this.b = e)
  43768. },
  43769. setHex: function (e) {
  43770. return (
  43771. (e = Math.floor(e)),
  43772. (this.r = ((e >> 16) & 255) / 255),
  43773. (this.g = ((e >> 8) & 255) / 255),
  43774. (this.b = (255 & e) / 255),
  43775. this
  43776. )
  43777. },
  43778. setRGB: function (e, t, i) {
  43779. return (this.r = e), (this.g = t), (this.b = i), this
  43780. },
  43781. setHSL: (function () {
  43782. function e(e, t, i) {
  43783. return (
  43784. i < 0 && (i += 1),
  43785. i > 1 && (i -= 1),
  43786. i < 1 / 6
  43787. ? e + 6 * (t - e) * i
  43788. : i < 0.5
  43789. ? t
  43790. : i < 2 / 3
  43791. ? e + 6 * (t - e) * (2 / 3 - i)
  43792. : e
  43793. )
  43794. }
  43795. return function (t, i, r) {
  43796. if (
  43797. ((t = n.Math.euclideanModulo(t, 1)),
  43798. (i = n.Math.clamp(i, 0, 1)),
  43799. (r = n.Math.clamp(r, 0, 1)),
  43800. 0 === i)
  43801. )
  43802. this.r = this.g = this.b = r
  43803. else {
  43804. var o = r <= 0.5 ? r * (1 + i) : r + i - r * i,
  43805. a = 2 * r - o
  43806. ;(this.r = e(a, o, t + 1 / 3)),
  43807. (this.g = e(a, o, t)),
  43808. (this.b = e(a, o, t - 1 / 3))
  43809. }
  43810. return this
  43811. }
  43812. })(),
  43813. setStyle: function (e) {
  43814. function t(t) {
  43815. void 0 !== t &&
  43816. parseFloat(t) < 1 &&
  43817. console.warn('THREE.Color: Alpha component of ' + e + ' will be ignored.')
  43818. }
  43819. var i
  43820. if ((i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e))) {
  43821. var r,
  43822. o = i[1],
  43823. a = i[2]
  43824. switch (o) {
  43825. case 'rgb':
  43826. case 'rgba':
  43827. if (
  43828. (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  43829. )
  43830. return (
  43831. (this.r = Math.min(255, parseInt(r[1], 10)) / 255),
  43832. (this.g = Math.min(255, parseInt(r[2], 10)) / 255),
  43833. (this.b = Math.min(255, parseInt(r[3], 10)) / 255),
  43834. t(r[5]),
  43835. this
  43836. )
  43837. if (
  43838. (r =
  43839. /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(
  43840. a
  43841. ))
  43842. )
  43843. return (
  43844. (this.r = Math.min(100, parseInt(r[1], 10)) / 100),
  43845. (this.g = Math.min(100, parseInt(r[2], 10)) / 100),
  43846. (this.b = Math.min(100, parseInt(r[3], 10)) / 100),
  43847. t(r[5]),
  43848. this
  43849. )
  43850. break
  43851. case 'hsl':
  43852. case 'hsla':
  43853. if (
  43854. (r =
  43855. /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(
  43856. a
  43857. ))
  43858. ) {
  43859. var s = parseFloat(r[1]) / 360,
  43860. l = parseInt(r[2], 10) / 100,
  43861. c = parseInt(r[3], 10) / 100
  43862. return t(r[5]), this.setHSL(s, l, c)
  43863. }
  43864. }
  43865. } else if ((i = /^\#([A-Fa-f0-9]+)$/.exec(e))) {
  43866. var h = i[1],
  43867. u = h.length
  43868. if (3 === u)
  43869. return (
  43870. (this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255),
  43871. (this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255),
  43872. (this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255),
  43873. this
  43874. )
  43875. if (6 === u)
  43876. return (
  43877. (this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255),
  43878. (this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255),
  43879. (this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255),
  43880. this
  43881. )
  43882. }
  43883. if (e && e.length > 0) {
  43884. var h = n.ColorKeywords[e]
  43885. void 0 !== h ? this.setHex(h) : console.warn('THREE.Color: Unknown color ' + e)
  43886. }
  43887. return this
  43888. },
  43889. clone: function () {
  43890. return new this.constructor(this.r, this.g, this.b)
  43891. },
  43892. copy: function (e) {
  43893. return (this.r = e.r), (this.g = e.g), (this.b = e.b), this
  43894. },
  43895. copyGammaToLinear: function (e, t) {
  43896. return (
  43897. void 0 === t && (t = 2),
  43898. (this.r = Math.pow(e.r, t)),
  43899. (this.g = Math.pow(e.g, t)),
  43900. (this.b = Math.pow(e.b, t)),
  43901. this
  43902. )
  43903. },
  43904. copyLinearToGamma: function (e, t) {
  43905. void 0 === t && (t = 2)
  43906. var i = t > 0 ? 1 / t : 1
  43907. return (
  43908. (this.r = Math.pow(e.r, i)),
  43909. (this.g = Math.pow(e.g, i)),
  43910. (this.b = Math.pow(e.b, i)),
  43911. this
  43912. )
  43913. },
  43914. convertGammaToLinear: function () {
  43915. var e = this.r,
  43916. t = this.g,
  43917. i = this.b
  43918. return (this.r = e * e), (this.g = t * t), (this.b = i * i), this
  43919. },
  43920. convertLinearToGamma: function () {
  43921. return (
  43922. (this.r = Math.sqrt(this.r)),
  43923. (this.g = Math.sqrt(this.g)),
  43924. (this.b = Math.sqrt(this.b)),
  43925. this
  43926. )
  43927. },
  43928. getHex: function () {
  43929. return ((255 * this.r) << 16) ^ ((255 * this.g) << 8) ^ ((255 * this.b) << 0)
  43930. },
  43931. getHexString: function () {
  43932. return ('000000' + this.getHex().toString(16)).slice(-6)
  43933. },
  43934. getHSL: function (e) {
  43935. var t,
  43936. i,
  43937. n = e || {
  43938. h: 0,
  43939. s: 0,
  43940. l: 0
  43941. },
  43942. r = this.r,
  43943. o = this.g,
  43944. a = this.b,
  43945. s = Math.max(r, o, a),
  43946. l = Math.min(r, o, a),
  43947. c = (l + s) / 2
  43948. if (l === s) (t = 0), (i = 0)
  43949. else {
  43950. var h = s - l
  43951. switch (((i = c <= 0.5 ? h / (s + l) : h / (2 - s - l)), s)) {
  43952. case r:
  43953. t = (o - a) / h + (o < a ? 6 : 0)
  43954. break
  43955. case o:
  43956. t = (a - r) / h + 2
  43957. break
  43958. case a:
  43959. t = (r - o) / h + 4
  43960. }
  43961. t /= 6
  43962. }
  43963. return (n.h = t), (n.s = i), (n.l = c), n
  43964. },
  43965. getStyle: function () {
  43966. return (
  43967. 'rgb(' +
  43968. ((255 * this.r) | 0) +
  43969. ',' +
  43970. ((255 * this.g) | 0) +
  43971. ',' +
  43972. ((255 * this.b) | 0) +
  43973. ')'
  43974. )
  43975. },
  43976. offsetHSL: function (e, t, i) {
  43977. var n = this.getHSL()
  43978. return (n.h += e), (n.s += t), (n.l += i), this.setHSL(n.h, n.s, n.l), this
  43979. },
  43980. add: function (e) {
  43981. return (this.r += e.r), (this.g += e.g), (this.b += e.b), this
  43982. },
  43983. addColors: function (e, t) {
  43984. return (this.r = e.r + t.r), (this.g = e.g + t.g), (this.b = e.b + t.b), this
  43985. },
  43986. addScalar: function (e) {
  43987. return (this.r += e), (this.g += e), (this.b += e), this
  43988. },
  43989. multiply: function (e) {
  43990. return (this.r *= e.r), (this.g *= e.g), (this.b *= e.b), this
  43991. },
  43992. multiplyScalar: function (e) {
  43993. return (this.r *= e), (this.g *= e), (this.b *= e), this
  43994. },
  43995. lerp: function (e, t) {
  43996. return (
  43997. (this.r += (e.r - this.r) * t),
  43998. (this.g += (e.g - this.g) * t),
  43999. (this.b += (e.b - this.b) * t),
  44000. this
  44001. )
  44002. },
  44003. equals: function (e) {
  44004. return e.r === this.r && e.g === this.g && e.b === this.b
  44005. },
  44006. fromArray: function (e, t) {
  44007. return (
  44008. void 0 === t && (t = 0),
  44009. (this.r = e[t]),
  44010. (this.g = e[t + 1]),
  44011. (this.b = e[t + 2]),
  44012. this
  44013. )
  44014. },
  44015. toArray: function (e, t) {
  44016. return (
  44017. void 0 === e && (e = []),
  44018. void 0 === t && (t = 0),
  44019. (e[t] = this.r),
  44020. (e[t + 1] = this.g),
  44021. (e[t + 2] = this.b),
  44022. e
  44023. )
  44024. }
  44025. }),
  44026. (n.ColorKeywords = {
  44027. aliceblue: 15792383,
  44028. antiquewhite: 16444375,
  44029. aqua: 65535,
  44030. aquamarine: 8388564,
  44031. azure: 15794175,
  44032. beige: 16119260,
  44033. bisque: 16770244,
  44034. black: 0,
  44035. blanchedalmond: 16772045,
  44036. blue: 255,
  44037. blueviolet: 9055202,
  44038. brown: 10824234,
  44039. burlywood: 14596231,
  44040. cadetblue: 6266528,
  44041. chartreuse: 8388352,
  44042. chocolate: 13789470,
  44043. coral: 16744272,
  44044. cornflowerblue: 6591981,
  44045. cornsilk: 16775388,
  44046. crimson: 14423100,
  44047. cyan: 65535,
  44048. darkblue: 139,
  44049. darkcyan: 35723,
  44050. darkgoldenrod: 12092939,
  44051. darkgray: 11119017,
  44052. darkgreen: 25600,
  44053. darkgrey: 11119017,
  44054. darkkhaki: 12433259,
  44055. darkmagenta: 9109643,
  44056. darkolivegreen: 5597999,
  44057. darkorange: 16747520,
  44058. darkorchid: 10040012,
  44059. darkred: 9109504,
  44060. darksalmon: 15308410,
  44061. darkseagreen: 9419919,
  44062. darkslateblue: 4734347,
  44063. darkslategray: 3100495,
  44064. darkslategrey: 3100495,
  44065. darkturquoise: 52945,
  44066. darkviolet: 9699539,
  44067. deeppink: 16716947,
  44068. deepskyblue: 49151,
  44069. dimgray: 6908265,
  44070. dimgrey: 6908265,
  44071. dodgerblue: 2003199,
  44072. firebrick: 11674146,
  44073. floralwhite: 16775920,
  44074. forestgreen: 2263842,
  44075. fuchsia: 16711935,
  44076. gainsboro: 14474460,
  44077. ghostwhite: 16316671,
  44078. gold: 16766720,
  44079. goldenrod: 14329120,
  44080. gray: 8421504,
  44081. green: 32768,
  44082. greenyellow: 11403055,
  44083. grey: 8421504,
  44084. honeydew: 15794160,
  44085. hotpink: 16738740,
  44086. indianred: 13458524,
  44087. indigo: 4915330,
  44088. ivory: 16777200,
  44089. khaki: 15787660,
  44090. lavender: 15132410,
  44091. lavenderblush: 16773365,
  44092. lawngreen: 8190976,
  44093. lemonchiffon: 16775885,
  44094. lightblue: 11393254,
  44095. lightcoral: 15761536,
  44096. lightcyan: 14745599,
  44097. lightgoldenrodyellow: 16448210,
  44098. lightgray: 13882323,
  44099. lightgreen: 9498256,
  44100. lightgrey: 13882323,
  44101. lightpink: 16758465,
  44102. lightsalmon: 16752762,
  44103. lightseagreen: 2142890,
  44104. lightskyblue: 8900346,
  44105. lightslategray: 7833753,
  44106. lightslategrey: 7833753,
  44107. lightsteelblue: 11584734,
  44108. lightyellow: 16777184,
  44109. lime: 65280,
  44110. limegreen: 3329330,
  44111. linen: 16445670,
  44112. magenta: 16711935,
  44113. maroon: 8388608,
  44114. mediumaquamarine: 6737322,
  44115. mediumblue: 205,
  44116. mediumorchid: 12211667,
  44117. mediumpurple: 9662683,
  44118. mediumseagreen: 3978097,
  44119. mediumslateblue: 8087790,
  44120. mediumspringgreen: 64154,
  44121. mediumturquoise: 4772300,
  44122. mediumvioletred: 13047173,
  44123. midnightblue: 1644912,
  44124. mintcream: 16121850,
  44125. mistyrose: 16770273,
  44126. moccasin: 16770229,
  44127. navajowhite: 16768685,
  44128. navy: 128,
  44129. oldlace: 16643558,
  44130. olive: 8421376,
  44131. olivedrab: 7048739,
  44132. orange: 16753920,
  44133. orangered: 16729344,
  44134. orchid: 14315734,
  44135. palegoldenrod: 15657130,
  44136. palegreen: 10025880,
  44137. paleturquoise: 11529966,
  44138. palevioletred: 14381203,
  44139. papayawhip: 16773077,
  44140. peachpuff: 16767673,
  44141. peru: 13468991,
  44142. pink: 16761035,
  44143. plum: 14524637,
  44144. powderblue: 11591910,
  44145. purple: 8388736,
  44146. red: 16711680,
  44147. rosybrown: 12357519,
  44148. royalblue: 4286945,
  44149. saddlebrown: 9127187,
  44150. salmon: 16416882,
  44151. sandybrown: 16032864,
  44152. seagreen: 3050327,
  44153. seashell: 16774638,
  44154. sienna: 10506797,
  44155. silver: 12632256,
  44156. skyblue: 8900331,
  44157. slateblue: 6970061,
  44158. slategray: 7372944,
  44159. slategrey: 7372944,
  44160. snow: 16775930,
  44161. springgreen: 65407,
  44162. steelblue: 4620980,
  44163. tan: 13808780,
  44164. teal: 32896,
  44165. thistle: 14204888,
  44166. tomato: 16737095,
  44167. turquoise: 4251856,
  44168. violet: 15631086,
  44169. wheat: 16113331,
  44170. white: 16777215,
  44171. whitesmoke: 16119285,
  44172. yellow: 16776960,
  44173. yellowgreen: 10145074
  44174. }),
  44175. (n.Quaternion = function (e, t, i, n) {
  44176. ;(this._x = e || 0),
  44177. (this._y = t || 0),
  44178. (this._z = i || 0),
  44179. (this._w = void 0 !== n ? n : 1)
  44180. }),
  44181. (n.Quaternion.prototype = {
  44182. constructor: n.Quaternion,
  44183. get x() {
  44184. return this._x
  44185. },
  44186. set x(e) {
  44187. ;(this._x = e), this.onChangeCallback()
  44188. },
  44189. get y() {
  44190. return this._y
  44191. },
  44192. set y(e) {
  44193. ;(this._y = e), this.onChangeCallback()
  44194. },
  44195. get z() {
  44196. return this._z
  44197. },
  44198. set z(e) {
  44199. ;(this._z = e), this.onChangeCallback()
  44200. },
  44201. get w() {
  44202. return this._w
  44203. },
  44204. set w(e) {
  44205. ;(this._w = e), this.onChangeCallback()
  44206. },
  44207. set: function (e, t, i, n) {
  44208. return (
  44209. (this._x = e),
  44210. (this._y = t),
  44211. (this._z = i),
  44212. (this._w = n),
  44213. this.onChangeCallback(),
  44214. this
  44215. )
  44216. },
  44217. clone: function () {
  44218. return new this.constructor(this._x, this._y, this._z, this._w)
  44219. },
  44220. copy: function (e) {
  44221. return (
  44222. (this._x = e.x),
  44223. (this._y = e.y),
  44224. (this._z = e.z),
  44225. (this._w = e.w),
  44226. this.onChangeCallback(),
  44227. this
  44228. )
  44229. },
  44230. setFromEuler: function (e, t) {
  44231. if (e instanceof n.Euler == !1)
  44232. throw new Error(
  44233. 'THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.'
  44234. )
  44235. var i = Math.cos(e._x / 2),
  44236. r = Math.cos(e._y / 2),
  44237. o = Math.cos(e._z / 2),
  44238. a = Math.sin(e._x / 2),
  44239. s = Math.sin(e._y / 2),
  44240. l = Math.sin(e._z / 2),
  44241. c = e.order
  44242. return (
  44243. 'XYZ' === c
  44244. ? ((this._x = a * r * o + i * s * l),
  44245. (this._y = i * s * o - a * r * l),
  44246. (this._z = i * r * l + a * s * o),
  44247. (this._w = i * r * o - a * s * l))
  44248. : 'YXZ' === c
  44249. ? ((this._x = a * r * o + i * s * l),
  44250. (this._y = i * s * o - a * r * l),
  44251. (this._z = i * r * l - a * s * o),
  44252. (this._w = i * r * o + a * s * l))
  44253. : 'ZXY' === c
  44254. ? ((this._x = a * r * o - i * s * l),
  44255. (this._y = i * s * o + a * r * l),
  44256. (this._z = i * r * l + a * s * o),
  44257. (this._w = i * r * o - a * s * l))
  44258. : 'ZYX' === c
  44259. ? ((this._x = a * r * o - i * s * l),
  44260. (this._y = i * s * o + a * r * l),
  44261. (this._z = i * r * l - a * s * o),
  44262. (this._w = i * r * o + a * s * l))
  44263. : 'YZX' === c
  44264. ? ((this._x = a * r * o + i * s * l),
  44265. (this._y = i * s * o + a * r * l),
  44266. (this._z = i * r * l - a * s * o),
  44267. (this._w = i * r * o - a * s * l))
  44268. : 'XZY' === c &&
  44269. ((this._x = a * r * o - i * s * l),
  44270. (this._y = i * s * o - a * r * l),
  44271. (this._z = i * r * l + a * s * o),
  44272. (this._w = i * r * o + a * s * l)),
  44273. t !== !1 && this.onChangeCallback(),
  44274. this
  44275. )
  44276. },
  44277. setFromAxisAngle: function (e, t) {
  44278. var i = t / 2,
  44279. n = Math.sin(i)
  44280. return (
  44281. (this._x = e.x * n),
  44282. (this._y = e.y * n),
  44283. (this._z = e.z * n),
  44284. (this._w = Math.cos(i)),
  44285. this.onChangeCallback(),
  44286. this
  44287. )
  44288. },
  44289. setFromRotationMatrix: function (e) {
  44290. var t,
  44291. i = e.elements,
  44292. n = i[0],
  44293. r = i[4],
  44294. o = i[8],
  44295. a = i[1],
  44296. s = i[5],
  44297. l = i[9],
  44298. c = i[2],
  44299. h = i[6],
  44300. u = i[10],
  44301. d = n + s + u
  44302. return (
  44303. d > 0
  44304. ? ((t = 0.5 / Math.sqrt(d + 1)),
  44305. (this._w = 0.25 / t),
  44306. (this._x = (h - l) * t),
  44307. (this._y = (o - c) * t),
  44308. (this._z = (a - r) * t))
  44309. : n > s && n > u
  44310. ? ((t = 2 * Math.sqrt(1 + n - s - u)),
  44311. (this._w = (h - l) / t),
  44312. (this._x = 0.25 * t),
  44313. (this._y = (r + a) / t),
  44314. (this._z = (o + c) / t))
  44315. : s > u
  44316. ? ((t = 2 * Math.sqrt(1 + s - n - u)),
  44317. (this._w = (o - c) / t),
  44318. (this._x = (r + a) / t),
  44319. (this._y = 0.25 * t),
  44320. (this._z = (l + h) / t))
  44321. : ((t = 2 * Math.sqrt(1 + u - n - s)),
  44322. (this._w = (a - r) / t),
  44323. (this._x = (o + c) / t),
  44324. (this._y = (l + h) / t),
  44325. (this._z = 0.25 * t)),
  44326. this.onChangeCallback(),
  44327. this
  44328. )
  44329. },
  44330. setFromUnitVectors: (function () {
  44331. var e,
  44332. t,
  44333. i = 1e-6
  44334. return function (r, o) {
  44335. return (
  44336. void 0 === e && (e = new n.Vector3()),
  44337. (t = r.dot(o) + 1),
  44338. t < i
  44339. ? ((t = 0),
  44340. Math.abs(r.x) > Math.abs(r.z) ? e.set(-r.y, r.x, 0) : e.set(0, -r.z, r.y))
  44341. : e.crossVectors(r, o),
  44342. (this._x = e.x),
  44343. (this._y = e.y),
  44344. (this._z = e.z),
  44345. (this._w = t),
  44346. this.normalize(),
  44347. this
  44348. )
  44349. }
  44350. })(),
  44351. inverse: function () {
  44352. return this.conjugate().normalize(), this
  44353. },
  44354. conjugate: function () {
  44355. return (
  44356. (this._x *= -1), (this._y *= -1), (this._z *= -1), this.onChangeCallback(), this
  44357. )
  44358. },
  44359. dot: function (e) {
  44360. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  44361. },
  44362. lengthSq: function () {
  44363. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  44364. },
  44365. length: function () {
  44366. return Math.sqrt(
  44367. this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  44368. )
  44369. },
  44370. normalize: function () {
  44371. var e = this.length()
  44372. return (
  44373. 0 === e
  44374. ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
  44375. : ((e = 1 / e),
  44376. (this._x = this._x * e),
  44377. (this._y = this._y * e),
  44378. (this._z = this._z * e),
  44379. (this._w = this._w * e)),
  44380. this.onChangeCallback(),
  44381. this
  44382. )
  44383. },
  44384. multiply: function (e, t) {
  44385. return void 0 !== t
  44386. ? (console.warn(
  44387. 'THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.'
  44388. ),
  44389. this.multiplyQuaternions(e, t))
  44390. : this.multiplyQuaternions(this, e)
  44391. },
  44392. multiplyQuaternions: function (e, t) {
  44393. var i = e._x,
  44394. n = e._y,
  44395. r = e._z,
  44396. o = e._w,
  44397. a = t._x,
  44398. s = t._y,
  44399. l = t._z,
  44400. c = t._w
  44401. return (
  44402. (this._x = i * c + o * a + n * l - r * s),
  44403. (this._y = n * c + o * s + r * a - i * l),
  44404. (this._z = r * c + o * l + i * s - n * a),
  44405. (this._w = o * c - i * a - n * s - r * l),
  44406. this.onChangeCallback(),
  44407. this
  44408. )
  44409. },
  44410. slerp: function (e, t) {
  44411. if (0 === t) return this
  44412. if (1 === t) return this.copy(e)
  44413. var i = this._x,
  44414. n = this._y,
  44415. r = this._z,
  44416. o = this._w,
  44417. a = o * e._w + i * e._x + n * e._y + r * e._z
  44418. if (
  44419. (a < 0
  44420. ? ((this._w = -e._w),
  44421. (this._x = -e._x),
  44422. (this._y = -e._y),
  44423. (this._z = -e._z),
  44424. (a = -a))
  44425. : this.copy(e),
  44426. a >= 1)
  44427. )
  44428. return (this._w = o), (this._x = i), (this._y = n), (this._z = r), this
  44429. var s = Math.sqrt(1 - a * a)
  44430. if (Math.abs(s) < 0.001)
  44431. return (
  44432. (this._w = 0.5 * (o + this._w)),
  44433. (this._x = 0.5 * (i + this._x)),
  44434. (this._y = 0.5 * (n + this._y)),
  44435. (this._z = 0.5 * (r + this._z)),
  44436. this
  44437. )
  44438. var l = Math.atan2(s, a),
  44439. c = Math.sin((1 - t) * l) / s,
  44440. h = Math.sin(t * l) / s
  44441. return (
  44442. (this._w = o * c + this._w * h),
  44443. (this._x = i * c + this._x * h),
  44444. (this._y = n * c + this._y * h),
  44445. (this._z = r * c + this._z * h),
  44446. this.onChangeCallback(),
  44447. this
  44448. )
  44449. },
  44450. equals: function (e) {
  44451. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  44452. },
  44453. fromArray: function (e, t) {
  44454. return (
  44455. void 0 === t && (t = 0),
  44456. (this._x = e[t]),
  44457. (this._y = e[t + 1]),
  44458. (this._z = e[t + 2]),
  44459. (this._w = e[t + 3]),
  44460. this.onChangeCallback(),
  44461. this
  44462. )
  44463. },
  44464. toArray: function (e, t) {
  44465. return (
  44466. void 0 === e && (e = []),
  44467. void 0 === t && (t = 0),
  44468. (e[t] = this._x),
  44469. (e[t + 1] = this._y),
  44470. (e[t + 2] = this._z),
  44471. (e[t + 3] = this._w),
  44472. e
  44473. )
  44474. },
  44475. onChange: function (e) {
  44476. return (this.onChangeCallback = e), this
  44477. },
  44478. onChangeCallback: function () {}
  44479. }),
  44480. Object.assign(n.Quaternion, {
  44481. slerp: function (e, t, i, n) {
  44482. return i.copy(e).slerp(t, n)
  44483. },
  44484. slerpFlat: function (e, t, i, n, r, o, a) {
  44485. var s = i[n + 0],
  44486. l = i[n + 1],
  44487. c = i[n + 2],
  44488. h = i[n + 3],
  44489. u = r[o + 0],
  44490. d = r[o + 1],
  44491. p = r[o + 2],
  44492. f = r[o + 3]
  44493. if (h !== f || s !== u || l !== d || c !== p) {
  44494. var g = 1 - a,
  44495. m = s * u + l * d + c * p + h * f,
  44496. v = m >= 0 ? 1 : -1,
  44497. A = 1 - m * m
  44498. if (A > Number.EPSILON) {
  44499. var y = Math.sqrt(A),
  44500. C = Math.atan2(y, m * v)
  44501. ;(g = Math.sin(g * C) / y), (a = Math.sin(a * C) / y)
  44502. }
  44503. var I = a * v
  44504. if (
  44505. ((s = s * g + u * I),
  44506. (l = l * g + d * I),
  44507. (c = c * g + p * I),
  44508. (h = h * g + f * I),
  44509. g === 1 - a)
  44510. ) {
  44511. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h)
  44512. ;(s *= E), (l *= E), (c *= E), (h *= E)
  44513. }
  44514. }
  44515. ;(e[t] = s), (e[t + 1] = l), (e[t + 2] = c), (e[t + 3] = h)
  44516. }
  44517. }),
  44518. (n.Vector2 = function (e, t) {
  44519. ;(this.x = e || 0), (this.y = t || 0)
  44520. }),
  44521. (n.Vector2.prototype = {
  44522. constructor: n.Vector2,
  44523. get width() {
  44524. return this.x
  44525. },
  44526. set width(e) {
  44527. this.x = e
  44528. },
  44529. get height() {
  44530. return this.y
  44531. },
  44532. set height(e) {
  44533. this.y = e
  44534. },
  44535. set: function (e, t) {
  44536. return (this.x = e), (this.y = t), this
  44537. },
  44538. setScalar: function (e) {
  44539. return (this.x = e), (this.y = e), this
  44540. },
  44541. setX: function (e) {
  44542. return (this.x = e), this
  44543. },
  44544. setY: function (e) {
  44545. return (this.y = e), this
  44546. },
  44547. setComponent: function (e, t) {
  44548. switch (e) {
  44549. case 0:
  44550. this.x = t
  44551. break
  44552. case 1:
  44553. this.y = t
  44554. break
  44555. default:
  44556. throw new Error('index is out of range: ' + e)
  44557. }
  44558. },
  44559. getComponent: function (e) {
  44560. switch (e) {
  44561. case 0:
  44562. return this.x
  44563. case 1:
  44564. return this.y
  44565. default:
  44566. throw new Error('index is out of range: ' + e)
  44567. }
  44568. },
  44569. clone: function () {
  44570. return new this.constructor(this.x, this.y)
  44571. },
  44572. copy: function (e) {
  44573. return (this.x = e.x), (this.y = e.y), this
  44574. },
  44575. add: function (e, t) {
  44576. return void 0 !== t
  44577. ? (console.warn(
  44578. 'THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'
  44579. ),
  44580. this.addVectors(e, t))
  44581. : ((this.x += e.x), (this.y += e.y), this)
  44582. },
  44583. addScalar: function (e) {
  44584. return (this.x += e), (this.y += e), this
  44585. },
  44586. addVectors: function (e, t) {
  44587. return (this.x = e.x + t.x), (this.y = e.y + t.y), this
  44588. },
  44589. addScaledVector: function (e, t) {
  44590. return (this.x += e.x * t), (this.y += e.y * t), this
  44591. },
  44592. sub: function (e, t) {
  44593. return void 0 !== t
  44594. ? (console.warn(
  44595. 'THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'
  44596. ),
  44597. this.subVectors(e, t))
  44598. : ((this.x -= e.x), (this.y -= e.y), this)
  44599. },
  44600. subScalar: function (e) {
  44601. return (this.x -= e), (this.y -= e), this
  44602. },
  44603. subVectors: function (e, t) {
  44604. return (this.x = e.x - t.x), (this.y = e.y - t.y), this
  44605. },
  44606. multiply: function (e) {
  44607. return (this.x *= e.x), (this.y *= e.y), this
  44608. },
  44609. multiplyScalar: function (e) {
  44610. return (
  44611. isFinite(e) ? ((this.x *= e), (this.y *= e)) : ((this.x = 0), (this.y = 0)), this
  44612. )
  44613. },
  44614. divide: function (e) {
  44615. return (this.x /= e.x), (this.y /= e.y), this
  44616. },
  44617. divideScalar: function (e) {
  44618. return this.multiplyScalar(1 / e)
  44619. },
  44620. min: function (e) {
  44621. return (this.x = Math.min(this.x, e.x)), (this.y = Math.min(this.y, e.y)), this
  44622. },
  44623. max: function (e) {
  44624. return (this.x = Math.max(this.x, e.x)), (this.y = Math.max(this.y, e.y)), this
  44625. },
  44626. clamp: function (e, t) {
  44627. return (
  44628. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  44629. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  44630. this
  44631. )
  44632. },
  44633. clampScalar: (function () {
  44634. var e, t
  44635. return function (i, r) {
  44636. return (
  44637. void 0 === e && ((e = new n.Vector2()), (t = new n.Vector2())),
  44638. e.set(i, i),
  44639. t.set(r, r),
  44640. this.clamp(e, t)
  44641. )
  44642. }
  44643. })(),
  44644. clampLength: function (e, t) {
  44645. var i = this.length()
  44646. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this
  44647. },
  44648. floor: function () {
  44649. return (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), this
  44650. },
  44651. ceil: function () {
  44652. return (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), this
  44653. },
  44654. round: function () {
  44655. return (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), this
  44656. },
  44657. roundToZero: function () {
  44658. return (
  44659. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  44660. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  44661. this
  44662. )
  44663. },
  44664. negate: function () {
  44665. return (this.x = -this.x), (this.y = -this.y), this
  44666. },
  44667. dot: function (e) {
  44668. return this.x * e.x + this.y * e.y
  44669. },
  44670. lengthSq: function () {
  44671. return this.x * this.x + this.y * this.y
  44672. },
  44673. length: function () {
  44674. return Math.sqrt(this.x * this.x + this.y * this.y)
  44675. },
  44676. lengthManhattan: function () {
  44677. return Math.abs(this.x) + Math.abs(this.y)
  44678. },
  44679. normalize: function () {
  44680. return this.divideScalar(this.length())
  44681. },
  44682. angle: function () {
  44683. var e = Math.atan2(this.y, this.x)
  44684. return e < 0 && (e += 2 * Math.PI), e
  44685. },
  44686. distanceTo: function (e) {
  44687. return Math.sqrt(this.distanceToSquared(e))
  44688. },
  44689. distanceToSquared: function (e) {
  44690. var t = this.x - e.x,
  44691. i = this.y - e.y
  44692. return t * t + i * i
  44693. },
  44694. setLength: function (e) {
  44695. return this.multiplyScalar(e / this.length())
  44696. },
  44697. lerp: function (e, t) {
  44698. return (this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), this
  44699. },
  44700. lerpVectors: function (e, t, i) {
  44701. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  44702. },
  44703. equals: function (e) {
  44704. return e.x === this.x && e.y === this.y
  44705. },
  44706. fromArray: function (e, t) {
  44707. return void 0 === t && (t = 0), (this.x = e[t]), (this.y = e[t + 1]), this
  44708. },
  44709. toArray: function (e, t) {
  44710. return (
  44711. void 0 === e && (e = []),
  44712. void 0 === t && (t = 0),
  44713. (e[t] = this.x),
  44714. (e[t + 1] = this.y),
  44715. e
  44716. )
  44717. },
  44718. fromAttribute: function (e, t, i) {
  44719. return (
  44720. void 0 === i && (i = 0),
  44721. (t = t * e.itemSize + i),
  44722. (this.x = e.array[t]),
  44723. (this.y = e.array[t + 1]),
  44724. this
  44725. )
  44726. },
  44727. rotateAround: function (e, t) {
  44728. var i = Math.cos(t),
  44729. n = Math.sin(t),
  44730. r = this.x - e.x,
  44731. o = this.y - e.y
  44732. return (this.x = r * i - o * n + e.x), (this.y = r * n + o * i + e.y), this
  44733. }
  44734. }),
  44735. (n.Vector3 = function (e, t, i) {
  44736. ;(this.x = e || 0), (this.y = t || 0), (this.z = i || 0)
  44737. }),
  44738. (n.Vector3.prototype = {
  44739. constructor: n.Vector3,
  44740. set: function (e, t, i) {
  44741. return (this.x = e), (this.y = t), (this.z = i), this
  44742. },
  44743. setScalar: function (e) {
  44744. return (this.x = e), (this.y = e), (this.z = e), this
  44745. },
  44746. setX: function (e) {
  44747. return (this.x = e), this
  44748. },
  44749. setY: function (e) {
  44750. return (this.y = e), this
  44751. },
  44752. setZ: function (e) {
  44753. return (this.z = e), this
  44754. },
  44755. setComponent: function (e, t) {
  44756. switch (e) {
  44757. case 0:
  44758. this.x = t
  44759. break
  44760. case 1:
  44761. this.y = t
  44762. break
  44763. case 2:
  44764. this.z = t
  44765. break
  44766. default:
  44767. throw new Error('index is out of range: ' + e)
  44768. }
  44769. },
  44770. getComponent: function (e) {
  44771. switch (e) {
  44772. case 0:
  44773. return this.x
  44774. case 1:
  44775. return this.y
  44776. case 2:
  44777. return this.z
  44778. default:
  44779. throw new Error('index is out of range: ' + e)
  44780. }
  44781. },
  44782. clone: function () {
  44783. return new this.constructor(this.x, this.y, this.z)
  44784. },
  44785. copy: function (e) {
  44786. return (this.x = e.x), (this.y = e.y), (this.z = e.z), this
  44787. },
  44788. add: function (e, t) {
  44789. return void 0 !== t
  44790. ? (console.warn(
  44791. 'THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'
  44792. ),
  44793. this.addVectors(e, t))
  44794. : ((this.x += e.x), (this.y += e.y), (this.z += e.z), this)
  44795. },
  44796. addScalar: function (e) {
  44797. return (this.x += e), (this.y += e), (this.z += e), this
  44798. },
  44799. addVectors: function (e, t) {
  44800. return (this.x = e.x + t.x), (this.y = e.y + t.y), (this.z = e.z + t.z), this
  44801. },
  44802. addScaledVector: function (e, t) {
  44803. return (this.x += e.x * t), (this.y += e.y * t), (this.z += e.z * t), this
  44804. },
  44805. sub: function (e, t) {
  44806. return void 0 !== t
  44807. ? (console.warn(
  44808. 'THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'
  44809. ),
  44810. this.subVectors(e, t))
  44811. : ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), this)
  44812. },
  44813. subScalar: function (e) {
  44814. return (this.x -= e), (this.y -= e), (this.z -= e), this
  44815. },
  44816. subVectors: function (e, t) {
  44817. return (this.x = e.x - t.x), (this.y = e.y - t.y), (this.z = e.z - t.z), this
  44818. },
  44819. multiply: function (e, t) {
  44820. return void 0 !== t
  44821. ? (console.warn(
  44822. 'THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.'
  44823. ),
  44824. this.multiplyVectors(e, t))
  44825. : ((this.x *= e.x), (this.y *= e.y), (this.z *= e.z), this)
  44826. },
  44827. multiplyScalar: function (e) {
  44828. return (
  44829. isFinite(e)
  44830. ? ((this.x *= e), (this.y *= e), (this.z *= e))
  44831. : ((this.x = 0), (this.y = 0), (this.z = 0)),
  44832. this
  44833. )
  44834. },
  44835. multiplyVectors: function (e, t) {
  44836. return (this.x = e.x * t.x), (this.y = e.y * t.y), (this.z = e.z * t.z), this
  44837. },
  44838. applyEuler: (function () {
  44839. var e
  44840. return function (t) {
  44841. return (
  44842. t instanceof n.Euler == !1 &&
  44843. console.error(
  44844. 'THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.'
  44845. ),
  44846. void 0 === e && (e = new n.Quaternion()),
  44847. this.applyQuaternion(e.setFromEuler(t)),
  44848. this
  44849. )
  44850. }
  44851. })(),
  44852. applyAxisAngle: (function () {
  44853. var e
  44854. return function (t, i) {
  44855. return (
  44856. void 0 === e && (e = new n.Quaternion()),
  44857. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  44858. this
  44859. )
  44860. }
  44861. })(),
  44862. applyMatrix3: function (e) {
  44863. var t = this.x,
  44864. i = this.y,
  44865. n = this.z,
  44866. r = e.elements
  44867. return (
  44868. (this.x = r[0] * t + r[3] * i + r[6] * n),
  44869. (this.y = r[1] * t + r[4] * i + r[7] * n),
  44870. (this.z = r[2] * t + r[5] * i + r[8] * n),
  44871. this
  44872. )
  44873. },
  44874. applyMatrix4: function (e) {
  44875. var t = this.x,
  44876. i = this.y,
  44877. n = this.z,
  44878. r = e.elements
  44879. return (
  44880. (this.x = r[0] * t + r[4] * i + r[8] * n + r[12]),
  44881. (this.y = r[1] * t + r[5] * i + r[9] * n + r[13]),
  44882. (this.z = r[2] * t + r[6] * i + r[10] * n + r[14]),
  44883. this
  44884. )
  44885. },
  44886. applyProjection: function (e) {
  44887. var t = this.x,
  44888. i = this.y,
  44889. n = this.z,
  44890. r = e.elements,
  44891. o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15])
  44892. return (
  44893. (this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o),
  44894. (this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o),
  44895. (this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o),
  44896. this
  44897. )
  44898. },
  44899. applyQuaternion: function (e) {
  44900. var t = this.x,
  44901. i = this.y,
  44902. n = this.z,
  44903. r = e.x,
  44904. o = e.y,
  44905. a = e.z,
  44906. s = e.w,
  44907. l = s * t + o * n - a * i,
  44908. c = s * i + a * t - r * n,
  44909. h = s * n + r * i - o * t,
  44910. u = -r * t - o * i - a * n
  44911. return (
  44912. (this.x = l * s + u * -r + c * -a - h * -o),
  44913. (this.y = c * s + u * -o + h * -r - l * -a),
  44914. (this.z = h * s + u * -a + l * -o - c * -r),
  44915. this
  44916. )
  44917. },
  44918. project: (function () {
  44919. var e
  44920. return function (t) {
  44921. return (
  44922. void 0 === e && (e = new n.Matrix4()),
  44923. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  44924. this.applyProjection(e)
  44925. )
  44926. }
  44927. })(),
  44928. unproject: (function () {
  44929. var e
  44930. return function (t) {
  44931. return (
  44932. void 0 === e && (e = new n.Matrix4()),
  44933. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  44934. this.applyProjection(e)
  44935. )
  44936. }
  44937. })(),
  44938. transformDirection: function (e) {
  44939. var t = this.x,
  44940. i = this.y,
  44941. n = this.z,
  44942. r = e.elements
  44943. return (
  44944. (this.x = r[0] * t + r[4] * i + r[8] * n),
  44945. (this.y = r[1] * t + r[5] * i + r[9] * n),
  44946. (this.z = r[2] * t + r[6] * i + r[10] * n),
  44947. this.normalize(),
  44948. this
  44949. )
  44950. },
  44951. divide: function (e) {
  44952. return (this.x /= e.x), (this.y /= e.y), (this.z /= e.z), this
  44953. },
  44954. divideScalar: function (e) {
  44955. return this.multiplyScalar(1 / e)
  44956. },
  44957. min: function (e) {
  44958. return (
  44959. (this.x = Math.min(this.x, e.x)),
  44960. (this.y = Math.min(this.y, e.y)),
  44961. (this.z = Math.min(this.z, e.z)),
  44962. this
  44963. )
  44964. },
  44965. max: function (e) {
  44966. return (
  44967. (this.x = Math.max(this.x, e.x)),
  44968. (this.y = Math.max(this.y, e.y)),
  44969. (this.z = Math.max(this.z, e.z)),
  44970. this
  44971. )
  44972. },
  44973. clamp: function (e, t) {
  44974. return (
  44975. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  44976. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  44977. (this.z = Math.max(e.z, Math.min(t.z, this.z))),
  44978. this
  44979. )
  44980. },
  44981. clampScalar: (function () {
  44982. var e, t
  44983. return function (i, r) {
  44984. return (
  44985. void 0 === e && ((e = new n.Vector3()), (t = new n.Vector3())),
  44986. e.set(i, i, i),
  44987. t.set(r, r, r),
  44988. this.clamp(e, t)
  44989. )
  44990. }
  44991. })(),
  44992. clampLength: function (e, t) {
  44993. var i = this.length()
  44994. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this
  44995. },
  44996. floor: function () {
  44997. return (
  44998. (this.x = Math.floor(this.x)),
  44999. (this.y = Math.floor(this.y)),
  45000. (this.z = Math.floor(this.z)),
  45001. this
  45002. )
  45003. },
  45004. ceil: function () {
  45005. return (
  45006. (this.x = Math.ceil(this.x)),
  45007. (this.y = Math.ceil(this.y)),
  45008. (this.z = Math.ceil(this.z)),
  45009. this
  45010. )
  45011. },
  45012. round: function () {
  45013. return (
  45014. (this.x = Math.round(this.x)),
  45015. (this.y = Math.round(this.y)),
  45016. (this.z = Math.round(this.z)),
  45017. this
  45018. )
  45019. },
  45020. roundToZero: function () {
  45021. return (
  45022. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  45023. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  45024. (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
  45025. this
  45026. )
  45027. },
  45028. negate: function () {
  45029. return (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), this
  45030. },
  45031. dot: function (e) {
  45032. return this.x * e.x + this.y * e.y + this.z * e.z
  45033. },
  45034. lengthSq: function () {
  45035. return this.x * this.x + this.y * this.y + this.z * this.z
  45036. },
  45037. length: function () {
  45038. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  45039. },
  45040. lengthManhattan: function () {
  45041. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  45042. },
  45043. normalize: function () {
  45044. return this.divideScalar(this.length())
  45045. },
  45046. setLength: function (e) {
  45047. return this.multiplyScalar(e / this.length())
  45048. },
  45049. lerp: function (e, t) {
  45050. return (
  45051. (this.x += (e.x - this.x) * t),
  45052. (this.y += (e.y - this.y) * t),
  45053. (this.z += (e.z - this.z) * t),
  45054. this
  45055. )
  45056. },
  45057. lerpVectors: function (e, t, i) {
  45058. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  45059. },
  45060. cross: function (e, t) {
  45061. if (void 0 !== t)
  45062. return (
  45063. console.warn(
  45064. 'THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.'
  45065. ),
  45066. this.crossVectors(e, t)
  45067. )
  45068. var i = this.x,
  45069. n = this.y,
  45070. r = this.z
  45071. return (
  45072. (this.x = n * e.z - r * e.y),
  45073. (this.y = r * e.x - i * e.z),
  45074. (this.z = i * e.y - n * e.x),
  45075. this
  45076. )
  45077. },
  45078. crossVectors: function (e, t) {
  45079. var i = e.x,
  45080. n = e.y,
  45081. r = e.z,
  45082. o = t.x,
  45083. a = t.y,
  45084. s = t.z
  45085. return (
  45086. (this.x = n * s - r * a), (this.y = r * o - i * s), (this.z = i * a - n * o), this
  45087. )
  45088. },
  45089. projectOnVector: (function () {
  45090. var e, t
  45091. return function (i) {
  45092. return (
  45093. void 0 === e && (e = new n.Vector3()),
  45094. e.copy(i).normalize(),
  45095. (t = this.dot(e)),
  45096. this.copy(e).multiplyScalar(t)
  45097. )
  45098. }
  45099. })(),
  45100. projectOnPlane: (function () {
  45101. var e
  45102. return function (t) {
  45103. return (
  45104. void 0 === e && (e = new n.Vector3()),
  45105. e.copy(this).projectOnVector(t),
  45106. this.sub(e)
  45107. )
  45108. }
  45109. })(),
  45110. reflect: (function () {
  45111. var e
  45112. return function (t) {
  45113. return (
  45114. void 0 === e && (e = new n.Vector3()),
  45115. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  45116. )
  45117. }
  45118. })(),
  45119. angleTo: function (e) {
  45120. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq())
  45121. return Math.acos(n.Math.clamp(t, -1, 1))
  45122. },
  45123. distanceTo: function (e) {
  45124. return Math.sqrt(this.distanceToSquared(e))
  45125. },
  45126. distanceToSquared: function (e) {
  45127. var t = this.x - e.x,
  45128. i = this.y - e.y,
  45129. n = this.z - e.z
  45130. return t * t + i * i + n * n
  45131. },
  45132. setFromSpherical: function (e) {
  45133. var t = Math.sin(e.phi) * e.radius
  45134. return (
  45135. (this.x = t * Math.sin(e.theta)),
  45136. (this.y = Math.cos(e.phi) * e.radius),
  45137. (this.z = t * Math.cos(e.theta)),
  45138. this
  45139. )
  45140. },
  45141. setFromMatrixPosition: function (e) {
  45142. return this.setFromMatrixColumn(e, 3)
  45143. },
  45144. setFromMatrixScale: function (e) {
  45145. var t = this.setFromMatrixColumn(e, 0).length(),
  45146. i = this.setFromMatrixColumn(e, 1).length(),
  45147. n = this.setFromMatrixColumn(e, 2).length()
  45148. return (this.x = t), (this.y = i), (this.z = n), this
  45149. },
  45150. setFromMatrixColumn: function (e, t) {
  45151. return (
  45152. 'number' == typeof e &&
  45153. (console.warn(
  45154. 'THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).'
  45155. ),
  45156. (e = arguments[1]),
  45157. (t = arguments[0])),
  45158. this.fromArray(e.elements, 4 * t)
  45159. )
  45160. },
  45161. equals: function (e) {
  45162. return e.x === this.x && e.y === this.y && e.z === this.z
  45163. },
  45164. fromArray: function (e, t) {
  45165. return (
  45166. void 0 === t && (t = 0),
  45167. (this.x = e[t]),
  45168. (this.y = e[t + 1]),
  45169. (this.z = e[t + 2]),
  45170. this
  45171. )
  45172. },
  45173. toArray: function (e, t) {
  45174. return (
  45175. void 0 === e && (e = []),
  45176. void 0 === t && (t = 0),
  45177. (e[t] = this.x),
  45178. (e[t + 1] = this.y),
  45179. (e[t + 2] = this.z),
  45180. e
  45181. )
  45182. },
  45183. fromAttribute: function (e, t, i) {
  45184. return (
  45185. void 0 === i && (i = 0),
  45186. (t = t * e.itemSize + i),
  45187. (this.x = e.array[t]),
  45188. (this.y = e.array[t + 1]),
  45189. (this.z = e.array[t + 2]),
  45190. this
  45191. )
  45192. }
  45193. }),
  45194. (n.Vector4 = function (e, t, i, n) {
  45195. ;(this.x = e || 0),
  45196. (this.y = t || 0),
  45197. (this.z = i || 0),
  45198. (this.w = void 0 !== n ? n : 1)
  45199. }),
  45200. (n.Vector4.prototype = {
  45201. constructor: n.Vector4,
  45202. set: function (e, t, i, n) {
  45203. return (this.x = e), (this.y = t), (this.z = i), (this.w = n), this
  45204. },
  45205. setScalar: function (e) {
  45206. return (this.x = e), (this.y = e), (this.z = e), (this.w = e), this
  45207. },
  45208. setX: function (e) {
  45209. return (this.x = e), this
  45210. },
  45211. setY: function (e) {
  45212. return (this.y = e), this
  45213. },
  45214. setZ: function (e) {
  45215. return (this.z = e), this
  45216. },
  45217. setW: function (e) {
  45218. return (this.w = e), this
  45219. },
  45220. setComponent: function (e, t) {
  45221. switch (e) {
  45222. case 0:
  45223. this.x = t
  45224. break
  45225. case 1:
  45226. this.y = t
  45227. break
  45228. case 2:
  45229. this.z = t
  45230. break
  45231. case 3:
  45232. this.w = t
  45233. break
  45234. default:
  45235. throw new Error('index is out of range: ' + e)
  45236. }
  45237. },
  45238. getComponent: function (e) {
  45239. switch (e) {
  45240. case 0:
  45241. return this.x
  45242. case 1:
  45243. return this.y
  45244. case 2:
  45245. return this.z
  45246. case 3:
  45247. return this.w
  45248. default:
  45249. throw new Error('index is out of range: ' + e)
  45250. }
  45251. },
  45252. clone: function () {
  45253. return new this.constructor(this.x, this.y, this.z, this.w)
  45254. },
  45255. copy: function (e) {
  45256. return (
  45257. (this.x = e.x),
  45258. (this.y = e.y),
  45259. (this.z = e.z),
  45260. (this.w = void 0 !== e.w ? e.w : 1),
  45261. this
  45262. )
  45263. },
  45264. add: function (e, t) {
  45265. return void 0 !== t
  45266. ? (console.warn(
  45267. 'THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'
  45268. ),
  45269. this.addVectors(e, t))
  45270. : ((this.x += e.x), (this.y += e.y), (this.z += e.z), (this.w += e.w), this)
  45271. },
  45272. addScalar: function (e) {
  45273. return (this.x += e), (this.y += e), (this.z += e), (this.w += e), this
  45274. },
  45275. addVectors: function (e, t) {
  45276. return (
  45277. (this.x = e.x + t.x),
  45278. (this.y = e.y + t.y),
  45279. (this.z = e.z + t.z),
  45280. (this.w = e.w + t.w),
  45281. this
  45282. )
  45283. },
  45284. addScaledVector: function (e, t) {
  45285. return (
  45286. (this.x += e.x * t),
  45287. (this.y += e.y * t),
  45288. (this.z += e.z * t),
  45289. (this.w += e.w * t),
  45290. this
  45291. )
  45292. },
  45293. sub: function (e, t) {
  45294. return void 0 !== t
  45295. ? (console.warn(
  45296. 'THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'
  45297. ),
  45298. this.subVectors(e, t))
  45299. : ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), (this.w -= e.w), this)
  45300. },
  45301. subScalar: function (e) {
  45302. return (this.x -= e), (this.y -= e), (this.z -= e), (this.w -= e), this
  45303. },
  45304. subVectors: function (e, t) {
  45305. return (
  45306. (this.x = e.x - t.x),
  45307. (this.y = e.y - t.y),
  45308. (this.z = e.z - t.z),
  45309. (this.w = e.w - t.w),
  45310. this
  45311. )
  45312. },
  45313. multiplyScalar: function (e) {
  45314. return (
  45315. isFinite(e)
  45316. ? ((this.x *= e), (this.y *= e), (this.z *= e), (this.w *= e))
  45317. : ((this.x = 0), (this.y = 0), (this.z = 0), (this.w = 0)),
  45318. this
  45319. )
  45320. },
  45321. applyMatrix4: function (e) {
  45322. var t = this.x,
  45323. i = this.y,
  45324. n = this.z,
  45325. r = this.w,
  45326. o = e.elements
  45327. return (
  45328. (this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r),
  45329. (this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r),
  45330. (this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r),
  45331. (this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r),
  45332. this
  45333. )
  45334. },
  45335. divideScalar: function (e) {
  45336. return this.multiplyScalar(1 / e)
  45337. },
  45338. setAxisAngleFromQuaternion: function (e) {
  45339. this.w = 2 * Math.acos(e.w)
  45340. var t = Math.sqrt(1 - e.w * e.w)
  45341. return (
  45342. t < 1e-4
  45343. ? ((this.x = 1), (this.y = 0), (this.z = 0))
  45344. : ((this.x = e.x / t), (this.y = e.y / t), (this.z = e.z / t)),
  45345. this
  45346. )
  45347. },
  45348. setAxisAngleFromRotationMatrix: function (e) {
  45349. var t,
  45350. i,
  45351. n,
  45352. r,
  45353. o = 0.01,
  45354. a = 0.1,
  45355. s = e.elements,
  45356. l = s[0],
  45357. c = s[4],
  45358. h = s[8],
  45359. u = s[1],
  45360. d = s[5],
  45361. p = s[9],
  45362. f = s[2],
  45363. g = s[6],
  45364. m = s[10]
  45365. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  45366. if (
  45367. Math.abs(c + u) < a &&
  45368. Math.abs(h + f) < a &&
  45369. Math.abs(p + g) < a &&
  45370. Math.abs(l + d + m - 3) < a
  45371. )
  45372. return this.set(1, 0, 0, 0), this
  45373. t = Math.PI
  45374. var v = (l + 1) / 2,
  45375. A = (d + 1) / 2,
  45376. y = (m + 1) / 2,
  45377. C = (c + u) / 4,
  45378. I = (h + f) / 4,
  45379. E = (p + g) / 4
  45380. return (
  45381. v > A && v > y
  45382. ? v < o
  45383. ? ((i = 0), (n = 0.707106781), (r = 0.707106781))
  45384. : ((i = Math.sqrt(v)), (n = C / i), (r = I / i))
  45385. : A > y
  45386. ? A < o
  45387. ? ((i = 0.707106781), (n = 0), (r = 0.707106781))
  45388. : ((n = Math.sqrt(A)), (i = C / n), (r = E / n))
  45389. : y < o
  45390. ? ((i = 0.707106781), (n = 0.707106781), (r = 0))
  45391. : ((r = Math.sqrt(y)), (i = I / r), (n = E / r)),
  45392. this.set(i, n, r, t),
  45393. this
  45394. )
  45395. }
  45396. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c))
  45397. return (
  45398. Math.abs(b) < 0.001 && (b = 1),
  45399. (this.x = (g - p) / b),
  45400. (this.y = (h - f) / b),
  45401. (this.z = (u - c) / b),
  45402. (this.w = Math.acos((l + d + m - 1) / 2)),
  45403. this
  45404. )
  45405. },
  45406. min: function (e) {
  45407. return (
  45408. (this.x = Math.min(this.x, e.x)),
  45409. (this.y = Math.min(this.y, e.y)),
  45410. (this.z = Math.min(this.z, e.z)),
  45411. (this.w = Math.min(this.w, e.w)),
  45412. this
  45413. )
  45414. },
  45415. max: function (e) {
  45416. return (
  45417. (this.x = Math.max(this.x, e.x)),
  45418. (this.y = Math.max(this.y, e.y)),
  45419. (this.z = Math.max(this.z, e.z)),
  45420. (this.w = Math.max(this.w, e.w)),
  45421. this
  45422. )
  45423. },
  45424. clamp: function (e, t) {
  45425. return (
  45426. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  45427. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  45428. (this.z = Math.max(e.z, Math.min(t.z, this.z))),
  45429. (this.w = Math.max(e.w, Math.min(t.w, this.w))),
  45430. this
  45431. )
  45432. },
  45433. clampScalar: (function () {
  45434. var e, t
  45435. return function (i, r) {
  45436. return (
  45437. void 0 === e && ((e = new n.Vector4()), (t = new n.Vector4())),
  45438. e.set(i, i, i, i),
  45439. t.set(r, r, r, r),
  45440. this.clamp(e, t)
  45441. )
  45442. }
  45443. })(),
  45444. floor: function () {
  45445. return (
  45446. (this.x = Math.floor(this.x)),
  45447. (this.y = Math.floor(this.y)),
  45448. (this.z = Math.floor(this.z)),
  45449. (this.w = Math.floor(this.w)),
  45450. this
  45451. )
  45452. },
  45453. ceil: function () {
  45454. return (
  45455. (this.x = Math.ceil(this.x)),
  45456. (this.y = Math.ceil(this.y)),
  45457. (this.z = Math.ceil(this.z)),
  45458. (this.w = Math.ceil(this.w)),
  45459. this
  45460. )
  45461. },
  45462. round: function () {
  45463. return (
  45464. (this.x = Math.round(this.x)),
  45465. (this.y = Math.round(this.y)),
  45466. (this.z = Math.round(this.z)),
  45467. (this.w = Math.round(this.w)),
  45468. this
  45469. )
  45470. },
  45471. roundToZero: function () {
  45472. return (
  45473. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  45474. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  45475. (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
  45476. (this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w)),
  45477. this
  45478. )
  45479. },
  45480. negate: function () {
  45481. return (
  45482. (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), (this.w = -this.w), this
  45483. )
  45484. },
  45485. dot: function (e) {
  45486. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  45487. },
  45488. lengthSq: function () {
  45489. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  45490. },
  45491. length: function () {
  45492. return Math.sqrt(
  45493. this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  45494. )
  45495. },
  45496. lengthManhattan: function () {
  45497. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  45498. },
  45499. normalize: function () {
  45500. return this.divideScalar(this.length())
  45501. },
  45502. setLength: function (e) {
  45503. return this.multiplyScalar(e / this.length())
  45504. },
  45505. lerp: function (e, t) {
  45506. return (
  45507. (this.x += (e.x - this.x) * t),
  45508. (this.y += (e.y - this.y) * t),
  45509. (this.z += (e.z - this.z) * t),
  45510. (this.w += (e.w - this.w) * t),
  45511. this
  45512. )
  45513. },
  45514. lerpVectors: function (e, t, i) {
  45515. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  45516. },
  45517. equals: function (e) {
  45518. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  45519. },
  45520. fromArray: function (e, t) {
  45521. return (
  45522. void 0 === t && (t = 0),
  45523. (this.x = e[t]),
  45524. (this.y = e[t + 1]),
  45525. (this.z = e[t + 2]),
  45526. (this.w = e[t + 3]),
  45527. this
  45528. )
  45529. },
  45530. toArray: function (e, t) {
  45531. return (
  45532. void 0 === e && (e = []),
  45533. void 0 === t && (t = 0),
  45534. (e[t] = this.x),
  45535. (e[t + 1] = this.y),
  45536. (e[t + 2] = this.z),
  45537. (e[t + 3] = this.w),
  45538. e
  45539. )
  45540. },
  45541. fromAttribute: function (e, t, i) {
  45542. return (
  45543. void 0 === i && (i = 0),
  45544. (t = t * e.itemSize + i),
  45545. (this.x = e.array[t]),
  45546. (this.y = e.array[t + 1]),
  45547. (this.z = e.array[t + 2]),
  45548. (this.w = e.array[t + 3]),
  45549. this
  45550. )
  45551. }
  45552. }),
  45553. (n.Euler = function (e, t, i, r) {
  45554. ;(this._x = e || 0),
  45555. (this._y = t || 0),
  45556. (this._z = i || 0),
  45557. (this._order = r || n.Euler.DefaultOrder)
  45558. }),
  45559. (n.Euler.RotationOrders = ['XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX']),
  45560. (n.Euler.DefaultOrder = 'XYZ'),
  45561. (n.Euler.prototype = {
  45562. constructor: n.Euler,
  45563. get x() {
  45564. return this._x
  45565. },
  45566. set x(e) {
  45567. ;(this._x = e), this.onChangeCallback()
  45568. },
  45569. get y() {
  45570. return this._y
  45571. },
  45572. set y(e) {
  45573. ;(this._y = e), this.onChangeCallback()
  45574. },
  45575. get z() {
  45576. return this._z
  45577. },
  45578. set z(e) {
  45579. ;(this._z = e), this.onChangeCallback()
  45580. },
  45581. get order() {
  45582. return this._order
  45583. },
  45584. set order(e) {
  45585. ;(this._order = e), this.onChangeCallback()
  45586. },
  45587. set: function (e, t, i, n) {
  45588. return (
  45589. (this._x = e),
  45590. (this._y = t),
  45591. (this._z = i),
  45592. (this._order = n || this._order),
  45593. this.onChangeCallback(),
  45594. this
  45595. )
  45596. },
  45597. clone: function () {
  45598. return new this.constructor(this._x, this._y, this._z, this._order)
  45599. },
  45600. copy: function (e) {
  45601. return (
  45602. (this._x = e._x),
  45603. (this._y = e._y),
  45604. (this._z = e._z),
  45605. (this._order = e._order),
  45606. this.onChangeCallback(),
  45607. this
  45608. )
  45609. },
  45610. setFromRotationMatrix: function (e, t, i) {
  45611. var r = n.Math.clamp,
  45612. o = e.elements,
  45613. a = o[0],
  45614. s = o[4],
  45615. l = o[8],
  45616. c = o[1],
  45617. h = o[5],
  45618. u = o[9],
  45619. d = o[2],
  45620. p = o[6],
  45621. f = o[10]
  45622. return (
  45623. (t = t || this._order),
  45624. 'XYZ' === t
  45625. ? ((this._y = Math.asin(r(l, -1, 1))),
  45626. Math.abs(l) < 0.99999
  45627. ? ((this._x = Math.atan2(-u, f)), (this._z = Math.atan2(-s, a)))
  45628. : ((this._x = Math.atan2(p, h)), (this._z = 0)))
  45629. : 'YXZ' === t
  45630. ? ((this._x = Math.asin(-r(u, -1, 1))),
  45631. Math.abs(u) < 0.99999
  45632. ? ((this._y = Math.atan2(l, f)), (this._z = Math.atan2(c, h)))
  45633. : ((this._y = Math.atan2(-d, a)), (this._z = 0)))
  45634. : 'ZXY' === t
  45635. ? ((this._x = Math.asin(r(p, -1, 1))),
  45636. Math.abs(p) < 0.99999
  45637. ? ((this._y = Math.atan2(-d, f)), (this._z = Math.atan2(-s, h)))
  45638. : ((this._y = 0), (this._z = Math.atan2(c, a))))
  45639. : 'ZYX' === t
  45640. ? ((this._y = Math.asin(-r(d, -1, 1))),
  45641. Math.abs(d) < 0.99999
  45642. ? ((this._x = Math.atan2(p, f)), (this._z = Math.atan2(c, a)))
  45643. : ((this._x = 0), (this._z = Math.atan2(-s, h))))
  45644. : 'YZX' === t
  45645. ? ((this._z = Math.asin(r(c, -1, 1))),
  45646. Math.abs(c) < 0.99999
  45647. ? ((this._x = Math.atan2(-u, h)), (this._y = Math.atan2(-d, a)))
  45648. : ((this._x = 0), (this._y = Math.atan2(l, f))))
  45649. : 'XZY' === t
  45650. ? ((this._z = Math.asin(-r(s, -1, 1))),
  45651. Math.abs(s) < 0.99999
  45652. ? ((this._x = Math.atan2(p, h)), (this._y = Math.atan2(l, a)))
  45653. : ((this._x = Math.atan2(-u, f)), (this._y = 0)))
  45654. : console.warn(
  45655. 'THREE.Euler: .setFromRotationMatrix() given unsupported order: ' + t
  45656. ),
  45657. (this._order = t),
  45658. i !== !1 && this.onChangeCallback(),
  45659. this
  45660. )
  45661. },
  45662. setFromQuaternion: (function () {
  45663. var e
  45664. return function (t, i, r) {
  45665. return (
  45666. void 0 === e && (e = new n.Matrix4()),
  45667. e.makeRotationFromQuaternion(t),
  45668. this.setFromRotationMatrix(e, i, r),
  45669. this
  45670. )
  45671. }
  45672. })(),
  45673. setFromVector3: function (e, t) {
  45674. return this.set(e.x, e.y, e.z, t || this._order)
  45675. },
  45676. reorder: (function () {
  45677. var e = new n.Quaternion()
  45678. return function (t) {
  45679. e.setFromEuler(this), this.setFromQuaternion(e, t)
  45680. }
  45681. })(),
  45682. equals: function (e) {
  45683. return (
  45684. e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  45685. )
  45686. },
  45687. fromArray: function (e) {
  45688. return (
  45689. (this._x = e[0]),
  45690. (this._y = e[1]),
  45691. (this._z = e[2]),
  45692. void 0 !== e[3] && (this._order = e[3]),
  45693. this.onChangeCallback(),
  45694. this
  45695. )
  45696. },
  45697. toArray: function (e, t) {
  45698. return (
  45699. void 0 === e && (e = []),
  45700. void 0 === t && (t = 0),
  45701. (e[t] = this._x),
  45702. (e[t + 1] = this._y),
  45703. (e[t + 2] = this._z),
  45704. (e[t + 3] = this._order),
  45705. e
  45706. )
  45707. },
  45708. toVector3: function (e) {
  45709. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x, this._y, this._z)
  45710. },
  45711. onChange: function (e) {
  45712. return (this.onChangeCallback = e), this
  45713. },
  45714. onChangeCallback: function () {}
  45715. }),
  45716. (n.Line3 = function (e, t) {
  45717. ;(this.start = void 0 !== e ? e : new n.Vector3()),
  45718. (this.end = void 0 !== t ? t : new n.Vector3())
  45719. }),
  45720. (n.Line3.prototype = {
  45721. constructor: n.Line3,
  45722. set: function (e, t) {
  45723. return this.start.copy(e), this.end.copy(t), this
  45724. },
  45725. clone: function () {
  45726. return new this.constructor().copy(this)
  45727. },
  45728. copy: function (e) {
  45729. return this.start.copy(e.start), this.end.copy(e.end), this
  45730. },
  45731. center: function (e) {
  45732. var t = e || new n.Vector3()
  45733. return t.addVectors(this.start, this.end).multiplyScalar(0.5)
  45734. },
  45735. delta: function (e) {
  45736. var t = e || new n.Vector3()
  45737. return t.subVectors(this.end, this.start)
  45738. },
  45739. distanceSq: function () {
  45740. return this.start.distanceToSquared(this.end)
  45741. },
  45742. distance: function () {
  45743. return this.start.distanceTo(this.end)
  45744. },
  45745. at: function (e, t) {
  45746. var i = t || new n.Vector3()
  45747. return this.delta(i).multiplyScalar(e).add(this.start)
  45748. },
  45749. closestPointToPointParameter: (function () {
  45750. var e = new n.Vector3(),
  45751. t = new n.Vector3()
  45752. return function (i, r) {
  45753. e.subVectors(i, this.start), t.subVectors(this.end, this.start)
  45754. var o = t.dot(t),
  45755. a = t.dot(e),
  45756. s = a / o
  45757. return r && (s = n.Math.clamp(s, 0, 1)), s
  45758. }
  45759. })(),
  45760. closestPointToPoint: function (e, t, i) {
  45761. var r = this.closestPointToPointParameter(e, t),
  45762. o = i || new n.Vector3()
  45763. return this.delta(o).multiplyScalar(r).add(this.start)
  45764. },
  45765. applyMatrix4: function (e) {
  45766. return this.start.applyMatrix4(e), this.end.applyMatrix4(e), this
  45767. },
  45768. equals: function (e) {
  45769. return e.start.equals(this.start) && e.end.equals(this.end)
  45770. }
  45771. }),
  45772. (n.Box2 = function (e, t) {
  45773. ;(this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0), +(1 / 0))),
  45774. (this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0), -(1 / 0)))
  45775. }),
  45776. (n.Box2.prototype = {
  45777. constructor: n.Box2,
  45778. set: function (e, t) {
  45779. return this.min.copy(e), this.max.copy(t), this
  45780. },
  45781. setFromPoints: function (e) {
  45782. this.makeEmpty()
  45783. for (var t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t])
  45784. return this
  45785. },
  45786. setFromCenterAndSize: (function () {
  45787. var e = new n.Vector2()
  45788. return function (t, i) {
  45789. var n = e.copy(i).multiplyScalar(0.5)
  45790. return this.min.copy(t).sub(n), this.max.copy(t).add(n), this
  45791. }
  45792. })(),
  45793. clone: function () {
  45794. return new this.constructor().copy(this)
  45795. },
  45796. copy: function (e) {
  45797. return this.min.copy(e.min), this.max.copy(e.max), this
  45798. },
  45799. makeEmpty: function () {
  45800. return (
  45801. (this.min.x = this.min.y = +(1 / 0)), (this.max.x = this.max.y = -(1 / 0)), this
  45802. )
  45803. },
  45804. isEmpty: function () {
  45805. return this.max.x < this.min.x || this.max.y < this.min.y
  45806. },
  45807. center: function (e) {
  45808. var t = e || new n.Vector2()
  45809. return t.addVectors(this.min, this.max).multiplyScalar(0.5)
  45810. },
  45811. size: function (e) {
  45812. var t = e || new n.Vector2()
  45813. return t.subVectors(this.max, this.min)
  45814. },
  45815. expandByPoint: function (e) {
  45816. return this.min.min(e), this.max.max(e), this
  45817. },
  45818. expandByVector: function (e) {
  45819. return this.min.sub(e), this.max.add(e), this
  45820. },
  45821. expandByScalar: function (e) {
  45822. return this.min.addScalar(-e), this.max.addScalar(e), this
  45823. },
  45824. containsPoint: function (e) {
  45825. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  45826. },
  45827. containsBox: function (e) {
  45828. return (
  45829. this.min.x <= e.min.x &&
  45830. e.max.x <= this.max.x &&
  45831. this.min.y <= e.min.y &&
  45832. e.max.y <= this.max.y
  45833. )
  45834. },
  45835. getParameter: function (e, t) {
  45836. var i = t || new n.Vector2()
  45837. return i.set(
  45838. (e.x - this.min.x) / (this.max.x - this.min.x),
  45839. (e.y - this.min.y) / (this.max.y - this.min.y)
  45840. )
  45841. },
  45842. intersectsBox: function (e) {
  45843. return !(
  45844. e.max.x < this.min.x ||
  45845. e.min.x > this.max.x ||
  45846. e.max.y < this.min.y ||
  45847. e.min.y > this.max.y
  45848. )
  45849. },
  45850. clampPoint: function (e, t) {
  45851. var i = t || new n.Vector2()
  45852. return i.copy(e).clamp(this.min, this.max)
  45853. },
  45854. distanceToPoint: (function () {
  45855. var e = new n.Vector2()
  45856. return function (t) {
  45857. var i = e.copy(t).clamp(this.min, this.max)
  45858. return i.sub(t).length()
  45859. }
  45860. })(),
  45861. intersect: function (e) {
  45862. return this.min.max(e.min), this.max.min(e.max), this
  45863. },
  45864. union: function (e) {
  45865. return this.min.min(e.min), this.max.max(e.max), this
  45866. },
  45867. translate: function (e) {
  45868. return this.min.add(e), this.max.add(e), this
  45869. },
  45870. equals: function (e) {
  45871. return e.min.equals(this.min) && e.max.equals(this.max)
  45872. }
  45873. }),
  45874. (n.Box3 = function (e, t) {
  45875. ;(this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0), +(1 / 0), +(1 / 0))),
  45876. (this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0), -(1 / 0), -(1 / 0)))
  45877. }),
  45878. (n.Box3.prototype = {
  45879. constructor: n.Box3,
  45880. set: function (e, t) {
  45881. return this.min.copy(e), this.max.copy(t), this
  45882. },
  45883. setFromArray: function (e) {
  45884. this.makeEmpty()
  45885. for (
  45886. var t = +(1 / 0),
  45887. i = +(1 / 0),
  45888. n = +(1 / 0),
  45889. r = -(1 / 0),
  45890. o = -(1 / 0),
  45891. a = -(1 / 0),
  45892. s = 0,
  45893. l = e.length;
  45894. s < l;
  45895. s += 3
  45896. ) {
  45897. var c = e[s],
  45898. h = e[s + 1],
  45899. u = e[s + 2]
  45900. c < t && (t = c),
  45901. h < i && (i = h),
  45902. u < n && (n = u),
  45903. c > r && (r = c),
  45904. h > o && (o = h),
  45905. u > a && (a = u)
  45906. }
  45907. this.min.set(t, i, n), this.max.set(r, o, a)
  45908. },
  45909. setFromPoints: function (e) {
  45910. this.makeEmpty()
  45911. for (var t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t])
  45912. return this
  45913. },
  45914. setFromCenterAndSize: (function () {
  45915. var e = new n.Vector3()
  45916. return function (t, i) {
  45917. var n = e.copy(i).multiplyScalar(0.5)
  45918. return this.min.copy(t).sub(n), this.max.copy(t).add(n), this
  45919. }
  45920. })(),
  45921. setFromObject: (function () {
  45922. var e
  45923. return function (t) {
  45924. void 0 === e && (e = new n.Box3())
  45925. var i = this
  45926. return (
  45927. this.makeEmpty(),
  45928. t.updateMatrixWorld(!0),
  45929. t.traverse(function (t) {
  45930. var n = t.geometry
  45931. void 0 !== n &&
  45932. (null === n.boundingBox && n.computeBoundingBox(),
  45933. n.boundingBox.isEmpty() === !1 &&
  45934. (e.copy(n.boundingBox), e.applyMatrix4(t.matrixWorld), i.union(e)))
  45935. }),
  45936. this
  45937. )
  45938. }
  45939. })(),
  45940. clone: function () {
  45941. return new this.constructor().copy(this)
  45942. },
  45943. copy: function (e) {
  45944. return this.min.copy(e.min), this.max.copy(e.max), this
  45945. },
  45946. makeEmpty: function () {
  45947. return (
  45948. (this.min.x = this.min.y = this.min.z = +(1 / 0)),
  45949. (this.max.x = this.max.y = this.max.z = -(1 / 0)),
  45950. this
  45951. )
  45952. },
  45953. isEmpty: function () {
  45954. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  45955. },
  45956. center: function (e) {
  45957. var t = e || new n.Vector3()
  45958. return t.addVectors(this.min, this.max).multiplyScalar(0.5)
  45959. },
  45960. size: function (e) {
  45961. var t = e || new n.Vector3()
  45962. return t.subVectors(this.max, this.min)
  45963. },
  45964. expandByPoint: function (e) {
  45965. return this.min.min(e), this.max.max(e), this
  45966. },
  45967. expandByVector: function (e) {
  45968. return this.min.sub(e), this.max.add(e), this
  45969. },
  45970. expandByScalar: function (e) {
  45971. return this.min.addScalar(-e), this.max.addScalar(e), this
  45972. },
  45973. containsPoint: function (e) {
  45974. return !(
  45975. e.x < this.min.x ||
  45976. e.x > this.max.x ||
  45977. e.y < this.min.y ||
  45978. e.y > this.max.y ||
  45979. e.z < this.min.z ||
  45980. e.z > this.max.z
  45981. )
  45982. },
  45983. containsBox: function (e) {
  45984. return (
  45985. this.min.x <= e.min.x &&
  45986. e.max.x <= this.max.x &&
  45987. this.min.y <= e.min.y &&
  45988. e.max.y <= this.max.y &&
  45989. this.min.z <= e.min.z &&
  45990. e.max.z <= this.max.z
  45991. )
  45992. },
  45993. getParameter: function (e, t) {
  45994. var i = t || new n.Vector3()
  45995. return i.set(
  45996. (e.x - this.min.x) / (this.max.x - this.min.x),
  45997. (e.y - this.min.y) / (this.max.y - this.min.y),
  45998. (e.z - this.min.z) / (this.max.z - this.min.z)
  45999. )
  46000. },
  46001. intersectsBox: function (e) {
  46002. return !(
  46003. e.max.x < this.min.x ||
  46004. e.min.x > this.max.x ||
  46005. e.max.y < this.min.y ||
  46006. e.min.y > this.max.y ||
  46007. e.max.z < this.min.z ||
  46008. e.min.z > this.max.z
  46009. )
  46010. },
  46011. intersectsSphere: (function () {
  46012. var e
  46013. return function (t) {
  46014. return (
  46015. void 0 === e && (e = new n.Vector3()),
  46016. this.clampPoint(t.center, e),
  46017. e.distanceToSquared(t.center) <= t.radius * t.radius
  46018. )
  46019. }
  46020. })(),
  46021. intersectsPlane: function (e) {
  46022. var t, i
  46023. return (
  46024. e.normal.x > 0
  46025. ? ((t = e.normal.x * this.min.x), (i = e.normal.x * this.max.x))
  46026. : ((t = e.normal.x * this.max.x), (i = e.normal.x * this.min.x)),
  46027. e.normal.y > 0
  46028. ? ((t += e.normal.y * this.min.y), (i += e.normal.y * this.max.y))
  46029. : ((t += e.normal.y * this.max.y), (i += e.normal.y * this.min.y)),
  46030. e.normal.z > 0
  46031. ? ((t += e.normal.z * this.min.z), (i += e.normal.z * this.max.z))
  46032. : ((t += e.normal.z * this.max.z), (i += e.normal.z * this.min.z)),
  46033. t <= e.constant && i >= e.constant
  46034. )
  46035. },
  46036. clampPoint: function (e, t) {
  46037. var i = t || new n.Vector3()
  46038. return i.copy(e).clamp(this.min, this.max)
  46039. },
  46040. distanceToPoint: (function () {
  46041. var e = new n.Vector3()
  46042. return function (t) {
  46043. var i = e.copy(t).clamp(this.min, this.max)
  46044. return i.sub(t).length()
  46045. }
  46046. })(),
  46047. getBoundingSphere: (function () {
  46048. var e = new n.Vector3()
  46049. return function (t) {
  46050. var i = t || new n.Sphere()
  46051. return (i.center = this.center()), (i.radius = 0.5 * this.size(e).length()), i
  46052. }
  46053. })(),
  46054. intersect: function (e) {
  46055. return this.min.max(e.min), this.max.min(e.max), this
  46056. },
  46057. union: function (e) {
  46058. return this.min.min(e.min), this.max.max(e.max), this
  46059. },
  46060. applyMatrix4: (function () {
  46061. var e = [
  46062. new n.Vector3(),
  46063. new n.Vector3(),
  46064. new n.Vector3(),
  46065. new n.Vector3(),
  46066. new n.Vector3(),
  46067. new n.Vector3(),
  46068. new n.Vector3(),
  46069. new n.Vector3()
  46070. ]
  46071. return function (t) {
  46072. return (
  46073. e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  46074. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  46075. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  46076. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  46077. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  46078. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  46079. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  46080. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  46081. this.makeEmpty(),
  46082. this.setFromPoints(e),
  46083. this
  46084. )
  46085. }
  46086. })(),
  46087. translate: function (e) {
  46088. return this.min.add(e), this.max.add(e), this
  46089. },
  46090. equals: function (e) {
  46091. return e.min.equals(this.min) && e.max.equals(this.max)
  46092. }
  46093. }),
  46094. (n.Matrix3 = function () {
  46095. ;(this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1])),
  46096. arguments.length > 0 &&
  46097. console.error(
  46098. 'THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.'
  46099. )
  46100. }),
  46101. (n.Matrix3.prototype = {
  46102. constructor: n.Matrix3,
  46103. set: function (e, t, i, n, r, o, a, s, l) {
  46104. var c = this.elements
  46105. return (
  46106. (c[0] = e),
  46107. (c[1] = n),
  46108. (c[2] = a),
  46109. (c[3] = t),
  46110. (c[4] = r),
  46111. (c[5] = s),
  46112. (c[6] = i),
  46113. (c[7] = o),
  46114. (c[8] = l),
  46115. this
  46116. )
  46117. },
  46118. identity: function () {
  46119. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this
  46120. },
  46121. clone: function () {
  46122. return new this.constructor().fromArray(this.elements)
  46123. },
  46124. copy: function (e) {
  46125. var t = e.elements
  46126. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]), this
  46127. },
  46128. setFromMatrix4: function (e) {
  46129. var t = e.elements
  46130. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]), this
  46131. },
  46132. applyToVector3Array: (function () {
  46133. var e
  46134. return function (t, i, r) {
  46135. void 0 === e && (e = new n.Vector3()),
  46136. void 0 === i && (i = 0),
  46137. void 0 === r && (r = t.length)
  46138. for (var o = 0, a = i; o < r; o += 3, a += 3)
  46139. e.fromArray(t, a), e.applyMatrix3(this), e.toArray(t, a)
  46140. return t
  46141. }
  46142. })(),
  46143. applyToBuffer: (function () {
  46144. var e
  46145. return function (t, i, r) {
  46146. void 0 === e && (e = new n.Vector3()),
  46147. void 0 === i && (i = 0),
  46148. void 0 === r && (r = t.length / t.itemSize)
  46149. for (var o = 0, a = i; o < r; o++, a++)
  46150. (e.x = t.getX(a)),
  46151. (e.y = t.getY(a)),
  46152. (e.z = t.getZ(a)),
  46153. e.applyMatrix3(this),
  46154. t.setXYZ(e.x, e.y, e.z)
  46155. return t
  46156. }
  46157. })(),
  46158. multiplyScalar: function (e) {
  46159. var t = this.elements
  46160. return (
  46161. (t[0] *= e),
  46162. (t[3] *= e),
  46163. (t[6] *= e),
  46164. (t[1] *= e),
  46165. (t[4] *= e),
  46166. (t[7] *= e),
  46167. (t[2] *= e),
  46168. (t[5] *= e),
  46169. (t[8] *= e),
  46170. this
  46171. )
  46172. },
  46173. determinant: function () {
  46174. var e = this.elements,
  46175. t = e[0],
  46176. i = e[1],
  46177. n = e[2],
  46178. r = e[3],
  46179. o = e[4],
  46180. a = e[5],
  46181. s = e[6],
  46182. l = e[7],
  46183. c = e[8]
  46184. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  46185. },
  46186. getInverse: function (e, t) {
  46187. e instanceof n.Matrix4 &&
  46188. console.warn('THREE.Matrix3.getInverse no longer takes a Matrix4 argument.')
  46189. var i = e.elements,
  46190. r = this.elements,
  46191. o = i[0],
  46192. a = i[1],
  46193. s = i[2],
  46194. l = i[3],
  46195. c = i[4],
  46196. h = i[5],
  46197. u = i[6],
  46198. d = i[7],
  46199. p = i[8],
  46200. f = p * c - h * d,
  46201. g = h * u - p * l,
  46202. m = d * l - c * u,
  46203. v = o * f + a * g + s * m
  46204. if (0 === v) {
  46205. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0"
  46206. if (t) throw new Error(A)
  46207. return console.warn(A), this.identity()
  46208. }
  46209. return (
  46210. (r[0] = f),
  46211. (r[1] = s * d - p * a),
  46212. (r[2] = h * a - s * c),
  46213. (r[3] = g),
  46214. (r[4] = p * o - s * u),
  46215. (r[5] = s * l - h * o),
  46216. (r[6] = m),
  46217. (r[7] = a * u - d * o),
  46218. (r[8] = c * o - a * l),
  46219. this.multiplyScalar(1 / v)
  46220. )
  46221. },
  46222. transpose: function () {
  46223. var e,
  46224. t = this.elements
  46225. return (
  46226. (e = t[1]),
  46227. (t[1] = t[3]),
  46228. (t[3] = e),
  46229. (e = t[2]),
  46230. (t[2] = t[6]),
  46231. (t[6] = e),
  46232. (e = t[5]),
  46233. (t[5] = t[7]),
  46234. (t[7] = e),
  46235. this
  46236. )
  46237. },
  46238. flattenToArrayOffset: function (e, t) {
  46239. var i = this.elements
  46240. return (
  46241. (e[t] = i[0]),
  46242. (e[t + 1] = i[1]),
  46243. (e[t + 2] = i[2]),
  46244. (e[t + 3] = i[3]),
  46245. (e[t + 4] = i[4]),
  46246. (e[t + 5] = i[5]),
  46247. (e[t + 6] = i[6]),
  46248. (e[t + 7] = i[7]),
  46249. (e[t + 8] = i[8]),
  46250. e
  46251. )
  46252. },
  46253. getNormalMatrix: function (e) {
  46254. return this.setFromMatrix4(e).getInverse(this).transpose()
  46255. },
  46256. transposeIntoArray: function (e) {
  46257. var t = this.elements
  46258. return (
  46259. (e[0] = t[0]),
  46260. (e[1] = t[3]),
  46261. (e[2] = t[6]),
  46262. (e[3] = t[1]),
  46263. (e[4] = t[4]),
  46264. (e[5] = t[7]),
  46265. (e[6] = t[2]),
  46266. (e[7] = t[5]),
  46267. (e[8] = t[8]),
  46268. this
  46269. )
  46270. },
  46271. fromArray: function (e) {
  46272. return this.elements.set(e), this
  46273. },
  46274. toArray: function () {
  46275. var e = this.elements
  46276. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  46277. }
  46278. }),
  46279. (n.Matrix4 = function () {
  46280. ;(this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])),
  46281. arguments.length > 0 &&
  46282. console.error(
  46283. 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.'
  46284. )
  46285. }),
  46286. (n.Matrix4.prototype = {
  46287. constructor: n.Matrix4,
  46288. set: function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  46289. var m = this.elements
  46290. return (
  46291. (m[0] = e),
  46292. (m[4] = t),
  46293. (m[8] = i),
  46294. (m[12] = n),
  46295. (m[1] = r),
  46296. (m[5] = o),
  46297. (m[9] = a),
  46298. (m[13] = s),
  46299. (m[2] = l),
  46300. (m[6] = c),
  46301. (m[10] = h),
  46302. (m[14] = u),
  46303. (m[3] = d),
  46304. (m[7] = p),
  46305. (m[11] = f),
  46306. (m[15] = g),
  46307. this
  46308. )
  46309. },
  46310. identity: function () {
  46311. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  46312. },
  46313. clone: function () {
  46314. return new n.Matrix4().fromArray(this.elements)
  46315. },
  46316. copy: function (e) {
  46317. return this.elements.set(e.elements), this
  46318. },
  46319. copyPosition: function (e) {
  46320. var t = this.elements,
  46321. i = e.elements
  46322. return (t[12] = i[12]), (t[13] = i[13]), (t[14] = i[14]), this
  46323. },
  46324. extractBasis: function (e, t, i) {
  46325. return (
  46326. e.setFromMatrixColumn(this, 0),
  46327. t.setFromMatrixColumn(this, 1),
  46328. i.setFromMatrixColumn(this, 2),
  46329. this
  46330. )
  46331. },
  46332. makeBasis: function (e, t, i) {
  46333. return (
  46334. 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
  46335. )
  46336. },
  46337. extractRotation: (function () {
  46338. var e
  46339. return function (t) {
  46340. void 0 === e && (e = new n.Vector3())
  46341. var i = this.elements,
  46342. r = t.elements,
  46343. o = 1 / e.setFromMatrixColumn(t, 0).length(),
  46344. a = 1 / e.setFromMatrixColumn(t, 1).length(),
  46345. s = 1 / e.setFromMatrixColumn(t, 2).length()
  46346. return (
  46347. (i[0] = r[0] * o),
  46348. (i[1] = r[1] * o),
  46349. (i[2] = r[2] * o),
  46350. (i[4] = r[4] * a),
  46351. (i[5] = r[5] * a),
  46352. (i[6] = r[6] * a),
  46353. (i[8] = r[8] * s),
  46354. (i[9] = r[9] * s),
  46355. (i[10] = r[10] * s),
  46356. this
  46357. )
  46358. }
  46359. })(),
  46360. makeRotationFromEuler: function (e) {
  46361. e instanceof n.Euler == !1 &&
  46362. console.error(
  46363. 'THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.'
  46364. )
  46365. var t = this.elements,
  46366. i = e.x,
  46367. r = e.y,
  46368. o = e.z,
  46369. a = Math.cos(i),
  46370. s = Math.sin(i),
  46371. l = Math.cos(r),
  46372. c = Math.sin(r),
  46373. h = Math.cos(o),
  46374. u = Math.sin(o)
  46375. if ('XYZ' === e.order) {
  46376. var d = a * h,
  46377. p = a * u,
  46378. f = s * h,
  46379. g = s * u
  46380. ;(t[0] = l * h),
  46381. (t[4] = -l * u),
  46382. (t[8] = c),
  46383. (t[1] = p + f * c),
  46384. (t[5] = d - g * c),
  46385. (t[9] = -s * l),
  46386. (t[2] = g - d * c),
  46387. (t[6] = f + p * c),
  46388. (t[10] = a * l)
  46389. } else if ('YXZ' === e.order) {
  46390. var m = l * h,
  46391. v = l * u,
  46392. A = c * h,
  46393. y = c * u
  46394. ;(t[0] = m + y * s),
  46395. (t[4] = A * s - v),
  46396. (t[8] = a * c),
  46397. (t[1] = a * u),
  46398. (t[5] = a * h),
  46399. (t[9] = -s),
  46400. (t[2] = v * s - A),
  46401. (t[6] = y + m * s),
  46402. (t[10] = a * l)
  46403. } else if ('ZXY' === e.order) {
  46404. var m = l * h,
  46405. v = l * u,
  46406. A = c * h,
  46407. y = c * u
  46408. ;(t[0] = m - y * s),
  46409. (t[4] = -a * u),
  46410. (t[8] = A + v * s),
  46411. (t[1] = v + A * s),
  46412. (t[5] = a * h),
  46413. (t[9] = y - m * s),
  46414. (t[2] = -a * c),
  46415. (t[6] = s),
  46416. (t[10] = a * l)
  46417. } else if ('ZYX' === e.order) {
  46418. var d = a * h,
  46419. p = a * u,
  46420. f = s * h,
  46421. g = s * u
  46422. ;(t[0] = l * h),
  46423. (t[4] = f * c - p),
  46424. (t[8] = d * c + g),
  46425. (t[1] = l * u),
  46426. (t[5] = g * c + d),
  46427. (t[9] = p * c - f),
  46428. (t[2] = -c),
  46429. (t[6] = s * l),
  46430. (t[10] = a * l)
  46431. } else if ('YZX' === e.order) {
  46432. var C = a * l,
  46433. I = a * c,
  46434. E = s * l,
  46435. b = s * c
  46436. ;(t[0] = l * h),
  46437. (t[4] = b - C * u),
  46438. (t[8] = E * u + I),
  46439. (t[1] = u),
  46440. (t[5] = a * h),
  46441. (t[9] = -s * h),
  46442. (t[2] = -c * h),
  46443. (t[6] = I * u + E),
  46444. (t[10] = C - b * u)
  46445. } else if ('XZY' === e.order) {
  46446. var C = a * l,
  46447. I = a * c,
  46448. E = s * l,
  46449. b = s * c
  46450. ;(t[0] = l * h),
  46451. (t[4] = -u),
  46452. (t[8] = c * h),
  46453. (t[1] = C * u + b),
  46454. (t[5] = a * h),
  46455. (t[9] = I * u - E),
  46456. (t[2] = E * u - I),
  46457. (t[6] = s * h),
  46458. (t[10] = b * u + C)
  46459. }
  46460. return (
  46461. (t[3] = 0),
  46462. (t[7] = 0),
  46463. (t[11] = 0),
  46464. (t[12] = 0),
  46465. (t[13] = 0),
  46466. (t[14] = 0),
  46467. (t[15] = 1),
  46468. this
  46469. )
  46470. },
  46471. makeRotationFromQuaternion: function (e) {
  46472. var t = this.elements,
  46473. i = e.x,
  46474. n = e.y,
  46475. r = e.z,
  46476. o = e.w,
  46477. a = i + i,
  46478. s = n + n,
  46479. l = r + r,
  46480. c = i * a,
  46481. h = i * s,
  46482. u = i * l,
  46483. d = n * s,
  46484. p = n * l,
  46485. f = r * l,
  46486. g = o * a,
  46487. m = o * s,
  46488. v = o * l
  46489. return (
  46490. (t[0] = 1 - (d + f)),
  46491. (t[4] = h - v),
  46492. (t[8] = u + m),
  46493. (t[1] = h + v),
  46494. (t[5] = 1 - (c + f)),
  46495. (t[9] = p - g),
  46496. (t[2] = u - m),
  46497. (t[6] = p + g),
  46498. (t[10] = 1 - (c + d)),
  46499. (t[3] = 0),
  46500. (t[7] = 0),
  46501. (t[11] = 0),
  46502. (t[12] = 0),
  46503. (t[13] = 0),
  46504. (t[14] = 0),
  46505. (t[15] = 1),
  46506. this
  46507. )
  46508. },
  46509. lookAt: (function () {
  46510. var e, t, i
  46511. return function (r, o, a) {
  46512. void 0 === e && (e = new n.Vector3()),
  46513. void 0 === t && (t = new n.Vector3()),
  46514. void 0 === i && (i = new n.Vector3())
  46515. var s = this.elements
  46516. return (
  46517. i.subVectors(r, o).normalize(),
  46518. 0 === i.lengthSq() && (i.z = 1),
  46519. e.crossVectors(a, i).normalize(),
  46520. 0 === e.lengthSq() && ((i.x += 1e-4), e.crossVectors(a, i).normalize()),
  46521. t.crossVectors(i, e),
  46522. (s[0] = e.x),
  46523. (s[4] = t.x),
  46524. (s[8] = i.x),
  46525. (s[1] = e.y),
  46526. (s[5] = t.y),
  46527. (s[9] = i.y),
  46528. (s[2] = e.z),
  46529. (s[6] = t.z),
  46530. (s[10] = i.z),
  46531. this
  46532. )
  46533. }
  46534. })(),
  46535. multiply: function (e, t) {
  46536. return void 0 !== t
  46537. ? (console.warn(
  46538. 'THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.'
  46539. ),
  46540. this.multiplyMatrices(e, t))
  46541. : this.multiplyMatrices(this, e)
  46542. },
  46543. multiplyMatrices: function (e, t) {
  46544. var i = e.elements,
  46545. n = t.elements,
  46546. r = this.elements,
  46547. o = i[0],
  46548. a = i[4],
  46549. s = i[8],
  46550. l = i[12],
  46551. c = i[1],
  46552. h = i[5],
  46553. u = i[9],
  46554. d = i[13],
  46555. p = i[2],
  46556. f = i[6],
  46557. g = i[10],
  46558. m = i[14],
  46559. v = i[3],
  46560. A = i[7],
  46561. y = i[11],
  46562. C = i[15],
  46563. I = n[0],
  46564. E = n[4],
  46565. b = n[8],
  46566. w = n[12],
  46567. _ = n[1],
  46568. T = n[5],
  46569. x = n[9],
  46570. S = n[13],
  46571. M = n[2],
  46572. R = n[6],
  46573. P = n[10],
  46574. O = n[14],
  46575. L = n[3],
  46576. D = n[7],
  46577. N = n[11],
  46578. B = n[15]
  46579. return (
  46580. (r[0] = o * I + a * _ + s * M + l * L),
  46581. (r[4] = o * E + a * T + s * R + l * D),
  46582. (r[8] = o * b + a * x + s * P + l * N),
  46583. (r[12] = o * w + a * S + s * O + l * B),
  46584. (r[1] = c * I + h * _ + u * M + d * L),
  46585. (r[5] = c * E + h * T + u * R + d * D),
  46586. (r[9] = c * b + h * x + u * P + d * N),
  46587. (r[13] = c * w + h * S + u * O + d * B),
  46588. (r[2] = p * I + f * _ + g * M + m * L),
  46589. (r[6] = p * E + f * T + g * R + m * D),
  46590. (r[10] = p * b + f * x + g * P + m * N),
  46591. (r[14] = p * w + f * S + g * O + m * B),
  46592. (r[3] = v * I + A * _ + y * M + C * L),
  46593. (r[7] = v * E + A * T + y * R + C * D),
  46594. (r[11] = v * b + A * x + y * P + C * N),
  46595. (r[15] = v * w + A * S + y * O + C * B),
  46596. this
  46597. )
  46598. },
  46599. multiplyToArray: function (e, t, i) {
  46600. var n = this.elements
  46601. return (
  46602. this.multiplyMatrices(e, t),
  46603. (i[0] = n[0]),
  46604. (i[1] = n[1]),
  46605. (i[2] = n[2]),
  46606. (i[3] = n[3]),
  46607. (i[4] = n[4]),
  46608. (i[5] = n[5]),
  46609. (i[6] = n[6]),
  46610. (i[7] = n[7]),
  46611. (i[8] = n[8]),
  46612. (i[9] = n[9]),
  46613. (i[10] = n[10]),
  46614. (i[11] = n[11]),
  46615. (i[12] = n[12]),
  46616. (i[13] = n[13]),
  46617. (i[14] = n[14]),
  46618. (i[15] = n[15]),
  46619. this
  46620. )
  46621. },
  46622. multiplyScalar: function (e) {
  46623. var t = this.elements
  46624. return (
  46625. (t[0] *= e),
  46626. (t[4] *= e),
  46627. (t[8] *= e),
  46628. (t[12] *= e),
  46629. (t[1] *= e),
  46630. (t[5] *= e),
  46631. (t[9] *= e),
  46632. (t[13] *= e),
  46633. (t[2] *= e),
  46634. (t[6] *= e),
  46635. (t[10] *= e),
  46636. (t[14] *= e),
  46637. (t[3] *= e),
  46638. (t[7] *= e),
  46639. (t[11] *= e),
  46640. (t[15] *= e),
  46641. this
  46642. )
  46643. },
  46644. applyToVector3Array: (function () {
  46645. var e
  46646. return function (t, i, r) {
  46647. void 0 === e && (e = new n.Vector3()),
  46648. void 0 === i && (i = 0),
  46649. void 0 === r && (r = t.length)
  46650. for (var o = 0, a = i; o < r; o += 3, a += 3)
  46651. e.fromArray(t, a), e.applyMatrix4(this), e.toArray(t, a)
  46652. return t
  46653. }
  46654. })(),
  46655. applyToBuffer: (function () {
  46656. var e
  46657. return function (t, i, r) {
  46658. void 0 === e && (e = new n.Vector3()),
  46659. void 0 === i && (i = 0),
  46660. void 0 === r && (r = t.length / t.itemSize)
  46661. for (var o = 0, a = i; o < r; o++, a++)
  46662. (e.x = t.getX(a)),
  46663. (e.y = t.getY(a)),
  46664. (e.z = t.getZ(a)),
  46665. e.applyMatrix4(this),
  46666. t.setXYZ(e.x, e.y, e.z)
  46667. return t
  46668. }
  46669. })(),
  46670. determinant: function () {
  46671. var e = this.elements,
  46672. t = e[0],
  46673. i = e[4],
  46674. n = e[8],
  46675. r = e[12],
  46676. o = e[1],
  46677. a = e[5],
  46678. s = e[9],
  46679. l = e[13],
  46680. c = e[2],
  46681. h = e[6],
  46682. u = e[10],
  46683. d = e[14],
  46684. p = e[3],
  46685. f = e[7],
  46686. g = e[11],
  46687. m = e[15]
  46688. return (
  46689. p * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) +
  46690. f * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) +
  46691. g * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) +
  46692. m * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  46693. )
  46694. },
  46695. transpose: function () {
  46696. var e,
  46697. t = this.elements
  46698. return (
  46699. (e = t[1]),
  46700. (t[1] = t[4]),
  46701. (t[4] = e),
  46702. (e = t[2]),
  46703. (t[2] = t[8]),
  46704. (t[8] = e),
  46705. (e = t[6]),
  46706. (t[6] = t[9]),
  46707. (t[9] = e),
  46708. (e = t[3]),
  46709. (t[3] = t[12]),
  46710. (t[12] = e),
  46711. (e = t[7]),
  46712. (t[7] = t[13]),
  46713. (t[13] = e),
  46714. (e = t[11]),
  46715. (t[11] = t[14]),
  46716. (t[14] = e),
  46717. this
  46718. )
  46719. },
  46720. flattenToArrayOffset: function (e, t) {
  46721. var i = this.elements
  46722. return (
  46723. (e[t] = i[0]),
  46724. (e[t + 1] = i[1]),
  46725. (e[t + 2] = i[2]),
  46726. (e[t + 3] = i[3]),
  46727. (e[t + 4] = i[4]),
  46728. (e[t + 5] = i[5]),
  46729. (e[t + 6] = i[6]),
  46730. (e[t + 7] = i[7]),
  46731. (e[t + 8] = i[8]),
  46732. (e[t + 9] = i[9]),
  46733. (e[t + 10] = i[10]),
  46734. (e[t + 11] = i[11]),
  46735. (e[t + 12] = i[12]),
  46736. (e[t + 13] = i[13]),
  46737. (e[t + 14] = i[14]),
  46738. (e[t + 15] = i[15]),
  46739. e
  46740. )
  46741. },
  46742. getPosition: (function () {
  46743. var e
  46744. return function () {
  46745. return (
  46746. void 0 === e && (e = new n.Vector3()),
  46747. console.warn(
  46748. 'THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.'
  46749. ),
  46750. e.setFromMatrixColumn(this, 3)
  46751. )
  46752. }
  46753. })(),
  46754. setPosition: function (e) {
  46755. var t = this.elements
  46756. return (t[12] = e.x), (t[13] = e.y), (t[14] = e.z), this
  46757. },
  46758. getInverse: function (e, t) {
  46759. var i = this.elements,
  46760. n = e.elements,
  46761. r = n[0],
  46762. o = n[1],
  46763. a = n[2],
  46764. s = n[3],
  46765. l = n[4],
  46766. c = n[5],
  46767. h = n[6],
  46768. u = n[7],
  46769. d = n[8],
  46770. p = n[9],
  46771. f = n[10],
  46772. g = n[11],
  46773. m = n[12],
  46774. v = n[13],
  46775. A = n[14],
  46776. y = n[15],
  46777. C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y,
  46778. I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y,
  46779. E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y,
  46780. b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A,
  46781. w = r * C + o * I + a * E + s * b
  46782. if (0 === w) {
  46783. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0"
  46784. if (t) throw new Error(_)
  46785. return console.warn(_), this.identity()
  46786. }
  46787. return (
  46788. (i[0] = C),
  46789. (i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y),
  46790. (i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y),
  46791. (i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g),
  46792. (i[4] = I),
  46793. (i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y),
  46794. (i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y),
  46795. (i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g),
  46796. (i[8] = E),
  46797. (i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y),
  46798. (i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y),
  46799. (i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g),
  46800. (i[12] = b),
  46801. (i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A),
  46802. (i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A),
  46803. (i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f),
  46804. this.multiplyScalar(1 / w)
  46805. )
  46806. },
  46807. scale: function (e) {
  46808. var t = this.elements,
  46809. i = e.x,
  46810. n = e.y,
  46811. r = e.z
  46812. return (
  46813. (t[0] *= i),
  46814. (t[4] *= n),
  46815. (t[8] *= r),
  46816. (t[1] *= i),
  46817. (t[5] *= n),
  46818. (t[9] *= r),
  46819. (t[2] *= i),
  46820. (t[6] *= n),
  46821. (t[10] *= r),
  46822. (t[3] *= i),
  46823. (t[7] *= n),
  46824. (t[11] *= r),
  46825. this
  46826. )
  46827. },
  46828. getMaxScaleOnAxis: function () {
  46829. var e = this.elements,
  46830. t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2],
  46831. i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6],
  46832. n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10]
  46833. return Math.sqrt(Math.max(t, i, n))
  46834. },
  46835. makeTranslation: function (e, t, i) {
  46836. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1), this
  46837. },
  46838. makeRotationX: function (e) {
  46839. var t = Math.cos(e),
  46840. i = Math.sin(e)
  46841. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1), this
  46842. },
  46843. makeRotationY: function (e) {
  46844. var t = Math.cos(e),
  46845. i = Math.sin(e)
  46846. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1), this
  46847. },
  46848. makeRotationZ: function (e) {
  46849. var t = Math.cos(e),
  46850. i = Math.sin(e)
  46851. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  46852. },
  46853. makeRotationAxis: function (e, t) {
  46854. var i = Math.cos(t),
  46855. n = Math.sin(t),
  46856. r = 1 - i,
  46857. o = e.x,
  46858. a = e.y,
  46859. s = e.z,
  46860. l = r * o,
  46861. c = r * a
  46862. return (
  46863. this.set(
  46864. l * o + i,
  46865. l * a - n * s,
  46866. l * s + n * a,
  46867. 0,
  46868. l * a + n * s,
  46869. c * a + i,
  46870. c * s - n * o,
  46871. 0,
  46872. l * s - n * a,
  46873. c * s + n * o,
  46874. r * s * s + i,
  46875. 0,
  46876. 0,
  46877. 0,
  46878. 0,
  46879. 1
  46880. ),
  46881. this
  46882. )
  46883. },
  46884. makeScale: function (e, t, i) {
  46885. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1), this
  46886. },
  46887. compose: function (e, t, i) {
  46888. return this.makeRotationFromQuaternion(t), this.scale(i), this.setPosition(e), this
  46889. },
  46890. decompose: (function () {
  46891. var e, t
  46892. return function (i, r, o) {
  46893. void 0 === e && (e = new n.Vector3()), void 0 === t && (t = new n.Matrix4())
  46894. var a = this.elements,
  46895. s = e.set(a[0], a[1], a[2]).length(),
  46896. l = e.set(a[4], a[5], a[6]).length(),
  46897. c = e.set(a[8], a[9], a[10]).length(),
  46898. h = this.determinant()
  46899. h < 0 && (s = -s),
  46900. (i.x = a[12]),
  46901. (i.y = a[13]),
  46902. (i.z = a[14]),
  46903. t.elements.set(this.elements)
  46904. var u = 1 / s,
  46905. d = 1 / l,
  46906. p = 1 / c
  46907. return (
  46908. (t.elements[0] *= u),
  46909. (t.elements[1] *= u),
  46910. (t.elements[2] *= u),
  46911. (t.elements[4] *= d),
  46912. (t.elements[5] *= d),
  46913. (t.elements[6] *= d),
  46914. (t.elements[8] *= p),
  46915. (t.elements[9] *= p),
  46916. (t.elements[10] *= p),
  46917. r.setFromRotationMatrix(t),
  46918. (o.x = s),
  46919. (o.y = l),
  46920. (o.z = c),
  46921. this
  46922. )
  46923. }
  46924. })(),
  46925. makeFrustum: function (e, t, i, n, r, o) {
  46926. var a = this.elements,
  46927. s = (2 * r) / (t - e),
  46928. l = (2 * r) / (n - i),
  46929. c = (t + e) / (t - e),
  46930. h = (n + i) / (n - i),
  46931. u = -(o + r) / (o - r),
  46932. d = (-2 * o * r) / (o - r)
  46933. return (
  46934. (a[0] = s),
  46935. (a[4] = 0),
  46936. (a[8] = c),
  46937. (a[12] = 0),
  46938. (a[1] = 0),
  46939. (a[5] = l),
  46940. (a[9] = h),
  46941. (a[13] = 0),
  46942. (a[2] = 0),
  46943. (a[6] = 0),
  46944. (a[10] = u),
  46945. (a[14] = d),
  46946. (a[3] = 0),
  46947. (a[7] = 0),
  46948. (a[11] = -1),
  46949. (a[15] = 0),
  46950. this
  46951. )
  46952. },
  46953. makePerspective: function (e, t, i, r) {
  46954. var o = i * Math.tan(n.Math.degToRad(0.5 * e)),
  46955. a = -o,
  46956. s = a * t,
  46957. l = o * t
  46958. return this.makeFrustum(s, l, a, o, i, r)
  46959. },
  46960. makeOrthographic: function (e, t, i, n, r, o) {
  46961. var a = this.elements,
  46962. s = 1 / (t - e),
  46963. l = 1 / (i - n),
  46964. c = 1 / (o - r),
  46965. h = (t + e) * s,
  46966. u = (i + n) * l,
  46967. d = (o + r) * c
  46968. return (
  46969. (a[0] = 2 * s),
  46970. (a[4] = 0),
  46971. (a[8] = 0),
  46972. (a[12] = -h),
  46973. (a[1] = 0),
  46974. (a[5] = 2 * l),
  46975. (a[9] = 0),
  46976. (a[13] = -u),
  46977. (a[2] = 0),
  46978. (a[6] = 0),
  46979. (a[10] = -2 * c),
  46980. (a[14] = -d),
  46981. (a[3] = 0),
  46982. (a[7] = 0),
  46983. (a[11] = 0),
  46984. (a[15] = 1),
  46985. this
  46986. )
  46987. },
  46988. equals: function (e) {
  46989. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  46990. if (t[n] !== i[n]) return !1
  46991. return !0
  46992. },
  46993. fromArray: function (e) {
  46994. return this.elements.set(e), this
  46995. },
  46996. toArray: function () {
  46997. var e = this.elements
  46998. return [
  46999. e[0],
  47000. e[1],
  47001. e[2],
  47002. e[3],
  47003. e[4],
  47004. e[5],
  47005. e[6],
  47006. e[7],
  47007. e[8],
  47008. e[9],
  47009. e[10],
  47010. e[11],
  47011. e[12],
  47012. e[13],
  47013. e[14],
  47014. e[15]
  47015. ]
  47016. }
  47017. }),
  47018. (n.Ray = function (e, t) {
  47019. ;(this.origin = void 0 !== e ? e : new n.Vector3()),
  47020. (this.direction = void 0 !== t ? t : new n.Vector3())
  47021. }),
  47022. (n.Ray.prototype = {
  47023. constructor: n.Ray,
  47024. set: function (e, t) {
  47025. return this.origin.copy(e), this.direction.copy(t), this
  47026. },
  47027. clone: function () {
  47028. return new this.constructor().copy(this)
  47029. },
  47030. copy: function (e) {
  47031. return this.origin.copy(e.origin), this.direction.copy(e.direction), this
  47032. },
  47033. at: function (e, t) {
  47034. var i = t || new n.Vector3()
  47035. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  47036. },
  47037. lookAt: function (e) {
  47038. this.direction.copy(e).sub(this.origin).normalize()
  47039. },
  47040. recast: (function () {
  47041. var e = new n.Vector3()
  47042. return function (t) {
  47043. return this.origin.copy(this.at(t, e)), this
  47044. }
  47045. })(),
  47046. closestPointToPoint: function (e, t) {
  47047. var i = t || new n.Vector3()
  47048. i.subVectors(e, this.origin)
  47049. var r = i.dot(this.direction)
  47050. return r < 0
  47051. ? i.copy(this.origin)
  47052. : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  47053. },
  47054. distanceToPoint: function (e) {
  47055. return Math.sqrt(this.distanceSqToPoint(e))
  47056. },
  47057. distanceSqToPoint: (function () {
  47058. var e = new n.Vector3()
  47059. return function (t) {
  47060. var i = e.subVectors(t, this.origin).dot(this.direction)
  47061. return i < 0
  47062. ? this.origin.distanceToSquared(t)
  47063. : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  47064. e.distanceToSquared(t))
  47065. }
  47066. })(),
  47067. distanceSqToSegment: (function () {
  47068. var e = new n.Vector3(),
  47069. t = new n.Vector3(),
  47070. i = new n.Vector3()
  47071. return function (n, r, o, a) {
  47072. e.copy(n).add(r).multiplyScalar(0.5),
  47073. t.copy(r).sub(n).normalize(),
  47074. i.copy(this.origin).sub(e)
  47075. var s,
  47076. l,
  47077. c,
  47078. h,
  47079. u = 0.5 * n.distanceTo(r),
  47080. d = -this.direction.dot(t),
  47081. p = i.dot(this.direction),
  47082. f = -i.dot(t),
  47083. g = i.lengthSq(),
  47084. m = Math.abs(1 - d * d)
  47085. if (m > 0)
  47086. if (((s = d * f - p), (l = d * p - f), (h = u * m), s >= 0))
  47087. if (l >= -h)
  47088. if (l <= h) {
  47089. var v = 1 / m
  47090. ;(s *= v),
  47091. (l *= v),
  47092. (c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g)
  47093. } else
  47094. (l = u), (s = Math.max(0, -(d * l + p))), (c = -s * s + l * (l + 2 * f) + g)
  47095. else
  47096. (l = -u), (s = Math.max(0, -(d * l + p))), (c = -s * s + l * (l + 2 * f) + g)
  47097. else
  47098. l <= -h
  47099. ? ((s = Math.max(0, -(-d * u + p))),
  47100. (l = s > 0 ? -u : Math.min(Math.max(-u, -f), u)),
  47101. (c = -s * s + l * (l + 2 * f) + g))
  47102. : l <= h
  47103. ? ((s = 0), (l = Math.min(Math.max(-u, -f), u)), (c = l * (l + 2 * f) + g))
  47104. : ((s = Math.max(0, -(d * u + p))),
  47105. (l = s > 0 ? u : Math.min(Math.max(-u, -f), u)),
  47106. (c = -s * s + l * (l + 2 * f) + g))
  47107. else
  47108. (l = d > 0 ? -u : u),
  47109. (s = Math.max(0, -(d * l + p))),
  47110. (c = -s * s + l * (l + 2 * f) + g)
  47111. return (
  47112. o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  47113. a && a.copy(t).multiplyScalar(l).add(e),
  47114. c
  47115. )
  47116. }
  47117. })(),
  47118. intersectSphere: (function () {
  47119. var e = new n.Vector3()
  47120. return function (t, i) {
  47121. e.subVectors(t.center, this.origin)
  47122. var n = e.dot(this.direction),
  47123. r = e.dot(e) - n * n,
  47124. o = t.radius * t.radius
  47125. if (r > o) return null
  47126. var a = Math.sqrt(o - r),
  47127. s = n - a,
  47128. l = n + a
  47129. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  47130. }
  47131. })(),
  47132. intersectsSphere: function (e) {
  47133. return this.distanceToPoint(e.center) <= e.radius
  47134. },
  47135. distanceToPlane: function (e) {
  47136. var t = e.normal.dot(this.direction)
  47137. if (0 === t) return 0 === e.distanceToPoint(this.origin) ? 0 : null
  47138. var i = -(this.origin.dot(e.normal) + e.constant) / t
  47139. return i >= 0 ? i : null
  47140. },
  47141. intersectPlane: function (e, t) {
  47142. var i = this.distanceToPlane(e)
  47143. return null === i ? null : this.at(i, t)
  47144. },
  47145. intersectsPlane: function (e) {
  47146. var t = e.distanceToPoint(this.origin)
  47147. if (0 === t) return !0
  47148. var i = e.normal.dot(this.direction)
  47149. return i * t < 0
  47150. },
  47151. intersectBox: function (e, t) {
  47152. var i,
  47153. n,
  47154. r,
  47155. o,
  47156. a,
  47157. s,
  47158. l = 1 / this.direction.x,
  47159. c = 1 / this.direction.y,
  47160. h = 1 / this.direction.z,
  47161. u = this.origin
  47162. return (
  47163. l >= 0
  47164. ? ((i = (e.min.x - u.x) * l), (n = (e.max.x - u.x) * l))
  47165. : ((i = (e.max.x - u.x) * l), (n = (e.min.x - u.x) * l)),
  47166. c >= 0
  47167. ? ((r = (e.min.y - u.y) * c), (o = (e.max.y - u.y) * c))
  47168. : ((r = (e.max.y - u.y) * c), (o = (e.min.y - u.y) * c)),
  47169. i > o || r > n
  47170. ? null
  47171. : ((r > i || i !== i) && (i = r),
  47172. (o < n || n !== n) && (n = o),
  47173. h >= 0
  47174. ? ((a = (e.min.z - u.z) * h), (s = (e.max.z - u.z) * h))
  47175. : ((a = (e.max.z - u.z) * h), (s = (e.min.z - u.z) * h)),
  47176. i > s || a > n
  47177. ? null
  47178. : ((a > i || i !== i) && (i = a),
  47179. (s < n || n !== n) && (n = s),
  47180. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  47181. )
  47182. },
  47183. intersectsBox: (function () {
  47184. var e = new n.Vector3()
  47185. return function (t) {
  47186. return null !== this.intersectBox(t, e)
  47187. }
  47188. })(),
  47189. intersectTriangle: (function () {
  47190. var e = new n.Vector3(),
  47191. t = new n.Vector3(),
  47192. i = new n.Vector3(),
  47193. r = new n.Vector3()
  47194. return function (n, o, a, s, l) {
  47195. t.subVectors(o, n), i.subVectors(a, n), r.crossVectors(t, i)
  47196. var c,
  47197. h = this.direction.dot(r)
  47198. if (h > 0) {
  47199. if (s) return null
  47200. c = 1
  47201. } else {
  47202. if (!(h < 0)) return null
  47203. ;(c = -1), (h = -h)
  47204. }
  47205. e.subVectors(this.origin, n)
  47206. var u = c * this.direction.dot(i.crossVectors(e, i))
  47207. if (u < 0) return null
  47208. var d = c * this.direction.dot(t.cross(e))
  47209. if (d < 0) return null
  47210. if (u + d > h) return null
  47211. var p = -c * e.dot(r)
  47212. return p < 0 ? null : this.at(p / h, l)
  47213. }
  47214. })(),
  47215. applyMatrix4: function (e) {
  47216. return (
  47217. this.direction.add(this.origin).applyMatrix4(e),
  47218. this.origin.applyMatrix4(e),
  47219. this.direction.sub(this.origin),
  47220. this.direction.normalize(),
  47221. this
  47222. )
  47223. },
  47224. equals: function (e) {
  47225. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  47226. }
  47227. }),
  47228. (n.Sphere = function (e, t) {
  47229. ;(this.center = void 0 !== e ? e : new n.Vector3()),
  47230. (this.radius = void 0 !== t ? t : 0)
  47231. }),
  47232. (n.Sphere.prototype = {
  47233. constructor: n.Sphere,
  47234. set: function (e, t) {
  47235. return this.center.copy(e), (this.radius = t), this
  47236. },
  47237. setFromPoints: (function () {
  47238. var e = new n.Box3()
  47239. return function (t, i) {
  47240. var n = this.center
  47241. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n)
  47242. for (var r = 0, o = 0, a = t.length; o < a; o++)
  47243. r = Math.max(r, n.distanceToSquared(t[o]))
  47244. return (this.radius = Math.sqrt(r)), this
  47245. }
  47246. })(),
  47247. clone: function () {
  47248. return new this.constructor().copy(this)
  47249. },
  47250. copy: function (e) {
  47251. return this.center.copy(e.center), (this.radius = e.radius), this
  47252. },
  47253. empty: function () {
  47254. return this.radius <= 0
  47255. },
  47256. containsPoint: function (e) {
  47257. return e.distanceToSquared(this.center) <= this.radius * this.radius
  47258. },
  47259. distanceToPoint: function (e) {
  47260. return e.distanceTo(this.center) - this.radius
  47261. },
  47262. intersectsSphere: function (e) {
  47263. var t = this.radius + e.radius
  47264. return e.center.distanceToSquared(this.center) <= t * t
  47265. },
  47266. intersectsBox: function (e) {
  47267. return e.intersectsSphere(this)
  47268. },
  47269. intersectsPlane: function (e) {
  47270. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  47271. },
  47272. clampPoint: function (e, t) {
  47273. var i = this.center.distanceToSquared(e),
  47274. r = t || new n.Vector3()
  47275. return (
  47276. r.copy(e),
  47277. i > this.radius * this.radius &&
  47278. (r.sub(this.center).normalize(), r.multiplyScalar(this.radius).add(this.center)),
  47279. r
  47280. )
  47281. },
  47282. getBoundingBox: function (e) {
  47283. var t = e || new n.Box3()
  47284. return t.set(this.center, this.center), t.expandByScalar(this.radius), t
  47285. },
  47286. applyMatrix4: function (e) {
  47287. return (
  47288. this.center.applyMatrix4(e),
  47289. (this.radius = this.radius * e.getMaxScaleOnAxis()),
  47290. this
  47291. )
  47292. },
  47293. translate: function (e) {
  47294. return this.center.add(e), this
  47295. },
  47296. equals: function (e) {
  47297. return e.center.equals(this.center) && e.radius === this.radius
  47298. }
  47299. }),
  47300. (n.Frustum = function (e, t, i, r, o, a) {
  47301. this.planes = [
  47302. void 0 !== e ? e : new n.Plane(),
  47303. void 0 !== t ? t : new n.Plane(),
  47304. void 0 !== i ? i : new n.Plane(),
  47305. void 0 !== r ? r : new n.Plane(),
  47306. void 0 !== o ? o : new n.Plane(),
  47307. void 0 !== a ? a : new n.Plane()
  47308. ]
  47309. }),
  47310. (n.Frustum.prototype = {
  47311. constructor: n.Frustum,
  47312. set: function (e, t, i, n, r, o) {
  47313. var a = this.planes
  47314. return (
  47315. a[0].copy(e),
  47316. a[1].copy(t),
  47317. a[2].copy(i),
  47318. a[3].copy(n),
  47319. a[4].copy(r),
  47320. a[5].copy(o),
  47321. this
  47322. )
  47323. },
  47324. clone: function () {
  47325. return new this.constructor().copy(this)
  47326. },
  47327. copy: function (e) {
  47328. for (var t = this.planes, i = 0; i < 6; i++) t[i].copy(e.planes[i])
  47329. return this
  47330. },
  47331. setFromMatrix: function (e) {
  47332. var t = this.planes,
  47333. i = e.elements,
  47334. n = i[0],
  47335. r = i[1],
  47336. o = i[2],
  47337. a = i[3],
  47338. s = i[4],
  47339. l = i[5],
  47340. c = i[6],
  47341. h = i[7],
  47342. u = i[8],
  47343. d = i[9],
  47344. p = i[10],
  47345. f = i[11],
  47346. g = i[12],
  47347. m = i[13],
  47348. v = i[14],
  47349. A = i[15]
  47350. return (
  47351. t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  47352. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  47353. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  47354. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  47355. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  47356. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  47357. this
  47358. )
  47359. },
  47360. intersectsObject: (function () {
  47361. var e = new n.Sphere()
  47362. return function (t) {
  47363. var i = t.geometry
  47364. return (
  47365. null === i.boundingSphere && i.computeBoundingSphere(),
  47366. e.copy(i.boundingSphere),
  47367. e.applyMatrix4(t.matrixWorld),
  47368. this.intersectsSphere(e)
  47369. )
  47370. }
  47371. })(),
  47372. intersectsSphere: function (e) {
  47373. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  47374. var o = t[r].distanceToPoint(i)
  47375. if (o < n) return !1
  47376. }
  47377. return !0
  47378. },
  47379. intersectsBox: (function () {
  47380. var e = new n.Vector3(),
  47381. t = new n.Vector3()
  47382. return function (i) {
  47383. for (var n = this.planes, r = 0; r < 6; r++) {
  47384. var o = n[r]
  47385. ;(e.x = o.normal.x > 0 ? i.min.x : i.max.x),
  47386. (t.x = o.normal.x > 0 ? i.max.x : i.min.x),
  47387. (e.y = o.normal.y > 0 ? i.min.y : i.max.y),
  47388. (t.y = o.normal.y > 0 ? i.max.y : i.min.y),
  47389. (e.z = o.normal.z > 0 ? i.min.z : i.max.z),
  47390. (t.z = o.normal.z > 0 ? i.max.z : i.min.z)
  47391. var a = o.distanceToPoint(e),
  47392. s = o.distanceToPoint(t)
  47393. if (a < 0 && s < 0) return !1
  47394. }
  47395. return !0
  47396. }
  47397. })(),
  47398. containsPoint: function (e) {
  47399. for (var t = this.planes, i = 0; i < 6; i++)
  47400. if (t[i].distanceToPoint(e) < 0) return !1
  47401. return !0
  47402. }
  47403. }),
  47404. (n.Plane = function (e, t) {
  47405. ;(this.normal = void 0 !== e ? e : new n.Vector3(1, 0, 0)),
  47406. (this.constant = void 0 !== t ? t : 0)
  47407. }),
  47408. (n.Plane.prototype = {
  47409. constructor: n.Plane,
  47410. set: function (e, t) {
  47411. return this.normal.copy(e), (this.constant = t), this
  47412. },
  47413. setComponents: function (e, t, i, n) {
  47414. return this.normal.set(e, t, i), (this.constant = n), this
  47415. },
  47416. setFromNormalAndCoplanarPoint: function (e, t) {
  47417. return this.normal.copy(e), (this.constant = -t.dot(this.normal)), this
  47418. },
  47419. setFromCoplanarPoints: (function () {
  47420. var e = new n.Vector3(),
  47421. t = new n.Vector3()
  47422. return function (i, n, r) {
  47423. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize()
  47424. return this.setFromNormalAndCoplanarPoint(o, i), this
  47425. }
  47426. })(),
  47427. clone: function () {
  47428. return new this.constructor().copy(this)
  47429. },
  47430. copy: function (e) {
  47431. return this.normal.copy(e.normal), (this.constant = e.constant), this
  47432. },
  47433. normalize: function () {
  47434. var e = 1 / this.normal.length()
  47435. return this.normal.multiplyScalar(e), (this.constant *= e), this
  47436. },
  47437. negate: function () {
  47438. return (this.constant *= -1), this.normal.negate(), this
  47439. },
  47440. distanceToPoint: function (e) {
  47441. return this.normal.dot(e) + this.constant
  47442. },
  47443. distanceToSphere: function (e) {
  47444. return this.distanceToPoint(e.center) - e.radius
  47445. },
  47446. projectPoint: function (e, t) {
  47447. return this.orthoPoint(e, t).sub(e).negate()
  47448. },
  47449. orthoPoint: function (e, t) {
  47450. var i = this.distanceToPoint(e),
  47451. r = t || new n.Vector3()
  47452. return r.copy(this.normal).multiplyScalar(i)
  47453. },
  47454. intersectLine: (function () {
  47455. var e = new n.Vector3()
  47456. return function (t, i) {
  47457. var r = i || new n.Vector3(),
  47458. o = t.delta(e),
  47459. a = this.normal.dot(o)
  47460. if (0 !== a) {
  47461. var s = -(t.start.dot(this.normal) + this.constant) / a
  47462. if (!(s < 0 || s > 1)) return r.copy(o).multiplyScalar(s).add(t.start)
  47463. } else if (0 === this.distanceToPoint(t.start)) return r.copy(t.start)
  47464. }
  47465. })(),
  47466. intersectsLine: function (e) {
  47467. var t = this.distanceToPoint(e.start),
  47468. i = this.distanceToPoint(e.end)
  47469. return (t < 0 && i > 0) || (i < 0 && t > 0)
  47470. },
  47471. intersectsBox: function (e) {
  47472. return e.intersectsPlane(this)
  47473. },
  47474. intersectsSphere: function (e) {
  47475. return e.intersectsPlane(this)
  47476. },
  47477. coplanarPoint: function (e) {
  47478. var t = e || new n.Vector3()
  47479. return t.copy(this.normal).multiplyScalar(-this.constant)
  47480. },
  47481. applyMatrix4: (function () {
  47482. var e = new n.Vector3(),
  47483. t = new n.Vector3(),
  47484. i = new n.Matrix3()
  47485. return function (n, r) {
  47486. var o = r || i.getNormalMatrix(n),
  47487. a = e.copy(this.normal).applyMatrix3(o),
  47488. s = this.coplanarPoint(t)
  47489. return s.applyMatrix4(n), this.setFromNormalAndCoplanarPoint(a, s), this
  47490. }
  47491. })(),
  47492. translate: function (e) {
  47493. return (this.constant = this.constant - e.dot(this.normal)), this
  47494. },
  47495. equals: function (e) {
  47496. return e.normal.equals(this.normal) && e.constant === this.constant
  47497. }
  47498. }),
  47499. (n.Spherical = function (e, t, i) {
  47500. return (
  47501. (this.radius = void 0 !== e ? e : 1),
  47502. (this.phi = void 0 !== t ? t : 0),
  47503. (this.theta = void 0 !== i ? i : 0),
  47504. this
  47505. )
  47506. }),
  47507. (n.Spherical.prototype = {
  47508. constructor: n.Spherical,
  47509. set: function (e, t, i) {
  47510. ;(this.radius = e), (this.phi = t), (this.theta = i)
  47511. },
  47512. clone: function () {
  47513. return new this.constructor().copy(this)
  47514. },
  47515. copy: function (e) {
  47516. return (
  47517. this.radius.copy(e.radius), this.phi.copy(e.phi), this.theta.copy(e.theta), this
  47518. )
  47519. },
  47520. makeSafe: function () {
  47521. var e = 1e-6
  47522. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  47523. },
  47524. setFromVector3: function (e) {
  47525. return (
  47526. (this.radius = e.length()),
  47527. 0 === this.radius
  47528. ? ((this.theta = 0), (this.phi = 0))
  47529. : ((this.theta = Math.atan2(e.x, e.z)),
  47530. (this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1)))),
  47531. this
  47532. )
  47533. }
  47534. }),
  47535. (n.Math = {
  47536. generateUUID: (function () {
  47537. var e,
  47538. t = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''),
  47539. i = new Array(36),
  47540. n = 0
  47541. return function () {
  47542. for (var r = 0; r < 36; r++)
  47543. 8 === r || 13 === r || 18 === r || 23 === r
  47544. ? (i[r] = '-')
  47545. : 14 === r
  47546. ? (i[r] = '4')
  47547. : (n <= 2 && (n = (33554432 + 16777216 * Math.random()) | 0),
  47548. (e = 15 & n),
  47549. (n >>= 4),
  47550. (i[r] = t[19 === r ? (3 & e) | 8 : e]))
  47551. return i.join('')
  47552. }
  47553. })(),
  47554. clamp: function (e, t, i) {
  47555. return Math.max(t, Math.min(i, e))
  47556. },
  47557. euclideanModulo: function (e, t) {
  47558. return ((e % t) + t) % t
  47559. },
  47560. mapLinear: function (e, t, i, n, r) {
  47561. return n + ((e - t) * (r - n)) / (i - t)
  47562. },
  47563. smoothstep: function (e, t, i) {
  47564. return e <= t ? 0 : e >= i ? 1 : ((e = (e - t) / (i - t)), e * e * (3 - 2 * e))
  47565. },
  47566. smootherstep: function (e, t, i) {
  47567. return e <= t
  47568. ? 0
  47569. : e >= i
  47570. ? 1
  47571. : ((e = (e - t) / (i - t)), e * e * e * (e * (6 * e - 15) + 10))
  47572. },
  47573. random16: function () {
  47574. return (
  47575. console.warn(
  47576. 'THREE.Math.random16() has been deprecated. Use Math.random() instead.'
  47577. ),
  47578. Math.random()
  47579. )
  47580. },
  47581. randInt: function (e, t) {
  47582. return e + Math.floor(Math.random() * (t - e + 1))
  47583. },
  47584. randFloat: function (e, t) {
  47585. return e + Math.random() * (t - e)
  47586. },
  47587. randFloatSpread: function (e) {
  47588. return e * (0.5 - Math.random())
  47589. },
  47590. degToRad: (function () {
  47591. var e = Math.PI / 180
  47592. return function (t) {
  47593. return t * e
  47594. }
  47595. })(),
  47596. radToDeg: (function () {
  47597. var e = 180 / Math.PI
  47598. return function (t) {
  47599. return t * e
  47600. }
  47601. })(),
  47602. isPowerOfTwo: function (e) {
  47603. return 0 === (e & (e - 1)) && 0 !== e
  47604. },
  47605. nearestPowerOfTwo: function (e) {
  47606. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  47607. },
  47608. nextPowerOfTwo: function (e) {
  47609. return (
  47610. e--,
  47611. (e |= e >> 1),
  47612. (e |= e >> 2),
  47613. (e |= e >> 4),
  47614. (e |= e >> 8),
  47615. (e |= e >> 16),
  47616. e++,
  47617. e
  47618. )
  47619. }
  47620. }),
  47621. (n.Spline = function (e) {
  47622. function t(e, t, i, n, r, o, a) {
  47623. var s = 0.5 * (i - e),
  47624. l = 0.5 * (n - t)
  47625. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  47626. }
  47627. this.points = e
  47628. var i,
  47629. r,
  47630. o,
  47631. a,
  47632. s,
  47633. l,
  47634. c,
  47635. h,
  47636. u,
  47637. d = [],
  47638. p = {
  47639. x: 0,
  47640. y: 0,
  47641. z: 0
  47642. }
  47643. ;(this.initFromArray = function (e) {
  47644. this.points = []
  47645. for (var t = 0; t < e.length; t++)
  47646. this.points[t] = {
  47647. x: e[t][0],
  47648. y: e[t][1],
  47649. z: e[t][2]
  47650. }
  47651. }),
  47652. (this.getPoint = function (e) {
  47653. return (
  47654. (i = (this.points.length - 1) * e),
  47655. (r = Math.floor(i)),
  47656. (o = i - r),
  47657. (d[0] = 0 === r ? r : r - 1),
  47658. (d[1] = r),
  47659. (d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1),
  47660. (d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2),
  47661. (l = this.points[d[0]]),
  47662. (c = this.points[d[1]]),
  47663. (h = this.points[d[2]]),
  47664. (u = this.points[d[3]]),
  47665. (a = o * o),
  47666. (s = o * a),
  47667. (p.x = t(l.x, c.x, h.x, u.x, o, a, s)),
  47668. (p.y = t(l.y, c.y, h.y, u.y, o, a, s)),
  47669. (p.z = t(l.z, c.z, h.z, u.z, o, a, s)),
  47670. p
  47671. )
  47672. }),
  47673. (this.getControlPointsArray = function () {
  47674. var e,
  47675. t,
  47676. i = this.points.length,
  47677. n = []
  47678. for (e = 0; e < i; e++) (t = this.points[e]), (n[e] = [t.x, t.y, t.z])
  47679. return n
  47680. }),
  47681. (this.getLength = function (e) {
  47682. var t,
  47683. i,
  47684. r,
  47685. o,
  47686. a = 0,
  47687. s = 0,
  47688. l = 0,
  47689. c = new n.Vector3(),
  47690. h = new n.Vector3(),
  47691. u = [],
  47692. d = 0
  47693. for (
  47694. u[0] = 0,
  47695. e || (e = 100),
  47696. r = this.points.length * e,
  47697. c.copy(this.points[0]),
  47698. t = 1;
  47699. t < r;
  47700. t++
  47701. )
  47702. (i = t / r),
  47703. (o = this.getPoint(i)),
  47704. h.copy(o),
  47705. (d += h.distanceTo(c)),
  47706. c.copy(o),
  47707. (a = (this.points.length - 1) * i),
  47708. (s = Math.floor(a)),
  47709. s !== l && ((u[s] = d), (l = s))
  47710. return (
  47711. (u[u.length] = d),
  47712. {
  47713. chunks: u,
  47714. total: d
  47715. }
  47716. )
  47717. }),
  47718. (this.reparametrizeByArcLength = function (e) {
  47719. var t,
  47720. i,
  47721. r,
  47722. o,
  47723. a,
  47724. s,
  47725. l,
  47726. c,
  47727. h = [],
  47728. u = new n.Vector3(),
  47729. d = this.getLength()
  47730. for (h.push(u.copy(this.points[0]).clone()), t = 1; t < this.points.length; t++) {
  47731. for (
  47732. s = d.chunks[t] - d.chunks[t - 1],
  47733. l = Math.ceil((e * s) / d.total),
  47734. o = (t - 1) / (this.points.length - 1),
  47735. a = t / (this.points.length - 1),
  47736. i = 1;
  47737. i < l - 1;
  47738. i++
  47739. )
  47740. (r = o + i * (1 / l) * (a - o)),
  47741. (c = this.getPoint(r)),
  47742. h.push(u.copy(c).clone())
  47743. h.push(u.copy(this.points[t]).clone())
  47744. }
  47745. this.points = h
  47746. })
  47747. }),
  47748. (n.Triangle = function (e, t, i) {
  47749. ;(this.a = void 0 !== e ? e : new n.Vector3()),
  47750. (this.b = void 0 !== t ? t : new n.Vector3()),
  47751. (this.c = void 0 !== i ? i : new n.Vector3())
  47752. }),
  47753. (n.Triangle.normal = (function () {
  47754. var e = new n.Vector3()
  47755. return function (t, i, r, o) {
  47756. var a = o || new n.Vector3()
  47757. a.subVectors(r, i), e.subVectors(t, i), a.cross(e)
  47758. var s = a.lengthSq()
  47759. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  47760. }
  47761. })()),
  47762. (n.Triangle.barycoordFromPoint = (function () {
  47763. var e = new n.Vector3(),
  47764. t = new n.Vector3(),
  47765. i = new n.Vector3()
  47766. return function (r, o, a, s, l) {
  47767. e.subVectors(s, o), t.subVectors(a, o), i.subVectors(r, o)
  47768. var c = e.dot(e),
  47769. h = e.dot(t),
  47770. u = e.dot(i),
  47771. d = t.dot(t),
  47772. p = t.dot(i),
  47773. f = c * d - h * h,
  47774. g = l || new n.Vector3()
  47775. if (0 === f) return g.set(-2, -1, -1)
  47776. var m = 1 / f,
  47777. v = (d * u - h * p) * m,
  47778. A = (c * p - h * u) * m
  47779. return g.set(1 - v - A, A, v)
  47780. }
  47781. })()),
  47782. (n.Triangle.containsPoint = (function () {
  47783. var e = new n.Vector3()
  47784. return function (t, i, r, o) {
  47785. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e)
  47786. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  47787. }
  47788. })()),
  47789. (n.Triangle.prototype = {
  47790. constructor: n.Triangle,
  47791. set: function (e, t, i) {
  47792. return this.a.copy(e), this.b.copy(t), this.c.copy(i), this
  47793. },
  47794. setFromPointsAndIndices: function (e, t, i, n) {
  47795. return this.a.copy(e[t]), this.b.copy(e[i]), this.c.copy(e[n]), this
  47796. },
  47797. clone: function () {
  47798. return new this.constructor().copy(this)
  47799. },
  47800. copy: function (e) {
  47801. return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this
  47802. },
  47803. area: (function () {
  47804. var e = new n.Vector3(),
  47805. t = new n.Vector3()
  47806. return function () {
  47807. return (
  47808. e.subVectors(this.c, this.b),
  47809. t.subVectors(this.a, this.b),
  47810. 0.5 * e.cross(t).length()
  47811. )
  47812. }
  47813. })(),
  47814. midpoint: function (e) {
  47815. var t = e || new n.Vector3()
  47816. return t
  47817. .addVectors(this.a, this.b)
  47818. .add(this.c)
  47819. .multiplyScalar(1 / 3)
  47820. },
  47821. normal: function (e) {
  47822. return n.Triangle.normal(this.a, this.b, this.c, e)
  47823. },
  47824. plane: function (e) {
  47825. var t = e || new n.Plane()
  47826. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  47827. },
  47828. barycoordFromPoint: function (e, t) {
  47829. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  47830. },
  47831. containsPoint: function (e) {
  47832. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  47833. },
  47834. equals: function (e) {
  47835. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  47836. }
  47837. }),
  47838. (n.Interpolant = function (e, t, i, n) {
  47839. ;(this.parameterPositions = e),
  47840. (this._cachedIndex = 0),
  47841. (this.resultBuffer = void 0 !== n ? n : new t.constructor(i)),
  47842. (this.sampleValues = t),
  47843. (this.valueSize = i)
  47844. }),
  47845. (n.Interpolant.prototype = {
  47846. constructor: n.Interpolant,
  47847. evaluate: function (e) {
  47848. var t = this.parameterPositions,
  47849. i = this._cachedIndex,
  47850. n = t[i],
  47851. r = t[i - 1]
  47852. e: {
  47853. t: {
  47854. var o
  47855. i: {
  47856. n: if (!(e < n)) {
  47857. for (var a = i + 2; ; ) {
  47858. if (void 0 === n) {
  47859. if (e < r) break n
  47860. return (
  47861. (i = t.length), (this._cachedIndex = i), this.afterEnd_(i - 1, e, r)
  47862. )
  47863. }
  47864. if (i === a) break
  47865. if (((r = n), (n = t[++i]), e < n)) break t
  47866. }
  47867. o = t.length
  47868. break i
  47869. }
  47870. {
  47871. if (e >= r) break e
  47872. var s = t[1]
  47873. e < s && ((i = 2), (r = s))
  47874. for (var a = i - 2; ; ) {
  47875. if (void 0 === r) return (this._cachedIndex = 0), this.beforeStart_(0, e, n)
  47876. if (i === a) break
  47877. if (((n = r), (r = t[--i - 1]), e >= r)) break t
  47878. }
  47879. ;(o = i), (i = 0)
  47880. }
  47881. }
  47882. for (; i < o; ) {
  47883. var l = (i + o) >>> 1
  47884. e < t[l] ? (o = l) : (i = l + 1)
  47885. }
  47886. if (((n = t[i]), (r = t[i - 1]), void 0 === r))
  47887. return (this._cachedIndex = 0), this.beforeStart_(0, e, n)
  47888. if (void 0 === n)
  47889. return (i = t.length), (this._cachedIndex = i), this.afterEnd_(i - 1, r, e)
  47890. }
  47891. ;(this._cachedIndex = i), this.intervalChanged_(i, r, n)
  47892. }
  47893. return this.interpolate_(i, r, e, n)
  47894. },
  47895. settings: null,
  47896. DefaultSettings_: {},
  47897. getSettings_: function () {
  47898. return this.settings || this.DefaultSettings_
  47899. },
  47900. copySampleValue_: function (e) {
  47901. for (
  47902. var t = this.resultBuffer,
  47903. i = this.sampleValues,
  47904. n = this.valueSize,
  47905. r = e * n,
  47906. o = 0;
  47907. o !== n;
  47908. ++o
  47909. )
  47910. t[o] = i[r + o]
  47911. return t
  47912. },
  47913. interpolate_: function (e, t, i, n) {
  47914. throw new Error('call to abstract method')
  47915. },
  47916. intervalChanged_: function (e, t, i) {}
  47917. }),
  47918. Object.assign(n.Interpolant.prototype, {
  47919. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  47920. afterEnd_: n.Interpolant.prototype.copySampleValue_
  47921. }),
  47922. (n.CubicInterpolant = function (e, t, i, r) {
  47923. n.Interpolant.call(this, e, t, i, r),
  47924. (this._weightPrev = -0),
  47925. (this._offsetPrev = -0),
  47926. (this._weightNext = -0),
  47927. (this._offsetNext = -0)
  47928. }),
  47929. (n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  47930. constructor: n.CubicInterpolant,
  47931. DefaultSettings_: {
  47932. endingStart: n.ZeroCurvatureEnding,
  47933. endingEnd: n.ZeroCurvatureEnding
  47934. },
  47935. intervalChanged_: function (e, t, i) {
  47936. var r = this.parameterPositions,
  47937. o = e - 2,
  47938. a = e + 1,
  47939. s = r[o],
  47940. l = r[a]
  47941. if (void 0 === s)
  47942. switch (this.getSettings_().endingStart) {
  47943. case n.ZeroSlopeEnding:
  47944. ;(o = e), (s = 2 * t - i)
  47945. break
  47946. case n.WrapAroundEnding:
  47947. ;(o = r.length - 2), (s = t + r[o] - r[o + 1])
  47948. break
  47949. default:
  47950. ;(o = e), (s = i)
  47951. }
  47952. if (void 0 === l)
  47953. switch (this.getSettings_().endingEnd) {
  47954. case n.ZeroSlopeEnding:
  47955. ;(a = e), (l = 2 * i - t)
  47956. break
  47957. case n.WrapAroundEnding:
  47958. ;(a = 1), (l = i + r[1] - r[0])
  47959. break
  47960. default:
  47961. ;(a = e - 1), (l = t)
  47962. }
  47963. var c = 0.5 * (i - t),
  47964. h = this.valueSize
  47965. ;(this._weightPrev = c / (t - s)),
  47966. (this._weightNext = c / (l - i)),
  47967. (this._offsetPrev = o * h),
  47968. (this._offsetNext = a * h)
  47969. },
  47970. interpolate_: function (e, t, i, n) {
  47971. for (
  47972. var r = this.resultBuffer,
  47973. o = this.sampleValues,
  47974. a = this.valueSize,
  47975. s = e * a,
  47976. l = s - a,
  47977. c = this._offsetPrev,
  47978. h = this._offsetNext,
  47979. u = this._weightPrev,
  47980. d = this._weightNext,
  47981. p = (i - t) / (n - t),
  47982. f = p * p,
  47983. g = f * p,
  47984. m = -u * g + 2 * u * f - u * p,
  47985. v = (1 + u) * g + (-1.5 - 2 * u) * f + (-0.5 + u) * p + 1,
  47986. A = (-1 - d) * g + (1.5 + d) * f + 0.5 * p,
  47987. y = d * g - d * f,
  47988. C = 0;
  47989. C !== a;
  47990. ++C
  47991. )
  47992. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C]
  47993. return r
  47994. }
  47995. })),
  47996. (n.DiscreteInterpolant = function (e, t, i, r) {
  47997. n.Interpolant.call(this, e, t, i, r)
  47998. }),
  47999. (n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  48000. constructor: n.DiscreteInterpolant,
  48001. interpolate_: function (e, t, i, n) {
  48002. return this.copySampleValue_(e - 1)
  48003. }
  48004. })),
  48005. (n.LinearInterpolant = function (e, t, i, r) {
  48006. n.Interpolant.call(this, e, t, i, r)
  48007. }),
  48008. (n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  48009. constructor: n.LinearInterpolant,
  48010. interpolate_: function (e, t, i, n) {
  48011. for (
  48012. var r = this.resultBuffer,
  48013. o = this.sampleValues,
  48014. a = this.valueSize,
  48015. s = e * a,
  48016. l = s - a,
  48017. c = (i - t) / (n - t),
  48018. h = 1 - c,
  48019. u = 0;
  48020. u !== a;
  48021. ++u
  48022. )
  48023. r[u] = o[l + u] * h + o[s + u] * c
  48024. return r
  48025. }
  48026. })),
  48027. (n.QuaternionLinearInterpolant = function (e, t, i, r) {
  48028. n.Interpolant.call(this, e, t, i, r)
  48029. }),
  48030. (n.QuaternionLinearInterpolant.prototype = Object.assign(
  48031. Object.create(n.Interpolant.prototype),
  48032. {
  48033. constructor: n.QuaternionLinearInterpolant,
  48034. interpolate_: function (e, t, i, r) {
  48035. for (
  48036. var o = this.resultBuffer,
  48037. a = this.sampleValues,
  48038. s = this.valueSize,
  48039. l = e * s,
  48040. c = (i - t) / (r - t),
  48041. h = l + s;
  48042. l !== h;
  48043. l += 4
  48044. )
  48045. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c)
  48046. return o
  48047. }
  48048. }
  48049. )),
  48050. (n.Clock = function (e) {
  48051. ;(this.autoStart = void 0 === e || e),
  48052. (this.startTime = 0),
  48053. (this.oldTime = 0),
  48054. (this.elapsedTime = 0),
  48055. (this.running = !1)
  48056. }),
  48057. (n.Clock.prototype = {
  48058. constructor: n.Clock,
  48059. start: function () {
  48060. ;(this.startTime = performance.now()),
  48061. (this.oldTime = this.startTime),
  48062. (this.running = !0)
  48063. },
  48064. stop: function () {
  48065. this.getElapsedTime(), (this.running = !1)
  48066. },
  48067. getElapsedTime: function () {
  48068. return this.getDelta(), this.elapsedTime
  48069. },
  48070. getDelta: function () {
  48071. var e = 0
  48072. if ((this.autoStart && !this.running && this.start(), this.running)) {
  48073. var t = performance.now()
  48074. ;(e = 0.001 * (t - this.oldTime)), (this.oldTime = t), (this.elapsedTime += e)
  48075. }
  48076. return e
  48077. }
  48078. }),
  48079. (n.EventDispatcher = function () {}),
  48080. (n.EventDispatcher.prototype = {
  48081. constructor: n.EventDispatcher,
  48082. apply: function (e) {
  48083. ;(e.addEventListener = n.EventDispatcher.prototype.addEventListener),
  48084. (e.hasEventListener = n.EventDispatcher.prototype.hasEventListener),
  48085. (e.removeEventListener = n.EventDispatcher.prototype.removeEventListener),
  48086. (e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent)
  48087. },
  48088. addEventListener: function (e, t) {
  48089. void 0 === this._listeners && (this._listeners = {})
  48090. var i = this._listeners
  48091. void 0 === i[e] && (i[e] = []), i[e].indexOf(t) === -1 && i[e].push(t)
  48092. },
  48093. hasEventListener: function (e, t) {
  48094. if (void 0 === this._listeners) return !1
  48095. var i = this._listeners
  48096. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  48097. },
  48098. removeEventListener: function (e, t) {
  48099. if (void 0 !== this._listeners) {
  48100. var i = this._listeners,
  48101. n = i[e]
  48102. if (void 0 !== n) {
  48103. var r = n.indexOf(t)
  48104. r !== -1 && n.splice(r, 1)
  48105. }
  48106. }
  48107. },
  48108. dispatchEvent: function (e) {
  48109. if (void 0 !== this._listeners) {
  48110. var t = this._listeners,
  48111. i = t[e.type]
  48112. if (void 0 !== i) {
  48113. e.target = this
  48114. for (var n = [], r = i.length, o = 0; o < r; o++) n[o] = i[o]
  48115. for (var o = 0; o < r; o++) n[o].call(this, e)
  48116. }
  48117. }
  48118. }
  48119. }),
  48120. (n.Layers = function () {
  48121. this.mask = 1
  48122. }),
  48123. (n.Layers.prototype = {
  48124. constructor: n.Layers,
  48125. set: function (e) {
  48126. this.mask = 1 << e
  48127. },
  48128. enable: function (e) {
  48129. this.mask |= 1 << e
  48130. },
  48131. toggle: function (e) {
  48132. this.mask ^= 1 << e
  48133. },
  48134. disable: function (e) {
  48135. this.mask &= ~(1 << e)
  48136. },
  48137. test: function (e) {
  48138. return 0 !== (this.mask & e.mask)
  48139. }
  48140. }),
  48141. (function (e) {
  48142. function t(e, t) {
  48143. return e.distance - t.distance
  48144. }
  48145. function i(e, t, n, r) {
  48146. if (e.visible !== !1 && (e.raycast(t, n), r === !0))
  48147. for (var o = e.children, a = 0, s = o.length; a < s; a++) i(o[a], t, n, !0)
  48148. }
  48149. ;(e.Raycaster = function (t, i, n, r) {
  48150. ;(this.ray = new e.Ray(t, i)),
  48151. (this.near = n || 0),
  48152. (this.far = r || 1 / 0),
  48153. (this.params = {
  48154. Mesh: {},
  48155. Line: {},
  48156. LOD: {},
  48157. Points: {
  48158. threshold: 1
  48159. },
  48160. Sprite: {}
  48161. }),
  48162. Object.defineProperties(this.params, {
  48163. PointCloud: {
  48164. get: function () {
  48165. return (
  48166. console.warn(
  48167. 'THREE.Raycaster: params.PointCloud has been renamed to params.Points.'
  48168. ),
  48169. this.Points
  48170. )
  48171. }
  48172. }
  48173. })
  48174. }),
  48175. (e.Raycaster.prototype = {
  48176. constructor: e.Raycaster,
  48177. linePrecision: 1,
  48178. set: function (e, t) {
  48179. this.ray.set(e, t)
  48180. },
  48181. setFromCamera: function (t, i) {
  48182. i instanceof e.PerspectiveCamera
  48183. ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  48184. this.ray.direction
  48185. .set(t.x, t.y, 0.5)
  48186. .unproject(i)
  48187. .sub(this.ray.origin)
  48188. .normalize())
  48189. : i instanceof e.OrthographicCamera
  48190. ? (this.ray.origin.set(t.x, t.y, -1).unproject(i),
  48191. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld))
  48192. : console.error('THREE.Raycaster: Unsupported camera type.')
  48193. },
  48194. intersectObject: function (e, n) {
  48195. var r = []
  48196. return i(e, this, r, n), r.sort(t), r
  48197. },
  48198. intersectObjects: function (e, n) {
  48199. var r = []
  48200. if (Array.isArray(e) === !1)
  48201. return (
  48202. console.warn('THREE.Raycaster.intersectObjects: objects is not an Array.'), r
  48203. )
  48204. for (var o = 0, a = e.length; o < a; o++) i(e[o], this, r, n)
  48205. return r.sort(t), r
  48206. }
  48207. })
  48208. })(n),
  48209. (n.Object3D = function () {
  48210. function e() {
  48211. o.setFromEuler(r, !1)
  48212. }
  48213. function t() {
  48214. r.setFromQuaternion(o, void 0, !1)
  48215. }
  48216. Object.defineProperty(this, 'id', {
  48217. value: n.Object3DIdCount++
  48218. }),
  48219. (this.uuid = n.Math.generateUUID()),
  48220. (this.name = ''),
  48221. (this.type = 'Object3D'),
  48222. (this.parent = null),
  48223. (this.children = []),
  48224. (this.up = n.Object3D.DefaultUp.clone())
  48225. var i = new n.Vector3(),
  48226. r = new n.Euler(),
  48227. o = new n.Quaternion(),
  48228. a = new n.Vector3(1, 1, 1)
  48229. r.onChange(e),
  48230. o.onChange(t),
  48231. Object.defineProperties(this, {
  48232. position: {
  48233. enumerable: !0,
  48234. value: i
  48235. },
  48236. rotation: {
  48237. enumerable: !0,
  48238. value: r
  48239. },
  48240. quaternion: {
  48241. enumerable: !0,
  48242. value: o
  48243. },
  48244. scale: {
  48245. enumerable: !0,
  48246. value: a
  48247. },
  48248. modelViewMatrix: {
  48249. value: new n.Matrix4()
  48250. },
  48251. normalMatrix: {
  48252. value: new n.Matrix3()
  48253. }
  48254. }),
  48255. (this.rotationAutoUpdate = !0),
  48256. (this.matrix = new n.Matrix4()),
  48257. (this.matrixWorld = new n.Matrix4()),
  48258. (this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate),
  48259. (this.matrixWorldNeedsUpdate = !1),
  48260. (this.layers = new n.Layers()),
  48261. (this.visible = !0),
  48262. (this.castShadow = !1),
  48263. (this.receiveShadow = !1),
  48264. (this.frustumCulled = !0),
  48265. (this.renderOrder = 0),
  48266. (this.userData = {})
  48267. }),
  48268. (n.Object3D.DefaultUp = new n.Vector3(0, 1, 0)),
  48269. (n.Object3D.DefaultMatrixAutoUpdate = !0),
  48270. (n.Object3D.prototype = {
  48271. constructor: n.Object3D,
  48272. applyMatrix: function (e) {
  48273. this.matrix.multiplyMatrices(e, this.matrix),
  48274. this.matrix.decompose(this.position, this.quaternion, this.scale)
  48275. },
  48276. setRotationFromAxisAngle: function (e, t) {
  48277. this.quaternion.setFromAxisAngle(e, t)
  48278. },
  48279. setRotationFromEuler: function (e) {
  48280. this.quaternion.setFromEuler(e, !0)
  48281. },
  48282. setRotationFromMatrix: function (e) {
  48283. this.quaternion.setFromRotationMatrix(e)
  48284. },
  48285. setRotationFromQuaternion: function (e) {
  48286. this.quaternion.copy(e)
  48287. },
  48288. rotateOnAxis: (function () {
  48289. var e = new n.Quaternion()
  48290. return function (t, i) {
  48291. return e.setFromAxisAngle(t, i), this.quaternion.multiply(e), this
  48292. }
  48293. })(),
  48294. rotateX: (function () {
  48295. var e = new n.Vector3(1, 0, 0)
  48296. return function (t) {
  48297. return this.rotateOnAxis(e, t)
  48298. }
  48299. })(),
  48300. rotateY: (function () {
  48301. var e = new n.Vector3(0, 1, 0)
  48302. return function (t) {
  48303. return this.rotateOnAxis(e, t)
  48304. }
  48305. })(),
  48306. rotateZ: (function () {
  48307. var e = new n.Vector3(0, 0, 1)
  48308. return function (t) {
  48309. return this.rotateOnAxis(e, t)
  48310. }
  48311. })(),
  48312. translateOnAxis: (function () {
  48313. var e = new n.Vector3()
  48314. return function (t, i) {
  48315. return (
  48316. e.copy(t).applyQuaternion(this.quaternion),
  48317. this.position.add(e.multiplyScalar(i)),
  48318. this
  48319. )
  48320. }
  48321. })(),
  48322. translateX: (function () {
  48323. var e = new n.Vector3(1, 0, 0)
  48324. return function (t) {
  48325. return this.translateOnAxis(e, t)
  48326. }
  48327. })(),
  48328. translateY: (function () {
  48329. var e = new n.Vector3(0, 1, 0)
  48330. return function (t) {
  48331. return this.translateOnAxis(e, t)
  48332. }
  48333. })(),
  48334. translateZ: (function () {
  48335. var e = new n.Vector3(0, 0, 1)
  48336. return function (t) {
  48337. return this.translateOnAxis(e, t)
  48338. }
  48339. })(),
  48340. localToWorld: function (e) {
  48341. return e.applyMatrix4(this.matrixWorld)
  48342. },
  48343. worldToLocal: (function () {
  48344. var e = new n.Matrix4()
  48345. return function (t) {
  48346. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  48347. }
  48348. })(),
  48349. lookAt: (function () {
  48350. var e = new n.Matrix4()
  48351. return function (t) {
  48352. e.lookAt(t, this.position, this.up), this.quaternion.setFromRotationMatrix(e)
  48353. }
  48354. })(),
  48355. add: function (e) {
  48356. if (arguments.length > 1) {
  48357. for (var t = 0; t < arguments.length; t++) this.add(arguments[t])
  48358. return this
  48359. }
  48360. return e === this
  48361. ? (console.error(
  48362. "THREE.Object3D.add: object can't be added as a child of itself.",
  48363. e
  48364. ),
  48365. this)
  48366. : (e instanceof n.Object3D
  48367. ? (null !== e.parent && e.parent.remove(e),
  48368. (e.parent = this),
  48369. e.dispatchEvent({
  48370. type: 'added'
  48371. }),
  48372. this.children.push(e))
  48373. : console.error(
  48374. 'THREE.Object3D.add: object not an instance of THREE.Object3D.',
  48375. e
  48376. ),
  48377. this)
  48378. },
  48379. remove: function (e) {
  48380. if (arguments.length > 1)
  48381. for (var t = 0; t < arguments.length; t++) this.remove(arguments[t])
  48382. var i = this.children.indexOf(e)
  48383. i !== -1 &&
  48384. ((e.parent = null),
  48385. e.dispatchEvent({
  48386. type: 'removed'
  48387. }),
  48388. this.children.splice(i, 1))
  48389. },
  48390. getObjectById: function (e) {
  48391. return this.getObjectByProperty('id', e)
  48392. },
  48393. getObjectByName: function (e) {
  48394. return this.getObjectByProperty('name', e)
  48395. },
  48396. getObjectByProperty: function (e, t) {
  48397. if (this[e] === t) return this
  48398. for (var i = 0, n = this.children.length; i < n; i++) {
  48399. var r = this.children[i],
  48400. o = r.getObjectByProperty(e, t)
  48401. if (void 0 !== o) return o
  48402. }
  48403. },
  48404. getWorldPosition: function (e) {
  48405. var t = e || new n.Vector3()
  48406. return this.updateMatrixWorld(!0), t.setFromMatrixPosition(this.matrixWorld)
  48407. },
  48408. getWorldQuaternion: (function () {
  48409. var e = new n.Vector3(),
  48410. t = new n.Vector3()
  48411. return function (i) {
  48412. var r = i || new n.Quaternion()
  48413. return this.updateMatrixWorld(!0), this.matrixWorld.decompose(e, r, t), r
  48414. }
  48415. })(),
  48416. getWorldRotation: (function () {
  48417. var e = new n.Quaternion()
  48418. return function (t) {
  48419. var i = t || new n.Euler()
  48420. return this.getWorldQuaternion(e), i.setFromQuaternion(e, this.rotation.order, !1)
  48421. }
  48422. })(),
  48423. getWorldScale: (function () {
  48424. var e = new n.Vector3(),
  48425. t = new n.Quaternion()
  48426. return function (i) {
  48427. var r = i || new n.Vector3()
  48428. return this.updateMatrixWorld(!0), this.matrixWorld.decompose(e, t, r), r
  48429. }
  48430. })(),
  48431. getWorldDirection: (function () {
  48432. var e = new n.Quaternion()
  48433. return function (t) {
  48434. var i = t || new n.Vector3()
  48435. return this.getWorldQuaternion(e), i.set(0, 0, 1).applyQuaternion(e)
  48436. }
  48437. })(),
  48438. raycast: function () {},
  48439. traverse: function (e) {
  48440. e(this)
  48441. for (var t = this.children, i = 0, n = t.length; i < n; i++) t[i].traverse(e)
  48442. },
  48443. traverseVisible: function (e) {
  48444. if (this.visible !== !1) {
  48445. e(this)
  48446. for (var t = this.children, i = 0, n = t.length; i < n; i++) t[i].traverseVisible(e)
  48447. }
  48448. },
  48449. traverseAncestors: function (e) {
  48450. var t = this.parent
  48451. null !== t && (e(t), t.traverseAncestors(e))
  48452. },
  48453. updateMatrix: function () {
  48454. this.matrix.compose(this.position, this.quaternion, this.scale),
  48455. (this.matrixWorldNeedsUpdate = !0)
  48456. },
  48457. updateMatrixWorld: function (e) {
  48458. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  48459. (this.matrixWorldNeedsUpdate !== !0 && e !== !0) ||
  48460. (null === this.parent
  48461. ? this.matrixWorld.copy(this.matrix)
  48462. : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  48463. (this.matrixWorldNeedsUpdate = !1),
  48464. (e = !0))
  48465. for (var t = 0, i = this.children.length; t < i; t++)
  48466. this.children[t].updateMatrixWorld(e)
  48467. },
  48468. toJSON: function (e) {
  48469. function t(e) {
  48470. var t = []
  48471. for (var i in e) {
  48472. var n = e[i]
  48473. delete n.metadata, t.push(n)
  48474. }
  48475. return t
  48476. }
  48477. var i = void 0 === e,
  48478. n = {}
  48479. i &&
  48480. ((e = {
  48481. geometries: {},
  48482. materials: {},
  48483. textures: {},
  48484. images: {}
  48485. }),
  48486. (n.metadata = {
  48487. version: 4.4,
  48488. type: 'Object',
  48489. generator: 'Object3D.toJSON'
  48490. }))
  48491. var r = {}
  48492. if (
  48493. ((r.uuid = this.uuid),
  48494. (r.type = this.type),
  48495. '' !== this.name && (r.name = this.name),
  48496. '{}' !== JSON.stringify(this.userData) && (r.userData = this.userData),
  48497. this.castShadow === !0 && (r.castShadow = !0),
  48498. this.receiveShadow === !0 && (r.receiveShadow = !0),
  48499. this.visible === !1 && (r.visible = !1),
  48500. (r.matrix = this.matrix.toArray()),
  48501. void 0 !== this.geometry &&
  48502. (void 0 === e.geometries[this.geometry.uuid] &&
  48503. (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  48504. (r.geometry = this.geometry.uuid)),
  48505. void 0 !== this.material &&
  48506. (void 0 === e.materials[this.material.uuid] &&
  48507. (e.materials[this.material.uuid] = this.material.toJSON(e)),
  48508. (r.material = this.material.uuid)),
  48509. this.children.length > 0)
  48510. ) {
  48511. r.children = []
  48512. for (var o = 0; o < this.children.length; o++)
  48513. r.children.push(this.children[o].toJSON(e).object)
  48514. }
  48515. if (i) {
  48516. var a = t(e.geometries),
  48517. s = t(e.materials),
  48518. l = t(e.textures),
  48519. c = t(e.images)
  48520. a.length > 0 && (n.geometries = a),
  48521. s.length > 0 && (n.materials = s),
  48522. l.length > 0 && (n.textures = l),
  48523. c.length > 0 && (n.images = c)
  48524. }
  48525. return (n.object = r), n
  48526. },
  48527. clone: function (e) {
  48528. return new this.constructor().copy(this, e)
  48529. },
  48530. copy: function (e, t) {
  48531. if (
  48532. (void 0 === t && (t = !0),
  48533. (this.name = e.name),
  48534. this.up.copy(e.up),
  48535. this.position.copy(e.position),
  48536. this.quaternion.copy(e.quaternion),
  48537. this.scale.copy(e.scale),
  48538. (this.rotationAutoUpdate = e.rotationAutoUpdate),
  48539. this.matrix.copy(e.matrix),
  48540. this.matrixWorld.copy(e.matrixWorld),
  48541. (this.matrixAutoUpdate = e.matrixAutoUpdate),
  48542. (this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate),
  48543. (this.visible = e.visible),
  48544. (this.castShadow = e.castShadow),
  48545. (this.receiveShadow = e.receiveShadow),
  48546. (this.frustumCulled = e.frustumCulled),
  48547. (this.renderOrder = e.renderOrder),
  48548. (this.userData = JSON.parse(JSON.stringify(e.userData))),
  48549. t === !0)
  48550. )
  48551. for (var i = 0; i < e.children.length; i++) {
  48552. var n = e.children[i]
  48553. this.add(n.clone())
  48554. }
  48555. return this
  48556. }
  48557. }),
  48558. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  48559. (n.Object3DIdCount = 0),
  48560. (n.Face3 = function (e, t, i, r, o, a) {
  48561. ;(this.a = e),
  48562. (this.b = t),
  48563. (this.c = i),
  48564. (this.normal = r instanceof n.Vector3 ? r : new n.Vector3()),
  48565. (this.vertexNormals = Array.isArray(r) ? r : []),
  48566. (this.color = o instanceof n.Color ? o : new n.Color()),
  48567. (this.vertexColors = Array.isArray(o) ? o : []),
  48568. (this.materialIndex = void 0 !== a ? a : 0)
  48569. }),
  48570. (n.Face3.prototype = {
  48571. constructor: n.Face3,
  48572. clone: function () {
  48573. return new this.constructor().copy(this)
  48574. },
  48575. copy: function (e) {
  48576. ;(this.a = e.a),
  48577. (this.b = e.b),
  48578. (this.c = e.c),
  48579. this.normal.copy(e.normal),
  48580. this.color.copy(e.color),
  48581. (this.materialIndex = e.materialIndex)
  48582. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  48583. this.vertexNormals[t] = e.vertexNormals[t].clone()
  48584. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  48585. this.vertexColors[t] = e.vertexColors[t].clone()
  48586. return this
  48587. }
  48588. }),
  48589. (n.BufferAttribute = function (e, t) {
  48590. ;(this.uuid = n.Math.generateUUID()),
  48591. (this.array = e),
  48592. (this.itemSize = t),
  48593. (this.dynamic = !1),
  48594. (this.updateRange = {
  48595. offset: 0,
  48596. count: -1
  48597. }),
  48598. (this.version = 0)
  48599. }),
  48600. (n.BufferAttribute.prototype = {
  48601. constructor: n.BufferAttribute,
  48602. get count() {
  48603. return this.array.length / this.itemSize
  48604. },
  48605. set needsUpdate(e) {
  48606. e === !0 && this.version++
  48607. },
  48608. setDynamic: function (e) {
  48609. return (this.dynamic = e), this
  48610. },
  48611. copy: function (e) {
  48612. return (
  48613. (this.array = new e.array.constructor(e.array)),
  48614. (this.itemSize = e.itemSize),
  48615. (this.dynamic = e.dynamic),
  48616. this
  48617. )
  48618. },
  48619. copyAt: function (e, t, i) {
  48620. ;(e *= this.itemSize), (i *= t.itemSize)
  48621. for (var n = 0, r = this.itemSize; n < r; n++) this.array[e + n] = t.array[i + n]
  48622. return this
  48623. },
  48624. copyArray: function (e) {
  48625. return this.array.set(e), this
  48626. },
  48627. copyColorsArray: function (e) {
  48628. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  48629. var a = e[r]
  48630. void 0 === a &&
  48631. (console.warn('THREE.BufferAttribute.copyColorsArray(): color is undefined', r),
  48632. (a = new n.Color())),
  48633. (t[i++] = a.r),
  48634. (t[i++] = a.g),
  48635. (t[i++] = a.b)
  48636. }
  48637. return this
  48638. },
  48639. copyIndicesArray: function (e) {
  48640. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  48641. var o = e[n]
  48642. ;(t[i++] = o.a), (t[i++] = o.b), (t[i++] = o.c)
  48643. }
  48644. return this
  48645. },
  48646. copyVector2sArray: function (e) {
  48647. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  48648. var a = e[r]
  48649. void 0 === a &&
  48650. (console.warn(
  48651. 'THREE.BufferAttribute.copyVector2sArray(): vector is undefined',
  48652. r
  48653. ),
  48654. (a = new n.Vector2())),
  48655. (t[i++] = a.x),
  48656. (t[i++] = a.y)
  48657. }
  48658. return this
  48659. },
  48660. copyVector3sArray: function (e) {
  48661. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  48662. var a = e[r]
  48663. void 0 === a &&
  48664. (console.warn(
  48665. 'THREE.BufferAttribute.copyVector3sArray(): vector is undefined',
  48666. r
  48667. ),
  48668. (a = new n.Vector3())),
  48669. (t[i++] = a.x),
  48670. (t[i++] = a.y),
  48671. (t[i++] = a.z)
  48672. }
  48673. return this
  48674. },
  48675. copyVector4sArray: function (e) {
  48676. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  48677. var a = e[r]
  48678. void 0 === a &&
  48679. (console.warn(
  48680. 'THREE.BufferAttribute.copyVector4sArray(): vector is undefined',
  48681. r
  48682. ),
  48683. (a = new n.Vector4())),
  48684. (t[i++] = a.x),
  48685. (t[i++] = a.y),
  48686. (t[i++] = a.z),
  48687. (t[i++] = a.w)
  48688. }
  48689. return this
  48690. },
  48691. set: function (e, t) {
  48692. return void 0 === t && (t = 0), this.array.set(e, t), this
  48693. },
  48694. getX: function (e) {
  48695. return this.array[e * this.itemSize]
  48696. },
  48697. setX: function (e, t) {
  48698. return (this.array[e * this.itemSize] = t), this
  48699. },
  48700. getY: function (e) {
  48701. return this.array[e * this.itemSize + 1]
  48702. },
  48703. setY: function (e, t) {
  48704. return (this.array[e * this.itemSize + 1] = t), this
  48705. },
  48706. getZ: function (e) {
  48707. return this.array[e * this.itemSize + 2]
  48708. },
  48709. setZ: function (e, t) {
  48710. return (this.array[e * this.itemSize + 2] = t), this
  48711. },
  48712. getW: function (e) {
  48713. return this.array[e * this.itemSize + 3]
  48714. },
  48715. setW: function (e, t) {
  48716. return (this.array[e * this.itemSize + 3] = t), this
  48717. },
  48718. setXY: function (e, t, i) {
  48719. return (e *= this.itemSize), (this.array[e + 0] = t), (this.array[e + 1] = i), this
  48720. },
  48721. setXYZ: function (e, t, i, n) {
  48722. return (
  48723. (e *= this.itemSize),
  48724. (this.array[e + 0] = t),
  48725. (this.array[e + 1] = i),
  48726. (this.array[e + 2] = n),
  48727. this
  48728. )
  48729. },
  48730. setXYZW: function (e, t, i, n, r) {
  48731. return (
  48732. (e *= this.itemSize),
  48733. (this.array[e + 0] = t),
  48734. (this.array[e + 1] = i),
  48735. (this.array[e + 2] = n),
  48736. (this.array[e + 3] = r),
  48737. this
  48738. )
  48739. },
  48740. clone: function () {
  48741. return new this.constructor().copy(this)
  48742. }
  48743. }),
  48744. (n.Int8Attribute = function (e, t) {
  48745. return new n.BufferAttribute(new Int8Array(e), t)
  48746. }),
  48747. (n.Uint8Attribute = function (e, t) {
  48748. return new n.BufferAttribute(new Uint8Array(e), t)
  48749. }),
  48750. (n.Uint8ClampedAttribute = function (e, t) {
  48751. return new n.BufferAttribute(new Uint8ClampedArray(e), t)
  48752. }),
  48753. (n.Int16Attribute = function (e, t) {
  48754. return new n.BufferAttribute(new Int16Array(e), t)
  48755. }),
  48756. (n.Uint16Attribute = function (e, t) {
  48757. return new n.BufferAttribute(new Uint16Array(e), t)
  48758. })
  48759. n.Int32Attribute = function (e, t) {
  48760. return new n.BufferAttribute(new Int32Array(e), t)
  48761. }
  48762. ;(n.Uint32Attribute = function (e, t) {
  48763. return new n.BufferAttribute(new Uint32Array(e), t)
  48764. }),
  48765. (n.Float32Attribute = function (e, t) {
  48766. return new n.BufferAttribute(new Float32Array(e), t)
  48767. }),
  48768. (n.Float64Attribute = function (e, t) {
  48769. return new n.BufferAttribute(new Float64Array(e), t)
  48770. }),
  48771. (n.DynamicBufferAttribute = function (e, t) {
  48772. return (
  48773. console.warn(
  48774. 'THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.'
  48775. ),
  48776. new n.BufferAttribute(e, t).setDynamic(!0)
  48777. )
  48778. }),
  48779. (n.InstancedBufferAttribute = function (e, t, i) {
  48780. n.BufferAttribute.call(this, e, t), (this.meshPerAttribute = i || 1)
  48781. }),
  48782. (n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype)),
  48783. (n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute),
  48784. (n.InstancedBufferAttribute.prototype.copy = function (e) {
  48785. return (
  48786. n.BufferAttribute.prototype.copy.call(this, e),
  48787. (this.meshPerAttribute = e.meshPerAttribute),
  48788. this
  48789. )
  48790. }),
  48791. (n.InterleavedBuffer = function (e, t) {
  48792. ;(this.uuid = n.Math.generateUUID()),
  48793. (this.array = e),
  48794. (this.stride = t),
  48795. (this.dynamic = !1),
  48796. (this.updateRange = {
  48797. offset: 0,
  48798. count: -1
  48799. }),
  48800. (this.version = 0)
  48801. }),
  48802. (n.InterleavedBuffer.prototype = {
  48803. constructor: n.InterleavedBuffer,
  48804. get length() {
  48805. return this.array.length
  48806. },
  48807. get count() {
  48808. return this.array.length / this.stride
  48809. },
  48810. set needsUpdate(e) {
  48811. e === !0 && this.version++
  48812. },
  48813. setDynamic: function (e) {
  48814. return (this.dynamic = e), this
  48815. },
  48816. copy: function (e) {
  48817. return (
  48818. (this.array = new e.array.constructor(e.array)),
  48819. (this.stride = e.stride),
  48820. (this.dynamic = e.dynamic),
  48821. this
  48822. )
  48823. },
  48824. copyAt: function (e, t, i) {
  48825. ;(e *= this.stride), (i *= t.stride)
  48826. for (var n = 0, r = this.stride; n < r; n++) this.array[e + n] = t.array[i + n]
  48827. return this
  48828. },
  48829. set: function (e, t) {
  48830. return void 0 === t && (t = 0), this.array.set(e, t), this
  48831. },
  48832. clone: function () {
  48833. return new this.constructor().copy(this)
  48834. }
  48835. }),
  48836. (n.InstancedInterleavedBuffer = function (e, t, i) {
  48837. n.InterleavedBuffer.call(this, e, t), (this.meshPerAttribute = i || 1)
  48838. }),
  48839. (n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype)),
  48840. (n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer),
  48841. (n.InstancedInterleavedBuffer.prototype.copy = function (e) {
  48842. return (
  48843. n.InterleavedBuffer.prototype.copy.call(this, e),
  48844. (this.meshPerAttribute = e.meshPerAttribute),
  48845. this
  48846. )
  48847. }),
  48848. (n.InterleavedBufferAttribute = function (e, t, i) {
  48849. ;(this.uuid = n.Math.generateUUID()),
  48850. (this.data = e),
  48851. (this.itemSize = t),
  48852. (this.offset = i)
  48853. }),
  48854. (n.InterleavedBufferAttribute.prototype = {
  48855. constructor: n.InterleavedBufferAttribute,
  48856. get length() {
  48857. return (
  48858. console.warn(
  48859. 'THREE.BufferAttribute: .length has been deprecated. Please use .count.'
  48860. ),
  48861. this.array.length
  48862. )
  48863. },
  48864. get count() {
  48865. return this.data.count
  48866. },
  48867. setX: function (e, t) {
  48868. return (this.data.array[e * this.data.stride + this.offset] = t), this
  48869. },
  48870. setY: function (e, t) {
  48871. return (this.data.array[e * this.data.stride + this.offset + 1] = t), this
  48872. },
  48873. setZ: function (e, t) {
  48874. return (this.data.array[e * this.data.stride + this.offset + 2] = t), this
  48875. },
  48876. setW: function (e, t) {
  48877. return (this.data.array[e * this.data.stride + this.offset + 3] = t), this
  48878. },
  48879. getX: function (e) {
  48880. return this.data.array[e * this.data.stride + this.offset]
  48881. },
  48882. getY: function (e) {
  48883. return this.data.array[e * this.data.stride + this.offset + 1]
  48884. },
  48885. getZ: function (e) {
  48886. return this.data.array[e * this.data.stride + this.offset + 2]
  48887. },
  48888. getW: function (e) {
  48889. return this.data.array[e * this.data.stride + this.offset + 3]
  48890. },
  48891. setXY: function (e, t, i) {
  48892. return (
  48893. (e = e * this.data.stride + this.offset),
  48894. (this.data.array[e + 0] = t),
  48895. (this.data.array[e + 1] = i),
  48896. this
  48897. )
  48898. },
  48899. setXYZ: function (e, t, i, n) {
  48900. return (
  48901. (e = e * this.data.stride + this.offset),
  48902. (this.data.array[e + 0] = t),
  48903. (this.data.array[e + 1] = i),
  48904. (this.data.array[e + 2] = n),
  48905. this
  48906. )
  48907. },
  48908. setXYZW: function (e, t, i, n, r) {
  48909. return (
  48910. (e = e * this.data.stride + this.offset),
  48911. (this.data.array[e + 0] = t),
  48912. (this.data.array[e + 1] = i),
  48913. (this.data.array[e + 2] = n),
  48914. (this.data.array[e + 3] = r),
  48915. this
  48916. )
  48917. }
  48918. }),
  48919. (n.Geometry = function () {
  48920. Object.defineProperty(this, 'id', {
  48921. value: n.GeometryIdCount++
  48922. }),
  48923. (this.uuid = n.Math.generateUUID()),
  48924. (this.name = ''),
  48925. (this.type = 'Geometry'),
  48926. (this.vertices = []),
  48927. (this.colors = []),
  48928. (this.faces = []),
  48929. (this.faceVertexUvs = [[]]),
  48930. (this.morphTargets = []),
  48931. (this.morphNormals = []),
  48932. (this.skinWeights = []),
  48933. (this.skinIndices = []),
  48934. (this.lineDistances = []),
  48935. (this.boundingBox = null),
  48936. (this.boundingSphere = null),
  48937. (this.verticesNeedUpdate = !1),
  48938. (this.elementsNeedUpdate = !1),
  48939. (this.uvsNeedUpdate = !1),
  48940. (this.normalsNeedUpdate = !1),
  48941. (this.colorsNeedUpdate = !1),
  48942. (this.lineDistancesNeedUpdate = !1),
  48943. (this.groupsNeedUpdate = !1)
  48944. }),
  48945. (n.Geometry.prototype = {
  48946. constructor: n.Geometry,
  48947. applyMatrix: function (e) {
  48948. for (
  48949. var t = new n.Matrix3().getNormalMatrix(e), i = 0, r = this.vertices.length;
  48950. i < r;
  48951. i++
  48952. ) {
  48953. var o = this.vertices[i]
  48954. o.applyMatrix4(e)
  48955. }
  48956. for (var i = 0, r = this.faces.length; i < r; i++) {
  48957. var a = this.faces[i]
  48958. a.normal.applyMatrix3(t).normalize()
  48959. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  48960. a.vertexNormals[s].applyMatrix3(t).normalize()
  48961. }
  48962. return (
  48963. null !== this.boundingBox && this.computeBoundingBox(),
  48964. null !== this.boundingSphere && this.computeBoundingSphere(),
  48965. (this.verticesNeedUpdate = !0),
  48966. (this.normalsNeedUpdate = !0),
  48967. this
  48968. )
  48969. },
  48970. rotateX: (function () {
  48971. var e
  48972. return function (t) {
  48973. return (
  48974. void 0 === e && (e = new n.Matrix4()),
  48975. e.makeRotationX(t),
  48976. this.applyMatrix(e),
  48977. this
  48978. )
  48979. }
  48980. })(),
  48981. rotateY: (function () {
  48982. var e
  48983. return function (t) {
  48984. return (
  48985. void 0 === e && (e = new n.Matrix4()),
  48986. e.makeRotationY(t),
  48987. this.applyMatrix(e),
  48988. this
  48989. )
  48990. }
  48991. })(),
  48992. rotateZ: (function () {
  48993. var e
  48994. return function (t) {
  48995. return (
  48996. void 0 === e && (e = new n.Matrix4()),
  48997. e.makeRotationZ(t),
  48998. this.applyMatrix(e),
  48999. this
  49000. )
  49001. }
  49002. })(),
  49003. translate: (function () {
  49004. var e
  49005. return function (t, i, r) {
  49006. return (
  49007. void 0 === e && (e = new n.Matrix4()),
  49008. e.makeTranslation(t, i, r),
  49009. this.applyMatrix(e),
  49010. this
  49011. )
  49012. }
  49013. })(),
  49014. scale: (function () {
  49015. var e
  49016. return function (t, i, r) {
  49017. return (
  49018. void 0 === e && (e = new n.Matrix4()),
  49019. e.makeScale(t, i, r),
  49020. this.applyMatrix(e),
  49021. this
  49022. )
  49023. }
  49024. })(),
  49025. lookAt: (function () {
  49026. var e
  49027. return function (t) {
  49028. void 0 === e && (e = new n.Object3D()),
  49029. e.lookAt(t),
  49030. e.updateMatrix(),
  49031. this.applyMatrix(e.matrix)
  49032. }
  49033. })(),
  49034. fromBufferGeometry: function (e) {
  49035. function t(e, t, r, o) {
  49036. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : [],
  49037. f =
  49038. void 0 !== l
  49039. ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()]
  49040. : [],
  49041. g = new n.Face3(e, t, r, a, f, o)
  49042. i.faces.push(g),
  49043. void 0 !== c &&
  49044. i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  49045. void 0 !== h &&
  49046. i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  49047. }
  49048. var i = this,
  49049. r = null !== e.index ? e.index.array : void 0,
  49050. o = e.attributes,
  49051. a = o.position.array,
  49052. s = void 0 !== o.normal ? o.normal.array : void 0,
  49053. l = void 0 !== o.color ? o.color.array : void 0,
  49054. c = void 0 !== o.uv ? o.uv.array : void 0,
  49055. h = void 0 !== o.uv2 ? o.uv2.array : void 0
  49056. void 0 !== h && (this.faceVertexUvs[1] = [])
  49057. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3, g += 2)
  49058. i.vertices.push(new n.Vector3(a[f], a[f + 1], a[f + 2])),
  49059. void 0 !== s && u.push(new n.Vector3(s[f], s[f + 1], s[f + 2])),
  49060. void 0 !== l && i.colors.push(new n.Color(l[f], l[f + 1], l[f + 2])),
  49061. void 0 !== c && d.push(new n.Vector2(c[g], c[g + 1])),
  49062. void 0 !== h && p.push(new n.Vector2(h[g], h[g + 1]))
  49063. if (void 0 !== r) {
  49064. var m = e.groups
  49065. if (m.length > 0)
  49066. for (var f = 0; f < m.length; f++)
  49067. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  49068. t(r[g], r[g + 1], r[g + 2], v.materialIndex)
  49069. else for (var f = 0; f < r.length; f += 3) t(r[f], r[f + 1], r[f + 2])
  49070. } else for (var f = 0; f < a.length / 3; f += 3) t(f, f + 1, f + 2)
  49071. return (
  49072. this.computeFaceNormals(),
  49073. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  49074. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  49075. this
  49076. )
  49077. },
  49078. center: function () {
  49079. this.computeBoundingBox()
  49080. var e = this.boundingBox.center().negate()
  49081. return this.translate(e.x, e.y, e.z), e
  49082. },
  49083. normalize: function () {
  49084. this.computeBoundingSphere()
  49085. var e = this.boundingSphere.center,
  49086. t = this.boundingSphere.radius,
  49087. i = 0 === t ? 1 : 1 / t,
  49088. r = new n.Matrix4()
  49089. return (
  49090. r.set(i, 0, 0, -i * e.x, 0, i, 0, -i * e.y, 0, 0, i, -i * e.z, 0, 0, 0, 1),
  49091. this.applyMatrix(r),
  49092. this
  49093. )
  49094. },
  49095. computeFaceNormals: function () {
  49096. for (
  49097. var e = new n.Vector3(), t = new n.Vector3(), i = 0, r = this.faces.length;
  49098. i < r;
  49099. i++
  49100. ) {
  49101. var o = this.faces[i],
  49102. a = this.vertices[o.a],
  49103. s = this.vertices[o.b],
  49104. l = this.vertices[o.c]
  49105. e.subVectors(l, s), t.subVectors(a, s), e.cross(t), e.normalize(), o.normal.copy(e)
  49106. }
  49107. },
  49108. computeVertexNormals: function (e) {
  49109. void 0 === e && (e = !0)
  49110. var t, i, r, o, a, s
  49111. for (s = new Array(this.vertices.length), t = 0, i = this.vertices.length; t < i; t++)
  49112. s[t] = new n.Vector3()
  49113. if (e) {
  49114. var l,
  49115. c,
  49116. h,
  49117. u = new n.Vector3(),
  49118. d = new n.Vector3()
  49119. for (r = 0, o = this.faces.length; r < o; r++)
  49120. (a = this.faces[r]),
  49121. (l = this.vertices[a.a]),
  49122. (c = this.vertices[a.b]),
  49123. (h = this.vertices[a.c]),
  49124. u.subVectors(h, c),
  49125. d.subVectors(l, c),
  49126. u.cross(d),
  49127. s[a.a].add(u),
  49128. s[a.b].add(u),
  49129. s[a.c].add(u)
  49130. } else
  49131. for (r = 0, o = this.faces.length; r < o; r++)
  49132. (a = this.faces[r]),
  49133. s[a.a].add(a.normal),
  49134. s[a.b].add(a.normal),
  49135. s[a.c].add(a.normal)
  49136. for (t = 0, i = this.vertices.length; t < i; t++) s[t].normalize()
  49137. for (r = 0, o = this.faces.length; r < o; r++) {
  49138. a = this.faces[r]
  49139. var p = a.vertexNormals
  49140. 3 === p.length
  49141. ? (p[0].copy(s[a.a]), p[1].copy(s[a.b]), p[2].copy(s[a.c]))
  49142. : ((p[0] = s[a.a].clone()), (p[1] = s[a.b].clone()), (p[2] = s[a.c].clone()))
  49143. }
  49144. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  49145. },
  49146. computeMorphNormals: function () {
  49147. var e, t, i, r, o
  49148. for (i = 0, r = this.faces.length; i < r; i++)
  49149. for (
  49150. o = this.faces[i],
  49151. o.__originalFaceNormal
  49152. ? o.__originalFaceNormal.copy(o.normal)
  49153. : (o.__originalFaceNormal = o.normal.clone()),
  49154. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  49155. e = 0,
  49156. t = o.vertexNormals.length;
  49157. e < t;
  49158. e++
  49159. )
  49160. o.__originalVertexNormals[e]
  49161. ? o.__originalVertexNormals[e].copy(o.vertexNormals[e])
  49162. : (o.__originalVertexNormals[e] = o.vertexNormals[e].clone())
  49163. var a = new n.Geometry()
  49164. for (a.faces = this.faces, e = 0, t = this.morphTargets.length; e < t; e++) {
  49165. if (!this.morphNormals[e]) {
  49166. ;(this.morphNormals[e] = {}),
  49167. (this.morphNormals[e].faceNormals = []),
  49168. (this.morphNormals[e].vertexNormals = [])
  49169. var s,
  49170. l,
  49171. c = this.morphNormals[e].faceNormals,
  49172. h = this.morphNormals[e].vertexNormals
  49173. for (i = 0, r = this.faces.length; i < r; i++)
  49174. (s = new n.Vector3()),
  49175. (l = {
  49176. a: new n.Vector3(),
  49177. b: new n.Vector3(),
  49178. c: new n.Vector3()
  49179. }),
  49180. c.push(s),
  49181. h.push(l)
  49182. }
  49183. var u = this.morphNormals[e]
  49184. ;(a.vertices = this.morphTargets[e].vertices),
  49185. a.computeFaceNormals(),
  49186. a.computeVertexNormals()
  49187. var s, l
  49188. for (i = 0, r = this.faces.length; i < r; i++)
  49189. (o = this.faces[i]),
  49190. (s = u.faceNormals[i]),
  49191. (l = u.vertexNormals[i]),
  49192. s.copy(o.normal),
  49193. l.a.copy(o.vertexNormals[0]),
  49194. l.b.copy(o.vertexNormals[1]),
  49195. l.c.copy(o.vertexNormals[2])
  49196. }
  49197. for (i = 0, r = this.faces.length; i < r; i++)
  49198. (o = this.faces[i]),
  49199. (o.normal = o.__originalFaceNormal),
  49200. (o.vertexNormals = o.__originalVertexNormals)
  49201. },
  49202. computeTangents: function () {
  49203. console.warn('THREE.Geometry: .computeTangents() has been removed.')
  49204. },
  49205. computeLineDistances: function () {
  49206. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  49207. i > 0 && (e += t[i].distanceTo(t[i - 1])), (this.lineDistances[i] = e)
  49208. },
  49209. computeBoundingBox: function () {
  49210. null === this.boundingBox && (this.boundingBox = new n.Box3()),
  49211. this.boundingBox.setFromPoints(this.vertices)
  49212. },
  49213. computeBoundingSphere: function () {
  49214. null === this.boundingSphere && (this.boundingSphere = new n.Sphere()),
  49215. this.boundingSphere.setFromPoints(this.vertices)
  49216. },
  49217. merge: function (e, t, i) {
  49218. if (e instanceof n.Geometry == !1)
  49219. return void console.error(
  49220. 'THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.',
  49221. e
  49222. )
  49223. var r,
  49224. o = this.vertices.length,
  49225. a = this.vertices,
  49226. s = e.vertices,
  49227. l = this.faces,
  49228. c = e.faces,
  49229. h = this.faceVertexUvs[0],
  49230. u = e.faceVertexUvs[0]
  49231. void 0 === i && (i = 0), void 0 !== t && (r = new n.Matrix3().getNormalMatrix(t))
  49232. for (var d = 0, p = s.length; d < p; d++) {
  49233. var f = s[d],
  49234. g = f.clone()
  49235. void 0 !== t && g.applyMatrix4(t), a.push(g)
  49236. }
  49237. for (d = 0, p = c.length; d < p; d++) {
  49238. var m,
  49239. v,
  49240. A,
  49241. y = c[d],
  49242. C = y.vertexNormals,
  49243. I = y.vertexColors
  49244. ;(m = new n.Face3(y.a + o, y.b + o, y.c + o)),
  49245. m.normal.copy(y.normal),
  49246. void 0 !== r && m.normal.applyMatrix3(r).normalize()
  49247. for (var E = 0, b = C.length; E < b; E++)
  49248. (v = C[E].clone()),
  49249. void 0 !== r && v.applyMatrix3(r).normalize(),
  49250. m.vertexNormals.push(v)
  49251. m.color.copy(y.color)
  49252. for (var E = 0, b = I.length; E < b; E++) (A = I[E]), m.vertexColors.push(A.clone())
  49253. ;(m.materialIndex = y.materialIndex + i), l.push(m)
  49254. }
  49255. for (d = 0, p = u.length; d < p; d++) {
  49256. var w = u[d],
  49257. _ = []
  49258. if (void 0 !== w) {
  49259. for (var E = 0, b = w.length; E < b; E++) _.push(w[E].clone())
  49260. h.push(_)
  49261. }
  49262. }
  49263. },
  49264. mergeMesh: function (e) {
  49265. return e instanceof n.Mesh == !1
  49266. ? void console.error(
  49267. 'THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.',
  49268. e
  49269. )
  49270. : (e.matrixAutoUpdate && e.updateMatrix(), void this.merge(e.geometry, e.matrix))
  49271. },
  49272. mergeVertices: function () {
  49273. var e,
  49274. t,
  49275. i,
  49276. n,
  49277. r,
  49278. o,
  49279. a,
  49280. s,
  49281. l = {},
  49282. c = [],
  49283. h = [],
  49284. u = 4,
  49285. d = Math.pow(10, u)
  49286. for (i = 0, n = this.vertices.length; i < n; i++)
  49287. (e = this.vertices[i]),
  49288. (t = Math.round(e.x * d) + '_' + Math.round(e.y * d) + '_' + Math.round(e.z * d)),
  49289. void 0 === l[t]
  49290. ? ((l[t] = i), c.push(this.vertices[i]), (h[i] = c.length - 1))
  49291. : (h[i] = h[l[t]])
  49292. var p = []
  49293. for (i = 0, n = this.faces.length; i < n; i++) {
  49294. ;(r = this.faces[i]),
  49295. (r.a = h[r.a]),
  49296. (r.b = h[r.b]),
  49297. (r.c = h[r.c]),
  49298. (o = [r.a, r.b, r.c])
  49299. for (var f = -1, g = 0; g < 3; g++)
  49300. if (o[g] === o[(g + 1) % 3]) {
  49301. ;(f = g), p.push(i)
  49302. break
  49303. }
  49304. }
  49305. for (i = p.length - 1; i >= 0; i--) {
  49306. var m = p[i]
  49307. for (this.faces.splice(m, 1), a = 0, s = this.faceVertexUvs.length; a < s; a++)
  49308. this.faceVertexUvs[a].splice(m, 1)
  49309. }
  49310. var v = this.vertices.length - c.length
  49311. return (this.vertices = c), v
  49312. },
  49313. sortFacesByMaterialIndex: function () {
  49314. function e(e, t) {
  49315. return e.materialIndex - t.materialIndex
  49316. }
  49317. for (var t = this.faces, i = t.length, n = 0; n < i; n++) t[n]._id = n
  49318. t.sort(e)
  49319. var r,
  49320. o,
  49321. a = this.faceVertexUvs[0],
  49322. s = this.faceVertexUvs[1]
  49323. a && a.length === i && (r = []), s && s.length === i && (o = [])
  49324. for (var n = 0; n < i; n++) {
  49325. var l = t[n]._id
  49326. r && r.push(a[l]), o && o.push(s[l])
  49327. }
  49328. r && (this.faceVertexUvs[0] = r), o && (this.faceVertexUvs[1] = o)
  49329. },
  49330. toJSON: function () {
  49331. function e(e, t, i) {
  49332. return i ? e | (1 << t) : e & ~(1 << t)
  49333. }
  49334. function t(e) {
  49335. var t = e.x.toString() + e.y.toString() + e.z.toString()
  49336. return void 0 !== d[t] ? d[t] : ((d[t] = u.length / 3), u.push(e.x, e.y, e.z), d[t])
  49337. }
  49338. function i(e) {
  49339. var t = e.r.toString() + e.g.toString() + e.b.toString()
  49340. return void 0 !== f[t] ? f[t] : ((f[t] = p.length), p.push(e.getHex()), f[t])
  49341. }
  49342. function n(e) {
  49343. var t = e.x.toString() + e.y.toString()
  49344. return void 0 !== m[t] ? m[t] : ((m[t] = g.length / 2), g.push(e.x, e.y), m[t])
  49345. }
  49346. var r = {
  49347. metadata: {
  49348. version: 4.4,
  49349. type: 'Geometry',
  49350. generator: 'Geometry.toJSON'
  49351. }
  49352. }
  49353. if (
  49354. ((r.uuid = this.uuid),
  49355. (r.type = this.type),
  49356. '' !== this.name && (r.name = this.name),
  49357. void 0 !== this.parameters)
  49358. ) {
  49359. var o = this.parameters
  49360. for (var a in o) void 0 !== o[a] && (r[a] = o[a])
  49361. return r
  49362. }
  49363. for (var s = [], l = 0; l < this.vertices.length; l++) {
  49364. var c = this.vertices[l]
  49365. s.push(c.x, c.y, c.z)
  49366. }
  49367. for (
  49368. var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0;
  49369. l < this.faces.length;
  49370. l++
  49371. ) {
  49372. var v = this.faces[l],
  49373. A = !0,
  49374. y = !1,
  49375. C = void 0 !== this.faceVertexUvs[0][l],
  49376. I = v.normal.length() > 0,
  49377. E = v.vertexNormals.length > 0,
  49378. b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b,
  49379. w = v.vertexColors.length > 0,
  49380. _ = 0
  49381. if (
  49382. ((_ = e(_, 0, 0)),
  49383. (_ = e(_, 1, A)),
  49384. (_ = e(_, 2, y)),
  49385. (_ = e(_, 3, C)),
  49386. (_ = e(_, 4, I)),
  49387. (_ = e(_, 5, E)),
  49388. (_ = e(_, 6, b)),
  49389. (_ = e(_, 7, w)),
  49390. h.push(_),
  49391. h.push(v.a, v.b, v.c),
  49392. h.push(v.materialIndex),
  49393. C)
  49394. ) {
  49395. var T = this.faceVertexUvs[0][l]
  49396. h.push(n(T[0]), n(T[1]), n(T[2]))
  49397. }
  49398. if ((I && h.push(t(v.normal)), E)) {
  49399. var x = v.vertexNormals
  49400. h.push(t(x[0]), t(x[1]), t(x[2]))
  49401. }
  49402. if ((b && h.push(i(v.color)), w)) {
  49403. var S = v.vertexColors
  49404. h.push(i(S[0]), i(S[1]), i(S[2]))
  49405. }
  49406. }
  49407. return (
  49408. (r.data = {}),
  49409. (r.data.vertices = s),
  49410. (r.data.normals = u),
  49411. p.length > 0 && (r.data.colors = p),
  49412. g.length > 0 && (r.data.uvs = [g]),
  49413. (r.data.faces = h),
  49414. r
  49415. )
  49416. },
  49417. clone: function () {
  49418. return new n.Geometry().copy(this)
  49419. },
  49420. copy: function (e) {
  49421. ;(this.vertices = []), (this.faces = []), (this.faceVertexUvs = [[]])
  49422. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  49423. this.vertices.push(t[i].clone())
  49424. for (var r = e.faces, i = 0, n = r.length; i < n; i++) this.faces.push(r[i].clone())
  49425. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  49426. var o = e.faceVertexUvs[i]
  49427. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = [])
  49428. for (var a = 0, s = o.length; a < s; a++) {
  49429. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  49430. var d = l[h]
  49431. c.push(d.clone())
  49432. }
  49433. this.faceVertexUvs[i].push(c)
  49434. }
  49435. }
  49436. return this
  49437. },
  49438. dispose: function () {
  49439. this.dispatchEvent({
  49440. type: 'dispose'
  49441. })
  49442. }
  49443. }),
  49444. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  49445. (n.GeometryIdCount = 0),
  49446. (n.DirectGeometry = function () {
  49447. Object.defineProperty(this, 'id', {
  49448. value: n.GeometryIdCount++
  49449. }),
  49450. (this.uuid = n.Math.generateUUID()),
  49451. (this.name = ''),
  49452. (this.type = 'DirectGeometry'),
  49453. (this.indices = []),
  49454. (this.vertices = []),
  49455. (this.normals = []),
  49456. (this.colors = []),
  49457. (this.uvs = []),
  49458. (this.uvs2 = []),
  49459. (this.groups = []),
  49460. (this.morphTargets = {}),
  49461. (this.skinWeights = []),
  49462. (this.skinIndices = []),
  49463. (this.boundingBox = null),
  49464. (this.boundingSphere = null),
  49465. (this.verticesNeedUpdate = !1),
  49466. (this.normalsNeedUpdate = !1),
  49467. (this.colorsNeedUpdate = !1),
  49468. (this.uvsNeedUpdate = !1),
  49469. (this.groupsNeedUpdate = !1)
  49470. }),
  49471. (n.DirectGeometry.prototype = {
  49472. constructor: n.DirectGeometry,
  49473. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  49474. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  49475. computeFaceNormals: function () {
  49476. console.warn(
  49477. 'THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.'
  49478. )
  49479. },
  49480. computeVertexNormals: function () {
  49481. console.warn(
  49482. 'THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.'
  49483. )
  49484. },
  49485. computeGroups: function (e) {
  49486. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  49487. var a = r[o]
  49488. a.materialIndex !== i &&
  49489. ((i = a.materialIndex),
  49490. void 0 !== t && ((t.count = 3 * o - t.start), n.push(t)),
  49491. (t = {
  49492. start: 3 * o,
  49493. materialIndex: i
  49494. }))
  49495. }
  49496. void 0 !== t && ((t.count = 3 * o - t.start), n.push(t)), (this.groups = n)
  49497. },
  49498. fromGeometry: function (e) {
  49499. var t,
  49500. i = e.faces,
  49501. r = e.vertices,
  49502. o = e.faceVertexUvs,
  49503. a = o[0] && o[0].length > 0,
  49504. s = o[1] && o[1].length > 0,
  49505. l = e.morphTargets,
  49506. c = l.length
  49507. if (c > 0) {
  49508. t = []
  49509. for (var h = 0; h < c; h++) t[h] = []
  49510. this.morphTargets.position = t
  49511. }
  49512. var u,
  49513. d = e.morphNormals,
  49514. p = d.length
  49515. if (p > 0) {
  49516. u = []
  49517. for (var h = 0; h < p; h++) u[h] = []
  49518. this.morphTargets.normal = u
  49519. }
  49520. for (
  49521. var f = e.skinIndices,
  49522. g = e.skinWeights,
  49523. m = f.length === r.length,
  49524. v = g.length === r.length,
  49525. h = 0;
  49526. h < i.length;
  49527. h++
  49528. ) {
  49529. var A = i[h]
  49530. this.vertices.push(r[A.a], r[A.b], r[A.c])
  49531. var y = A.vertexNormals
  49532. if (3 === y.length) this.normals.push(y[0], y[1], y[2])
  49533. else {
  49534. var C = A.normal
  49535. this.normals.push(C, C, C)
  49536. }
  49537. var I = A.vertexColors
  49538. if (3 === I.length) this.colors.push(I[0], I[1], I[2])
  49539. else {
  49540. var E = A.color
  49541. this.colors.push(E, E, E)
  49542. }
  49543. if (a === !0) {
  49544. var b = o[0][h]
  49545. void 0 !== b
  49546. ? this.uvs.push(b[0], b[1], b[2])
  49547. : (console.warn('THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ', h),
  49548. this.uvs.push(new n.Vector2(), new n.Vector2(), new n.Vector2()))
  49549. }
  49550. if (s === !0) {
  49551. var b = o[1][h]
  49552. void 0 !== b
  49553. ? this.uvs2.push(b[0], b[1], b[2])
  49554. : (console.warn('THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ', h),
  49555. this.uvs2.push(new n.Vector2(), new n.Vector2(), new n.Vector2()))
  49556. }
  49557. for (var w = 0; w < c; w++) {
  49558. var _ = l[w].vertices
  49559. t[w].push(_[A.a], _[A.b], _[A.c])
  49560. }
  49561. for (var w = 0; w < p; w++) {
  49562. var T = d[w].vertexNormals[h]
  49563. u[w].push(T.a, T.b, T.c)
  49564. }
  49565. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  49566. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  49567. }
  49568. return (
  49569. this.computeGroups(e),
  49570. (this.verticesNeedUpdate = e.verticesNeedUpdate),
  49571. (this.normalsNeedUpdate = e.normalsNeedUpdate),
  49572. (this.colorsNeedUpdate = e.colorsNeedUpdate),
  49573. (this.uvsNeedUpdate = e.uvsNeedUpdate),
  49574. (this.groupsNeedUpdate = e.groupsNeedUpdate),
  49575. this
  49576. )
  49577. },
  49578. dispose: function () {
  49579. this.dispatchEvent({
  49580. type: 'dispose'
  49581. })
  49582. }
  49583. }),
  49584. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  49585. (n.BufferGeometry = function () {
  49586. Object.defineProperty(this, 'id', {
  49587. value: n.GeometryIdCount++
  49588. }),
  49589. (this.uuid = n.Math.generateUUID()),
  49590. (this.name = ''),
  49591. (this.type = 'BufferGeometry'),
  49592. (this.index = null),
  49593. (this.attributes = {}),
  49594. (this.morphAttributes = {}),
  49595. (this.groups = []),
  49596. (this.boundingBox = null),
  49597. (this.boundingSphere = null),
  49598. (this.drawRange = {
  49599. start: 0,
  49600. count: 1 / 0
  49601. })
  49602. }),
  49603. (n.BufferGeometry.prototype = {
  49604. constructor: n.BufferGeometry,
  49605. getIndex: function () {
  49606. return this.index
  49607. },
  49608. setIndex: function (e) {
  49609. this.index = e
  49610. },
  49611. addAttribute: function (e, t) {
  49612. return t instanceof n.BufferAttribute == !1 &&
  49613. t instanceof n.InterleavedBufferAttribute == !1
  49614. ? (console.warn(
  49615. 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).'
  49616. ),
  49617. void this.addAttribute(e, new n.BufferAttribute(arguments[1], arguments[2])))
  49618. : 'index' === e
  49619. ? (console.warn(
  49620. 'THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.'
  49621. ),
  49622. void this.setIndex(t))
  49623. : ((this.attributes[e] = t), this)
  49624. },
  49625. getAttribute: function (e) {
  49626. return this.attributes[e]
  49627. },
  49628. removeAttribute: function (e) {
  49629. return delete this.attributes[e], this
  49630. },
  49631. addGroup: function (e, t, i) {
  49632. this.groups.push({
  49633. start: e,
  49634. count: t,
  49635. materialIndex: void 0 !== i ? i : 0
  49636. })
  49637. },
  49638. clearGroups: function () {
  49639. this.groups = []
  49640. },
  49641. setDrawRange: function (e, t) {
  49642. ;(this.drawRange.start = e), (this.drawRange.count = t)
  49643. },
  49644. applyMatrix: function (e) {
  49645. var t = this.attributes.position
  49646. void 0 !== t && (e.applyToVector3Array(t.array), (t.needsUpdate = !0))
  49647. var i = this.attributes.normal
  49648. if (void 0 !== i) {
  49649. var r = new n.Matrix3().getNormalMatrix(e)
  49650. r.applyToVector3Array(i.array), (i.needsUpdate = !0)
  49651. }
  49652. return (
  49653. null !== this.boundingBox && this.computeBoundingBox(),
  49654. null !== this.boundingSphere && this.computeBoundingSphere(),
  49655. this
  49656. )
  49657. },
  49658. rotateX: (function () {
  49659. var e
  49660. return function (t) {
  49661. return (
  49662. void 0 === e && (e = new n.Matrix4()),
  49663. e.makeRotationX(t),
  49664. this.applyMatrix(e),
  49665. this
  49666. )
  49667. }
  49668. })(),
  49669. rotateY: (function () {
  49670. var e
  49671. return function (t) {
  49672. return (
  49673. void 0 === e && (e = new n.Matrix4()),
  49674. e.makeRotationY(t),
  49675. this.applyMatrix(e),
  49676. this
  49677. )
  49678. }
  49679. })(),
  49680. rotateZ: (function () {
  49681. var e
  49682. return function (t) {
  49683. return (
  49684. void 0 === e && (e = new n.Matrix4()),
  49685. e.makeRotationZ(t),
  49686. this.applyMatrix(e),
  49687. this
  49688. )
  49689. }
  49690. })(),
  49691. translate: (function () {
  49692. var e
  49693. return function (t, i, r) {
  49694. return (
  49695. void 0 === e && (e = new n.Matrix4()),
  49696. e.makeTranslation(t, i, r),
  49697. this.applyMatrix(e),
  49698. this
  49699. )
  49700. }
  49701. })(),
  49702. scale: (function () {
  49703. var e
  49704. return function (t, i, r) {
  49705. return (
  49706. void 0 === e && (e = new n.Matrix4()),
  49707. e.makeScale(t, i, r),
  49708. this.applyMatrix(e),
  49709. this
  49710. )
  49711. }
  49712. })(),
  49713. lookAt: (function () {
  49714. var e
  49715. return function (t) {
  49716. void 0 === e && (e = new n.Object3D()),
  49717. e.lookAt(t),
  49718. e.updateMatrix(),
  49719. this.applyMatrix(e.matrix)
  49720. }
  49721. })(),
  49722. center: function () {
  49723. this.computeBoundingBox()
  49724. var e = this.boundingBox.center().negate()
  49725. return this.translate(e.x, e.y, e.z), e
  49726. },
  49727. setFromObject: function (e) {
  49728. var t = e.geometry
  49729. if (e instanceof n.Points || e instanceof n.Line) {
  49730. var i = new n.Float32Attribute(3 * t.vertices.length, 3),
  49731. r = new n.Float32Attribute(3 * t.colors.length, 3)
  49732. if (
  49733. (this.addAttribute('position', i.copyVector3sArray(t.vertices)),
  49734. this.addAttribute('color', r.copyColorsArray(t.colors)),
  49735. t.lineDistances && t.lineDistances.length === t.vertices.length)
  49736. ) {
  49737. var o = new n.Float32Attribute(t.lineDistances.length, 1)
  49738. this.addAttribute('lineDistance', o.copyArray(t.lineDistances))
  49739. }
  49740. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  49741. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  49742. } else e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t)
  49743. return this
  49744. },
  49745. updateFromObject: function (e) {
  49746. var t = e.geometry
  49747. if (e instanceof n.Mesh) {
  49748. var i = t.__directGeometry
  49749. if (void 0 === i) return this.fromGeometry(t)
  49750. ;(i.verticesNeedUpdate = t.verticesNeedUpdate),
  49751. (i.normalsNeedUpdate = t.normalsNeedUpdate),
  49752. (i.colorsNeedUpdate = t.colorsNeedUpdate),
  49753. (i.uvsNeedUpdate = t.uvsNeedUpdate),
  49754. (i.groupsNeedUpdate = t.groupsNeedUpdate),
  49755. (t.verticesNeedUpdate = !1),
  49756. (t.normalsNeedUpdate = !1),
  49757. (t.colorsNeedUpdate = !1),
  49758. (t.uvsNeedUpdate = !1),
  49759. (t.groupsNeedUpdate = !1),
  49760. (t = i)
  49761. }
  49762. if (t.verticesNeedUpdate === !0) {
  49763. var r = this.attributes.position
  49764. void 0 !== r && (r.copyVector3sArray(t.vertices), (r.needsUpdate = !0)),
  49765. (t.verticesNeedUpdate = !1)
  49766. }
  49767. if (t.normalsNeedUpdate === !0) {
  49768. var r = this.attributes.normal
  49769. void 0 !== r && (r.copyVector3sArray(t.normals), (r.needsUpdate = !0)),
  49770. (t.normalsNeedUpdate = !1)
  49771. }
  49772. if (t.colorsNeedUpdate === !0) {
  49773. var r = this.attributes.color
  49774. void 0 !== r && (r.copyColorsArray(t.colors), (r.needsUpdate = !0)),
  49775. (t.colorsNeedUpdate = !1)
  49776. }
  49777. if (t.uvsNeedUpdate) {
  49778. var r = this.attributes.uv
  49779. void 0 !== r && (r.copyVector2sArray(t.uvs), (r.needsUpdate = !0)),
  49780. (t.uvsNeedUpdate = !1)
  49781. }
  49782. if (t.lineDistancesNeedUpdate) {
  49783. var r = this.attributes.lineDistance
  49784. void 0 !== r && (r.copyArray(t.lineDistances), (r.needsUpdate = !0)),
  49785. (t.lineDistancesNeedUpdate = !1)
  49786. }
  49787. return (
  49788. t.groupsNeedUpdate &&
  49789. (t.computeGroups(e.geometry),
  49790. (this.groups = t.groups),
  49791. (t.groupsNeedUpdate = !1)),
  49792. this
  49793. )
  49794. },
  49795. fromGeometry: function (e) {
  49796. return (
  49797. (e.__directGeometry = new n.DirectGeometry().fromGeometry(e)),
  49798. this.fromDirectGeometry(e.__directGeometry)
  49799. )
  49800. },
  49801. fromDirectGeometry: function (e) {
  49802. var t = new Float32Array(3 * e.vertices.length)
  49803. if (
  49804. (this.addAttribute(
  49805. 'position',
  49806. new n.BufferAttribute(t, 3).copyVector3sArray(e.vertices)
  49807. ),
  49808. e.normals.length > 0)
  49809. ) {
  49810. var i = new Float32Array(3 * e.normals.length)
  49811. this.addAttribute(
  49812. 'normal',
  49813. new n.BufferAttribute(i, 3).copyVector3sArray(e.normals)
  49814. )
  49815. }
  49816. if (e.colors.length > 0) {
  49817. var r = new Float32Array(3 * e.colors.length)
  49818. this.addAttribute('color', new n.BufferAttribute(r, 3).copyColorsArray(e.colors))
  49819. }
  49820. if (e.uvs.length > 0) {
  49821. var o = new Float32Array(2 * e.uvs.length)
  49822. this.addAttribute('uv', new n.BufferAttribute(o, 2).copyVector2sArray(e.uvs))
  49823. }
  49824. if (e.uvs2.length > 0) {
  49825. var a = new Float32Array(2 * e.uvs2.length)
  49826. this.addAttribute('uv2', new n.BufferAttribute(a, 2).copyVector2sArray(e.uvs2))
  49827. }
  49828. if (e.indices.length > 0) {
  49829. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array,
  49830. l = new s(3 * e.indices.length)
  49831. this.setIndex(new n.BufferAttribute(l, 1).copyIndicesArray(e.indices))
  49832. }
  49833. this.groups = e.groups
  49834. for (var c in e.morphTargets) {
  49835. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  49836. var f = u[d],
  49837. g = new n.Float32Attribute(3 * f.length, 3)
  49838. h.push(g.copyVector3sArray(f))
  49839. }
  49840. this.morphAttributes[c] = h
  49841. }
  49842. if (e.skinIndices.length > 0) {
  49843. var m = new n.Float32Attribute(4 * e.skinIndices.length, 4)
  49844. this.addAttribute('skinIndex', m.copyVector4sArray(e.skinIndices))
  49845. }
  49846. if (e.skinWeights.length > 0) {
  49847. var v = new n.Float32Attribute(4 * e.skinWeights.length, 4)
  49848. this.addAttribute('skinWeight', v.copyVector4sArray(e.skinWeights))
  49849. }
  49850. return (
  49851. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  49852. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  49853. this
  49854. )
  49855. },
  49856. computeBoundingBox: (function () {
  49857. new n.Vector3()
  49858. return function () {
  49859. null === this.boundingBox && (this.boundingBox = new n.Box3())
  49860. var e = this.attributes.position.array
  49861. e && this.boundingBox.setFromArray(e),
  49862. (void 0 !== e && 0 !== e.length) ||
  49863. (this.boundingBox.min.set(0, 0, 0), this.boundingBox.max.set(0, 0, 0)),
  49864. (isNaN(this.boundingBox.min.x) ||
  49865. isNaN(this.boundingBox.min.y) ||
  49866. isNaN(this.boundingBox.min.z)) &&
  49867. console.error(
  49868. 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',
  49869. this
  49870. )
  49871. }
  49872. })(),
  49873. computeBoundingSphere: (function () {
  49874. var e = new n.Box3(),
  49875. t = new n.Vector3()
  49876. return function () {
  49877. null === this.boundingSphere && (this.boundingSphere = new n.Sphere())
  49878. var i = this.attributes.position.array
  49879. if (i) {
  49880. var r = this.boundingSphere.center
  49881. e.setFromArray(i), e.center(r)
  49882. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  49883. t.fromArray(i, a), (o = Math.max(o, r.distanceToSquared(t)))
  49884. ;(this.boundingSphere.radius = Math.sqrt(o)),
  49885. isNaN(this.boundingSphere.radius) &&
  49886. console.error(
  49887. 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
  49888. this
  49889. )
  49890. }
  49891. }
  49892. })(),
  49893. computeFaceNormals: function () {},
  49894. computeVertexNormals: function () {
  49895. var e = this.index,
  49896. t = this.attributes,
  49897. i = this.groups
  49898. if (t.position) {
  49899. var r = t.position.array
  49900. if (void 0 === t.normal)
  49901. this.addAttribute('normal', new n.BufferAttribute(new Float32Array(r.length), 3))
  49902. else for (var o = t.normal.array, a = 0, s = o.length; a < s; a++) o[a] = 0
  49903. var l,
  49904. c,
  49905. h,
  49906. u = t.normal.array,
  49907. d = new n.Vector3(),
  49908. p = new n.Vector3(),
  49909. f = new n.Vector3(),
  49910. g = new n.Vector3(),
  49911. m = new n.Vector3()
  49912. if (e) {
  49913. var v = e.array
  49914. 0 === i.length && this.addGroup(0, v.length)
  49915. for (var A = 0, y = i.length; A < y; ++A)
  49916. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  49917. (l = 3 * v[a + 0]),
  49918. (c = 3 * v[a + 1]),
  49919. (h = 3 * v[a + 2]),
  49920. d.fromArray(r, l),
  49921. p.fromArray(r, c),
  49922. f.fromArray(r, h),
  49923. g.subVectors(f, p),
  49924. m.subVectors(d, p),
  49925. g.cross(m),
  49926. (u[l] += g.x),
  49927. (u[l + 1] += g.y),
  49928. (u[l + 2] += g.z),
  49929. (u[c] += g.x),
  49930. (u[c + 1] += g.y),
  49931. (u[c + 2] += g.z),
  49932. (u[h] += g.x),
  49933. (u[h + 1] += g.y),
  49934. (u[h + 2] += g.z)
  49935. } else
  49936. for (var a = 0, s = r.length; a < s; a += 9)
  49937. d.fromArray(r, a),
  49938. p.fromArray(r, a + 3),
  49939. f.fromArray(r, a + 6),
  49940. g.subVectors(f, p),
  49941. m.subVectors(d, p),
  49942. g.cross(m),
  49943. (u[a] = g.x),
  49944. (u[a + 1] = g.y),
  49945. (u[a + 2] = g.z),
  49946. (u[a + 3] = g.x),
  49947. (u[a + 4] = g.y),
  49948. (u[a + 5] = g.z),
  49949. (u[a + 6] = g.x),
  49950. (u[a + 7] = g.y),
  49951. (u[a + 8] = g.z)
  49952. this.normalizeNormals(), (t.normal.needsUpdate = !0)
  49953. }
  49954. },
  49955. merge: function (e, t) {
  49956. if (e instanceof n.BufferGeometry == !1)
  49957. return void console.error(
  49958. 'THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.',
  49959. e
  49960. )
  49961. void 0 === t && (t = 0)
  49962. var i = this.attributes
  49963. for (var r in i)
  49964. if (void 0 !== e.attributes[r])
  49965. for (
  49966. var o = i[r],
  49967. a = o.array,
  49968. s = e.attributes[r],
  49969. l = s.array,
  49970. c = s.itemSize,
  49971. h = 0,
  49972. u = c * t;
  49973. h < l.length;
  49974. h++, u++
  49975. )
  49976. a[u] = l[h]
  49977. return this
  49978. },
  49979. normalizeNormals: function () {
  49980. for (
  49981. var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length;
  49982. o < a;
  49983. o += 3
  49984. )
  49985. (e = r[o]),
  49986. (t = r[o + 1]),
  49987. (i = r[o + 2]),
  49988. (n = 1 / Math.sqrt(e * e + t * t + i * i)),
  49989. (r[o] *= n),
  49990. (r[o + 1] *= n),
  49991. (r[o + 2] *= n)
  49992. },
  49993. toNonIndexed: function () {
  49994. if (null === this.index)
  49995. return (
  49996. console.warn(
  49997. 'THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed.'
  49998. ),
  49999. this
  50000. )
  50001. var e = new n.BufferGeometry(),
  50002. t = this.index.array,
  50003. i = this.attributes
  50004. for (var r in i) {
  50005. for (
  50006. var o = i[r],
  50007. a = o.array,
  50008. s = o.itemSize,
  50009. l = new a.constructor(t.length * s),
  50010. c = 0,
  50011. h = 0,
  50012. u = 0,
  50013. d = t.length;
  50014. u < d;
  50015. u++
  50016. ) {
  50017. c = t[u] * s
  50018. for (var p = 0; p < s; p++) l[h++] = a[c++]
  50019. }
  50020. e.addAttribute(r, new n.BufferAttribute(l, s))
  50021. }
  50022. return e
  50023. },
  50024. toJSON: function () {
  50025. var e = {
  50026. metadata: {
  50027. version: 4.4,
  50028. type: 'BufferGeometry',
  50029. generator: 'BufferGeometry.toJSON'
  50030. }
  50031. }
  50032. if (
  50033. ((e.uuid = this.uuid),
  50034. (e.type = this.type),
  50035. '' !== this.name && (e.name = this.name),
  50036. void 0 !== this.parameters)
  50037. ) {
  50038. var t = this.parameters
  50039. for (var i in t) void 0 !== t[i] && (e[i] = t[i])
  50040. return e
  50041. }
  50042. e.data = {
  50043. attributes: {}
  50044. }
  50045. var n = this.index
  50046. if (null !== n) {
  50047. var r = Array.prototype.slice.call(n.array)
  50048. e.data.index = {
  50049. type: n.array.constructor.name,
  50050. array: r
  50051. }
  50052. }
  50053. var o = this.attributes
  50054. for (var i in o) {
  50055. var a = o[i],
  50056. r = Array.prototype.slice.call(a.array)
  50057. e.data.attributes[i] = {
  50058. itemSize: a.itemSize,
  50059. type: a.array.constructor.name,
  50060. array: r
  50061. }
  50062. }
  50063. var s = this.groups
  50064. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)))
  50065. var l = this.boundingSphere
  50066. return (
  50067. null !== l &&
  50068. (e.data.boundingSphere = {
  50069. center: l.center.toArray(),
  50070. radius: l.radius
  50071. }),
  50072. e
  50073. )
  50074. },
  50075. clone: function () {
  50076. return new n.BufferGeometry().copy(this)
  50077. },
  50078. copy: function (e) {
  50079. var t = e.index
  50080. null !== t && this.setIndex(t.clone())
  50081. var i = e.attributes
  50082. for (var n in i) {
  50083. var r = i[n]
  50084. this.addAttribute(n, r.clone())
  50085. }
  50086. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  50087. var l = o[a]
  50088. this.addGroup(l.start, l.count)
  50089. }
  50090. return this
  50091. },
  50092. dispose: function () {
  50093. this.dispatchEvent({
  50094. type: 'dispose'
  50095. })
  50096. }
  50097. }),
  50098. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  50099. (n.BufferGeometry.MaxIndex = 65535),
  50100. (n.InstancedBufferGeometry = function () {
  50101. n.BufferGeometry.call(this),
  50102. (this.type = 'InstancedBufferGeometry'),
  50103. (this.maxInstancedCount = void 0)
  50104. }),
  50105. (n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  50106. (n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry),
  50107. (n.InstancedBufferGeometry.prototype.addGroup = function (e, t, i) {
  50108. this.groups.push({
  50109. start: e,
  50110. count: t,
  50111. instances: i
  50112. })
  50113. }),
  50114. (n.InstancedBufferGeometry.prototype.copy = function (e) {
  50115. var t = e.index
  50116. null !== t && this.setIndex(t.clone())
  50117. var i = e.attributes
  50118. for (var n in i) {
  50119. var r = i[n]
  50120. this.addAttribute(n, r.clone())
  50121. }
  50122. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  50123. var l = o[a]
  50124. this.addGroup(l.start, l.count, l.instances)
  50125. }
  50126. return this
  50127. }),
  50128. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  50129. (n.Uniform = function (e, t) {
  50130. ;(this.type = e), (this.value = t), (this.dynamic = !1)
  50131. }),
  50132. (n.Uniform.prototype = {
  50133. constructor: n.Uniform,
  50134. onUpdate: function (e) {
  50135. return (this.dynamic = !0), (this.onUpdateCallback = e), this
  50136. }
  50137. }),
  50138. (n.AnimationClip = function (e, t, i) {
  50139. ;(this.name = e || n.Math.generateUUID()),
  50140. (this.tracks = i),
  50141. (this.duration = void 0 !== t ? t : -1),
  50142. this.duration < 0 && this.resetDuration(),
  50143. this.trim(),
  50144. this.optimize()
  50145. }),
  50146. (n.AnimationClip.prototype = {
  50147. constructor: n.AnimationClip,
  50148. resetDuration: function () {
  50149. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  50150. var r = this.tracks[i]
  50151. t = Math.max(t, r.times[r.times.length - 1])
  50152. }
  50153. this.duration = t
  50154. },
  50155. trim: function () {
  50156. for (var e = 0; e < this.tracks.length; e++) this.tracks[e].trim(0, this.duration)
  50157. return this
  50158. },
  50159. optimize: function () {
  50160. for (var e = 0; e < this.tracks.length; e++) this.tracks[e].optimize()
  50161. return this
  50162. }
  50163. }),
  50164. Object.assign(n.AnimationClip, {
  50165. parse: function (e) {
  50166. for (
  50167. var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length;
  50168. o !== a;
  50169. ++o
  50170. )
  50171. t.push(n.KeyframeTrack.parse(i[o]).scale(r))
  50172. return new n.AnimationClip(e.name, e.duration, t)
  50173. },
  50174. toJSON: function (e) {
  50175. for (
  50176. var t = [],
  50177. i = e.tracks,
  50178. r = {
  50179. name: e.name,
  50180. duration: e.duration,
  50181. tracks: t
  50182. },
  50183. o = 0,
  50184. a = i.length;
  50185. o !== a;
  50186. ++o
  50187. )
  50188. t.push(n.KeyframeTrack.toJSON(i[o]))
  50189. return r
  50190. },
  50191. CreateFromMorphTargetSequence: function (e, t, i) {
  50192. for (var r = t.length, o = [], a = 0; a < r; a++) {
  50193. var s = [],
  50194. l = []
  50195. s.push((a + r - 1) % r, a, (a + 1) % r), l.push(0, 1, 0)
  50196. var c = n.AnimationUtils.getKeyframeOrder(s)
  50197. ;(s = n.AnimationUtils.sortedArray(s, 1, c)),
  50198. (l = n.AnimationUtils.sortedArray(l, 1, c)),
  50199. 0 === s[0] && (s.push(r), l.push(l[0])),
  50200. o.push(
  50201. new n.NumberKeyframeTrack(
  50202. '.morphTargetInfluences[' + t[a].name + ']',
  50203. s,
  50204. l
  50205. ).scale(1 / i)
  50206. )
  50207. }
  50208. return new n.AnimationClip(e, -1, o)
  50209. },
  50210. findByName: function (e, t) {
  50211. for (var i = 0; i < e.length; i++) if (e[i].name === t) return e[i]
  50212. return null
  50213. },
  50214. CreateClipsFromMorphTargetSequences: function (e, t) {
  50215. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  50216. var s = e[o],
  50217. l = s.name.match(r)
  50218. if (l && l.length > 1) {
  50219. var c = l[1],
  50220. h = i[c]
  50221. h || (i[c] = h = []), h.push(s)
  50222. }
  50223. }
  50224. var u = []
  50225. for (var c in i) u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t))
  50226. return u
  50227. },
  50228. parseAnimation: function (e, t, i) {
  50229. if (!e) return console.error(' no animation in JSONLoader data'), null
  50230. for (
  50231. var r = function (e, t, i, r, o) {
  50232. if (0 !== i.length) {
  50233. var a = [],
  50234. s = []
  50235. n.AnimationUtils.flattenJSON(i, a, s, r),
  50236. 0 !== a.length && o.push(new e(t, a, s))
  50237. }
  50238. },
  50239. o = [],
  50240. a = e.name || 'default',
  50241. s = e.length || -1,
  50242. l = e.fps || 30,
  50243. c = e.hierarchy || [],
  50244. h = 0;
  50245. h < c.length;
  50246. h++
  50247. ) {
  50248. var u = c[h].keys
  50249. if (u && 0 != u.length)
  50250. if (u[0].morphTargets) {
  50251. for (var d = {}, p = 0; p < u.length; p++)
  50252. if (u[p].morphTargets)
  50253. for (var f = 0; f < u[p].morphTargets.length; f++)
  50254. d[u[p].morphTargets[f]] = -1
  50255. for (var g in d) {
  50256. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  50257. var A = u[p]
  50258. m.push(A.time), v.push(A.morphTarget === g ? 1 : 0)
  50259. }
  50260. o.push(new n.NumberKeyframeTrack('.morphTargetInfluence[' + g + ']', m, v))
  50261. }
  50262. s = d.length * (l || 1)
  50263. } else {
  50264. var y = '.bones[' + t[h].name + ']'
  50265. r(n.VectorKeyframeTrack, y + '.position', u, 'pos', o),
  50266. r(n.QuaternionKeyframeTrack, y + '.quaternion', u, 'rot', o),
  50267. r(n.VectorKeyframeTrack, y + '.scale', u, 'scl', o)
  50268. }
  50269. }
  50270. if (0 === o.length) return null
  50271. var C = new n.AnimationClip(a, s, o)
  50272. return C
  50273. }
  50274. }),
  50275. (n.AnimationMixer = function (e) {
  50276. ;(this._root = e),
  50277. this._initMemoryManager(),
  50278. (this._accuIndex = 0),
  50279. (this.time = 0),
  50280. (this.timeScale = 1)
  50281. }),
  50282. (n.AnimationMixer.prototype = {
  50283. constructor: n.AnimationMixer,
  50284. clipAction: function (e, t) {
  50285. var i,
  50286. r = t || this._root,
  50287. o = r.uuid,
  50288. a = 'string' == typeof e ? e : e.name,
  50289. s = e !== a ? e : null,
  50290. l = this._actionsByClip[a]
  50291. if (void 0 !== l) {
  50292. var c = l.actionByRoot[o]
  50293. if (void 0 !== c) return c
  50294. if (((i = l.knownActions[0]), (s = i._clip), e !== a && e !== s))
  50295. throw new Error('Different clips with the same name detected!')
  50296. }
  50297. if (null === s) return null
  50298. var h = new n.AnimationMixer._Action(this, s, t)
  50299. return this._bindAction(h, i), this._addInactiveAction(h, a, o), h
  50300. },
  50301. existingAction: function (e, t) {
  50302. var i = t || this._root,
  50303. n = i.uuid,
  50304. r = 'string' == typeof e ? e : e.name,
  50305. o = this._actionsByClip[r]
  50306. return void 0 !== o ? o.actionByRoot[n] || null : null
  50307. },
  50308. stopAllAction: function () {
  50309. var e = this._actions,
  50310. t = this._nActiveActions,
  50311. i = this._bindings,
  50312. n = this._nActiveBindings
  50313. ;(this._nActiveActions = 0), (this._nActiveBindings = 0)
  50314. for (var r = 0; r !== t; ++r) e[r].reset()
  50315. for (var r = 0; r !== n; ++r) i[r].useCount = 0
  50316. return this
  50317. },
  50318. update: function (e) {
  50319. e *= this.timeScale
  50320. for (
  50321. var t = this._actions,
  50322. i = this._nActiveActions,
  50323. n = (this.time += e),
  50324. r = Math.sign(e),
  50325. o = (this._accuIndex ^= 1),
  50326. a = 0;
  50327. a !== i;
  50328. ++a
  50329. ) {
  50330. var s = t[a]
  50331. s.enabled && s._update(n, e, r, o)
  50332. }
  50333. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  50334. l[a].apply(o)
  50335. return this
  50336. },
  50337. getRoot: function () {
  50338. return this._root
  50339. },
  50340. uncacheClip: function (e) {
  50341. var t = this._actions,
  50342. i = e.name,
  50343. n = this._actionsByClip,
  50344. r = n[i]
  50345. if (void 0 !== r) {
  50346. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  50347. var l = o[a]
  50348. this._deactivateAction(l)
  50349. var c = l._cacheIndex,
  50350. h = t[t.length - 1]
  50351. ;(l._cacheIndex = null),
  50352. (l._byClipCacheIndex = null),
  50353. (h._cacheIndex = c),
  50354. (t[c] = h),
  50355. t.pop(),
  50356. this._removeInactiveBindingsForAction(l)
  50357. }
  50358. delete n[i]
  50359. }
  50360. },
  50361. uncacheRoot: function (e) {
  50362. var t = e.uuid,
  50363. i = this._actionsByClip
  50364. for (var n in i) {
  50365. var r = i[n].actionByRoot,
  50366. o = r[t]
  50367. void 0 !== o && (this._deactivateAction(o), this._removeInactiveAction(o))
  50368. }
  50369. var a = this._bindingsByRootAndName,
  50370. s = a[t]
  50371. if (void 0 !== s)
  50372. for (var l in s) {
  50373. var c = s[l]
  50374. c.restoreOriginalState(), this._removeInactiveBinding(c)
  50375. }
  50376. },
  50377. uncacheAction: function (e, t) {
  50378. var i = this.existingAction(e, t)
  50379. null !== i && (this._deactivateAction(i), this._removeInactiveAction(i))
  50380. }
  50381. }),
  50382. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  50383. (n.AnimationMixer._Action = function (e, t, i) {
  50384. ;(this._mixer = e), (this._clip = t), (this._localRoot = i || null)
  50385. for (
  50386. var r = t.tracks,
  50387. o = r.length,
  50388. a = new Array(o),
  50389. s = {
  50390. endingStart: n.ZeroCurvatureEnding,
  50391. endingEnd: n.ZeroCurvatureEnding
  50392. },
  50393. l = 0;
  50394. l !== o;
  50395. ++l
  50396. ) {
  50397. var c = r[l].createInterpolant(null)
  50398. ;(a[l] = c), (c.settings = s)
  50399. }
  50400. ;(this._interpolantSettings = s),
  50401. (this._interpolants = a),
  50402. (this._propertyBindings = new Array(o)),
  50403. (this._cacheIndex = null),
  50404. (this._byClipCacheIndex = null),
  50405. (this._timeScaleInterpolant = null),
  50406. (this._weightInterpolant = null),
  50407. (this.loop = n.LoopRepeat),
  50408. (this._loopCount = -1),
  50409. (this._startTime = null),
  50410. (this.time = 0),
  50411. (this.timeScale = 1),
  50412. (this._effectiveTimeScale = 1),
  50413. (this.weight = 1),
  50414. (this._effectiveWeight = 1),
  50415. (this.repetitions = 1 / 0),
  50416. (this.paused = !1),
  50417. (this.enabled = !0),
  50418. (this.clampWhenFinished = !1),
  50419. (this.zeroSlopeAtStart = !0),
  50420. (this.zeroSlopeAtEnd = !0)
  50421. }),
  50422. (n.AnimationMixer._Action.prototype = {
  50423. constructor: n.AnimationMixer._Action,
  50424. play: function () {
  50425. return this._mixer._activateAction(this), this
  50426. },
  50427. stop: function () {
  50428. return this._mixer._deactivateAction(this), this.reset()
  50429. },
  50430. reset: function () {
  50431. return (
  50432. (this.paused = !1),
  50433. (this.enabled = !0),
  50434. (this.time = 0),
  50435. (this._loopCount = -1),
  50436. (this._startTime = null),
  50437. this.stopFading().stopWarping()
  50438. )
  50439. },
  50440. isRunning: function () {
  50441. this._startTime
  50442. return (
  50443. this.enabled &&
  50444. !this.paused &&
  50445. 0 !== this.timeScale &&
  50446. null === this._startTime &&
  50447. this._mixer._isActiveAction(this)
  50448. )
  50449. },
  50450. isScheduled: function () {
  50451. return this._mixer._isActiveAction(this)
  50452. },
  50453. startAt: function (e) {
  50454. return (this._startTime = e), this
  50455. },
  50456. setLoop: function (e, t) {
  50457. return (this.loop = e), (this.repetitions = t), this
  50458. },
  50459. setEffectiveWeight: function (e) {
  50460. return (
  50461. (this.weight = e), (this._effectiveWeight = this.enabled ? e : 0), this.stopFading()
  50462. )
  50463. },
  50464. getEffectiveWeight: function () {
  50465. return this._effectiveWeight
  50466. },
  50467. fadeIn: function (e) {
  50468. return this._scheduleFading(e, 0, 1)
  50469. },
  50470. fadeOut: function (e) {
  50471. return this._scheduleFading(e, 1, 0)
  50472. },
  50473. crossFadeFrom: function (e, t, i) {
  50474. this._mixer
  50475. if ((e.fadeOut(t), this.fadeIn(t), i)) {
  50476. var n = this._clip.duration,
  50477. r = e._clip.duration,
  50478. o = r / n,
  50479. a = n / r
  50480. e.warp(1, o, t), this.warp(a, 1, t)
  50481. }
  50482. return this
  50483. },
  50484. crossFadeTo: function (e, t, i) {
  50485. return e.crossFadeFrom(this, t, i)
  50486. },
  50487. stopFading: function () {
  50488. var e = this._weightInterpolant
  50489. return (
  50490. null !== e &&
  50491. ((this._weightInterpolant = null), this._mixer._takeBackControlInterpolant(e)),
  50492. this
  50493. )
  50494. },
  50495. setEffectiveTimeScale: function (e) {
  50496. return (
  50497. (this.timeScale = e),
  50498. (this._effectiveTimeScale = this.paused ? 0 : e),
  50499. this.stopWarping()
  50500. )
  50501. },
  50502. getEffectiveTimeScale: function () {
  50503. return this._effectiveTimeScale
  50504. },
  50505. setDuration: function (e) {
  50506. return (this.timeScale = this._clip.duration / e), this.stopWarping()
  50507. },
  50508. syncWith: function (e) {
  50509. return (this.time = e.time), (this.timeScale = e.timeScale), this.stopWarping()
  50510. },
  50511. halt: function (e) {
  50512. return this.warp(this._currentTimeScale, 0, e)
  50513. },
  50514. warp: function (e, t, i) {
  50515. var n = this._mixer,
  50516. r = n.time,
  50517. o = this._timeScaleInterpolant,
  50518. a = this.timeScale
  50519. null === o && ((o = n._lendControlInterpolant()), (this._timeScaleInterpolant = o))
  50520. var s = o.parameterPositions,
  50521. l = o.sampleValues
  50522. return (s[0] = r), (s[1] = r + i), (l[0] = e / a), (l[1] = t / a), this
  50523. },
  50524. stopWarping: function () {
  50525. var e = this._timeScaleInterpolant
  50526. return (
  50527. null !== e &&
  50528. ((this._timeScaleInterpolant = null), this._mixer._takeBackControlInterpolant(e)),
  50529. this
  50530. )
  50531. },
  50532. getMixer: function () {
  50533. return this._mixer
  50534. },
  50535. getClip: function () {
  50536. return this._clip
  50537. },
  50538. getRoot: function () {
  50539. return this._localRoot || this._mixer._root
  50540. },
  50541. _update: function (e, t, i, n) {
  50542. var r = this._startTime
  50543. if (null !== r) {
  50544. var o = (e - r) * i
  50545. if (o < 0 || 0 === i) return
  50546. ;(this._startTime = null), (t = i * o)
  50547. }
  50548. t *= this._updateTimeScale(e)
  50549. var a = this._updateTime(t),
  50550. s = this._updateWeight(e)
  50551. if (s > 0)
  50552. for (
  50553. var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length;
  50554. h !== u;
  50555. ++h
  50556. )
  50557. l[h].evaluate(a), c[h].accumulate(n, s)
  50558. },
  50559. _updateWeight: function (e) {
  50560. var t = 0
  50561. if (this.enabled) {
  50562. t = this.weight
  50563. var i = this._weightInterpolant
  50564. if (null !== i) {
  50565. var n = i.evaluate(e)[0]
  50566. ;(t *= n),
  50567. e > i.parameterPositions[1] &&
  50568. (this.stopFading(), 0 === n && (this.enabled = !1))
  50569. }
  50570. }
  50571. return (this._effectiveWeight = t), t
  50572. },
  50573. _updateTimeScale: function (e) {
  50574. var t = 0
  50575. if (!this.paused) {
  50576. t = this.timeScale
  50577. var i = this._timeScaleInterpolant
  50578. if (null !== i) {
  50579. var n = i.evaluate(e)[0]
  50580. ;(t *= n),
  50581. e > i.parameterPositions[1] &&
  50582. (this.stopWarping(), 0 === t ? (this.pause = !0) : (this.timeScale = t))
  50583. }
  50584. }
  50585. return (this._effectiveTimeScale = t), t
  50586. },
  50587. _updateTime: function (e) {
  50588. var t = this.time + e
  50589. if (0 === e) return t
  50590. var i = this._clip.duration,
  50591. r = this.loop,
  50592. o = this._loopCount,
  50593. a = !1
  50594. switch (r) {
  50595. case n.LoopOnce:
  50596. if ((o === -1 && ((this.loopCount = 0), this._setEndings(!0, !0, !1)), t >= i))
  50597. t = i
  50598. else {
  50599. if (!(t < 0)) break
  50600. t = 0
  50601. }
  50602. this.clampWhenFinished ? (this.pause = !0) : (this.enabled = !1),
  50603. this._mixer.dispatchEvent({
  50604. type: 'finished',
  50605. action: this,
  50606. direction: e < 0 ? -1 : 1
  50607. })
  50608. break
  50609. case n.LoopPingPong:
  50610. a = !0
  50611. case n.LoopRepeat:
  50612. if (
  50613. (o === -1 &&
  50614. (e > 0
  50615. ? ((o = 0), this._setEndings(!0, 0 === this.repetitions, a))
  50616. : this._setEndings(0 === this.repetitions, !0, a)),
  50617. t >= i || t < 0)
  50618. ) {
  50619. var s = Math.floor(t / i)
  50620. ;(t -= i * s), (o += Math.abs(s))
  50621. var l = this.repetitions - o
  50622. if (l < 0) {
  50623. this.clampWhenFinished ? (this.paused = !0) : (this.enabled = !1),
  50624. (t = e > 0 ? i : 0),
  50625. this._mixer.dispatchEvent({
  50626. type: 'finished',
  50627. action: this,
  50628. direction: e > 0 ? 1 : -1
  50629. })
  50630. break
  50631. }
  50632. if (0 === l) {
  50633. var c = e < 0
  50634. this._setEndings(c, !c, a)
  50635. } else this._setEndings(!1, !1, a)
  50636. ;(this._loopCount = o),
  50637. this._mixer.dispatchEvent({
  50638. type: 'loop',
  50639. action: this,
  50640. loopDelta: s
  50641. })
  50642. }
  50643. if (r === n.LoopPingPong && 1 === (1 & o)) return (this.time = t), i - t
  50644. }
  50645. return (this.time = t), t
  50646. },
  50647. _setEndings: function (e, t, i) {
  50648. var r = this._interpolantSettings
  50649. i
  50650. ? ((r.endingStart = n.ZeroSlopeEnding), (r.endingEnd = n.ZeroSlopeEnding))
  50651. : (e
  50652. ? (r.endingStart = this.zeroSlopeAtStart
  50653. ? n.ZeroSlopeEnding
  50654. : n.ZeroCurvatureEnding)
  50655. : (r.endingStart = n.WrapAroundEnding),
  50656. t
  50657. ? (r.endingEnd = this.zeroSlopeAtEnd
  50658. ? n.ZeroSlopeEnding
  50659. : n.ZeroCurvatureEnding)
  50660. : (r.endingEnd = n.WrapAroundEnding))
  50661. },
  50662. _scheduleFading: function (e, t, i) {
  50663. var n = this._mixer,
  50664. r = n.time,
  50665. o = this._weightInterpolant
  50666. null === o && ((o = n._lendControlInterpolant()), (this._weightInterpolant = o))
  50667. var a = o.parameterPositions,
  50668. s = o.sampleValues
  50669. return (a[0] = r), (s[0] = t), (a[1] = r + e), (s[1] = i), this
  50670. }
  50671. }),
  50672. Object.assign(n.AnimationMixer.prototype, {
  50673. _bindAction: function (e, t) {
  50674. var i = e._localRoot || this._root,
  50675. r = e._clip.tracks,
  50676. o = r.length,
  50677. a = e._propertyBindings,
  50678. s = e._interpolants,
  50679. l = i.uuid,
  50680. c = this._bindingsByRootAndName,
  50681. h = c[l]
  50682. void 0 === h && ((h = {}), (c[l] = h))
  50683. for (var u = 0; u !== o; ++u) {
  50684. var d = r[u],
  50685. p = d.name,
  50686. f = h[p]
  50687. if (void 0 !== f) a[u] = f
  50688. else {
  50689. if (((f = a[u]), void 0 !== f)) {
  50690. null === f._cacheIndex &&
  50691. (++f.referenceCount, this._addInactiveBinding(f, l, p))
  50692. continue
  50693. }
  50694. var g = t && t._propertyBindings[u].binding.parsedPath
  50695. ;(f = new n.PropertyMixer(
  50696. n.PropertyBinding.create(i, p, g),
  50697. d.ValueTypeName,
  50698. d.getValueSize()
  50699. )),
  50700. ++f.referenceCount,
  50701. this._addInactiveBinding(f, l, p),
  50702. (a[u] = f)
  50703. }
  50704. s[u].resultBuffer = f.buffer
  50705. }
  50706. },
  50707. _activateAction: function (e) {
  50708. if (!this._isActiveAction(e)) {
  50709. if (null === e._cacheIndex) {
  50710. var t = (e._localRoot || this._root).uuid,
  50711. i = e._clip.name,
  50712. n = this._actionsByClip[i]
  50713. this._bindAction(e, n && n.knownActions[0]), this._addInactiveAction(e, i, t)
  50714. }
  50715. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  50716. var s = r[o]
  50717. 0 === s.useCount++ && (this._lendBinding(s), s.saveOriginalState())
  50718. }
  50719. this._lendAction(e)
  50720. }
  50721. },
  50722. _deactivateAction: function (e) {
  50723. if (this._isActiveAction(e)) {
  50724. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  50725. var r = t[i]
  50726. 0 === --r.useCount && (r.restoreOriginalState(), this._takeBackBinding(r))
  50727. }
  50728. this._takeBackAction(e)
  50729. }
  50730. },
  50731. _initMemoryManager: function () {
  50732. ;(this._actions = []),
  50733. (this._nActiveActions = 0),
  50734. (this._actionsByClip = {}),
  50735. (this._bindings = []),
  50736. (this._nActiveBindings = 0),
  50737. (this._bindingsByRootAndName = {}),
  50738. (this._controlInterpolants = []),
  50739. (this._nActiveControlInterpolants = 0)
  50740. var e = this
  50741. this.stats = {
  50742. actions: {
  50743. get total() {
  50744. return e._actions.length
  50745. },
  50746. get inUse() {
  50747. return e._nActiveActions
  50748. }
  50749. },
  50750. bindings: {
  50751. get total() {
  50752. return e._bindings.length
  50753. },
  50754. get inUse() {
  50755. return e._nActiveBindings
  50756. }
  50757. },
  50758. controlInterpolants: {
  50759. get total() {
  50760. return e._controlInterpolants.length
  50761. },
  50762. get inUse() {
  50763. return e._nActiveControlInterpolants
  50764. }
  50765. }
  50766. }
  50767. },
  50768. _isActiveAction: function (e) {
  50769. var t = e._cacheIndex
  50770. return null !== t && t < this._nActiveActions
  50771. },
  50772. _addInactiveAction: function (e, t, i) {
  50773. var n = this._actions,
  50774. r = this._actionsByClip,
  50775. o = r[t]
  50776. if (void 0 === o)
  50777. (o = {
  50778. knownActions: [e],
  50779. actionByRoot: {}
  50780. }),
  50781. (e._byClipCacheIndex = 0),
  50782. (r[t] = o)
  50783. else {
  50784. var a = o.knownActions
  50785. ;(e._byClipCacheIndex = a.length), a.push(e)
  50786. }
  50787. ;(e._cacheIndex = n.length), n.push(e), (o.actionByRoot[i] = e)
  50788. },
  50789. _removeInactiveAction: function (e) {
  50790. var t = this._actions,
  50791. i = t[t.length - 1],
  50792. n = e._cacheIndex
  50793. ;(i._cacheIndex = n), (t[n] = i), t.pop(), (e._cacheIndex = null)
  50794. var r = e._clip.name,
  50795. o = this._actionsByClip,
  50796. a = o[r],
  50797. s = a.knownActions,
  50798. l = s[s.length - 1],
  50799. c = e._byClipCacheIndex
  50800. ;(l._byClipCacheIndex = c), (s[c] = l), s.pop(), (e._byClipCacheIndex = null)
  50801. var h = a.actionByRoot,
  50802. u = (t._localRoot || this._root).uuid
  50803. delete h[u], 0 === s.length && delete o[r], this._removeInactiveBindingsForAction(e)
  50804. },
  50805. _removeInactiveBindingsForAction: function (e) {
  50806. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  50807. var r = t[i]
  50808. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  50809. }
  50810. },
  50811. _lendAction: function (e) {
  50812. var t = this._actions,
  50813. i = e._cacheIndex,
  50814. n = this._nActiveActions++,
  50815. r = t[n]
  50816. ;(e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r)
  50817. },
  50818. _takeBackAction: function (e) {
  50819. var t = this._actions,
  50820. i = e._cacheIndex,
  50821. n = --this._nActiveActions,
  50822. r = t[n]
  50823. ;(e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r)
  50824. },
  50825. _addInactiveBinding: function (e, t, i) {
  50826. var n = this._bindingsByRootAndName,
  50827. r = n[t],
  50828. o = this._bindings
  50829. void 0 === r && ((r = {}), (n[t] = r)),
  50830. (r[i] = e),
  50831. (e._cacheIndex = o.length),
  50832. o.push(e)
  50833. },
  50834. _removeInactiveBinding: function (e) {
  50835. var t = this._bindings,
  50836. i = e.binding,
  50837. n = i.rootNode.uuid,
  50838. r = i.path,
  50839. o = this._bindingsByRootAndName,
  50840. a = o[n],
  50841. s = t[t.length - 1],
  50842. l = e._cacheIndex
  50843. ;(s._cacheIndex = l), (t[l] = s), t.pop(), delete a[r]
  50844. e: {
  50845. for (var c in a) break e
  50846. delete o[n]
  50847. }
  50848. },
  50849. _lendBinding: function (e) {
  50850. var t = this._bindings,
  50851. i = e._cacheIndex,
  50852. n = this._nActiveBindings++,
  50853. r = t[n]
  50854. ;(e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r)
  50855. },
  50856. _takeBackBinding: function (e) {
  50857. var t = this._bindings,
  50858. i = e._cacheIndex,
  50859. n = --this._nActiveBindings,
  50860. r = t[n]
  50861. ;(e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r)
  50862. },
  50863. _lendControlInterpolant: function () {
  50864. var e = this._controlInterpolants,
  50865. t = this._nActiveControlInterpolants++,
  50866. i = e[t]
  50867. return (
  50868. void 0 === i &&
  50869. ((i = new n.LinearInterpolant(
  50870. new Float32Array(2),
  50871. new Float32Array(2),
  50872. 1,
  50873. this._controlInterpolantsResultBuffer
  50874. )),
  50875. (i.__cacheIndex = t),
  50876. (e[t] = i)),
  50877. i
  50878. )
  50879. },
  50880. _takeBackControlInterpolant: function (e) {
  50881. var t = this._controlInterpolants,
  50882. i = e.__cacheIndex,
  50883. n = --this._nActiveControlInterpolants,
  50884. r = t[n]
  50885. ;(e.__cacheIndex = n), (t[n] = e), (r.__cacheIndex = i), (t[i] = r)
  50886. },
  50887. _controlInterpolantsResultBuffer: new Float32Array(1)
  50888. }),
  50889. (n.AnimationObjectGroup = function (e) {
  50890. ;(this.uuid = n.Math.generateUUID()),
  50891. (this._objects = Array.prototype.slice.call(arguments)),
  50892. (this.nCachedObjects_ = 0)
  50893. var t = {}
  50894. this._indicesByUUID = t
  50895. for (var i = 0, r = arguments.length; i !== r; ++i) t[arguments[i].uuid] = i
  50896. ;(this._paths = []),
  50897. (this._parsedPaths = []),
  50898. (this._bindings = []),
  50899. (this._bindingsIndicesByPath = {})
  50900. var o = this
  50901. this.stats = {
  50902. objects: {
  50903. get total() {
  50904. return o._objects.length
  50905. },
  50906. get inUse() {
  50907. return this.total - o.nCachedObjects_
  50908. }
  50909. },
  50910. get bindingsPerObject() {
  50911. return o._bindings.length
  50912. }
  50913. }
  50914. }),
  50915. (n.AnimationObjectGroup.prototype = {
  50916. constructor: n.AnimationObjectGroup,
  50917. add: function (e) {
  50918. for (
  50919. var t = this._objects,
  50920. i = t.length,
  50921. r = this.nCachedObjects_,
  50922. o = this._indicesByUUID,
  50923. a = this._paths,
  50924. s = this._parsedPaths,
  50925. l = this._bindings,
  50926. c = l.length,
  50927. h = 0,
  50928. u = arguments.length;
  50929. h !== u;
  50930. ++h
  50931. ) {
  50932. var d = arguments[h],
  50933. p = d.uuid,
  50934. f = o[p]
  50935. if (void 0 === f) {
  50936. ;(f = i++), (o[p] = f), t.push(d)
  50937. for (var g = 0, m = c; g !== m; ++g)
  50938. l[g].push(new n.PropertyBinding(d, a[g], s[g]))
  50939. } else if (f < r) {
  50940. var v = t[f],
  50941. A = --r,
  50942. y = t[A]
  50943. ;(o[y.uuid] = f), (t[f] = y), (o[p] = A), (t[A] = d)
  50944. for (var g = 0, m = c; g !== m; ++g) {
  50945. var C = l[g],
  50946. I = C[A],
  50947. E = C[f]
  50948. ;(C[f] = I),
  50949. void 0 === E && (E = new n.PropertyBinding(d, a[g], s[g])),
  50950. (C[A] = E)
  50951. }
  50952. } else
  50953. t[f] !== v &&
  50954. console.error(
  50955. 'Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...'
  50956. )
  50957. }
  50958. this.nCachedObjects_ = r
  50959. },
  50960. remove: function (e) {
  50961. for (
  50962. var t = this._objects,
  50963. i = (t.length, this.nCachedObjects_),
  50964. n = this._indicesByUUID,
  50965. r = this._bindings,
  50966. o = r.length,
  50967. a = 0,
  50968. s = arguments.length;
  50969. a !== s;
  50970. ++a
  50971. ) {
  50972. var l = arguments[a],
  50973. c = l.uuid,
  50974. h = n[c]
  50975. if (void 0 !== h && h >= i) {
  50976. var u = i++,
  50977. d = t[u]
  50978. ;(n[d.uuid] = h), (t[h] = d), (n[c] = u), (t[u] = l)
  50979. for (var p = 0, f = o; p !== f; ++p) {
  50980. var g = r[p],
  50981. m = g[u],
  50982. v = g[h]
  50983. ;(g[h] = m), (g[u] = v)
  50984. }
  50985. }
  50986. }
  50987. this.nCachedObjects_ = i
  50988. },
  50989. uncache: function (e) {
  50990. for (
  50991. var t = this._objects,
  50992. i = t.length,
  50993. n = this.nCachedObjects_,
  50994. r = this._indicesByUUID,
  50995. o = this._bindings,
  50996. a = o.length,
  50997. s = 0,
  50998. l = arguments.length;
  50999. s !== l;
  51000. ++s
  51001. ) {
  51002. var c = arguments[s],
  51003. h = c.uuid,
  51004. u = r[h]
  51005. if (void 0 !== u)
  51006. if ((delete r[h], u < n)) {
  51007. var d = --n,
  51008. p = t[d],
  51009. f = --i,
  51010. g = t[f]
  51011. ;(r[p.uuid] = u), (t[u] = p), (r[g.uuid] = d), (t[d] = g), t.pop()
  51012. for (var m = 0, v = a; m !== v; ++m) {
  51013. var A = o[m],
  51014. y = A[d],
  51015. C = A[f]
  51016. ;(A[u] = y), (A[d] = C), A.pop()
  51017. }
  51018. } else {
  51019. var f = --i,
  51020. g = t[f]
  51021. ;(r[g.uuid] = u), (t[u] = g), t.pop()
  51022. for (var m = 0, v = a; m !== v; ++m) {
  51023. var A = o[m]
  51024. ;(A[u] = A[f]), A.pop()
  51025. }
  51026. }
  51027. }
  51028. this.nCachedObjects_ = n
  51029. },
  51030. subscribe_: function (e, t) {
  51031. var i = this._bindingsIndicesByPath,
  51032. r = i[e],
  51033. o = this._bindings
  51034. if (void 0 !== r) return o[r]
  51035. var a = this._paths,
  51036. s = this._parsedPaths,
  51037. l = this._objects,
  51038. c = l.length,
  51039. h = this.nCachedObjects_,
  51040. u = new Array(c)
  51041. ;(r = o.length), (i[e] = r), a.push(e), s.push(t), o.push(u)
  51042. for (var d = h, p = l.length; d !== p; ++d) {
  51043. var f = l[d]
  51044. u[d] = new n.PropertyBinding(f, e, t)
  51045. }
  51046. return u
  51047. },
  51048. unsubscribe_: function (e) {
  51049. var t = this._bindingsIndicesByPath,
  51050. i = t[e]
  51051. if (void 0 !== i) {
  51052. var n = this._paths,
  51053. r = this._parsedPaths,
  51054. o = this._bindings,
  51055. a = o.length - 1,
  51056. s = o[a],
  51057. l = e[a]
  51058. ;(t[l] = i), (o[i] = s), o.pop(), (r[i] = r[a]), r.pop(), (n[i] = n[a]), n.pop()
  51059. }
  51060. }
  51061. }),
  51062. (n.AnimationUtils = {
  51063. arraySlice: function (e, t, i) {
  51064. return n.AnimationUtils.isTypedArray(e)
  51065. ? new e.constructor(e.subarray(t, i))
  51066. : e.slice(t, i)
  51067. },
  51068. convertArray: function (e, t, i) {
  51069. return !e || (!i && e.constructor === t)
  51070. ? e
  51071. : 'number' == typeof t.BYTES_PER_ELEMENT
  51072. ? new t(e)
  51073. : Array.prototype.slice.call(e)
  51074. },
  51075. isTypedArray: function (e) {
  51076. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  51077. },
  51078. getKeyframeOrder: function (e) {
  51079. function t(t, i) {
  51080. return e[t] - e[i]
  51081. }
  51082. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r) n[r] = r
  51083. return n.sort(t), n
  51084. },
  51085. sortedArray: function (e, t, i) {
  51086. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  51087. for (var s = i[o] * t, l = 0; l !== t; ++l) r[a++] = e[s + l]
  51088. return r
  51089. },
  51090. flattenJSON: function (e, t, i, n) {
  51091. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; ) o = e[r++]
  51092. if (void 0 !== o) {
  51093. var a = o[n]
  51094. if (void 0 !== a)
  51095. if (Array.isArray(a)) {
  51096. do
  51097. (a = o[n]), void 0 !== a && (t.push(o.time), i.push.apply(i, a)), (o = e[r++])
  51098. while (void 0 !== o)
  51099. } else if (void 0 !== a.toArray) {
  51100. do
  51101. (a = o[n]),
  51102. void 0 !== a && (t.push(o.time), a.toArray(i, i.length)),
  51103. (o = e[r++])
  51104. while (void 0 !== o)
  51105. } else
  51106. do (a = o[n]), void 0 !== a && (t.push(o.time), i.push(a)), (o = e[r++])
  51107. while (void 0 !== o)
  51108. }
  51109. }
  51110. }),
  51111. (n.KeyframeTrack = function (e, t, i, r) {
  51112. if (void 0 === e) throw new Error('track name is undefined')
  51113. if (void 0 === t || 0 === t.length) throw new Error('no keyframes in track named ' + e)
  51114. ;(this.name = e),
  51115. (this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType)),
  51116. (this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType)),
  51117. this.setInterpolation(r || this.DefaultInterpolation),
  51118. this.validate(),
  51119. this.optimize()
  51120. }),
  51121. (n.KeyframeTrack.prototype = {
  51122. constructor: n.KeyframeTrack,
  51123. TimeBufferType: Float32Array,
  51124. ValueBufferType: Float32Array,
  51125. DefaultInterpolation: n.InterpolateLinear,
  51126. InterpolantFactoryMethodDiscrete: function (e) {
  51127. return new n.DiscreteInterpolant(this.times, this.values, this.getValueSize(), e)
  51128. },
  51129. InterpolantFactoryMethodLinear: function (e) {
  51130. return new n.LinearInterpolant(this.times, this.values, this.getValueSize(), e)
  51131. },
  51132. InterpolantFactoryMethodSmooth: function (e) {
  51133. return new n.CubicInterpolant(this.times, this.values, this.getValueSize(), e)
  51134. },
  51135. setInterpolation: function (e) {
  51136. var t = void 0
  51137. switch (e) {
  51138. case n.InterpolateDiscrete:
  51139. t = this.InterpolantFactoryMethodDiscrete
  51140. break
  51141. case n.InterpolateLinear:
  51142. t = this.InterpolantFactoryMethodLinear
  51143. break
  51144. case n.InterpolateSmooth:
  51145. t = this.InterpolantFactoryMethodSmooth
  51146. }
  51147. if (void 0 === t) {
  51148. var i =
  51149. 'unsupported interpolation for ' +
  51150. this.ValueTypeName +
  51151. ' keyframe track named ' +
  51152. this.name
  51153. if (void 0 === this.createInterpolant) {
  51154. if (e === this.DefaultInterpolation) throw new Error(i)
  51155. this.setInterpolation(this.DefaultInterpolation)
  51156. }
  51157. return void console.warn(i)
  51158. }
  51159. this.createInterpolant = t
  51160. },
  51161. getInterpolation: function () {
  51162. switch (this.createInterpolant) {
  51163. case this.InterpolantFactoryMethodDiscrete:
  51164. return n.InterpolateDiscrete
  51165. case this.InterpolantFactoryMethodLinear:
  51166. return n.InterpolateLinear
  51167. case this.InterpolantFactoryMethodSmooth:
  51168. return n.InterpolateSmooth
  51169. }
  51170. },
  51171. getValueSize: function () {
  51172. return this.values.length / this.times.length
  51173. },
  51174. shift: function (e) {
  51175. if (0 !== e) for (var t = this.times, i = 0, n = t.length; i !== n; ++i) t[i] += e
  51176. return this
  51177. },
  51178. scale: function (e) {
  51179. if (1 !== e) for (var t = this.times, i = 0, n = t.length; i !== n; ++i) t[i] *= e
  51180. return this
  51181. },
  51182. trim: function (e, t) {
  51183. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; ) ++o
  51184. for (; a !== -1 && i[a] > t; ) --a
  51185. if ((++a, 0 !== o || a !== r)) {
  51186. o >= a && ((a = Math.max(a, 1)), (o = a - 1))
  51187. var s = this.getValueSize()
  51188. ;(this.times = n.AnimationUtils.arraySlice(i, o, a)),
  51189. (this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s))
  51190. }
  51191. return this
  51192. },
  51193. validate: function () {
  51194. var e = !0,
  51195. t = this.getValueSize()
  51196. t - Math.floor(t) !== 0 &&
  51197. (console.error('invalid value size in track', this), (e = !1))
  51198. var i = this.times,
  51199. r = this.values,
  51200. o = i.length
  51201. 0 === o && (console.error('track is empty', this), (e = !1))
  51202. for (var a = null, s = 0; s !== o; s++) {
  51203. var l = i[s]
  51204. if ('number' == typeof l && isNaN(l)) {
  51205. console.error('time is not a valid number', this, s, l), (e = !1)
  51206. break
  51207. }
  51208. if (null !== a && a > l) {
  51209. console.error('out of order keys', this, s, l, a), (e = !1)
  51210. break
  51211. }
  51212. a = l
  51213. }
  51214. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  51215. for (var s = 0, c = r.length; s !== c; ++s) {
  51216. var h = r[s]
  51217. if (isNaN(h)) {
  51218. console.error('value is not a valid number', this, s, h), (e = !1)
  51219. break
  51220. }
  51221. }
  51222. return e
  51223. },
  51224. optimize: function () {
  51225. for (
  51226. var e = this.times,
  51227. t = this.values,
  51228. i = this.getValueSize(),
  51229. r = 1,
  51230. o = 1,
  51231. a = e.length - 1;
  51232. o <= a;
  51233. ++o
  51234. ) {
  51235. var s = !1,
  51236. l = e[o],
  51237. c = e[o + 1]
  51238. if (l !== c && (1 !== o || l !== l[0]))
  51239. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  51240. var f = t[h + p]
  51241. if (f !== t[u + p] || f !== t[d + p]) {
  51242. s = !0
  51243. break
  51244. }
  51245. }
  51246. if (s) {
  51247. if (o !== r) {
  51248. e[r] = e[o]
  51249. for (var g = o * i, m = r * i, p = 0; p !== i; ++p) t[m + p] = t[g + p]
  51250. }
  51251. ++r
  51252. }
  51253. }
  51254. return (
  51255. r !== e.length &&
  51256. ((this.times = n.AnimationUtils.arraySlice(e, 0, r)),
  51257. (this.values = n.AnimationUtils.arraySlice(t, 0, r * i))),
  51258. this
  51259. )
  51260. }
  51261. }),
  51262. Object.assign(n.KeyframeTrack, {
  51263. parse: function (e) {
  51264. if (void 0 === e.type) throw new Error('track type undefined, can not parse')
  51265. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type)
  51266. if (void 0 === e.times) {
  51267. console.warn('legacy JSON format detected, converting')
  51268. var i = [],
  51269. r = []
  51270. n.AnimationUtils.flattenJSON(e.keys, i, r, 'value'), (e.times = i), (e.values = r)
  51271. }
  51272. return void 0 !== t.parse
  51273. ? t.parse(e)
  51274. : new t(e.name, e.times, e.values, e.interpolation)
  51275. },
  51276. toJSON: function (e) {
  51277. var t,
  51278. i = e.constructor
  51279. if (void 0 !== i.toJSON) t = i.toJSON(e)
  51280. else {
  51281. t = {
  51282. name: e.name,
  51283. times: n.AnimationUtils.convertArray(e.times, Array),
  51284. values: n.AnimationUtils.convertArray(e.values, Array)
  51285. }
  51286. var r = e.getInterpolation()
  51287. r !== e.DefaultInterpolation && (t.interpolation = r)
  51288. }
  51289. return (t.type = e.ValueTypeName), t
  51290. },
  51291. _getTrackTypeForValueTypeName: function (e) {
  51292. switch (e.toLowerCase()) {
  51293. case 'scalar':
  51294. case 'double':
  51295. case 'float':
  51296. case 'number':
  51297. case 'integer':
  51298. return n.NumberKeyframeTrack
  51299. case 'vector':
  51300. case 'vector2':
  51301. case 'vector3':
  51302. case 'vector4':
  51303. return n.VectorKeyframeTrack
  51304. case 'color':
  51305. return n.ColorKeyframeTrack
  51306. case 'quaternion':
  51307. return n.QuaternionKeyframeTrack
  51308. case 'bool':
  51309. case 'boolean':
  51310. return n.BooleanKeyframeTrack
  51311. case 'string':
  51312. return n.StringKeyframeTrack
  51313. }
  51314. throw new Error('Unsupported typeName: ' + e)
  51315. }
  51316. }),
  51317. (n.PropertyBinding = function (e, t, i) {
  51318. ;(this.path = t),
  51319. (this.parsedPath = i || n.PropertyBinding.parseTrackName(t)),
  51320. (this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e),
  51321. (this.rootNode = e)
  51322. }),
  51323. (n.PropertyBinding.prototype = {
  51324. constructor: n.PropertyBinding,
  51325. getValue: function (e, t) {
  51326. this.bind(), this.getValue(e, t)
  51327. },
  51328. setValue: function (e, t) {
  51329. this.bind(), this.setValue(e, t)
  51330. },
  51331. bind: function () {
  51332. var e = this.node,
  51333. t = this.parsedPath,
  51334. i = t.objectName,
  51335. r = t.propertyName,
  51336. o = t.propertyIndex
  51337. if (
  51338. (e ||
  51339. ((e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode),
  51340. (this.node = e)),
  51341. (this.getValue = this._getValue_unavailable),
  51342. (this.setValue = this._setValue_unavailable),
  51343. !e)
  51344. )
  51345. return void console.error(
  51346. ' trying to update node for track: ' + this.path + " but it wasn't found."
  51347. )
  51348. if (i) {
  51349. var a = t.objectIndex
  51350. switch (i) {
  51351. case 'materials':
  51352. if (!e.material)
  51353. return void console.error(
  51354. ' can not bind to material as node does not have a material',
  51355. this
  51356. )
  51357. if (!e.material.materials)
  51358. return void console.error(
  51359. ' can not bind to material.materials as node.material does not have a materials array',
  51360. this
  51361. )
  51362. e = e.material.materials
  51363. break
  51364. case 'bones':
  51365. if (!e.skeleton)
  51366. return void console.error(
  51367. ' can not bind to bones as node does not have a skeleton',
  51368. this
  51369. )
  51370. e = e.skeleton.bones
  51371. for (var s = 0; s < e.length; s++)
  51372. if (e[s].name === a) {
  51373. a = s
  51374. break
  51375. }
  51376. break
  51377. default:
  51378. if (void 0 === e[i])
  51379. return void console.error(
  51380. ' can not bind to objectName of node, undefined',
  51381. this
  51382. )
  51383. e = e[i]
  51384. }
  51385. if (void 0 !== a) {
  51386. if (void 0 === e[a])
  51387. return void console.error(
  51388. ' trying to bind to objectIndex of objectName, but is undefined:',
  51389. this,
  51390. e
  51391. )
  51392. e = e[a]
  51393. }
  51394. }
  51395. var l = e[r]
  51396. if (!l) {
  51397. var c = t.nodeName
  51398. return void console.error(
  51399. ' trying to update property for track: ' + c + '.' + r + " but it wasn't found.",
  51400. e
  51401. )
  51402. }
  51403. var h = this.Versioning.None
  51404. void 0 !== e.needsUpdate
  51405. ? ((h = this.Versioning.NeedsUpdate), (this.targetObject = e))
  51406. : void 0 !== e.matrixWorldNeedsUpdate &&
  51407. ((h = this.Versioning.MatrixWorldNeedsUpdate), (this.targetObject = e))
  51408. var u = this.BindingType.Direct
  51409. if (void 0 !== o) {
  51410. if ('morphTargetInfluences' === r) {
  51411. if (!e.geometry)
  51412. return void console.error(
  51413. ' can not bind to morphTargetInfluences becasuse node does not have a geometry',
  51414. this
  51415. )
  51416. if (!e.geometry.morphTargets)
  51417. return void console.error(
  51418. ' can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets',
  51419. this
  51420. )
  51421. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  51422. if (e.geometry.morphTargets[s].name === o) {
  51423. o = s
  51424. break
  51425. }
  51426. }
  51427. ;(u = this.BindingType.ArrayElement),
  51428. (this.resolvedProperty = l),
  51429. (this.propertyIndex = o)
  51430. } else
  51431. void 0 !== l.fromArray && void 0 !== l.toArray
  51432. ? ((u = this.BindingType.HasFromToArray), (this.resolvedProperty = l))
  51433. : void 0 !== l.length
  51434. ? ((u = this.BindingType.EntireArray), (this.resolvedProperty = l))
  51435. : (this.propertyName = r)
  51436. ;(this.getValue = this.GetterByBindingType[u]),
  51437. (this.setValue = this.SetterByBindingTypeAndVersioning[u][h])
  51438. },
  51439. unbind: function () {
  51440. ;(this.node = null),
  51441. (this.getValue = this._getValue_unbound),
  51442. (this.setValue = this._setValue_unbound)
  51443. }
  51444. }),
  51445. Object.assign(n.PropertyBinding.prototype, {
  51446. _getValue_unavailable: function () {},
  51447. _setValue_unavailable: function () {},
  51448. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  51449. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  51450. BindingType: {
  51451. Direct: 0,
  51452. EntireArray: 1,
  51453. ArrayElement: 2,
  51454. HasFromToArray: 3
  51455. },
  51456. Versioning: {
  51457. None: 0,
  51458. NeedsUpdate: 1,
  51459. MatrixWorldNeedsUpdate: 2
  51460. },
  51461. GetterByBindingType: [
  51462. function (e, t) {
  51463. e[t] = this.node[this.propertyName]
  51464. },
  51465. function (e, t) {
  51466. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) e[t++] = i[n]
  51467. },
  51468. function (e, t) {
  51469. e[t] = this.resolvedProperty[this.propertyIndex]
  51470. },
  51471. function (e, t) {
  51472. this.resolvedProperty.toArray(e, t)
  51473. }
  51474. ],
  51475. SetterByBindingTypeAndVersioning: [
  51476. [
  51477. function (e, t) {
  51478. this.node[this.propertyName] = e[t]
  51479. },
  51480. function (e, t) {
  51481. ;(this.node[this.propertyName] = e[t]), (this.targetObject.needsUpdate = !0)
  51482. },
  51483. function (e, t) {
  51484. ;(this.node[this.propertyName] = e[t]),
  51485. (this.targetObject.matrixWorldNeedsUpdate = !0)
  51486. }
  51487. ],
  51488. [
  51489. function (e, t) {
  51490. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  51491. i[n] = e[t++]
  51492. },
  51493. function (e, t) {
  51494. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  51495. i[n] = e[t++]
  51496. this.targetObject.needsUpdate = !0
  51497. },
  51498. function (e, t) {
  51499. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  51500. i[n] = e[t++]
  51501. this.targetObject.matrixWorldNeedsUpdate = !0
  51502. }
  51503. ],
  51504. [
  51505. function (e, t) {
  51506. this.resolvedProperty[this.propertyIndex] = e[t]
  51507. },
  51508. function (e, t) {
  51509. ;(this.resolvedProperty[this.propertyIndex] = e[t]),
  51510. (this.targetObject.needsUpdate = !0)
  51511. },
  51512. function (e, t) {
  51513. ;(this.resolvedProperty[this.propertyIndex] = e[t]),
  51514. (this.targetObject.matrixWorldNeedsUpdate = !0)
  51515. }
  51516. ],
  51517. [
  51518. function (e, t) {
  51519. this.resolvedProperty.fromArray(e, t)
  51520. },
  51521. function (e, t) {
  51522. this.resolvedProperty.fromArray(e, t), (this.targetObject.needsUpdate = !0)
  51523. },
  51524. function (e, t) {
  51525. this.resolvedProperty.fromArray(e, t),
  51526. (this.targetObject.matrixWorldNeedsUpdate = !0)
  51527. }
  51528. ]
  51529. ]
  51530. }),
  51531. (n.PropertyBinding.Composite = function (e, t, i) {
  51532. var r = i || n.PropertyBinding.parseTrackName(t)
  51533. ;(this._targetGroup = e), (this._bindings = e.subscribe_(t, r))
  51534. }),
  51535. (n.PropertyBinding.Composite.prototype = {
  51536. constructor: n.PropertyBinding.Composite,
  51537. getValue: function (e, t) {
  51538. this.bind()
  51539. var i = this._targetGroup.nCachedObjects_,
  51540. n = this._bindings[i]
  51541. void 0 !== n && n.getValue(e, t)
  51542. },
  51543. setValue: function (e, t) {
  51544. for (
  51545. var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length;
  51546. n !== r;
  51547. ++n
  51548. )
  51549. i[n].setValue(e, t)
  51550. },
  51551. bind: function () {
  51552. for (
  51553. var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length;
  51554. t !== i;
  51555. ++t
  51556. )
  51557. e[t].bind()
  51558. },
  51559. unbind: function () {
  51560. for (
  51561. var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length;
  51562. t !== i;
  51563. ++t
  51564. )
  51565. e[t].unbind()
  51566. }
  51567. }),
  51568. (n.PropertyBinding.create = function (e, t, i) {
  51569. return e instanceof n.AnimationObjectGroup
  51570. ? new n.PropertyBinding.Composite(e, t, i)
  51571. : new n.PropertyBinding(e, t, i)
  51572. }),
  51573. (n.PropertyBinding.parseTrackName = function (e) {
  51574. var t =
  51575. /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/,
  51576. i = t.exec(e)
  51577. if (!i) throw new Error('cannot parse trackName at all: ' + e)
  51578. i.index === t.lastIndex && t.lastIndex++
  51579. var n = {
  51580. nodeName: i[3],
  51581. objectName: i[5],
  51582. objectIndex: i[7],
  51583. propertyName: i[9],
  51584. propertyIndex: i[11]
  51585. }
  51586. if (null === n.propertyName || 0 === n.propertyName.length)
  51587. throw new Error('can not parse propertyName from trackName: ' + e)
  51588. return n
  51589. }),
  51590. (n.PropertyBinding.findNode = function (e, t) {
  51591. if (
  51592. !t ||
  51593. '' === t ||
  51594. 'root' === t ||
  51595. '.' === t ||
  51596. t === -1 ||
  51597. t === e.name ||
  51598. t === e.uuid
  51599. )
  51600. return e
  51601. if (e.skeleton) {
  51602. var i = function (e) {
  51603. for (var i = 0; i < e.bones.length; i++) {
  51604. var n = e.bones[i]
  51605. if (n.name === t) return n
  51606. }
  51607. return null
  51608. },
  51609. n = i(e.skeleton)
  51610. if (n) return n
  51611. }
  51612. if (e.children) {
  51613. var r = function (e) {
  51614. for (var i = 0; i < e.length; i++) {
  51615. var n = e[i]
  51616. if (n.name === t || n.uuid === t) return n
  51617. var o = r(n.children)
  51618. if (o) return o
  51619. }
  51620. return null
  51621. },
  51622. o = r(e.children)
  51623. if (o) return o
  51624. }
  51625. return null
  51626. }),
  51627. (n.PropertyMixer = function (e, t, i) {
  51628. ;(this.binding = e), (this.valueSize = i)
  51629. var n,
  51630. r = Float64Array
  51631. switch (t) {
  51632. case 'quaternion':
  51633. n = this._slerp
  51634. break
  51635. case 'string':
  51636. case 'bool':
  51637. ;(r = Array), (n = this._select)
  51638. break
  51639. default:
  51640. n = this._lerp
  51641. }
  51642. ;(this.buffer = new r(4 * i)),
  51643. (this._mixBufferRegion = n),
  51644. (this.cumulativeWeight = 0),
  51645. (this.useCount = 0),
  51646. (this.referenceCount = 0)
  51647. }),
  51648. (n.PropertyMixer.prototype = {
  51649. constructor: n.PropertyMixer,
  51650. accumulate: function (e, t) {
  51651. var i = this.buffer,
  51652. n = this.valueSize,
  51653. r = e * n + n,
  51654. o = this.cumulativeWeight
  51655. if (0 === o) {
  51656. for (var a = 0; a !== n; ++a) i[r + a] = i[a]
  51657. o = t
  51658. } else {
  51659. o += t
  51660. var s = t / o
  51661. this._mixBufferRegion(i, r, 0, s, n)
  51662. }
  51663. this.cumulativeWeight = o
  51664. },
  51665. apply: function (e) {
  51666. var t = this.valueSize,
  51667. i = this.buffer,
  51668. n = e * t + t,
  51669. r = this.cumulativeWeight,
  51670. o = this.binding
  51671. if (((this.cumulativeWeight = 0), r < 1)) {
  51672. var a = 3 * t
  51673. this._mixBufferRegion(i, n, a, 1 - r, t)
  51674. }
  51675. for (var s = t, l = t + t; s !== l; ++s)
  51676. if (i[s] !== i[s + t]) {
  51677. o.setValue(i, n)
  51678. break
  51679. }
  51680. },
  51681. saveOriginalState: function () {
  51682. var e = this.binding,
  51683. t = this.buffer,
  51684. i = this.valueSize,
  51685. n = 3 * i
  51686. e.getValue(t, n)
  51687. for (var r = i, o = n; r !== o; ++r) t[r] = t[n + (r % i)]
  51688. this.cumulativeWeight = 0
  51689. },
  51690. restoreOriginalState: function () {
  51691. var e = 3 * this.valueSize
  51692. this.binding.setValue(this.buffer, e)
  51693. },
  51694. _select: function (e, t, i, n, r) {
  51695. if (n >= 0.5) for (var o = 0; o !== r; ++o) e[t + o] = e[i + o]
  51696. },
  51697. _slerp: function (e, t, i, r, o) {
  51698. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  51699. },
  51700. _lerp: function (e, t, i, n, r) {
  51701. for (var o = 1 - n, a = 0; a !== r; ++a) {
  51702. var s = t + a
  51703. e[s] = e[s] * o + e[i + a] * n
  51704. }
  51705. }
  51706. }),
  51707. (n.BooleanKeyframeTrack = function (e, t, i) {
  51708. n.KeyframeTrack.call(this, e, t, i)
  51709. }),
  51710. (n.BooleanKeyframeTrack.prototype = Object.assign(
  51711. Object.create(n.KeyframeTrack.prototype),
  51712. {
  51713. constructor: n.BooleanKeyframeTrack,
  51714. ValueTypeName: 'bool',
  51715. ValueBufferType: Array,
  51716. DefaultInterpolation: n.IntepolateDiscrete,
  51717. InterpolantFactoryMethodLinear: void 0,
  51718. InterpolantFactoryMethodSmooth: void 0
  51719. }
  51720. )),
  51721. (n.NumberKeyframeTrack = function (e, t, i, r) {
  51722. n.KeyframeTrack.call(this, e, t, i, r)
  51723. }),
  51724. (n.NumberKeyframeTrack.prototype = Object.assign(
  51725. Object.create(n.KeyframeTrack.prototype),
  51726. {
  51727. constructor: n.NumberKeyframeTrack,
  51728. ValueTypeName: 'number'
  51729. }
  51730. )),
  51731. (n.QuaternionKeyframeTrack = function (e, t, i, r) {
  51732. n.KeyframeTrack.call(this, e, t, i, r)
  51733. }),
  51734. (n.QuaternionKeyframeTrack.prototype = Object.assign(
  51735. Object.create(n.KeyframeTrack.prototype),
  51736. {
  51737. constructor: n.QuaternionKeyframeTrack,
  51738. ValueTypeName: 'quaternion',
  51739. DefaultInterpolation: n.InterpolateLinear,
  51740. InterpolantFactoryMethodLinear: function (e) {
  51741. return new n.QuaternionLinearInterpolant(
  51742. this.times,
  51743. this.values,
  51744. this.getValueSize(),
  51745. e
  51746. )
  51747. },
  51748. InterpolantFactoryMethodSmooth: void 0
  51749. }
  51750. )),
  51751. (n.StringKeyframeTrack = function (e, t, i, r) {
  51752. n.KeyframeTrack.call(this, e, t, i, r)
  51753. }),
  51754. (n.StringKeyframeTrack.prototype = Object.assign(
  51755. Object.create(n.KeyframeTrack.prototype),
  51756. {
  51757. constructor: n.StringKeyframeTrack,
  51758. ValueTypeName: 'string',
  51759. ValueBufferType: Array,
  51760. DefaultInterpolation: n.IntepolateDiscrete,
  51761. InterpolantFactoryMethodLinear: void 0,
  51762. InterpolantFactoryMethodSmooth: void 0
  51763. }
  51764. )),
  51765. (n.VectorKeyframeTrack = function (e, t, i, r) {
  51766. n.KeyframeTrack.call(this, e, t, i, r)
  51767. }),
  51768. (n.VectorKeyframeTrack.prototype = Object.assign(
  51769. Object.create(n.KeyframeTrack.prototype),
  51770. {
  51771. constructor: n.VectorKeyframeTrack,
  51772. ValueTypeName: 'vector'
  51773. }
  51774. )),
  51775. (n.Audio = function (e) {
  51776. n.Object3D.call(this),
  51777. (this.type = 'Audio'),
  51778. (this.context = e.context),
  51779. (this.source = this.context.createBufferSource()),
  51780. (this.source.onended = this.onEnded.bind(this)),
  51781. (this.gain = this.context.createGain()),
  51782. this.gain.connect(e.getInput()),
  51783. (this.autoplay = !1),
  51784. (this.startTime = 0),
  51785. (this.playbackRate = 1),
  51786. (this.isPlaying = !1),
  51787. (this.hasPlaybackControl = !0),
  51788. (this.sourceType = 'empty'),
  51789. (this.filter = null)
  51790. }),
  51791. (n.Audio.prototype = Object.create(n.Object3D.prototype)),
  51792. (n.Audio.prototype.constructor = n.Audio),
  51793. (n.Audio.prototype.getOutput = function () {
  51794. return this.gain
  51795. }),
  51796. (n.Audio.prototype.load = function (e) {
  51797. var t = new n.AudioBuffer(this.context)
  51798. return t.load(e), this.setBuffer(t), this
  51799. }),
  51800. (n.Audio.prototype.setNodeSource = function (e) {
  51801. return (
  51802. (this.hasPlaybackControl = !1),
  51803. (this.sourceType = 'audioNode'),
  51804. (this.source = e),
  51805. this.connect(),
  51806. this
  51807. )
  51808. }),
  51809. (n.Audio.prototype.setBuffer = function (e) {
  51810. var t = this
  51811. return (
  51812. e.onReady(function (e) {
  51813. ;(t.source.buffer = e), (t.sourceType = 'buffer'), t.autoplay && t.play()
  51814. }),
  51815. this
  51816. )
  51817. }),
  51818. (n.Audio.prototype.play = function () {
  51819. if (this.isPlaying === !0)
  51820. return void console.warn('THREE.Audio: Audio is already playing.')
  51821. if (this.hasPlaybackControl === !1)
  51822. return void console.warn('THREE.Audio: this Audio has no playback control.')
  51823. var e = this.context.createBufferSource()
  51824. ;(e.buffer = this.source.buffer),
  51825. (e.loop = this.source.loop),
  51826. (e.onended = this.source.onended),
  51827. e.start(0, this.startTime),
  51828. (e.playbackRate.value = this.playbackRate),
  51829. (this.isPlaying = !0),
  51830. (this.source = e),
  51831. this.connect()
  51832. }),
  51833. (n.Audio.prototype.pause = function () {
  51834. return this.hasPlaybackControl === !1
  51835. ? void console.warn('THREE.Audio: this Audio has no playback control.')
  51836. : (this.source.stop(), void (this.startTime = this.context.currentTime))
  51837. }),
  51838. (n.Audio.prototype.stop = function () {
  51839. return this.hasPlaybackControl === !1
  51840. ? void console.warn('THREE.Audio: this Audio has no playback control.')
  51841. : (this.source.stop(), void (this.startTime = 0))
  51842. }),
  51843. (n.Audio.prototype.connect = function () {
  51844. null !== this.filter
  51845. ? (this.source.connect(this.filter), this.filter.connect(this.getOutput()))
  51846. : this.source.connect(this.getOutput())
  51847. }),
  51848. (n.Audio.prototype.disconnect = function () {
  51849. null !== this.filter
  51850. ? (this.source.disconnect(this.filter), this.filter.disconnect(this.getOutput()))
  51851. : this.source.disconnect(this.getOutput())
  51852. }),
  51853. (n.Audio.prototype.getFilter = function () {
  51854. return this.filter
  51855. }),
  51856. (n.Audio.prototype.setFilter = function (e) {
  51857. void 0 === e && (e = null),
  51858. this.isPlaying === !0
  51859. ? (this.disconnect(), (this.filter = e), this.connect())
  51860. : (this.filter = e)
  51861. }),
  51862. (n.Audio.prototype.setPlaybackRate = function (e) {
  51863. return this.hasPlaybackControl === !1
  51864. ? void console.warn('THREE.Audio: this Audio has no playback control.')
  51865. : ((this.playbackRate = e),
  51866. void (
  51867. this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)
  51868. ))
  51869. }),
  51870. (n.Audio.prototype.getPlaybackRate = function () {
  51871. return this.playbackRate
  51872. }),
  51873. (n.Audio.prototype.onEnded = function () {
  51874. this.isPlaying = !1
  51875. }),
  51876. (n.Audio.prototype.setLoop = function (e) {
  51877. return this.hasPlaybackControl === !1
  51878. ? void console.warn('THREE.Audio: this Audio has no playback control.')
  51879. : void (this.source.loop = e)
  51880. }),
  51881. (n.Audio.prototype.getLoop = function () {
  51882. return this.hasPlaybackControl === !1
  51883. ? (console.warn('THREE.Audio: this Audio has no playback control.'), !1)
  51884. : this.source.loop
  51885. }),
  51886. (n.Audio.prototype.setVolume = function (e) {
  51887. this.gain.gain.value = e
  51888. }),
  51889. (n.Audio.prototype.getVolume = function () {
  51890. return this.gain.gain.value
  51891. }),
  51892. (n.AudioAnalyser = function (e, t) {
  51893. ;(this.analyser = e.context.createAnalyser()),
  51894. (this.analyser.fftSize = void 0 !== t ? t : 2048),
  51895. (this.data = new Uint8Array(this.analyser.frequencyBinCount)),
  51896. e.getOutput().connect(this.analyser)
  51897. }),
  51898. (n.AudioAnalyser.prototype = {
  51899. constructor: n.AudioAnalyser,
  51900. getData: function () {
  51901. return this.analyser.getByteFrequencyData(this.data), this.data
  51902. }
  51903. }),
  51904. (n.AudioBuffer = function (e) {
  51905. ;(this.context = e), (this.ready = !1), (this.readyCallbacks = [])
  51906. }),
  51907. (n.AudioBuffer.prototype.load = function (e) {
  51908. var t = this,
  51909. i = new XMLHttpRequest()
  51910. return (
  51911. i.open('GET', e, !0),
  51912. (i.responseType = 'arraybuffer'),
  51913. (i.onload = function (e) {
  51914. t.context.decodeAudioData(this.response, function (e) {
  51915. ;(t.buffer = e), (t.ready = !0)
  51916. for (var i = 0; i < t.readyCallbacks.length; i++) t.readyCallbacks[i](t.buffer)
  51917. t.readyCallbacks = []
  51918. })
  51919. }),
  51920. i.send(),
  51921. this
  51922. )
  51923. }),
  51924. (n.AudioBuffer.prototype.onReady = function (e) {
  51925. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  51926. }),
  51927. (n.PositionalAudio = function (e) {
  51928. n.Audio.call(this, e),
  51929. (this.panner = this.context.createPanner()),
  51930. this.panner.connect(this.gain)
  51931. }),
  51932. (n.PositionalAudio.prototype = Object.create(n.Audio.prototype)),
  51933. (n.PositionalAudio.prototype.constructor = n.PositionalAudio),
  51934. (n.PositionalAudio.prototype.getOutput = function () {
  51935. return this.panner
  51936. }),
  51937. (n.PositionalAudio.prototype.setRefDistance = function (e) {
  51938. this.panner.refDistance = e
  51939. }),
  51940. (n.PositionalAudio.prototype.getRefDistance = function () {
  51941. return this.panner.refDistance
  51942. }),
  51943. (n.PositionalAudio.prototype.setRolloffFactor = function (e) {
  51944. this.panner.rolloffFactor = e
  51945. }),
  51946. (n.PositionalAudio.prototype.getRolloffFactor = function () {
  51947. return this.panner.rolloffFactor
  51948. }),
  51949. (n.PositionalAudio.prototype.setDistanceModel = function (e) {
  51950. this.panner.distanceModel = e
  51951. }),
  51952. (n.PositionalAudio.prototype.getDistanceModel = function () {
  51953. return this.panner.distanceModel
  51954. }),
  51955. (n.PositionalAudio.prototype.setMaxDistance = function (e) {
  51956. this.panner.maxDistance = e
  51957. }),
  51958. (n.PositionalAudio.prototype.getMaxDistance = function () {
  51959. return this.panner.maxDistance
  51960. }),
  51961. (n.PositionalAudio.prototype.updateMatrixWorld = (function () {
  51962. var e = new n.Vector3()
  51963. return function (t) {
  51964. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  51965. e.setFromMatrixPosition(this.matrixWorld),
  51966. this.panner.setPosition(e.x, e.y, e.z)
  51967. }
  51968. })()),
  51969. (n.AudioListener = function () {
  51970. n.Object3D.call(this),
  51971. (this.type = 'AudioListener'),
  51972. (this.context = new (window.AudioContext || window.webkitAudioContext)()),
  51973. (this.gain = this.context.createGain()),
  51974. this.gain.connect(this.context.destination),
  51975. (this.filter = null)
  51976. }),
  51977. (n.AudioListener.prototype = Object.create(n.Object3D.prototype)),
  51978. (n.AudioListener.prototype.constructor = n.AudioListener),
  51979. (n.AudioListener.prototype.getInput = function () {
  51980. return this.gain
  51981. }),
  51982. (n.AudioListener.prototype.removeFilter = function () {
  51983. null !== this.filter &&
  51984. (this.gain.disconnect(this.filter),
  51985. this.filter.disconnect(this.context.destination),
  51986. this.gain.connect(this.context.destination),
  51987. (this.filter = null))
  51988. }),
  51989. (n.AudioListener.prototype.setFilter = function (e) {
  51990. null !== this.filter
  51991. ? (this.gain.disconnect(this.filter),
  51992. this.filter.disconnect(this.context.destination))
  51993. : this.gain.disconnect(this.context.destination),
  51994. (this.filter = e),
  51995. this.gain.connect(this.filter),
  51996. this.filter.connect(this.context.destination)
  51997. }),
  51998. (n.AudioListener.prototype.getFilter = function () {
  51999. return this.filter
  52000. }),
  52001. (n.AudioListener.prototype.setMasterVolume = function (e) {
  52002. this.gain.gain.value = e
  52003. }),
  52004. (n.AudioListener.prototype.getMasterVolume = function () {
  52005. return this.gain.gain.value
  52006. }),
  52007. (n.AudioListener.prototype.updateMatrixWorld = (function () {
  52008. var e = new n.Vector3(),
  52009. t = new n.Quaternion(),
  52010. i = new n.Vector3(),
  52011. r = new n.Vector3()
  52012. return function (o) {
  52013. n.Object3D.prototype.updateMatrixWorld.call(this, o)
  52014. var a = this.context.listener,
  52015. s = this.up
  52016. this.matrixWorld.decompose(e, t, i),
  52017. r.set(0, 0, -1).applyQuaternion(t),
  52018. a.setPosition(e.x, e.y, e.z),
  52019. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  52020. }
  52021. })()),
  52022. (n.Camera = function () {
  52023. n.Object3D.call(this),
  52024. (this.type = 'Camera'),
  52025. (this.matrixWorldInverse = new n.Matrix4()),
  52026. (this.projectionMatrix = new n.Matrix4())
  52027. }),
  52028. (n.Camera.prototype = Object.create(n.Object3D.prototype)),
  52029. (n.Camera.prototype.constructor = n.Camera),
  52030. (n.Camera.prototype.getWorldDirection = (function () {
  52031. var e = new n.Quaternion()
  52032. return function (t) {
  52033. var i = t || new n.Vector3()
  52034. return this.getWorldQuaternion(e), i.set(0, 0, -1).applyQuaternion(e)
  52035. }
  52036. })()),
  52037. (n.Camera.prototype.lookAt = (function () {
  52038. var e = new n.Matrix4()
  52039. return function (t) {
  52040. e.lookAt(this.position, t, this.up), this.quaternion.setFromRotationMatrix(e)
  52041. }
  52042. })()),
  52043. (n.Camera.prototype.clone = function () {
  52044. return new this.constructor().copy(this)
  52045. }),
  52046. (n.Camera.prototype.copy = function (e) {
  52047. return (
  52048. n.Object3D.prototype.copy.call(this, e),
  52049. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  52050. this.projectionMatrix.copy(e.projectionMatrix),
  52051. this
  52052. )
  52053. }),
  52054. (n.CubeCamera = function (e, t, i) {
  52055. n.Object3D.call(this), (this.type = 'CubeCamera')
  52056. var r = 90,
  52057. o = 1,
  52058. a = new n.PerspectiveCamera(r, o, e, t)
  52059. a.up.set(0, -1, 0), a.lookAt(new n.Vector3(1, 0, 0)), this.add(a)
  52060. var s = new n.PerspectiveCamera(r, o, e, t)
  52061. s.up.set(0, -1, 0), s.lookAt(new n.Vector3(-1, 0, 0)), this.add(s)
  52062. var l = new n.PerspectiveCamera(r, o, e, t)
  52063. l.up.set(0, 0, 1), l.lookAt(new n.Vector3(0, 1, 0)), this.add(l)
  52064. var c = new n.PerspectiveCamera(r, o, e, t)
  52065. c.up.set(0, 0, -1), c.lookAt(new n.Vector3(0, -1, 0)), this.add(c)
  52066. var h = new n.PerspectiveCamera(r, o, e, t)
  52067. h.up.set(0, -1, 0), h.lookAt(new n.Vector3(0, 0, 1)), this.add(h)
  52068. var u = new n.PerspectiveCamera(r, o, e, t)
  52069. u.up.set(0, -1, 0), u.lookAt(new n.Vector3(0, 0, -1)), this.add(u)
  52070. var d = {
  52071. format: n.RGBFormat,
  52072. magFilter: n.LinearFilter,
  52073. minFilter: n.LinearFilter
  52074. }
  52075. ;(this.renderTarget = new n.WebGLRenderTargetCube(i, i, d)),
  52076. (this.updateCubeMap = function (e, t) {
  52077. null === this.parent && this.updateMatrixWorld()
  52078. var i = this.renderTarget,
  52079. n = i.texture.generateMipmaps
  52080. ;(i.texture.generateMipmaps = !1),
  52081. (i.activeCubeFace = 0),
  52082. e.render(t, a, i),
  52083. (i.activeCubeFace = 1),
  52084. e.render(t, s, i),
  52085. (i.activeCubeFace = 2),
  52086. e.render(t, l, i),
  52087. (i.activeCubeFace = 3),
  52088. e.render(t, c, i),
  52089. (i.activeCubeFace = 4),
  52090. e.render(t, h, i),
  52091. (i.texture.generateMipmaps = n),
  52092. (i.activeCubeFace = 5),
  52093. e.render(t, u, i),
  52094. e.setRenderTarget(null)
  52095. })
  52096. }),
  52097. (n.CubeCamera.prototype = Object.create(n.Object3D.prototype)),
  52098. (n.CubeCamera.prototype.constructor = n.CubeCamera),
  52099. (n.OrthographicCamera = function (e, t, i, r, o, a) {
  52100. n.Camera.call(this),
  52101. (this.type = 'OrthographicCamera'),
  52102. (this.zoom = 1),
  52103. (this.left = e),
  52104. (this.right = t),
  52105. (this.top = i),
  52106. (this.bottom = r),
  52107. (this.near = void 0 !== o ? o : 0.1),
  52108. (this.far = void 0 !== a ? a : 2e3),
  52109. this.updateProjectionMatrix()
  52110. }),
  52111. (n.OrthographicCamera.prototype = Object.create(n.Camera.prototype)),
  52112. (n.OrthographicCamera.prototype.constructor = n.OrthographicCamera),
  52113. (n.OrthographicCamera.prototype.updateProjectionMatrix = function () {
  52114. var e = (this.right - this.left) / (2 * this.zoom),
  52115. t = (this.top - this.bottom) / (2 * this.zoom),
  52116. i = (this.right + this.left) / 2,
  52117. n = (this.top + this.bottom) / 2
  52118. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  52119. }),
  52120. (n.OrthographicCamera.prototype.copy = function (e) {
  52121. return (
  52122. n.Camera.prototype.copy.call(this, e),
  52123. (this.left = e.left),
  52124. (this.right = e.right),
  52125. (this.top = e.top),
  52126. (this.bottom = e.bottom),
  52127. (this.near = e.near),
  52128. (this.far = e.far),
  52129. (this.zoom = e.zoom),
  52130. this
  52131. )
  52132. }),
  52133. (n.OrthographicCamera.prototype.toJSON = function (e) {
  52134. var t = n.Object3D.prototype.toJSON.call(this, e)
  52135. return (
  52136. (t.object.zoom = this.zoom),
  52137. (t.object.left = this.left),
  52138. (t.object.right = this.right),
  52139. (t.object.top = this.top),
  52140. (t.object.bottom = this.bottom),
  52141. (t.object.near = this.near),
  52142. (t.object.far = this.far),
  52143. t
  52144. )
  52145. }),
  52146. (n.PerspectiveCamera = function (e, t, i, r) {
  52147. n.Camera.call(this),
  52148. (this.type = 'PerspectiveCamera'),
  52149. (this.focalLength = 10),
  52150. (this.zoom = 1),
  52151. (this.fov = void 0 !== e ? e : 50),
  52152. (this.aspect = void 0 !== t ? t : 1),
  52153. (this.near = void 0 !== i ? i : 0.1),
  52154. (this.far = void 0 !== r ? r : 2e3),
  52155. this.updateProjectionMatrix()
  52156. }),
  52157. (n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype)),
  52158. (n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera),
  52159. (n.PerspectiveCamera.prototype.setLens = function (e, t) {
  52160. void 0 === t && (t = 24),
  52161. (this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e)))),
  52162. this.updateProjectionMatrix()
  52163. }),
  52164. (n.PerspectiveCamera.prototype.setViewOffset = function (e, t, i, n, r, o) {
  52165. ;(this.fullWidth = e),
  52166. (this.fullHeight = t),
  52167. (this.x = i),
  52168. (this.y = n),
  52169. (this.width = r),
  52170. (this.height = o),
  52171. this.updateProjectionMatrix()
  52172. }),
  52173. (n.PerspectiveCamera.prototype.updateProjectionMatrix = function () {
  52174. var e = n.Math.radToDeg(
  52175. 2 * Math.atan(Math.tan(0.5 * n.Math.degToRad(this.fov)) / this.zoom)
  52176. )
  52177. if (this.fullWidth) {
  52178. var t = this.fullWidth / this.fullHeight,
  52179. i = Math.tan(n.Math.degToRad(0.5 * e)) * this.near,
  52180. r = -i,
  52181. o = t * r,
  52182. a = t * i,
  52183. s = Math.abs(a - o),
  52184. l = Math.abs(i - r)
  52185. this.projectionMatrix.makeFrustum(
  52186. o + (this.x * s) / this.fullWidth,
  52187. o + ((this.x + this.width) * s) / this.fullWidth,
  52188. i - ((this.y + this.height) * l) / this.fullHeight,
  52189. i - (this.y * l) / this.fullHeight,
  52190. this.near,
  52191. this.far
  52192. )
  52193. } else this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  52194. }),
  52195. (n.PerspectiveCamera.prototype.copy = function (e) {
  52196. return (
  52197. n.Camera.prototype.copy.call(this, e),
  52198. (this.focalLength = e.focalLength),
  52199. (this.zoom = e.zoom),
  52200. (this.fov = e.fov),
  52201. (this.aspect = e.aspect),
  52202. (this.near = e.near),
  52203. (this.far = e.far),
  52204. this
  52205. )
  52206. }),
  52207. (n.PerspectiveCamera.prototype.toJSON = function (e) {
  52208. var t = n.Object3D.prototype.toJSON.call(this, e)
  52209. return (
  52210. (t.object.focalLength = this.focalLength),
  52211. (t.object.zoom = this.zoom),
  52212. (t.object.fov = this.fov),
  52213. (t.object.aspect = this.aspect),
  52214. (t.object.near = this.near),
  52215. (t.object.far = this.far),
  52216. t
  52217. )
  52218. }),
  52219. (n.StereoCamera = function () {
  52220. ;(this.type = 'StereoCamera'),
  52221. (this.aspect = 1),
  52222. (this.cameraL = new n.PerspectiveCamera()),
  52223. this.cameraL.layers.enable(1),
  52224. (this.cameraL.matrixAutoUpdate = !1),
  52225. (this.cameraR = new n.PerspectiveCamera()),
  52226. this.cameraR.layers.enable(2),
  52227. (this.cameraR.matrixAutoUpdate = !1)
  52228. }),
  52229. (n.StereoCamera.prototype = {
  52230. constructor: n.StereoCamera,
  52231. update: (function () {
  52232. var e,
  52233. t,
  52234. i,
  52235. r,
  52236. o,
  52237. a = new n.Matrix4(),
  52238. s = new n.Matrix4()
  52239. return function (l) {
  52240. var c =
  52241. e !== l.focalLength ||
  52242. t !== l.fov ||
  52243. i !== l.aspect * this.aspect ||
  52244. r !== l.near ||
  52245. o !== l.far
  52246. if (c) {
  52247. ;(e = l.focalLength),
  52248. (t = l.fov),
  52249. (i = l.aspect * this.aspect),
  52250. (r = l.near),
  52251. (o = l.far)
  52252. var h,
  52253. u,
  52254. d = l.projectionMatrix.clone(),
  52255. p = 0.032,
  52256. f = (p * r) / e,
  52257. g = r * Math.tan(n.Math.degToRad(0.5 * t))
  52258. ;(s.elements[12] = -p),
  52259. (a.elements[12] = p),
  52260. (h = -g * i + f),
  52261. (u = g * i + f),
  52262. (d.elements[0] = (2 * r) / (u - h)),
  52263. (d.elements[8] = (u + h) / (u - h)),
  52264. this.cameraL.projectionMatrix.copy(d),
  52265. (h = -g * i - f),
  52266. (u = g * i - f),
  52267. (d.elements[0] = (2 * r) / (u - h)),
  52268. (d.elements[8] = (u + h) / (u - h)),
  52269. this.cameraR.projectionMatrix.copy(d)
  52270. }
  52271. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  52272. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  52273. }
  52274. })()
  52275. }),
  52276. (n.Light = function (e, t) {
  52277. n.Object3D.call(this),
  52278. (this.type = 'Light'),
  52279. (this.color = new n.Color(e)),
  52280. (this.intensity = void 0 !== t ? t : 1),
  52281. (this.receiveShadow = void 0)
  52282. }),
  52283. (n.Light.prototype = Object.create(n.Object3D.prototype)),
  52284. (n.Light.prototype.constructor = n.Light),
  52285. (n.Light.prototype.copy = function (e) {
  52286. return (
  52287. n.Object3D.prototype.copy.call(this, e),
  52288. this.color.copy(e.color),
  52289. (this.intensity = e.intensity),
  52290. this
  52291. )
  52292. }),
  52293. (n.Light.prototype.toJSON = function (e) {
  52294. var t = n.Object3D.prototype.toJSON.call(this, e)
  52295. return (
  52296. (t.object.color = this.color.getHex()),
  52297. (t.object.intensity = this.intensity),
  52298. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  52299. void 0 !== this.distance && (t.object.distance = this.distance),
  52300. void 0 !== this.angle && (t.object.angle = this.angle),
  52301. void 0 !== this.decay && (t.object.decay = this.decay),
  52302. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  52303. t
  52304. )
  52305. }),
  52306. (n.LightShadow = function (e) {
  52307. ;(this.camera = e),
  52308. (this.bias = 0),
  52309. (this.radius = 1),
  52310. (this.mapSize = new n.Vector2(512, 512)),
  52311. (this.map = null),
  52312. (this.matrix = new n.Matrix4())
  52313. }),
  52314. (n.LightShadow.prototype = {
  52315. constructor: n.LightShadow,
  52316. copy: function (e) {
  52317. return (
  52318. (this.camera = e.camera.clone()),
  52319. (this.bias = e.bias),
  52320. (this.radius = e.radius),
  52321. this.mapSize.copy(e.mapSize),
  52322. this
  52323. )
  52324. },
  52325. clone: function () {
  52326. return new this.constructor().copy(this)
  52327. }
  52328. }),
  52329. (n.AmbientLight = function (e, t) {
  52330. n.Light.call(this, e, t), (this.type = 'AmbientLight'), (this.castShadow = void 0)
  52331. }),
  52332. (n.AmbientLight.prototype = Object.create(n.Light.prototype)),
  52333. (n.AmbientLight.prototype.constructor = n.AmbientLight),
  52334. (n.DirectionalLight = function (e, t) {
  52335. n.Light.call(this, e, t),
  52336. (this.type = 'DirectionalLight'),
  52337. this.position.set(0, 1, 0),
  52338. this.updateMatrix(),
  52339. (this.target = new n.Object3D()),
  52340. (this.shadow = new n.LightShadow(new n.OrthographicCamera(-5, 5, 5, -5, 0.5, 500)))
  52341. }),
  52342. (n.DirectionalLight.prototype = Object.create(n.Light.prototype)),
  52343. (n.DirectionalLight.prototype.constructor = n.DirectionalLight),
  52344. (n.DirectionalLight.prototype.copy = function (e) {
  52345. return (
  52346. n.Light.prototype.copy.call(this, e),
  52347. (this.target = e.target.clone()),
  52348. (this.shadow = e.shadow.clone()),
  52349. this
  52350. )
  52351. }),
  52352. (n.HemisphereLight = function (e, t, i) {
  52353. n.Light.call(this, e, i),
  52354. (this.type = 'HemisphereLight'),
  52355. (this.castShadow = void 0),
  52356. this.position.set(0, 1, 0),
  52357. this.updateMatrix(),
  52358. (this.groundColor = new n.Color(t))
  52359. }),
  52360. (n.HemisphereLight.prototype = Object.create(n.Light.prototype)),
  52361. (n.HemisphereLight.prototype.constructor = n.HemisphereLight),
  52362. (n.HemisphereLight.prototype.copy = function (e) {
  52363. return n.Light.prototype.copy.call(this, e), this.groundColor.copy(e.groundColor), this
  52364. }),
  52365. (n.PointLight = function (e, t, i, r) {
  52366. n.Light.call(this, e, t),
  52367. (this.type = 'PointLight'),
  52368. (this.distance = void 0 !== i ? i : 0),
  52369. (this.decay = void 0 !== r ? r : 1),
  52370. (this.shadow = new n.LightShadow(new n.PerspectiveCamera(90, 1, 0.5, 500)))
  52371. }),
  52372. (n.PointLight.prototype = Object.create(n.Light.prototype)),
  52373. (n.PointLight.prototype.constructor = n.PointLight),
  52374. Object.defineProperty(n.PointLight.prototype, 'power', {
  52375. get: function () {
  52376. return 4 * this.intensity * Math.PI
  52377. },
  52378. set: function (e) {
  52379. this.intensity = e / (4 * Math.PI)
  52380. }
  52381. }),
  52382. (n.PointLight.prototype.copy = function (e) {
  52383. return (
  52384. n.Light.prototype.copy.call(this, e),
  52385. (this.distance = e.distance),
  52386. (this.decay = e.decay),
  52387. (this.shadow = e.shadow.clone()),
  52388. this
  52389. )
  52390. }),
  52391. (n.SpotLight = function (e, t, i, r, o, a) {
  52392. n.Light.call(this, e, t),
  52393. (this.type = 'SpotLight'),
  52394. this.position.set(0, 1, 0),
  52395. this.updateMatrix(),
  52396. (this.target = new n.Object3D()),
  52397. (this.distance = void 0 !== i ? i : 0),
  52398. (this.angle = void 0 !== r ? r : Math.PI / 3),
  52399. (this.penumbra = void 0 !== o ? o : 0),
  52400. (this.decay = void 0 !== a ? a : 1),
  52401. (this.shadow = new n.LightShadow(new n.PerspectiveCamera(50, 1, 0.5, 500)))
  52402. }),
  52403. (n.SpotLight.prototype = Object.create(n.Light.prototype)),
  52404. (n.SpotLight.prototype.constructor = n.SpotLight),
  52405. Object.defineProperty(n.SpotLight.prototype, 'power', {
  52406. get: function () {
  52407. return this.intensity * Math.PI
  52408. },
  52409. set: function (e) {
  52410. this.intensity = e / Math.PI
  52411. }
  52412. }),
  52413. (n.SpotLight.prototype.copy = function (e) {
  52414. return (
  52415. n.Light.prototype.copy.call(this, e),
  52416. (this.distance = e.distance),
  52417. (this.angle = e.angle),
  52418. (this.penumbra = e.penumbra),
  52419. (this.decay = e.decay),
  52420. (this.target = e.target.clone()),
  52421. (this.shadow = e.shadow.clone()),
  52422. this
  52423. )
  52424. }),
  52425. (n.Cache = {
  52426. enabled: !1,
  52427. files: {},
  52428. add: function (e, t) {
  52429. this.enabled !== !1 && (this.files[e] = t)
  52430. },
  52431. get: function (e) {
  52432. if (this.enabled !== !1) return this.files[e]
  52433. },
  52434. remove: function (e) {
  52435. delete this.files[e]
  52436. },
  52437. clear: function () {
  52438. this.files = {}
  52439. }
  52440. }),
  52441. (n.Loader = function () {
  52442. ;(this.onLoadStart = function () {}),
  52443. (this.onLoadProgress = function () {}),
  52444. (this.onLoadComplete = function () {})
  52445. }),
  52446. (n.Loader.prototype = {
  52447. constructor: n.Loader,
  52448. crossOrigin: void 0,
  52449. extractUrlBase: function (e) {
  52450. var t = e.split('/')
  52451. return 1 === t.length ? './' : (t.pop(), t.join('/') + '/')
  52452. },
  52453. initMaterials: function (e, t, i) {
  52454. for (var n = [], r = 0; r < e.length; ++r) n[r] = this.createMaterial(e[r], t, i)
  52455. return n
  52456. },
  52457. createMaterial: (function () {
  52458. var e, t, i
  52459. return function (r, o, a) {
  52460. function s(e, i, r, s, c) {
  52461. var h,
  52462. u = o + e,
  52463. d = n.Loader.Handlers.get(u)
  52464. null !== d ? (h = d.load(u)) : (t.setCrossOrigin(a), (h = t.load(u))),
  52465. void 0 !== i &&
  52466. (h.repeat.fromArray(i),
  52467. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  52468. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  52469. void 0 !== r && h.offset.fromArray(r),
  52470. void 0 !== s &&
  52471. ('repeat' === s[0] && (h.wrapS = n.RepeatWrapping),
  52472. 'mirror' === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  52473. 'repeat' === s[1] && (h.wrapT = n.RepeatWrapping),
  52474. 'mirror' === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  52475. void 0 !== c && (h.anisotropy = c)
  52476. var p = n.Math.generateUUID()
  52477. return (l[p] = h), p
  52478. }
  52479. void 0 === e && (e = new n.Color()),
  52480. void 0 === t && (t = new n.TextureLoader()),
  52481. void 0 === i && (i = new n.MaterialLoader())
  52482. var l = {},
  52483. c = {
  52484. uuid: n.Math.generateUUID(),
  52485. type: 'MeshLambertMaterial'
  52486. }
  52487. for (var h in r) {
  52488. var u = r[h]
  52489. switch (h) {
  52490. case 'DbgColor':
  52491. case 'DbgIndex':
  52492. case 'opticalDensity':
  52493. case 'illumination':
  52494. break
  52495. case 'DbgName':
  52496. c.name = u
  52497. break
  52498. case 'blending':
  52499. c.blending = n[u]
  52500. break
  52501. case 'colorAmbient':
  52502. case 'mapAmbient':
  52503. console.warn('THREE.Loader.createMaterial:', h, 'is no longer supported.')
  52504. break
  52505. case 'colorDiffuse':
  52506. c.color = e.fromArray(u).getHex()
  52507. break
  52508. case 'colorSpecular':
  52509. c.specular = e.fromArray(u).getHex()
  52510. break
  52511. case 'colorEmissive':
  52512. c.emissive = e.fromArray(u).getHex()
  52513. break
  52514. case 'specularCoef':
  52515. c.shininess = u
  52516. break
  52517. case 'shading':
  52518. 'basic' === u.toLowerCase() && (c.type = 'MeshBasicMaterial'),
  52519. 'phong' === u.toLowerCase() && (c.type = 'MeshPhongMaterial')
  52520. break
  52521. case 'mapDiffuse':
  52522. c.map = s(
  52523. u,
  52524. r.mapDiffuseRepeat,
  52525. r.mapDiffuseOffset,
  52526. r.mapDiffuseWrap,
  52527. r.mapDiffuseAnisotropy
  52528. )
  52529. break
  52530. case 'mapDiffuseRepeat':
  52531. case 'mapDiffuseOffset':
  52532. case 'mapDiffuseWrap':
  52533. case 'mapDiffuseAnisotropy':
  52534. break
  52535. case 'mapLight':
  52536. c.lightMap = s(
  52537. u,
  52538. r.mapLightRepeat,
  52539. r.mapLightOffset,
  52540. r.mapLightWrap,
  52541. r.mapLightAnisotropy
  52542. )
  52543. break
  52544. case 'mapLightRepeat':
  52545. case 'mapLightOffset':
  52546. case 'mapLightWrap':
  52547. case 'mapLightAnisotropy':
  52548. break
  52549. case 'mapAO':
  52550. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy)
  52551. break
  52552. case 'mapAORepeat':
  52553. case 'mapAOOffset':
  52554. case 'mapAOWrap':
  52555. case 'mapAOAnisotropy':
  52556. break
  52557. case 'mapBump':
  52558. c.bumpMap = s(
  52559. u,
  52560. r.mapBumpRepeat,
  52561. r.mapBumpOffset,
  52562. r.mapBumpWrap,
  52563. r.mapBumpAnisotropy
  52564. )
  52565. break
  52566. case 'mapBumpScale':
  52567. c.bumpScale = u
  52568. break
  52569. case 'mapBumpRepeat':
  52570. case 'mapBumpOffset':
  52571. case 'mapBumpWrap':
  52572. case 'mapBumpAnisotropy':
  52573. break
  52574. case 'mapNormal':
  52575. c.normalMap = s(
  52576. u,
  52577. r.mapNormalRepeat,
  52578. r.mapNormalOffset,
  52579. r.mapNormalWrap,
  52580. r.mapNormalAnisotropy
  52581. )
  52582. break
  52583. case 'mapNormalFactor':
  52584. c.normalScale = [u, u]
  52585. break
  52586. case 'mapNormalRepeat':
  52587. case 'mapNormalOffset':
  52588. case 'mapNormalWrap':
  52589. case 'mapNormalAnisotropy':
  52590. break
  52591. case 'mapSpecular':
  52592. c.specularMap = s(
  52593. u,
  52594. r.mapSpecularRepeat,
  52595. r.mapSpecularOffset,
  52596. r.mapSpecularWrap,
  52597. r.mapSpecularAnisotropy
  52598. )
  52599. break
  52600. case 'mapSpecularRepeat':
  52601. case 'mapSpecularOffset':
  52602. case 'mapSpecularWrap':
  52603. case 'mapSpecularAnisotropy':
  52604. break
  52605. case 'mapAlpha':
  52606. c.alphaMap = s(
  52607. u,
  52608. r.mapAlphaRepeat,
  52609. r.mapAlphaOffset,
  52610. r.mapAlphaWrap,
  52611. r.mapAlphaAnisotropy
  52612. )
  52613. break
  52614. case 'mapAlphaRepeat':
  52615. case 'mapAlphaOffset':
  52616. case 'mapAlphaWrap':
  52617. case 'mapAlphaAnisotropy':
  52618. break
  52619. case 'flipSided':
  52620. c.side = n.BackSide
  52621. break
  52622. case 'doubleSided':
  52623. c.side = n.DoubleSide
  52624. break
  52625. case 'transparency':
  52626. console.warn(
  52627. 'THREE.Loader.createMaterial: transparency has been renamed to opacity'
  52628. ),
  52629. (c.opacity = u)
  52630. break
  52631. case 'depthTest':
  52632. case 'depthWrite':
  52633. case 'colorWrite':
  52634. case 'opacity':
  52635. case 'reflectivity':
  52636. case 'transparent':
  52637. case 'visible':
  52638. case 'wireframe':
  52639. c[h] = u
  52640. break
  52641. case 'vertexColors':
  52642. u === !0 && (c.vertexColors = n.VertexColors),
  52643. 'face' === u && (c.vertexColors = n.FaceColors)
  52644. break
  52645. default:
  52646. console.error('THREE.Loader.createMaterial: Unsupported', h, u)
  52647. }
  52648. }
  52649. return (
  52650. 'MeshBasicMaterial' === c.type && delete c.emissive,
  52651. 'MeshPhongMaterial' !== c.type && delete c.specular,
  52652. c.opacity < 1 && (c.transparent = !0),
  52653. i.setTextures(l),
  52654. i.parse(c)
  52655. )
  52656. }
  52657. })()
  52658. }),
  52659. (n.Loader.Handlers = {
  52660. handlers: [],
  52661. add: function (e, t) {
  52662. this.handlers.push(e, t)
  52663. },
  52664. get: function (e) {
  52665. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  52666. var r = t[i],
  52667. o = t[i + 1]
  52668. if (r.test(e)) return o
  52669. }
  52670. return null
  52671. }
  52672. }),
  52673. (n.XHRLoader = function (e) {
  52674. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  52675. }),
  52676. (n.XHRLoader.prototype = {
  52677. constructor: n.XHRLoader,
  52678. load: function (e, t, i, r) {
  52679. void 0 !== this.path && (e = this.path + e)
  52680. var o = this,
  52681. a = n.Cache.get(e)
  52682. if (void 0 !== a)
  52683. return (
  52684. t &&
  52685. setTimeout(function () {
  52686. t(a)
  52687. }, 0),
  52688. a
  52689. )
  52690. var s = new XMLHttpRequest()
  52691. return (
  52692. s.overrideMimeType('text/plain'),
  52693. s.open('GET', e, !0),
  52694. s.addEventListener(
  52695. 'load',
  52696. function (i) {
  52697. var a = i.target.response
  52698. n.Cache.add(e, a),
  52699. 200 === this.status
  52700. ? (t && t(a), o.manager.itemEnd(e))
  52701. : 0 === this.status
  52702. ? (console.warn('THREE.XHRLoader: HTTP Status 0 received.'),
  52703. t && t(a),
  52704. o.manager.itemEnd(e))
  52705. : (r && r(i), o.manager.itemError(e))
  52706. },
  52707. !1
  52708. ),
  52709. void 0 !== i &&
  52710. s.addEventListener(
  52711. 'progress',
  52712. function (e) {
  52713. i(e)
  52714. },
  52715. !1
  52716. ),
  52717. s.addEventListener(
  52718. 'error',
  52719. function (t) {
  52720. r && r(t), o.manager.itemError(e)
  52721. },
  52722. !1
  52723. ),
  52724. void 0 !== this.responseType && (s.responseType = this.responseType),
  52725. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  52726. s.send(null),
  52727. o.manager.itemStart(e),
  52728. s
  52729. )
  52730. },
  52731. setPath: function (e) {
  52732. this.path = e
  52733. },
  52734. setResponseType: function (e) {
  52735. this.responseType = e
  52736. },
  52737. setWithCredentials: function (e) {
  52738. this.withCredentials = e
  52739. }
  52740. }),
  52741. (n.FontLoader = function (e) {
  52742. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  52743. }),
  52744. (n.FontLoader.prototype = {
  52745. constructor: n.FontLoader,
  52746. load: function (e, t, i, r) {
  52747. var o = new n.XHRLoader(this.manager)
  52748. o.load(
  52749. e,
  52750. function (e) {
  52751. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  52752. },
  52753. i,
  52754. r
  52755. )
  52756. }
  52757. }),
  52758. (n.ImageLoader = function (e) {
  52759. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  52760. }),
  52761. (n.ImageLoader.prototype = {
  52762. constructor: n.ImageLoader,
  52763. load: function (e, t, i, r) {
  52764. void 0 !== this.path && (e = this.path + e)
  52765. var o = this,
  52766. a = n.Cache.get(e)
  52767. if (void 0 !== a)
  52768. return (
  52769. o.manager.itemStart(e),
  52770. t
  52771. ? setTimeout(function () {
  52772. t(a), o.manager.itemEnd(e)
  52773. }, 0)
  52774. : o.manager.itemEnd(e),
  52775. a
  52776. )
  52777. var s = document.createElement('img')
  52778. return (
  52779. s.addEventListener(
  52780. 'load',
  52781. function (i) {
  52782. n.Cache.add(e, this), t && t(this), o.manager.itemEnd(e)
  52783. },
  52784. !1
  52785. ),
  52786. void 0 !== i &&
  52787. s.addEventListener(
  52788. 'progress',
  52789. function (e) {
  52790. i(e)
  52791. },
  52792. !1
  52793. ),
  52794. s.addEventListener(
  52795. 'error',
  52796. function (t) {
  52797. r && r(t), o.manager.itemError(e)
  52798. },
  52799. !1
  52800. ),
  52801. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  52802. o.manager.itemStart(e),
  52803. (s.src = e),
  52804. s
  52805. )
  52806. },
  52807. setCrossOrigin: function (e) {
  52808. this.crossOrigin = e
  52809. },
  52810. setPath: function (e) {
  52811. this.path = e
  52812. }
  52813. }),
  52814. (n.JSONLoader = function (e) {
  52815. 'boolean' == typeof e &&
  52816. (console.warn(
  52817. 'THREE.JSONLoader: showStatus parameter has been removed from constructor.'
  52818. ),
  52819. (e = void 0)),
  52820. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager),
  52821. (this.withCredentials = !1)
  52822. }),
  52823. (n.JSONLoader.prototype = {
  52824. constructor: n.JSONLoader,
  52825. get statusDomElement() {
  52826. return (
  52827. void 0 === this._statusDomElement &&
  52828. (this._statusDomElement = document.createElement('div')),
  52829. console.warn('THREE.JSONLoader: .statusDomElement has been removed.'),
  52830. this._statusDomElement
  52831. )
  52832. },
  52833. load: function (e, t, i, r) {
  52834. var o = this,
  52835. a =
  52836. this.texturePath && 'string' == typeof this.texturePath
  52837. ? this.texturePath
  52838. : n.Loader.prototype.extractUrlBase(e),
  52839. s = new n.XHRLoader(this.manager)
  52840. s.setWithCredentials(this.withCredentials),
  52841. s.load(
  52842. e,
  52843. function (i) {
  52844. var n = JSON.parse(i),
  52845. r = n.metadata
  52846. if (void 0 !== r) {
  52847. var s = r.type
  52848. if (void 0 !== s) {
  52849. if ('object' === s.toLowerCase())
  52850. return void console.error(
  52851. 'THREE.JSONLoader: ' +
  52852. e +
  52853. ' should be loaded with THREE.ObjectLoader instead.'
  52854. )
  52855. if ('scene' === s.toLowerCase())
  52856. return void console.error(
  52857. 'THREE.JSONLoader: ' +
  52858. e +
  52859. ' should be loaded with THREE.SceneLoader instead.'
  52860. )
  52861. }
  52862. }
  52863. var l = o.parse(n, a)
  52864. t(l.geometry, l.materials)
  52865. },
  52866. i,
  52867. r
  52868. )
  52869. },
  52870. setTexturePath: function (e) {
  52871. this.texturePath = e
  52872. },
  52873. parse: function (e, t) {
  52874. function i(t) {
  52875. function i(e, t) {
  52876. return e & (1 << t)
  52877. }
  52878. var r,
  52879. o,
  52880. a,
  52881. l,
  52882. c,
  52883. h,
  52884. u,
  52885. d,
  52886. p,
  52887. f,
  52888. g,
  52889. m,
  52890. v,
  52891. A,
  52892. y,
  52893. C,
  52894. I,
  52895. E,
  52896. b,
  52897. w,
  52898. _,
  52899. T,
  52900. x,
  52901. S,
  52902. M,
  52903. R,
  52904. P,
  52905. O = e.faces,
  52906. L = e.vertices,
  52907. D = e.normals,
  52908. N = e.colors,
  52909. B = 0
  52910. if (void 0 !== e.uvs) {
  52911. for (r = 0; r < e.uvs.length; r++) e.uvs[r].length && B++
  52912. for (r = 0; r < B; r++) s.faceVertexUvs[r] = []
  52913. }
  52914. for (l = 0, c = L.length; l < c; )
  52915. (E = new n.Vector3()),
  52916. (E.x = L[l++] * t),
  52917. (E.y = L[l++] * t),
  52918. (E.z = L[l++] * t),
  52919. s.vertices.push(E)
  52920. for (l = 0, c = O.length; l < c; )
  52921. if (
  52922. ((f = O[l++]),
  52923. (g = i(f, 0)),
  52924. (m = i(f, 1)),
  52925. (v = i(f, 3)),
  52926. (A = i(f, 4)),
  52927. (y = i(f, 5)),
  52928. (C = i(f, 6)),
  52929. (I = i(f, 7)),
  52930. g)
  52931. ) {
  52932. if (
  52933. ((w = new n.Face3()),
  52934. (w.a = O[l]),
  52935. (w.b = O[l + 1]),
  52936. (w.c = O[l + 3]),
  52937. (_ = new n.Face3()),
  52938. (_.a = O[l + 1]),
  52939. (_.b = O[l + 2]),
  52940. (_.c = O[l + 3]),
  52941. (l += 4),
  52942. m && ((p = O[l++]), (w.materialIndex = p), (_.materialIndex = p)),
  52943. (a = s.faces.length),
  52944. v)
  52945. )
  52946. for (r = 0; r < B; r++)
  52947. for (
  52948. S = e.uvs[r],
  52949. s.faceVertexUvs[r][a] = [],
  52950. s.faceVertexUvs[r][a + 1] = [],
  52951. o = 0;
  52952. o < 4;
  52953. o++
  52954. )
  52955. (d = O[l++]),
  52956. (R = S[2 * d]),
  52957. (P = S[2 * d + 1]),
  52958. (M = new n.Vector2(R, P)),
  52959. 2 !== o && s.faceVertexUvs[r][a].push(M),
  52960. 0 !== o && s.faceVertexUvs[r][a + 1].push(M)
  52961. if (
  52962. (A &&
  52963. ((u = 3 * O[l++]),
  52964. w.normal.set(D[u++], D[u++], D[u]),
  52965. _.normal.copy(w.normal)),
  52966. y)
  52967. )
  52968. for (r = 0; r < 4; r++)
  52969. (u = 3 * O[l++]),
  52970. (x = new n.Vector3(D[u++], D[u++], D[u])),
  52971. 2 !== r && w.vertexNormals.push(x),
  52972. 0 !== r && _.vertexNormals.push(x)
  52973. if ((C && ((h = O[l++]), (T = N[h]), w.color.setHex(T), _.color.setHex(T)), I))
  52974. for (r = 0; r < 4; r++)
  52975. (h = O[l++]),
  52976. (T = N[h]),
  52977. 2 !== r && w.vertexColors.push(new n.Color(T)),
  52978. 0 !== r && _.vertexColors.push(new n.Color(T))
  52979. s.faces.push(w), s.faces.push(_)
  52980. } else {
  52981. if (
  52982. ((b = new n.Face3()),
  52983. (b.a = O[l++]),
  52984. (b.b = O[l++]),
  52985. (b.c = O[l++]),
  52986. m && ((p = O[l++]), (b.materialIndex = p)),
  52987. (a = s.faces.length),
  52988. v)
  52989. )
  52990. for (r = 0; r < B; r++)
  52991. for (S = e.uvs[r], s.faceVertexUvs[r][a] = [], o = 0; o < 3; o++)
  52992. (d = O[l++]),
  52993. (R = S[2 * d]),
  52994. (P = S[2 * d + 1]),
  52995. (M = new n.Vector2(R, P)),
  52996. s.faceVertexUvs[r][a].push(M)
  52997. if ((A && ((u = 3 * O[l++]), b.normal.set(D[u++], D[u++], D[u])), y))
  52998. for (r = 0; r < 3; r++)
  52999. (u = 3 * O[l++]),
  53000. (x = new n.Vector3(D[u++], D[u++], D[u])),
  53001. b.vertexNormals.push(x)
  53002. if ((C && ((h = O[l++]), b.color.setHex(N[h])), I))
  53003. for (r = 0; r < 3; r++) (h = O[l++]), b.vertexColors.push(new n.Color(N[h]))
  53004. s.faces.push(b)
  53005. }
  53006. }
  53007. function r() {
  53008. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2
  53009. if (e.skinWeights)
  53010. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  53011. var o = e.skinWeights[i],
  53012. a = t > 1 ? e.skinWeights[i + 1] : 0,
  53013. l = t > 2 ? e.skinWeights[i + 2] : 0,
  53014. c = t > 3 ? e.skinWeights[i + 3] : 0
  53015. s.skinWeights.push(new n.Vector4(o, a, l, c))
  53016. }
  53017. if (e.skinIndices)
  53018. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  53019. var h = e.skinIndices[i],
  53020. u = t > 1 ? e.skinIndices[i + 1] : 0,
  53021. d = t > 2 ? e.skinIndices[i + 2] : 0,
  53022. p = t > 3 ? e.skinIndices[i + 3] : 0
  53023. s.skinIndices.push(new n.Vector4(h, u, d, p))
  53024. }
  53025. ;(s.bones = e.bones),
  53026. s.bones &&
  53027. s.bones.length > 0 &&
  53028. (s.skinWeights.length !== s.skinIndices.length ||
  53029. s.skinIndices.length !== s.vertices.length) &&
  53030. console.warn(
  53031. 'When skinning, number of vertices (' +
  53032. s.vertices.length +
  53033. '), skinIndices (' +
  53034. s.skinIndices.length +
  53035. '), and skinWeights (' +
  53036. s.skinWeights.length +
  53037. ') should match.'
  53038. )
  53039. }
  53040. function o(t) {
  53041. if (void 0 !== e.morphTargets)
  53042. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  53043. ;(s.morphTargets[i] = {}),
  53044. (s.morphTargets[i].name = e.morphTargets[i].name),
  53045. (s.morphTargets[i].vertices = [])
  53046. for (
  53047. var o = s.morphTargets[i].vertices,
  53048. a = e.morphTargets[i].vertices,
  53049. l = 0,
  53050. c = a.length;
  53051. l < c;
  53052. l += 3
  53053. ) {
  53054. var h = new n.Vector3()
  53055. ;(h.x = a[l] * t), (h.y = a[l + 1] * t), (h.z = a[l + 2] * t), o.push(h)
  53056. }
  53057. }
  53058. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  53059. console.warn(
  53060. 'THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.'
  53061. )
  53062. for (
  53063. var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length;
  53064. i < r;
  53065. i++
  53066. )
  53067. u[i].color.fromArray(d, 3 * i)
  53068. }
  53069. }
  53070. function a() {
  53071. var t = [],
  53072. i = []
  53073. void 0 !== e.animation && i.push(e.animation),
  53074. void 0 !== e.animations &&
  53075. (e.animations.length ? (i = i.concat(e.animations)) : i.push(e.animations))
  53076. for (var r = 0; r < i.length; r++) {
  53077. var o = n.AnimationClip.parseAnimation(i[r], s.bones)
  53078. o && t.push(o)
  53079. }
  53080. if (s.morphTargets) {
  53081. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10)
  53082. t = t.concat(a)
  53083. }
  53084. t.length > 0 && (s.animations = t)
  53085. }
  53086. var s = new n.Geometry(),
  53087. l = void 0 !== e.scale ? 1 / e.scale : 1
  53088. if (
  53089. (i(l),
  53090. r(),
  53091. o(l),
  53092. a(),
  53093. s.computeFaceNormals(),
  53094. s.computeBoundingSphere(),
  53095. void 0 === e.materials || 0 === e.materials.length)
  53096. )
  53097. return {
  53098. geometry: s
  53099. }
  53100. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin)
  53101. return {
  53102. geometry: s,
  53103. materials: c
  53104. }
  53105. }
  53106. }),
  53107. (n.LoadingManager = function (e, t, i) {
  53108. var n = this,
  53109. r = !1,
  53110. o = 0,
  53111. a = 0
  53112. ;(this.onStart = void 0),
  53113. (this.onLoad = e),
  53114. (this.onProgress = t),
  53115. (this.onError = i),
  53116. (this.itemStart = function (e) {
  53117. a++, r === !1 && void 0 !== n.onStart && n.onStart(e, o, a), (r = !0)
  53118. }),
  53119. (this.itemEnd = function (e) {
  53120. o++,
  53121. void 0 !== n.onProgress && n.onProgress(e, o, a),
  53122. o === a && ((r = !1), void 0 !== n.onLoad && n.onLoad())
  53123. }),
  53124. (this.itemError = function (e) {
  53125. void 0 !== n.onError && n.onError(e)
  53126. })
  53127. }),
  53128. (n.DefaultLoadingManager = new n.LoadingManager()),
  53129. (n.BufferGeometryLoader = function (e) {
  53130. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  53131. }),
  53132. (n.BufferGeometryLoader.prototype = {
  53133. constructor: n.BufferGeometryLoader,
  53134. load: function (e, t, i, r) {
  53135. var o = this,
  53136. a = new n.XHRLoader(o.manager)
  53137. a.load(
  53138. e,
  53139. function (e) {
  53140. t(o.parse(JSON.parse(e)))
  53141. },
  53142. i,
  53143. r
  53144. )
  53145. },
  53146. parse: function (e) {
  53147. var t = new n.BufferGeometry(),
  53148. i = e.data.index,
  53149. r = {
  53150. Int8Array: Int8Array,
  53151. Uint8Array: Uint8Array,
  53152. Uint8ClampedArray: Uint8ClampedArray,
  53153. Int16Array: Int16Array,
  53154. Uint16Array: Uint16Array,
  53155. Int32Array: Int32Array,
  53156. Uint32Array: Uint32Array,
  53157. Float32Array: Float32Array,
  53158. Float64Array: Float64Array
  53159. }
  53160. if (void 0 !== i) {
  53161. var o = new r[i.type](i.array)
  53162. t.setIndex(new n.BufferAttribute(o, 1))
  53163. }
  53164. var a = e.data.attributes
  53165. for (var s in a) {
  53166. var l = a[s],
  53167. o = new r[l.type](l.array)
  53168. t.addAttribute(s, new n.BufferAttribute(o, l.itemSize))
  53169. }
  53170. var c = e.data.groups || e.data.drawcalls || e.data.offsets
  53171. if (void 0 !== c)
  53172. for (var h = 0, u = c.length; h !== u; ++h) {
  53173. var d = c[h]
  53174. t.addGroup(d.start, d.count, d.materialIndex)
  53175. }
  53176. var p = e.data.boundingSphere
  53177. if (void 0 !== p) {
  53178. var f = new n.Vector3()
  53179. void 0 !== p.center && f.fromArray(p.center),
  53180. (t.boundingSphere = new n.Sphere(f, p.radius))
  53181. }
  53182. return t
  53183. }
  53184. }),
  53185. (n.MaterialLoader = function (e) {
  53186. ;(this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this.textures = {})
  53187. }),
  53188. (n.MaterialLoader.prototype = {
  53189. constructor: n.MaterialLoader,
  53190. load: function (e, t, i, r) {
  53191. var o = this,
  53192. a = new n.XHRLoader(o.manager)
  53193. a.load(
  53194. e,
  53195. function (e) {
  53196. t(o.parse(JSON.parse(e)))
  53197. },
  53198. i,
  53199. r
  53200. )
  53201. },
  53202. setTextures: function (e) {
  53203. this.textures = e
  53204. },
  53205. getTexture: function (e) {
  53206. var t = this.textures
  53207. return (
  53208. void 0 === t[e] && console.warn('THREE.MaterialLoader: Undefined texture', e), t[e]
  53209. )
  53210. },
  53211. parse: function (e) {
  53212. var t = new n[e.type]()
  53213. if (
  53214. (void 0 !== e.uuid && (t.uuid = e.uuid),
  53215. void 0 !== e.name && (t.name = e.name),
  53216. void 0 !== e.color && t.color.setHex(e.color),
  53217. void 0 !== e.roughness && (t.roughness = e.roughness),
  53218. void 0 !== e.metalness && (t.metalness = e.metalness),
  53219. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  53220. void 0 !== e.specular && t.specular.setHex(e.specular),
  53221. void 0 !== e.shininess && (t.shininess = e.shininess),
  53222. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  53223. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  53224. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  53225. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  53226. void 0 !== e.shading && (t.shading = e.shading),
  53227. void 0 !== e.blending && (t.blending = e.blending),
  53228. void 0 !== e.side && (t.side = e.side),
  53229. void 0 !== e.opacity && (t.opacity = e.opacity),
  53230. void 0 !== e.transparent && (t.transparent = e.transparent),
  53231. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  53232. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  53233. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  53234. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  53235. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  53236. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  53237. void 0 !== e.size && (t.size = e.size),
  53238. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  53239. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  53240. void 0 !== e.alphaMap &&
  53241. ((t.alphaMap = this.getTexture(e.alphaMap)), (t.transparent = !0)),
  53242. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  53243. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  53244. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  53245. void 0 !== e.normalScale)
  53246. ) {
  53247. var i = e.normalScale
  53248. Array.isArray(i) === !1 && (i = [i, i]),
  53249. (t.normalScale = new n.Vector2().fromArray(i))
  53250. }
  53251. if (
  53252. (void 0 !== e.displacementMap &&
  53253. (t.displacementMap = this.getTexture(e.displacementMap)),
  53254. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  53255. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  53256. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  53257. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  53258. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  53259. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  53260. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  53261. void 0 !== e.envMap &&
  53262. ((t.envMap = this.getTexture(e.envMap)), (t.combine = n.MultiplyOperation)),
  53263. e.reflectivity && (t.reflectivity = e.reflectivity),
  53264. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  53265. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  53266. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  53267. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  53268. void 0 !== e.materials)
  53269. )
  53270. for (var r = 0, o = e.materials.length; r < o; r++)
  53271. t.materials.push(this.parse(e.materials[r]))
  53272. return t
  53273. }
  53274. }),
  53275. (n.ObjectLoader = function (e) {
  53276. ;(this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this.texturePath = '')
  53277. }),
  53278. (n.ObjectLoader.prototype = {
  53279. constructor: n.ObjectLoader,
  53280. load: function (e, t, i, r) {
  53281. '' === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf('/') + 1))
  53282. var o = this,
  53283. a = new n.XHRLoader(o.manager)
  53284. a.load(
  53285. e,
  53286. function (e) {
  53287. o.parse(JSON.parse(e), t)
  53288. },
  53289. i,
  53290. r
  53291. )
  53292. },
  53293. setTexturePath: function (e) {
  53294. this.texturePath = e
  53295. },
  53296. setCrossOrigin: function (e) {
  53297. this.crossOrigin = e
  53298. },
  53299. parse: function (e, t) {
  53300. var i = this.parseGeometries(e.geometries),
  53301. n = this.parseImages(e.images, function () {
  53302. void 0 !== t && t(a)
  53303. }),
  53304. r = this.parseTextures(e.textures, n),
  53305. o = this.parseMaterials(e.materials, r),
  53306. a = this.parseObject(e.object, i, o)
  53307. return (
  53308. e.animations && (a.animations = this.parseAnimations(e.animations)),
  53309. (void 0 !== e.images && 0 !== e.images.length) || (void 0 !== t && t(a)),
  53310. a
  53311. )
  53312. },
  53313. parseGeometries: function (e) {
  53314. var t = {}
  53315. if (void 0 !== e)
  53316. for (
  53317. var i = new n.JSONLoader(), r = new n.BufferGeometryLoader(), o = 0, a = e.length;
  53318. o < a;
  53319. o++
  53320. ) {
  53321. var s,
  53322. l = e[o]
  53323. switch (l.type) {
  53324. case 'PlaneGeometry':
  53325. case 'PlaneBufferGeometry':
  53326. s = new n[l.type](l.width, l.height, l.widthSegments, l.heightSegments)
  53327. break
  53328. case 'BoxGeometry':
  53329. case 'BoxBufferGeometry':
  53330. case 'CubeGeometry':
  53331. s = new n[l.type](
  53332. l.width,
  53333. l.height,
  53334. l.depth,
  53335. l.widthSegments,
  53336. l.heightSegments,
  53337. l.depthSegments
  53338. )
  53339. break
  53340. case 'CircleGeometry':
  53341. case 'CircleBufferGeometry':
  53342. s = new n[l.type](l.radius, l.segments, l.thetaStart, l.thetaLength)
  53343. break
  53344. case 'CylinderGeometry':
  53345. case 'CylinderBufferGeometry':
  53346. s = new n[l.type](
  53347. l.radiusTop,
  53348. l.radiusBottom,
  53349. l.height,
  53350. l.radialSegments,
  53351. l.heightSegments,
  53352. l.openEnded,
  53353. l.thetaStart,
  53354. l.thetaLength
  53355. )
  53356. break
  53357. case 'SphereGeometry':
  53358. case 'SphereBufferGeometry':
  53359. s = new n[l.type](
  53360. l.radius,
  53361. l.widthSegments,
  53362. l.heightSegments,
  53363. l.phiStart,
  53364. l.phiLength,
  53365. l.thetaStart,
  53366. l.thetaLength
  53367. )
  53368. break
  53369. case 'DodecahedronGeometry':
  53370. s = new n.DodecahedronGeometry(l.radius, l.detail)
  53371. break
  53372. case 'IcosahedronGeometry':
  53373. s = new n.IcosahedronGeometry(l.radius, l.detail)
  53374. break
  53375. case 'OctahedronGeometry':
  53376. s = new n.OctahedronGeometry(l.radius, l.detail)
  53377. break
  53378. case 'TetrahedronGeometry':
  53379. s = new n.TetrahedronGeometry(l.radius, l.detail)
  53380. break
  53381. case 'RingGeometry':
  53382. case 'RingBufferGeometry':
  53383. s = new n[l.type](
  53384. l.innerRadius,
  53385. l.outerRadius,
  53386. l.thetaSegments,
  53387. l.phiSegments,
  53388. l.thetaStart,
  53389. l.thetaLength
  53390. )
  53391. break
  53392. case 'TorusGeometry':
  53393. case 'TorusBufferGeometry':
  53394. s = new n[l.type](
  53395. l.radius,
  53396. l.tube,
  53397. l.radialSegments,
  53398. l.tubularSegments,
  53399. l.arc
  53400. )
  53401. break
  53402. case 'TorusKnotGeometry':
  53403. case 'TorusKnotBufferGeometry':
  53404. s = new n[l.type](
  53405. l.radius,
  53406. l.tube,
  53407. l.tubularSegments,
  53408. l.radialSegments,
  53409. l.p,
  53410. l.q
  53411. )
  53412. break
  53413. case 'LatheGeometry':
  53414. s = new n.LatheGeometry(l.points, l.segments, l.phiStart, l.phiLength)
  53415. break
  53416. case 'BufferGeometry':
  53417. s = r.parse(l)
  53418. break
  53419. case 'Geometry':
  53420. s = i.parse(l.data, this.texturePath).geometry
  53421. break
  53422. default:
  53423. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"')
  53424. continue
  53425. }
  53426. ;(s.uuid = l.uuid), void 0 !== l.name && (s.name = l.name), (t[l.uuid] = s)
  53427. }
  53428. return t
  53429. },
  53430. parseMaterials: function (e, t) {
  53431. var i = {}
  53432. if (void 0 !== e) {
  53433. var r = new n.MaterialLoader()
  53434. r.setTextures(t)
  53435. for (var o = 0, a = e.length; o < a; o++) {
  53436. var s = r.parse(e[o])
  53437. i[s.uuid] = s
  53438. }
  53439. }
  53440. return i
  53441. },
  53442. parseAnimations: function (e) {
  53443. for (var t = [], i = 0; i < e.length; i++) {
  53444. var r = n.AnimationClip.parse(e[i])
  53445. t.push(r)
  53446. }
  53447. return t
  53448. },
  53449. parseImages: function (e, t) {
  53450. function i(e) {
  53451. return (
  53452. r.manager.itemStart(e),
  53453. s.load(e, function () {
  53454. r.manager.itemEnd(e)
  53455. })
  53456. )
  53457. }
  53458. var r = this,
  53459. o = {}
  53460. if (void 0 !== e && e.length > 0) {
  53461. var a = new n.LoadingManager(t),
  53462. s = new n.ImageLoader(a)
  53463. s.setCrossOrigin(this.crossOrigin)
  53464. for (var l = 0, c = e.length; l < c; l++) {
  53465. var h = e[l],
  53466. u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url
  53467. o[h.uuid] = i(u)
  53468. }
  53469. }
  53470. return o
  53471. },
  53472. parseTextures: function (e, t) {
  53473. function i(e) {
  53474. return 'number' == typeof e
  53475. ? e
  53476. : (console.warn(
  53477. 'THREE.ObjectLoader.parseTexture: Constant should be in numeric form.',
  53478. e
  53479. ),
  53480. n[e])
  53481. }
  53482. var r = {}
  53483. if (void 0 !== e)
  53484. for (var o = 0, a = e.length; o < a; o++) {
  53485. var s = e[o]
  53486. void 0 === s.image &&
  53487. console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  53488. void 0 === t[s.image] &&
  53489. console.warn('THREE.ObjectLoader: Undefined image', s.image)
  53490. var l = new n.Texture(t[s.image])
  53491. ;(l.needsUpdate = !0),
  53492. (l.uuid = s.uuid),
  53493. void 0 !== s.name && (l.name = s.name),
  53494. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  53495. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0], s.offset[1])),
  53496. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0], s.repeat[1])),
  53497. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  53498. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  53499. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  53500. Array.isArray(s.wrap) && ((l.wrapS = i(s.wrap[0])), (l.wrapT = i(s.wrap[1]))),
  53501. (r[s.uuid] = l)
  53502. }
  53503. return r
  53504. },
  53505. parseObject: (function () {
  53506. var e = new n.Matrix4()
  53507. return function (t, i, r) {
  53508. function o(e) {
  53509. return (
  53510. void 0 === i[e] && console.warn('THREE.ObjectLoader: Undefined geometry', e),
  53511. i[e]
  53512. )
  53513. }
  53514. function a(e) {
  53515. if (void 0 !== e)
  53516. return (
  53517. void 0 === r[e] && console.warn('THREE.ObjectLoader: Undefined material', e),
  53518. r[e]
  53519. )
  53520. }
  53521. var s
  53522. switch (t.type) {
  53523. case 'Scene':
  53524. s = new n.Scene()
  53525. break
  53526. case 'PerspectiveCamera':
  53527. s = new n.PerspectiveCamera(t.fov, t.aspect, t.near, t.far)
  53528. break
  53529. case 'OrthographicCamera':
  53530. s = new n.OrthographicCamera(t.left, t.right, t.top, t.bottom, t.near, t.far)
  53531. break
  53532. case 'AmbientLight':
  53533. s = new n.AmbientLight(t.color, t.intensity)
  53534. break
  53535. case 'DirectionalLight':
  53536. s = new n.DirectionalLight(t.color, t.intensity)
  53537. break
  53538. case 'PointLight':
  53539. s = new n.PointLight(t.color, t.intensity, t.distance, t.decay)
  53540. break
  53541. case 'SpotLight':
  53542. s = new n.SpotLight(
  53543. t.color,
  53544. t.intensity,
  53545. t.distance,
  53546. t.angle,
  53547. t.penumbra,
  53548. t.decay
  53549. )
  53550. break
  53551. case 'HemisphereLight':
  53552. s = new n.HemisphereLight(t.color, t.groundColor, t.intensity)
  53553. break
  53554. case 'Mesh':
  53555. var l = o(t.geometry),
  53556. c = a(t.material)
  53557. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l, c) : new n.Mesh(l, c)
  53558. break
  53559. case 'LOD':
  53560. s = new n.LOD()
  53561. break
  53562. case 'Line':
  53563. s = new n.Line(o(t.geometry), a(t.material), t.mode)
  53564. break
  53565. case 'PointCloud':
  53566. case 'Points':
  53567. s = new n.Points(o(t.geometry), a(t.material))
  53568. break
  53569. case 'Sprite':
  53570. s = new n.Sprite(a(t.material))
  53571. break
  53572. case 'Group':
  53573. s = new n.Group()
  53574. break
  53575. default:
  53576. s = new n.Object3D()
  53577. }
  53578. if (
  53579. ((s.uuid = t.uuid),
  53580. void 0 !== t.name && (s.name = t.name),
  53581. void 0 !== t.matrix
  53582. ? (e.fromArray(t.matrix), e.decompose(s.position, s.quaternion, s.scale))
  53583. : (void 0 !== t.position && s.position.fromArray(t.position),
  53584. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  53585. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  53586. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  53587. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  53588. void 0 !== t.visible && (s.visible = t.visible),
  53589. void 0 !== t.userData && (s.userData = t.userData),
  53590. void 0 !== t.children)
  53591. )
  53592. for (var h in t.children) s.add(this.parseObject(t.children[h], i, r))
  53593. if ('LOD' === t.type)
  53594. for (var u = t.levels, d = 0; d < u.length; d++) {
  53595. var p = u[d],
  53596. h = s.getObjectByProperty('uuid', p.object)
  53597. void 0 !== h && s.addLevel(h, p.distance)
  53598. }
  53599. return s
  53600. }
  53601. })()
  53602. }),
  53603. (n.TextureLoader = function (e) {
  53604. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  53605. }),
  53606. (n.TextureLoader.prototype = {
  53607. constructor: n.TextureLoader,
  53608. load: function (e, t, i, r) {
  53609. var o = new n.Texture(),
  53610. a = new n.ImageLoader(this.manager)
  53611. return (
  53612. a.setCrossOrigin(this.crossOrigin),
  53613. a.setPath(this.path),
  53614. a.load(
  53615. e,
  53616. function (e) {
  53617. ;(o.image = e), (o.needsUpdate = !0), void 0 !== t && t(o)
  53618. },
  53619. i,
  53620. r
  53621. ),
  53622. o
  53623. )
  53624. },
  53625. setCrossOrigin: function (e) {
  53626. this.crossOrigin = e
  53627. },
  53628. setPath: function (e) {
  53629. this.path = e
  53630. }
  53631. }),
  53632. (n.CubeTextureLoader = function (e) {
  53633. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  53634. }),
  53635. (n.CubeTextureLoader.prototype = {
  53636. constructor: n.CubeTextureLoader,
  53637. load: function (e, t, i, r) {
  53638. function o(i) {
  53639. s.load(
  53640. e[i],
  53641. function (e) {
  53642. ;(a.images[i] = e), l++, 6 === l && ((a.needsUpdate = !0), t && t(a))
  53643. },
  53644. void 0,
  53645. r
  53646. )
  53647. }
  53648. var a = new n.CubeTexture(),
  53649. s = new n.ImageLoader(this.manager)
  53650. s.setCrossOrigin(this.crossOrigin), s.setPath(this.path)
  53651. for (var l = 0, c = 0; c < e.length; ++c) o(c)
  53652. return a
  53653. },
  53654. setCrossOrigin: function (e) {
  53655. this.crossOrigin = e
  53656. },
  53657. setPath: function (e) {
  53658. this.path = e
  53659. }
  53660. }),
  53661. (n.DataTextureLoader = n.BinaryTextureLoader =
  53662. function (e) {
  53663. ;(this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this._parser = null)
  53664. }),
  53665. (n.BinaryTextureLoader.prototype = {
  53666. constructor: n.BinaryTextureLoader,
  53667. load: function (e, t, i, r) {
  53668. var o = this,
  53669. a = new n.DataTexture(),
  53670. s = new n.XHRLoader(this.manager)
  53671. return (
  53672. s.setResponseType('arraybuffer'),
  53673. s.load(
  53674. e,
  53675. function (e) {
  53676. var i = o._parser(e)
  53677. i &&
  53678. (void 0 !== i.image
  53679. ? (a.image = i.image)
  53680. : void 0 !== i.data &&
  53681. ((a.image.width = i.width),
  53682. (a.image.height = i.height),
  53683. (a.image.data = i.data)),
  53684. (a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping),
  53685. (a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping),
  53686. (a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter),
  53687. (a.minFilter =
  53688. void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter),
  53689. (a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1),
  53690. void 0 !== i.format && (a.format = i.format),
  53691. void 0 !== i.type && (a.type = i.type),
  53692. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  53693. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  53694. (a.needsUpdate = !0),
  53695. t && t(a, i))
  53696. },
  53697. i,
  53698. r
  53699. ),
  53700. a
  53701. )
  53702. }
  53703. }),
  53704. (n.CompressedTextureLoader = function (e) {
  53705. ;(this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this._parser = null)
  53706. })
  53707. n.CompressedTextureLoader.prototype = {
  53708. constructor: n.CompressedTextureLoader,
  53709. load: function (e, t, i, r) {
  53710. function o(o) {
  53711. c.load(
  53712. e[o],
  53713. function (e) {
  53714. var i = a._parser(e, !0)
  53715. ;(s[o] = {
  53716. width: i.width,
  53717. height: i.height,
  53718. format: i.format,
  53719. mipmaps: i.mipmaps
  53720. }),
  53721. (h += 1),
  53722. 6 === h &&
  53723. (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  53724. (l.format = i.format),
  53725. (l.needsUpdate = !0),
  53726. t && t(l))
  53727. },
  53728. i,
  53729. r
  53730. )
  53731. }
  53732. var a = this,
  53733. s = [],
  53734. l = new n.CompressedTexture()
  53735. l.image = s
  53736. var c = new n.XHRLoader(this.manager)
  53737. if ((c.setPath(this.path), c.setResponseType('arraybuffer'), Array.isArray(e)))
  53738. for (var h = 0, u = 0, d = e.length; u < d; ++u) o(u)
  53739. else
  53740. c.load(
  53741. e,
  53742. function (e) {
  53743. var i = a._parser(e, !0)
  53744. if (i.isCubemap)
  53745. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  53746. s[o] = {
  53747. mipmaps: []
  53748. }
  53749. for (var c = 0; c < i.mipmapCount; c++)
  53750. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  53751. (s[o].format = i.format),
  53752. (s[o].width = i.width),
  53753. (s[o].height = i.height)
  53754. }
  53755. else
  53756. (l.image.width = i.width), (l.image.height = i.height), (l.mipmaps = i.mipmaps)
  53757. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  53758. (l.format = i.format),
  53759. (l.needsUpdate = !0),
  53760. t && t(l)
  53761. },
  53762. i,
  53763. r
  53764. )
  53765. return l
  53766. },
  53767. setPath: function (e) {
  53768. this.path = e
  53769. }
  53770. }
  53771. ;(n.Material = function () {
  53772. Object.defineProperty(this, 'id', {
  53773. value: n.MaterialIdCount++
  53774. }),
  53775. (this.uuid = n.Math.generateUUID()),
  53776. (this.name = ''),
  53777. (this.type = 'Material'),
  53778. (this.side = n.FrontSide),
  53779. (this.opacity = 1),
  53780. (this.transparent = !1),
  53781. (this.blending = n.NormalBlending),
  53782. (this.blendSrc = n.SrcAlphaFactor),
  53783. (this.blendDst = n.OneMinusSrcAlphaFactor),
  53784. (this.blendEquation = n.AddEquation),
  53785. (this.blendSrcAlpha = null),
  53786. (this.blendDstAlpha = null),
  53787. (this.blendEquationAlpha = null),
  53788. (this.depthFunc = n.LessEqualDepth),
  53789. (this.depthTest = !0),
  53790. (this.depthWrite = !0),
  53791. (this.colorWrite = !0),
  53792. (this.precision = null),
  53793. (this.polygonOffset = !1),
  53794. (this.polygonOffsetFactor = 0),
  53795. (this.polygonOffsetUnits = 0),
  53796. (this.alphaTest = 0),
  53797. (this.premultipliedAlpha = !1),
  53798. (this.overdraw = 0),
  53799. (this.visible = !0),
  53800. (this._needsUpdate = !0)
  53801. }),
  53802. (n.Material.prototype = {
  53803. constructor: n.Material,
  53804. get needsUpdate() {
  53805. return this._needsUpdate
  53806. },
  53807. set needsUpdate(e) {
  53808. e === !0 && this.update(), (this._needsUpdate = e)
  53809. },
  53810. setValues: function (e) {
  53811. if (void 0 !== e)
  53812. for (var t in e) {
  53813. var i = e[t]
  53814. if (void 0 !== i) {
  53815. var r = this[t]
  53816. void 0 !== r
  53817. ? r instanceof n.Color
  53818. ? r.set(i)
  53819. : r instanceof n.Vector3 && i instanceof n.Vector3
  53820. ? r.copy(i)
  53821. : 'overdraw' === t
  53822. ? (this[t] = Number(i))
  53823. : (this[t] = i)
  53824. : console.warn(
  53825. 'THREE.' + this.type + ": '" + t + "' is not a property of this material."
  53826. )
  53827. } else console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  53828. }
  53829. },
  53830. toJSON: function (e) {
  53831. function t(e) {
  53832. var t = []
  53833. for (var i in e) {
  53834. var n = e[i]
  53835. delete n.metadata, t.push(n)
  53836. }
  53837. return t
  53838. }
  53839. var i = void 0 === e
  53840. i &&
  53841. (e = {
  53842. textures: {},
  53843. images: {}
  53844. })
  53845. var r = {
  53846. metadata: {
  53847. version: 4.4,
  53848. type: 'Material',
  53849. generator: 'Material.toJSON'
  53850. }
  53851. }
  53852. if (
  53853. ((r.uuid = this.uuid),
  53854. (r.type = this.type),
  53855. '' !== this.name && (r.name = this.name),
  53856. this.color instanceof n.Color && (r.color = this.color.getHex()),
  53857. 0.5 !== this.roughness && (r.roughness = this.roughness),
  53858. 0.5 !== this.metalness && (r.metalness = this.metalness),
  53859. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  53860. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  53861. void 0 !== this.shininess && (r.shininess = this.shininess),
  53862. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  53863. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  53864. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  53865. this.bumpMap instanceof n.Texture &&
  53866. ((r.bumpMap = this.bumpMap.toJSON(e).uuid), (r.bumpScale = this.bumpScale)),
  53867. this.normalMap instanceof n.Texture &&
  53868. ((r.normalMap = this.normalMap.toJSON(e).uuid),
  53869. (r.normalScale = this.normalScale.toArray())),
  53870. this.displacementMap instanceof n.Texture &&
  53871. ((r.displacementMap = this.displacementMap.toJSON(e).uuid),
  53872. (r.displacementScale = this.displacementScale),
  53873. (r.displacementBias = this.displacementBias)),
  53874. this.roughnessMap instanceof n.Texture &&
  53875. (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  53876. this.metalnessMap instanceof n.Texture &&
  53877. (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  53878. this.emissiveMap instanceof n.Texture &&
  53879. (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  53880. this.specularMap instanceof n.Texture &&
  53881. (r.specularMap = this.specularMap.toJSON(e).uuid),
  53882. this.envMap instanceof n.Texture &&
  53883. ((r.envMap = this.envMap.toJSON(e).uuid), (r.reflectivity = this.reflectivity)),
  53884. void 0 !== this.size && (r.size = this.size),
  53885. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  53886. void 0 !== this.vertexColors &&
  53887. this.vertexColors !== n.NoColors &&
  53888. (r.vertexColors = this.vertexColors),
  53889. void 0 !== this.shading &&
  53890. this.shading !== n.SmoothShading &&
  53891. (r.shading = this.shading),
  53892. void 0 !== this.blending &&
  53893. this.blending !== n.NormalBlending &&
  53894. (r.blending = this.blending),
  53895. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  53896. this.opacity < 1 && (r.opacity = this.opacity),
  53897. this.transparent === !0 && (r.transparent = this.transparent),
  53898. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  53899. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  53900. this.wireframe === !0 && (r.wireframe = this.wireframe),
  53901. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  53902. i)
  53903. ) {
  53904. var o = t(e.textures),
  53905. a = t(e.images)
  53906. o.length > 0 && (r.textures = o), a.length > 0 && (r.images = a)
  53907. }
  53908. return r
  53909. },
  53910. clone: function () {
  53911. return new this.constructor().copy(this)
  53912. },
  53913. copy: function (e) {
  53914. return (
  53915. (this.name = e.name),
  53916. (this.side = e.side),
  53917. (this.opacity = e.opacity),
  53918. (this.transparent = e.transparent),
  53919. (this.blending = e.blending),
  53920. (this.blendSrc = e.blendSrc),
  53921. (this.blendDst = e.blendDst),
  53922. (this.blendEquation = e.blendEquation),
  53923. (this.blendSrcAlpha = e.blendSrcAlpha),
  53924. (this.blendDstAlpha = e.blendDstAlpha),
  53925. (this.blendEquationAlpha = e.blendEquationAlpha),
  53926. (this.depthFunc = e.depthFunc),
  53927. (this.depthTest = e.depthTest),
  53928. (this.depthWrite = e.depthWrite),
  53929. (this.colorWrite = e.colorWrite),
  53930. (this.precision = e.precision),
  53931. (this.polygonOffset = e.polygonOffset),
  53932. (this.polygonOffsetFactor = e.polygonOffsetFactor),
  53933. (this.polygonOffsetUnits = e.polygonOffsetUnits),
  53934. (this.alphaTest = e.alphaTest),
  53935. (this.premultipliedAlpha = e.premultipliedAlpha),
  53936. (this.overdraw = e.overdraw),
  53937. (this.visible = e.visible),
  53938. this
  53939. )
  53940. },
  53941. update: function () {
  53942. this.dispatchEvent({
  53943. type: 'update'
  53944. })
  53945. },
  53946. dispose: function () {
  53947. this.dispatchEvent({
  53948. type: 'dispose'
  53949. })
  53950. }
  53951. }),
  53952. n.EventDispatcher.prototype.apply(n.Material.prototype),
  53953. (n.MaterialIdCount = 0),
  53954. (n.LineBasicMaterial = function (e) {
  53955. n.Material.call(this),
  53956. (this.type = 'LineBasicMaterial'),
  53957. (this.color = new n.Color(16777215)),
  53958. (this.linewidth = 1),
  53959. (this.linecap = 'round'),
  53960. (this.linejoin = 'round'),
  53961. (this.blending = n.NormalBlending),
  53962. (this.vertexColors = n.NoColors),
  53963. (this.fog = !0),
  53964. this.setValues(e)
  53965. }),
  53966. (n.LineBasicMaterial.prototype = Object.create(n.Material.prototype)),
  53967. (n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial),
  53968. (n.LineBasicMaterial.prototype.copy = function (e) {
  53969. return (
  53970. n.Material.prototype.copy.call(this, e),
  53971. this.color.copy(e.color),
  53972. (this.linewidth = e.linewidth),
  53973. (this.linecap = e.linecap),
  53974. (this.linejoin = e.linejoin),
  53975. (this.vertexColors = e.vertexColors),
  53976. (this.fog = e.fog),
  53977. this
  53978. )
  53979. }),
  53980. (n.LineDashedMaterial = function (e) {
  53981. n.Material.call(this),
  53982. (this.type = 'LineDashedMaterial'),
  53983. (this.color = new n.Color(16777215)),
  53984. (this.linewidth = 1),
  53985. (this.scale = 1),
  53986. (this.dashSize = 3),
  53987. (this.gapSize = 1),
  53988. (this.blending = n.NormalBlending),
  53989. (this.vertexColors = n.NoColors),
  53990. (this.fog = !0),
  53991. this.setValues(e)
  53992. }),
  53993. (n.LineDashedMaterial.prototype = Object.create(n.Material.prototype)),
  53994. (n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial),
  53995. (n.LineDashedMaterial.prototype.copy = function (e) {
  53996. return (
  53997. n.Material.prototype.copy.call(this, e),
  53998. this.color.copy(e.color),
  53999. (this.linewidth = e.linewidth),
  54000. (this.scale = e.scale),
  54001. (this.dashSize = e.dashSize),
  54002. (this.gapSize = e.gapSize),
  54003. (this.vertexColors = e.vertexColors),
  54004. (this.fog = e.fog),
  54005. this
  54006. )
  54007. }),
  54008. (n.MeshBasicMaterial = function (e) {
  54009. n.Material.call(this),
  54010. (this.type = 'MeshBasicMaterial'),
  54011. (this.color = new n.Color(16777215)),
  54012. (this.map = null),
  54013. (this.aoMap = null),
  54014. (this.aoMapIntensity = 1),
  54015. (this.specularMap = null),
  54016. (this.alphaMap = null),
  54017. (this.envMap = null),
  54018. (this.combine = n.MultiplyOperation),
  54019. (this.reflectivity = 1),
  54020. (this.refractionRatio = 0.98),
  54021. (this.fog = !0),
  54022. (this.shading = n.SmoothShading),
  54023. (this.blending = n.NormalBlending),
  54024. (this.wireframe = !1),
  54025. (this.wireframeLinewidth = 1),
  54026. (this.wireframeLinecap = 'round'),
  54027. (this.wireframeLinejoin = 'round'),
  54028. (this.vertexColors = n.NoColors),
  54029. (this.skinning = !1),
  54030. (this.morphTargets = !1),
  54031. this.setValues(e)
  54032. }),
  54033. (n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype)),
  54034. (n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial),
  54035. (n.MeshBasicMaterial.prototype.copy = function (e) {
  54036. return (
  54037. n.Material.prototype.copy.call(this, e),
  54038. this.color.copy(e.color),
  54039. (this.map = e.map),
  54040. (this.aoMap = e.aoMap),
  54041. (this.aoMapIntensity = e.aoMapIntensity),
  54042. (this.specularMap = e.specularMap),
  54043. (this.alphaMap = e.alphaMap),
  54044. (this.envMap = e.envMap),
  54045. (this.combine = e.combine),
  54046. (this.reflectivity = e.reflectivity),
  54047. (this.refractionRatio = e.refractionRatio),
  54048. (this.fog = e.fog),
  54049. (this.shading = e.shading),
  54050. (this.wireframe = e.wireframe),
  54051. (this.wireframeLinewidth = e.wireframeLinewidth),
  54052. (this.wireframeLinecap = e.wireframeLinecap),
  54053. (this.wireframeLinejoin = e.wireframeLinejoin),
  54054. (this.vertexColors = e.vertexColors),
  54055. (this.skinning = e.skinning),
  54056. (this.morphTargets = e.morphTargets),
  54057. this
  54058. )
  54059. }),
  54060. (n.MeshLambertMaterial = function (e) {
  54061. n.Material.call(this),
  54062. (this.type = 'MeshLambertMaterial'),
  54063. (this.color = new n.Color(16777215)),
  54064. (this.map = null),
  54065. (this.lightMap = null),
  54066. (this.lightMapIntensity = 1),
  54067. (this.aoMap = null),
  54068. (this.aoMapIntensity = 1),
  54069. (this.emissive = new n.Color(0)),
  54070. (this.emissiveIntensity = 1),
  54071. (this.emissiveMap = null),
  54072. (this.specularMap = null),
  54073. (this.alphaMap = null),
  54074. (this.envMap = null),
  54075. (this.combine = n.MultiplyOperation),
  54076. (this.reflectivity = 1),
  54077. (this.refractionRatio = 0.98),
  54078. (this.fog = !0),
  54079. (this.blending = n.NormalBlending),
  54080. (this.wireframe = !1),
  54081. (this.wireframeLinewidth = 1),
  54082. (this.wireframeLinecap = 'round'),
  54083. (this.wireframeLinejoin = 'round'),
  54084. (this.vertexColors = n.NoColors),
  54085. (this.skinning = !1),
  54086. (this.morphTargets = !1),
  54087. (this.morphNormals = !1),
  54088. this.setValues(e)
  54089. }),
  54090. (n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype)),
  54091. (n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial),
  54092. (n.MeshLambertMaterial.prototype.copy = function (e) {
  54093. return (
  54094. n.Material.prototype.copy.call(this, e),
  54095. this.color.copy(e.color),
  54096. (this.map = e.map),
  54097. (this.lightMap = e.lightMap),
  54098. (this.lightMapIntensity = e.lightMapIntensity),
  54099. (this.aoMap = e.aoMap),
  54100. (this.aoMapIntensity = e.aoMapIntensity),
  54101. this.emissive.copy(e.emissive),
  54102. (this.emissiveMap = e.emissiveMap),
  54103. (this.emissiveIntensity = e.emissiveIntensity),
  54104. (this.specularMap = e.specularMap),
  54105. (this.alphaMap = e.alphaMap),
  54106. (this.envMap = e.envMap),
  54107. (this.combine = e.combine),
  54108. (this.reflectivity = e.reflectivity),
  54109. (this.refractionRatio = e.refractionRatio),
  54110. (this.fog = e.fog),
  54111. (this.wireframe = e.wireframe),
  54112. (this.wireframeLinewidth = e.wireframeLinewidth),
  54113. (this.wireframeLinecap = e.wireframeLinecap),
  54114. (this.wireframeLinejoin = e.wireframeLinejoin),
  54115. (this.vertexColors = e.vertexColors),
  54116. (this.skinning = e.skinning),
  54117. (this.morphTargets = e.morphTargets),
  54118. (this.morphNormals = e.morphNormals),
  54119. this
  54120. )
  54121. }),
  54122. (n.MeshPhongMaterial = function (e) {
  54123. n.Material.call(this),
  54124. (this.type = 'MeshPhongMaterial'),
  54125. (this.color = new n.Color(16777215)),
  54126. (this.specular = new n.Color(1118481)),
  54127. (this.shininess = 30),
  54128. (this.map = null),
  54129. (this.lightMap = null),
  54130. (this.lightMapIntensity = 1),
  54131. (this.aoMap = null),
  54132. (this.aoMapIntensity = 1),
  54133. (this.emissive = new n.Color(0)),
  54134. (this.emissiveIntensity = 1),
  54135. (this.emissiveMap = null),
  54136. (this.bumpMap = null),
  54137. (this.bumpScale = 1),
  54138. (this.normalMap = null),
  54139. (this.normalScale = new n.Vector2(1, 1)),
  54140. (this.displacementMap = null),
  54141. (this.displacementScale = 1),
  54142. (this.displacementBias = 0),
  54143. (this.specularMap = null),
  54144. (this.alphaMap = null),
  54145. (this.envMap = null),
  54146. (this.combine = n.MultiplyOperation),
  54147. (this.reflectivity = 1),
  54148. (this.refractionRatio = 0.98),
  54149. (this.fog = !0),
  54150. (this.shading = n.SmoothShading),
  54151. (this.blending = n.NormalBlending),
  54152. (this.wireframe = !1),
  54153. (this.wireframeLinewidth = 1),
  54154. (this.wireframeLinecap = 'round'),
  54155. (this.wireframeLinejoin = 'round'),
  54156. (this.vertexColors = n.NoColors),
  54157. (this.skinning = !1),
  54158. (this.morphTargets = !1),
  54159. (this.morphNormals = !1),
  54160. this.setValues(e)
  54161. }),
  54162. (n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype)),
  54163. (n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial),
  54164. (n.MeshPhongMaterial.prototype.copy = function (e) {
  54165. return (
  54166. n.Material.prototype.copy.call(this, e),
  54167. this.color.copy(e.color),
  54168. this.specular.copy(e.specular),
  54169. (this.shininess = e.shininess),
  54170. (this.map = e.map),
  54171. (this.lightMap = e.lightMap),
  54172. (this.lightMapIntensity = e.lightMapIntensity),
  54173. (this.aoMap = e.aoMap),
  54174. (this.aoMapIntensity = e.aoMapIntensity),
  54175. this.emissive.copy(e.emissive),
  54176. (this.emissiveMap = e.emissiveMap),
  54177. (this.emissiveIntensity = e.emissiveIntensity),
  54178. (this.bumpMap = e.bumpMap),
  54179. (this.bumpScale = e.bumpScale),
  54180. (this.normalMap = e.normalMap),
  54181. this.normalScale.copy(e.normalScale),
  54182. (this.displacementMap = e.displacementMap),
  54183. (this.displacementScale = e.displacementScale),
  54184. (this.displacementBias = e.displacementBias),
  54185. (this.specularMap = e.specularMap),
  54186. (this.alphaMap = e.alphaMap),
  54187. (this.envMap = e.envMap),
  54188. (this.combine = e.combine),
  54189. (this.reflectivity = e.reflectivity),
  54190. (this.refractionRatio = e.refractionRatio),
  54191. (this.fog = e.fog),
  54192. (this.shading = e.shading),
  54193. (this.wireframe = e.wireframe),
  54194. (this.wireframeLinewidth = e.wireframeLinewidth),
  54195. (this.wireframeLinecap = e.wireframeLinecap),
  54196. (this.wireframeLinejoin = e.wireframeLinejoin),
  54197. (this.vertexColors = e.vertexColors),
  54198. (this.skinning = e.skinning),
  54199. (this.morphTargets = e.morphTargets),
  54200. (this.morphNormals = e.morphNormals),
  54201. this
  54202. )
  54203. }),
  54204. (n.MeshStandardMaterial = function (e) {
  54205. n.Material.call(this),
  54206. (this.type = 'MeshStandardMaterial'),
  54207. (this.color = new n.Color(16777215)),
  54208. (this.roughness = 0.5),
  54209. (this.metalness = 0.5),
  54210. (this.map = null),
  54211. (this.lightMap = null),
  54212. (this.lightMapIntensity = 1),
  54213. (this.aoMap = null),
  54214. (this.aoMapIntensity = 1),
  54215. (this.emissive = new n.Color(0)),
  54216. (this.emissiveIntensity = 1),
  54217. (this.emissiveMap = null),
  54218. (this.bumpMap = null),
  54219. (this.bumpScale = 1),
  54220. (this.normalMap = null),
  54221. (this.normalScale = new n.Vector2(1, 1)),
  54222. (this.displacementMap = null),
  54223. (this.displacementScale = 1),
  54224. (this.displacementBias = 0),
  54225. (this.roughnessMap = null),
  54226. (this.metalnessMap = null),
  54227. (this.alphaMap = null),
  54228. (this.envMap = null),
  54229. (this.envMapIntensity = 1),
  54230. (this.refractionRatio = 0.98),
  54231. (this.fog = !0),
  54232. (this.shading = n.SmoothShading),
  54233. (this.blending = n.NormalBlending),
  54234. (this.wireframe = !1),
  54235. (this.wireframeLinewidth = 1),
  54236. (this.wireframeLinecap = 'round'),
  54237. (this.wireframeLinejoin = 'round'),
  54238. (this.vertexColors = n.NoColors),
  54239. (this.skinning = !1),
  54240. (this.morphTargets = !1),
  54241. (this.morphNormals = !1),
  54242. this.setValues(e)
  54243. }),
  54244. (n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype)),
  54245. (n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial),
  54246. (n.MeshStandardMaterial.prototype.copy = function (e) {
  54247. return (
  54248. n.Material.prototype.copy.call(this, e),
  54249. this.color.copy(e.color),
  54250. (this.roughness = e.roughness),
  54251. (this.metalness = e.metalness),
  54252. (this.map = e.map),
  54253. (this.lightMap = e.lightMap),
  54254. (this.lightMapIntensity = e.lightMapIntensity),
  54255. (this.aoMap = e.aoMap),
  54256. (this.aoMapIntensity = e.aoMapIntensity),
  54257. this.emissive.copy(e.emissive),
  54258. (this.emissiveMap = e.emissiveMap),
  54259. (this.emissiveIntensity = e.emissiveIntensity),
  54260. (this.bumpMap = e.bumpMap),
  54261. (this.bumpScale = e.bumpScale),
  54262. (this.normalMap = e.normalMap),
  54263. this.normalScale.copy(e.normalScale),
  54264. (this.displacementMap = e.displacementMap),
  54265. (this.displacementScale = e.displacementScale),
  54266. (this.displacementBias = e.displacementBias),
  54267. (this.roughnessMap = e.roughnessMap),
  54268. (this.metalnessMap = e.metalnessMap),
  54269. (this.alphaMap = e.alphaMap),
  54270. (this.envMap = e.envMap),
  54271. (this.envMapIntensity = e.envMapIntensity),
  54272. (this.refractionRatio = e.refractionRatio),
  54273. (this.fog = e.fog),
  54274. (this.shading = e.shading),
  54275. (this.wireframe = e.wireframe),
  54276. (this.wireframeLinewidth = e.wireframeLinewidth),
  54277. (this.wireframeLinecap = e.wireframeLinecap),
  54278. (this.wireframeLinejoin = e.wireframeLinejoin),
  54279. (this.vertexColors = e.vertexColors),
  54280. (this.skinning = e.skinning),
  54281. (this.morphTargets = e.morphTargets),
  54282. (this.morphNormals = e.morphNormals),
  54283. this
  54284. )
  54285. }),
  54286. (n.MeshDepthMaterial = function (e) {
  54287. n.Material.call(this),
  54288. (this.type = 'MeshDepthMaterial'),
  54289. (this.morphTargets = !1),
  54290. (this.wireframe = !1),
  54291. (this.wireframeLinewidth = 1),
  54292. this.setValues(e)
  54293. }),
  54294. (n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype)),
  54295. (n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial),
  54296. (n.MeshDepthMaterial.prototype.copy = function (e) {
  54297. return (
  54298. n.Material.prototype.copy.call(this, e),
  54299. (this.wireframe = e.wireframe),
  54300. (this.wireframeLinewidth = e.wireframeLinewidth),
  54301. this
  54302. )
  54303. }),
  54304. (n.MeshNormalMaterial = function (e) {
  54305. n.Material.call(this, e),
  54306. (this.type = 'MeshNormalMaterial'),
  54307. (this.wireframe = !1),
  54308. (this.wireframeLinewidth = 1),
  54309. (this.morphTargets = !1),
  54310. this.setValues(e)
  54311. }),
  54312. (n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype)),
  54313. (n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial),
  54314. (n.MeshNormalMaterial.prototype.copy = function (e) {
  54315. return (
  54316. n.Material.prototype.copy.call(this, e),
  54317. (this.wireframe = e.wireframe),
  54318. (this.wireframeLinewidth = e.wireframeLinewidth),
  54319. this
  54320. )
  54321. }),
  54322. (n.MultiMaterial = function (e) {
  54323. ;(this.uuid = n.Math.generateUUID()),
  54324. (this.type = 'MultiMaterial'),
  54325. (this.materials = e instanceof Array ? e : []),
  54326. (this.visible = !0)
  54327. }),
  54328. (n.MultiMaterial.prototype = {
  54329. constructor: n.MultiMaterial,
  54330. toJSON: function (e) {
  54331. for (
  54332. var t = {
  54333. metadata: {
  54334. version: 4.2,
  54335. type: 'material',
  54336. generator: 'MaterialExporter'
  54337. },
  54338. uuid: this.uuid,
  54339. type: this.type,
  54340. materials: []
  54341. },
  54342. i = this.materials,
  54343. n = 0,
  54344. r = i.length;
  54345. n < r;
  54346. n++
  54347. ) {
  54348. var o = i[n].toJSON(e)
  54349. delete o.metadata, t.materials.push(o)
  54350. }
  54351. return (t.visible = this.visible), t
  54352. },
  54353. clone: function () {
  54354. for (var e = new this.constructor(), t = 0; t < this.materials.length; t++)
  54355. e.materials.push(this.materials[t].clone())
  54356. return (e.visible = this.visible), e
  54357. }
  54358. }),
  54359. (n.PointsMaterial = function (e) {
  54360. n.Material.call(this),
  54361. (this.type = 'PointsMaterial'),
  54362. (this.color = new n.Color(16777215)),
  54363. (this.map = null),
  54364. (this.size = 1),
  54365. (this.sizeAttenuation = !0),
  54366. (this.blending = n.NormalBlending),
  54367. (this.vertexColors = n.NoColors),
  54368. (this.fog = !0),
  54369. this.setValues(e)
  54370. }),
  54371. (n.PointsMaterial.prototype = Object.create(n.Material.prototype)),
  54372. (n.PointsMaterial.prototype.constructor = n.PointsMaterial),
  54373. (n.PointsMaterial.prototype.copy = function (e) {
  54374. return (
  54375. n.Material.prototype.copy.call(this, e),
  54376. this.color.copy(e.color),
  54377. (this.map = e.map),
  54378. (this.size = e.size),
  54379. (this.sizeAttenuation = e.sizeAttenuation),
  54380. (this.vertexColors = e.vertexColors),
  54381. (this.fog = e.fog),
  54382. this
  54383. )
  54384. }),
  54385. (n.ShaderMaterial = function (e) {
  54386. n.Material.call(this),
  54387. (this.type = 'ShaderMaterial'),
  54388. (this.defines = {}),
  54389. (this.uniforms = {}),
  54390. (this.vertexShader =
  54391. 'void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}'),
  54392. (this.fragmentShader =
  54393. 'void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}'),
  54394. (this.shading = n.SmoothShading),
  54395. (this.linewidth = 1),
  54396. (this.wireframe = !1),
  54397. (this.wireframeLinewidth = 1),
  54398. (this.fog = !1),
  54399. (this.lights = !1),
  54400. (this.vertexColors = n.NoColors),
  54401. (this.skinning = !1),
  54402. (this.morphTargets = !1),
  54403. (this.morphNormals = !1),
  54404. (this.extensions = {
  54405. derivatives: !1,
  54406. fragDepth: !1,
  54407. drawBuffers: !1,
  54408. shaderTextureLOD: !1
  54409. }),
  54410. (this.defaultAttributeValues = {
  54411. color: [1, 1, 1],
  54412. uv: [0, 0],
  54413. uv2: [0, 0]
  54414. }),
  54415. (this.index0AttributeName = void 0),
  54416. void 0 !== e &&
  54417. (void 0 !== e.attributes &&
  54418. console.error(
  54419. 'THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.'
  54420. ),
  54421. this.setValues(e))
  54422. }),
  54423. (n.ShaderMaterial.prototype = Object.create(n.Material.prototype)),
  54424. (n.ShaderMaterial.prototype.constructor = n.ShaderMaterial),
  54425. (n.ShaderMaterial.prototype.copy = function (e) {
  54426. return (
  54427. n.Material.prototype.copy.call(this, e),
  54428. (this.fragmentShader = e.fragmentShader),
  54429. (this.vertexShader = e.vertexShader),
  54430. (this.uniforms = n.UniformsUtils.clone(e.uniforms)),
  54431. (this.defines = e.defines),
  54432. (this.shading = e.shading),
  54433. (this.wireframe = e.wireframe),
  54434. (this.wireframeLinewidth = e.wireframeLinewidth),
  54435. (this.fog = e.fog),
  54436. (this.lights = e.lights),
  54437. (this.vertexColors = e.vertexColors),
  54438. (this.skinning = e.skinning),
  54439. (this.morphTargets = e.morphTargets),
  54440. (this.morphNormals = e.morphNormals),
  54441. (this.extensions = e.extensions),
  54442. this
  54443. )
  54444. }),
  54445. (n.ShaderMaterial.prototype.toJSON = function (e) {
  54446. var t = n.Material.prototype.toJSON.call(this, e)
  54447. return (
  54448. (t.uniforms = this.uniforms),
  54449. (t.vertexShader = this.vertexShader),
  54450. (t.fragmentShader = this.fragmentShader),
  54451. t
  54452. )
  54453. }),
  54454. (n.RawShaderMaterial = function (e) {
  54455. n.ShaderMaterial.call(this, e), (this.type = 'RawShaderMaterial')
  54456. }),
  54457. (n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype)),
  54458. (n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial),
  54459. (n.SpriteMaterial = function (e) {
  54460. n.Material.call(this),
  54461. (this.type = 'SpriteMaterial'),
  54462. (this.color = new n.Color(16777215)),
  54463. (this.map = null),
  54464. (this.rotation = 0),
  54465. (this.fog = !1),
  54466. this.setValues(e)
  54467. }),
  54468. (n.SpriteMaterial.prototype = Object.create(n.Material.prototype)),
  54469. (n.SpriteMaterial.prototype.constructor = n.SpriteMaterial),
  54470. (n.SpriteMaterial.prototype.copy = function (e) {
  54471. return (
  54472. n.Material.prototype.copy.call(this, e),
  54473. this.color.copy(e.color),
  54474. (this.map = e.map),
  54475. (this.rotation = e.rotation),
  54476. (this.fog = e.fog),
  54477. this
  54478. )
  54479. }),
  54480. (n.Texture = function (e, t, i, r, o, a, s, l, c) {
  54481. Object.defineProperty(this, 'id', {
  54482. value: n.TextureIdCount++
  54483. }),
  54484. (this.uuid = n.Math.generateUUID()),
  54485. (this.name = ''),
  54486. (this.sourceFile = ''),
  54487. (this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE),
  54488. (this.mipmaps = []),
  54489. (this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING),
  54490. (this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping),
  54491. (this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping),
  54492. (this.magFilter = void 0 !== o ? o : n.LinearFilter),
  54493. (this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter),
  54494. (this.anisotropy = void 0 !== c ? c : 1),
  54495. (this.format = void 0 !== s ? s : n.RGBAFormat),
  54496. (this.type = void 0 !== l ? l : n.UnsignedByteType),
  54497. (this.offset = new n.Vector2(0, 0)),
  54498. (this.repeat = new n.Vector2(1, 1)),
  54499. (this.generateMipmaps = !0),
  54500. (this.premultiplyAlpha = !1),
  54501. (this.flipY = !0),
  54502. (this.unpackAlignment = 4),
  54503. (this.encoding = n.LinearEncoding),
  54504. (this.version = 0),
  54505. (this.onUpdate = null)
  54506. }),
  54507. (n.Texture.DEFAULT_IMAGE = void 0),
  54508. (n.Texture.DEFAULT_MAPPING = n.UVMapping),
  54509. (n.Texture.prototype = {
  54510. constructor: n.Texture,
  54511. set needsUpdate(e) {
  54512. e === !0 && this.version++
  54513. },
  54514. clone: function () {
  54515. return new this.constructor().copy(this)
  54516. },
  54517. copy: function (e) {
  54518. return (
  54519. (this.image = e.image),
  54520. (this.mipmaps = e.mipmaps.slice(0)),
  54521. (this.mapping = e.mapping),
  54522. (this.wrapS = e.wrapS),
  54523. (this.wrapT = e.wrapT),
  54524. (this.magFilter = e.magFilter),
  54525. (this.minFilter = e.minFilter),
  54526. (this.anisotropy = e.anisotropy),
  54527. (this.format = e.format),
  54528. (this.type = e.type),
  54529. this.offset.copy(e.offset),
  54530. this.repeat.copy(e.repeat),
  54531. (this.generateMipmaps = e.generateMipmaps),
  54532. (this.premultiplyAlpha = e.premultiplyAlpha),
  54533. (this.flipY = e.flipY),
  54534. (this.unpackAlignment = e.unpackAlignment),
  54535. (this.encoding = e.encoding),
  54536. this
  54537. )
  54538. },
  54539. toJSON: function (e) {
  54540. function t(e) {
  54541. var t
  54542. return (
  54543. void 0 !== e.toDataURL
  54544. ? (t = e)
  54545. : ((t = document.createElement('canvas')),
  54546. (t.width = e.width),
  54547. (t.height = e.height),
  54548. t.getContext('2d').drawImage(e, 0, 0, e.width, e.height)),
  54549. t.width > 2048 || t.height > 2048
  54550. ? t.toDataURL('image/jpeg', 0.6)
  54551. : t.toDataURL('image/png')
  54552. )
  54553. }
  54554. if (void 0 !== e.textures[this.uuid]) return e.textures[this.uuid]
  54555. var i = {
  54556. metadata: {
  54557. version: 4.4,
  54558. type: 'Texture',
  54559. generator: 'Texture.toJSON'
  54560. },
  54561. uuid: this.uuid,
  54562. name: this.name,
  54563. mapping: this.mapping,
  54564. repeat: [this.repeat.x, this.repeat.y],
  54565. offset: [this.offset.x, this.offset.y],
  54566. wrap: [this.wrapS, this.wrapT],
  54567. minFilter: this.minFilter,
  54568. magFilter: this.magFilter,
  54569. anisotropy: this.anisotropy
  54570. }
  54571. if (void 0 !== this.image) {
  54572. var r = this.image
  54573. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  54574. void 0 === e.images[r.uuid] &&
  54575. (e.images[r.uuid] = {
  54576. uuid: r.uuid,
  54577. url: t(r)
  54578. }),
  54579. (i.image = r.uuid)
  54580. }
  54581. return (e.textures[this.uuid] = i), i
  54582. },
  54583. dispose: function () {
  54584. this.dispatchEvent({
  54585. type: 'dispose'
  54586. })
  54587. },
  54588. transformUv: function (e) {
  54589. if (this.mapping === n.UVMapping) {
  54590. if ((e.multiply(this.repeat), e.add(this.offset), e.x < 0 || e.x > 1))
  54591. switch (this.wrapS) {
  54592. case n.RepeatWrapping:
  54593. e.x = e.x - Math.floor(e.x)
  54594. break
  54595. case n.ClampToEdgeWrapping:
  54596. e.x = e.x < 0 ? 0 : 1
  54597. break
  54598. case n.MirroredRepeatWrapping:
  54599. 1 === Math.abs(Math.floor(e.x) % 2)
  54600. ? (e.x = Math.ceil(e.x) - e.x)
  54601. : (e.x = e.x - Math.floor(e.x))
  54602. }
  54603. if (e.y < 0 || e.y > 1)
  54604. switch (this.wrapT) {
  54605. case n.RepeatWrapping:
  54606. e.y = e.y - Math.floor(e.y)
  54607. break
  54608. case n.ClampToEdgeWrapping:
  54609. e.y = e.y < 0 ? 0 : 1
  54610. break
  54611. case n.MirroredRepeatWrapping:
  54612. 1 === Math.abs(Math.floor(e.y) % 2)
  54613. ? (e.y = Math.ceil(e.y) - e.y)
  54614. : (e.y = e.y - Math.floor(e.y))
  54615. }
  54616. this.flipY && (e.y = 1 - e.y)
  54617. }
  54618. }
  54619. }),
  54620. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  54621. (n.TextureIdCount = 0),
  54622. (n.CanvasTexture = function (e, t, i, r, o, a, s, l, c) {
  54623. n.Texture.call(this, e, t, i, r, o, a, s, l, c), (this.needsUpdate = !0)
  54624. }),
  54625. (n.CanvasTexture.prototype = Object.create(n.Texture.prototype)),
  54626. (n.CanvasTexture.prototype.constructor = n.CanvasTexture),
  54627. (n.CubeTexture = function (e, t, i, r, o, a, s, l, c) {
  54628. ;(e = void 0 !== e ? e : []),
  54629. (t = void 0 !== t ? t : n.CubeReflectionMapping),
  54630. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  54631. (this.flipY = !1)
  54632. }),
  54633. (n.CubeTexture.prototype = Object.create(n.Texture.prototype)),
  54634. (n.CubeTexture.prototype.constructor = n.CubeTexture),
  54635. Object.defineProperty(n.CubeTexture.prototype, 'images', {
  54636. get: function () {
  54637. return this.image
  54638. },
  54639. set: function (e) {
  54640. this.image = e
  54641. }
  54642. }),
  54643. (n.CompressedTexture = function (e, t, i, r, o, a, s, l, c, h, u) {
  54644. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  54645. (this.image = {
  54646. width: t,
  54647. height: i
  54648. }),
  54649. (this.mipmaps = e),
  54650. (this.flipY = !1),
  54651. (this.generateMipmaps = !1)
  54652. }),
  54653. (n.CompressedTexture.prototype = Object.create(n.Texture.prototype)),
  54654. (n.CompressedTexture.prototype.constructor = n.CompressedTexture),
  54655. (n.DataTexture = function (e, t, i, r, o, a, s, l, c, h, u) {
  54656. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  54657. (this.image = {
  54658. data: e,
  54659. width: t,
  54660. height: i
  54661. }),
  54662. (this.magFilter = void 0 !== c ? c : n.NearestFilter),
  54663. (this.minFilter = void 0 !== h ? h : n.NearestFilter),
  54664. (this.flipY = !1),
  54665. (this.generateMipmaps = !1)
  54666. }),
  54667. (n.DataTexture.prototype = Object.create(n.Texture.prototype)),
  54668. (n.DataTexture.prototype.constructor = n.DataTexture),
  54669. (n.VideoTexture = function (e, t, i, r, o, a, s, l, c) {
  54670. function h() {
  54671. requestAnimationFrame(h)
  54672. if (!e.paused && e.readyState === e.HAVE_ENOUGH_DATA) {
  54673. //改 add !e.paused
  54674. u.needsUpdate = !0
  54675. }
  54676. }
  54677. n.Texture.call(this, e, t, i, r, o, a, s, l, c), (this.generateMipmaps = !1)
  54678. var u = this
  54679. h()
  54680. }),
  54681. (n.VideoTexture.prototype = Object.create(n.Texture.prototype)),
  54682. (n.VideoTexture.prototype.constructor = n.VideoTexture),
  54683. (n.Group = function () {
  54684. n.Object3D.call(this), (this.type = 'Group')
  54685. }),
  54686. (n.Group.prototype = Object.create(n.Object3D.prototype)),
  54687. (n.Group.prototype.constructor = n.Group),
  54688. (n.Points = function (e, t) {
  54689. n.Object3D.call(this),
  54690. (this.type = 'Points'),
  54691. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  54692. (this.material =
  54693. void 0 !== t
  54694. ? t
  54695. : new n.PointsMaterial({
  54696. color: 16777215 * Math.random()
  54697. }))
  54698. }),
  54699. (n.Points.prototype = Object.create(n.Object3D.prototype)),
  54700. (n.Points.prototype.constructor = n.Points),
  54701. (n.Points.prototype.raycast = (function () {
  54702. var e = new n.Matrix4(),
  54703. t = new n.Ray(),
  54704. i = new n.Sphere()
  54705. return function (r, o) {
  54706. function a(e, i) {
  54707. var n = t.distanceSqToPoint(e)
  54708. if (n < d) {
  54709. var a = t.closestPointToPoint(e)
  54710. a.applyMatrix4(c)
  54711. var l = r.ray.origin.distanceTo(a)
  54712. if (l < r.near || l > r.far) return
  54713. o.push({
  54714. distance: l,
  54715. distanceToRay: Math.sqrt(n),
  54716. point: a.clone(),
  54717. index: i,
  54718. face: null,
  54719. object: s
  54720. })
  54721. }
  54722. }
  54723. var s = this,
  54724. l = this.geometry,
  54725. c = this.matrixWorld,
  54726. h = r.params.Points.threshold
  54727. if (
  54728. (null === l.boundingSphere && l.computeBoundingSphere(),
  54729. i.copy(l.boundingSphere),
  54730. i.applyMatrix4(c),
  54731. r.ray.intersectsSphere(i) !== !1)
  54732. ) {
  54733. e.getInverse(c), t.copy(r.ray).applyMatrix4(e)
  54734. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3),
  54735. d = u * u,
  54736. p = new n.Vector3()
  54737. if (l instanceof n.BufferGeometry) {
  54738. var f = l.index,
  54739. g = l.attributes,
  54740. m = g.position.array
  54741. if (null !== f)
  54742. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  54743. var C = v[A]
  54744. p.fromArray(m, 3 * C), a(p, C)
  54745. }
  54746. else for (var A = 0, I = m.length / 3; A < I; A++) p.fromArray(m, 3 * A), a(p, A)
  54747. } else for (var E = l.vertices, A = 0, I = E.length; A < I; A++) a(E[A], A)
  54748. }
  54749. }
  54750. })()),
  54751. (n.Points.prototype.clone = function () {
  54752. return new this.constructor(this.geometry, this.material).copy(this)
  54753. }),
  54754. (n.Line = function (e, t, i) {
  54755. return 1 === i
  54756. ? (console.warn(
  54757. 'THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead.'
  54758. ),
  54759. new n.LineSegments(e, t))
  54760. : (n.Object3D.call(this),
  54761. (this.type = 'Line'),
  54762. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  54763. void (this.material =
  54764. void 0 !== t
  54765. ? t
  54766. : new n.LineBasicMaterial({
  54767. color: 16777215 * Math.random()
  54768. })))
  54769. }),
  54770. (n.Line.prototype = Object.create(n.Object3D.prototype)),
  54771. (n.Line.prototype.constructor = n.Line),
  54772. (n.Line.prototype.raycast = (function () {
  54773. var e = new n.Matrix4(),
  54774. t = new n.Ray(),
  54775. i = new n.Sphere()
  54776. return function (r, o) {
  54777. var a = r.linePrecision,
  54778. s = a * a,
  54779. l = this.geometry,
  54780. c = this.matrixWorld
  54781. if (
  54782. (null === l.boundingSphere && l.computeBoundingSphere(),
  54783. i.copy(l.boundingSphere),
  54784. i.applyMatrix4(c),
  54785. r.ray.intersectsSphere(i) !== !1)
  54786. ) {
  54787. e.getInverse(c), t.copy(r.ray).applyMatrix4(e)
  54788. var h = new n.Vector3(),
  54789. u = new n.Vector3(),
  54790. d = new n.Vector3(),
  54791. p = new n.Vector3(),
  54792. f = this instanceof n.LineSegments ? 2 : 1
  54793. if (l instanceof n.BufferGeometry) {
  54794. var g = l.index,
  54795. m = l.attributes,
  54796. v = m.position.array
  54797. if (null !== g)
  54798. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  54799. var I = A[y],
  54800. E = A[y + 1]
  54801. h.fromArray(v, 3 * I), u.fromArray(v, 3 * E)
  54802. var b = t.distanceSqToSegment(h, u, p, d)
  54803. if (!(b > s)) {
  54804. p.applyMatrix4(this.matrixWorld)
  54805. var w = r.ray.origin.distanceTo(p)
  54806. w < r.near ||
  54807. w > r.far ||
  54808. o.push({
  54809. distance: w,
  54810. point: d.clone().applyMatrix4(this.matrixWorld),
  54811. index: y,
  54812. face: null,
  54813. faceIndex: null,
  54814. object: this
  54815. })
  54816. }
  54817. }
  54818. else
  54819. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  54820. h.fromArray(v, 3 * y), u.fromArray(v, 3 * y + 3)
  54821. var b = t.distanceSqToSegment(h, u, p, d)
  54822. if (!(b > s)) {
  54823. p.applyMatrix4(this.matrixWorld)
  54824. var w = r.ray.origin.distanceTo(p)
  54825. w < r.near ||
  54826. w > r.far ||
  54827. o.push({
  54828. distance: w,
  54829. point: d.clone().applyMatrix4(this.matrixWorld),
  54830. index: y,
  54831. face: null,
  54832. faceIndex: null,
  54833. object: this
  54834. })
  54835. }
  54836. }
  54837. } else if (l instanceof n.Geometry)
  54838. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  54839. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d)
  54840. if (!(b > s)) {
  54841. p.applyMatrix4(this.matrixWorld)
  54842. var w = r.ray.origin.distanceTo(p)
  54843. w < r.near ||
  54844. w > r.far ||
  54845. o.push({
  54846. distance: w,
  54847. point: d.clone().applyMatrix4(this.matrixWorld),
  54848. index: y,
  54849. face: null,
  54850. faceIndex: null,
  54851. object: this
  54852. })
  54853. }
  54854. }
  54855. }
  54856. }
  54857. })()),
  54858. (n.Line.prototype.clone = function () {
  54859. return new this.constructor(this.geometry, this.material).copy(this)
  54860. }),
  54861. (n.LineStrip = 0),
  54862. (n.LinePieces = 1),
  54863. (n.LineSegments = function (e, t) {
  54864. n.Line.call(this, e, t), (this.type = 'LineSegments')
  54865. }),
  54866. (n.LineSegments.prototype = Object.create(n.Line.prototype)),
  54867. (n.LineSegments.prototype.constructor = n.LineSegments),
  54868. (n.Mesh = function (e, t) {
  54869. n.Object3D.call(this),
  54870. (this.type = 'Mesh'),
  54871. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  54872. (this.material =
  54873. void 0 !== t
  54874. ? t
  54875. : new n.MeshBasicMaterial({
  54876. color: 16777215 * Math.random()
  54877. })),
  54878. (this.drawMode = n.TrianglesDrawMode),
  54879. this.updateMorphTargets()
  54880. }),
  54881. (n.Mesh.prototype = Object.create(n.Object3D.prototype)),
  54882. (n.Mesh.prototype.constructor = n.Mesh),
  54883. (n.Mesh.prototype.setDrawMode = function (e) {
  54884. this.drawMode = e
  54885. }),
  54886. (n.Mesh.prototype.updateMorphTargets = function () {
  54887. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  54888. ;(this.morphTargetBase = -1),
  54889. (this.morphTargetInfluences = []),
  54890. (this.morphTargetDictionary = {})
  54891. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  54892. this.morphTargetInfluences.push(0),
  54893. (this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e)
  54894. }
  54895. }),
  54896. (n.Mesh.prototype.getMorphTargetIndexByName = function (e) {
  54897. return void 0 !== this.morphTargetDictionary[e]
  54898. ? this.morphTargetDictionary[e]
  54899. : (console.warn(
  54900. 'THREE.Mesh.getMorphTargetIndexByName: morph target ' +
  54901. e +
  54902. ' does not exist. Returning 0.'
  54903. ),
  54904. 0)
  54905. }),
  54906. (n.Mesh.prototype.raycast = (function () {
  54907. function e(e, t, i, r, o, a, s) {
  54908. return (
  54909. n.Triangle.barycoordFromPoint(e, t, i, r, m),
  54910. o.multiplyScalar(m.x),
  54911. a.multiplyScalar(m.y),
  54912. s.multiplyScalar(m.z),
  54913. o.add(a).add(s),
  54914. o.clone()
  54915. )
  54916. }
  54917. function t(e, t, i, r, o, a, s) {
  54918. var l,
  54919. c = e.material
  54920. if (
  54921. ((l =
  54922. c.side === n.BackSide
  54923. ? i.intersectTriangle(a, o, r, !0, s)
  54924. : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s)),
  54925. null === l)
  54926. )
  54927. return null
  54928. A.copy(s), A.applyMatrix4(e.matrixWorld)
  54929. var h = t.ray.origin.distanceTo(A)
  54930. return h < t.near || h > t.far
  54931. ? null
  54932. : {
  54933. distance: h,
  54934. point: A.clone(),
  54935. object: e
  54936. }
  54937. }
  54938. function i(i, r, o, a, h, u, d, m) {
  54939. s.fromArray(a, 3 * u), l.fromArray(a, 3 * d), c.fromArray(a, 3 * m)
  54940. var A = t(i, r, o, s, l, c, v)
  54941. return (
  54942. A &&
  54943. (h &&
  54944. (p.fromArray(h, 2 * u),
  54945. f.fromArray(h, 2 * d),
  54946. g.fromArray(h, 2 * m),
  54947. (A.uv = e(v, s, l, c, p, f, g))),
  54948. (A.face = new n.Face3(u, d, m, n.Triangle.normal(s, l, c))),
  54949. (A.faceIndex = u)),
  54950. A
  54951. )
  54952. }
  54953. var r = new n.Matrix4(),
  54954. o = new n.Ray(),
  54955. a = new n.Sphere(),
  54956. s = new n.Vector3(),
  54957. l = new n.Vector3(),
  54958. c = new n.Vector3(),
  54959. h = new n.Vector3(),
  54960. u = new n.Vector3(),
  54961. d = new n.Vector3(),
  54962. p = new n.Vector2(),
  54963. f = new n.Vector2(),
  54964. g = new n.Vector2(),
  54965. m = new n.Vector3(),
  54966. v = new n.Vector3(),
  54967. A = new n.Vector3()
  54968. return function (m, A) {
  54969. var y = this.geometry,
  54970. C = this.material,
  54971. I = this.matrixWorld
  54972. if (
  54973. void 0 !== C &&
  54974. (null === y.boundingSphere && y.computeBoundingSphere(),
  54975. a.copy(y.boundingSphere),
  54976. a.applyMatrix4(I),
  54977. m.ray.intersectsSphere(a) !== !1 &&
  54978. (r.getInverse(I),
  54979. o.copy(m.ray).applyMatrix4(r),
  54980. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))
  54981. ) {
  54982. var E, b
  54983. if (y instanceof n.BufferGeometry) {
  54984. var w,
  54985. _,
  54986. T,
  54987. x = y.index,
  54988. S = y.attributes,
  54989. M = S.position.array
  54990. if ((void 0 !== S.uv && (E = S.uv.array), null !== x))
  54991. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  54992. (w = R[P]),
  54993. (_ = R[P + 1]),
  54994. (T = R[P + 2]),
  54995. (b = i(this, m, o, M, E, w, _, T)),
  54996. b && ((b.faceIndex = Math.floor(P / 3)), A.push(b))
  54997. else
  54998. for (var P = 0, O = M.length; P < O; P += 9)
  54999. (w = P / 3),
  55000. (_ = w + 1),
  55001. (T = w + 2),
  55002. (b = i(this, m, o, M, E, w, _, T)),
  55003. b && ((b.index = w), A.push(b))
  55004. } else if (y instanceof n.Geometry) {
  55005. var L,
  55006. D,
  55007. N,
  55008. B = C instanceof n.MultiMaterial,
  55009. F = B === !0 ? C.materials : null,
  55010. V = y.vertices,
  55011. U = y.faces,
  55012. k = y.faceVertexUvs[0]
  55013. k.length > 0 && (E = k)
  55014. for (var H = 0, G = U.length; H < G; H++) {
  55015. var z = U[H],
  55016. W = B === !0 ? F[z.materialIndex] : C
  55017. if (void 0 !== W) {
  55018. if (((L = V[z.a]), (D = V[z.b]), (N = V[z.c]), W.morphTargets === !0)) {
  55019. var j = y.morphTargets,
  55020. Y = this.morphTargetInfluences
  55021. s.set(0, 0, 0), l.set(0, 0, 0), c.set(0, 0, 0)
  55022. for (var X = 0, Z = j.length; X < Z; X++) {
  55023. var q = Y[X]
  55024. if (0 !== q) {
  55025. var K = j[X].vertices
  55026. s.addScaledVector(h.subVectors(K[z.a], L), q),
  55027. l.addScaledVector(u.subVectors(K[z.b], D), q),
  55028. c.addScaledVector(d.subVectors(K[z.c], N), q)
  55029. }
  55030. }
  55031. s.add(L), l.add(D), c.add(N), (L = s), (D = l), (N = c)
  55032. }
  55033. if ((b = t(this, m, o, L, D, N, v))) {
  55034. if (E) {
  55035. var Q = E[H]
  55036. p.copy(Q[0]), f.copy(Q[1]), g.copy(Q[2]), (b.uv = e(v, L, D, N, p, f, g))
  55037. }
  55038. ;(b.face = z), (b.faceIndex = H), A.push(b)
  55039. }
  55040. }
  55041. }
  55042. }
  55043. }
  55044. }
  55045. })()),
  55046. (n.Mesh.prototype.clone = function () {
  55047. return new this.constructor(this.geometry, this.material).copy(this)
  55048. }),
  55049. (n.Bone = function (e) {
  55050. n.Object3D.call(this), (this.type = 'Bone'), (this.skin = e)
  55051. }),
  55052. (n.Bone.prototype = Object.create(n.Object3D.prototype)),
  55053. (n.Bone.prototype.constructor = n.Bone),
  55054. (n.Bone.prototype.copy = function (e) {
  55055. return n.Object3D.prototype.copy.call(this, e), (this.skin = e.skin), this
  55056. }),
  55057. (n.Skeleton = function (e, t, i) {
  55058. if (
  55059. ((this.useVertexTexture = void 0 === i || i),
  55060. (this.identityMatrix = new n.Matrix4()),
  55061. (e = e || []),
  55062. (this.bones = e.slice(0)),
  55063. this.useVertexTexture)
  55064. ) {
  55065. var r = Math.sqrt(4 * this.bones.length)
  55066. ;(r = n.Math.nextPowerOfTwo(Math.ceil(r))),
  55067. (r = Math.max(r, 4)),
  55068. (this.boneTextureWidth = r),
  55069. (this.boneTextureHeight = r),
  55070. (this.boneMatrices = new Float32Array(
  55071. this.boneTextureWidth * this.boneTextureHeight * 4
  55072. )),
  55073. (this.boneTexture = new n.DataTexture(
  55074. this.boneMatrices,
  55075. this.boneTextureWidth,
  55076. this.boneTextureHeight,
  55077. n.RGBAFormat,
  55078. n.FloatType
  55079. ))
  55080. } else this.boneMatrices = new Float32Array(16 * this.bones.length)
  55081. if (void 0 === t) this.calculateInverses()
  55082. else if (this.bones.length === t.length) this.boneInverses = t.slice(0)
  55083. else {
  55084. console.warn('THREE.Skeleton bonInverses is the wrong length.'),
  55085. (this.boneInverses = [])
  55086. for (var o = 0, a = this.bones.length; o < a; o++)
  55087. this.boneInverses.push(new n.Matrix4())
  55088. }
  55089. }),
  55090. (n.Skeleton.prototype.calculateInverses = function () {
  55091. this.boneInverses = []
  55092. for (var e = 0, t = this.bones.length; e < t; e++) {
  55093. var i = new n.Matrix4()
  55094. this.bones[e] && i.getInverse(this.bones[e].matrixWorld), this.boneInverses.push(i)
  55095. }
  55096. }),
  55097. (n.Skeleton.prototype.pose = function () {
  55098. for (var e, t = 0, i = this.bones.length; t < i; t++)
  55099. (e = this.bones[t]), e && e.matrixWorld.getInverse(this.boneInverses[t])
  55100. for (var t = 0, i = this.bones.length; t < i; t++)
  55101. (e = this.bones[t]),
  55102. e &&
  55103. (e.parent
  55104. ? (e.matrix.getInverse(e.parent.matrixWorld), e.matrix.multiply(e.matrixWorld))
  55105. : e.matrix.copy(e.matrixWorld),
  55106. e.matrix.decompose(e.position, e.quaternion, e.scale))
  55107. }),
  55108. (n.Skeleton.prototype.update = (function () {
  55109. var e = new n.Matrix4()
  55110. return function () {
  55111. for (var t = 0, i = this.bones.length; t < i; t++) {
  55112. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix
  55113. e.multiplyMatrices(n, this.boneInverses[t]),
  55114. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  55115. }
  55116. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  55117. }
  55118. })()),
  55119. (n.Skeleton.prototype.clone = function () {
  55120. return new n.Skeleton(this.bones, this.boneInverses, this.useVertexTexture)
  55121. }),
  55122. (n.SkinnedMesh = function (e, t, i) {
  55123. n.Mesh.call(this, e, t),
  55124. (this.type = 'SkinnedMesh'),
  55125. (this.bindMode = 'attached'),
  55126. (this.bindMatrix = new n.Matrix4()),
  55127. (this.bindMatrixInverse = new n.Matrix4())
  55128. var r = []
  55129. if (this.geometry && void 0 !== this.geometry.bones) {
  55130. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  55131. (a = this.geometry.bones[s]),
  55132. (o = new n.Bone(this)),
  55133. r.push(o),
  55134. (o.name = a.name),
  55135. o.position.fromArray(a.pos),
  55136. o.quaternion.fromArray(a.rotq),
  55137. void 0 !== a.scl && o.scale.fromArray(a.scl)
  55138. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  55139. (a = this.geometry.bones[s]),
  55140. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  55141. }
  55142. this.normalizeSkinWeights(),
  55143. this.updateMatrixWorld(!0),
  55144. this.bind(new n.Skeleton(r, void 0, i), this.matrixWorld)
  55145. }),
  55146. (n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype)),
  55147. (n.SkinnedMesh.prototype.constructor = n.SkinnedMesh),
  55148. (n.SkinnedMesh.prototype.bind = function (e, t) {
  55149. ;(this.skeleton = e),
  55150. void 0 === t &&
  55151. (this.updateMatrixWorld(!0),
  55152. this.skeleton.calculateInverses(),
  55153. (t = this.matrixWorld)),
  55154. this.bindMatrix.copy(t),
  55155. this.bindMatrixInverse.getInverse(t)
  55156. }),
  55157. (n.SkinnedMesh.prototype.pose = function () {
  55158. this.skeleton.pose()
  55159. }),
  55160. (n.SkinnedMesh.prototype.normalizeSkinWeights = function () {
  55161. if (this.geometry instanceof n.Geometry)
  55162. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  55163. var t = this.geometry.skinWeights[e],
  55164. i = 1 / t.lengthManhattan()
  55165. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  55166. }
  55167. else if (this.geometry instanceof n.BufferGeometry)
  55168. for (
  55169. var r = new n.Vector4(), o = this.geometry.attributes.skinWeight, e = 0;
  55170. e < o.count;
  55171. e++
  55172. ) {
  55173. ;(r.x = o.getX(e)), (r.y = o.getY(e)), (r.z = o.getZ(e)), (r.w = o.getW(e))
  55174. var i = 1 / r.lengthManhattan()
  55175. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  55176. o.setXYZW(e, r.x, r.y, r.z, r.w)
  55177. }
  55178. }),
  55179. (n.SkinnedMesh.prototype.updateMatrixWorld = function (e) {
  55180. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  55181. 'attached' === this.bindMode
  55182. ? this.bindMatrixInverse.getInverse(this.matrixWorld)
  55183. : 'detached' === this.bindMode
  55184. ? this.bindMatrixInverse.getInverse(this.bindMatrix)
  55185. : console.warn('THREE.SkinnedMesh unrecognized bindMode: ' + this.bindMode)
  55186. }),
  55187. (n.SkinnedMesh.prototype.clone = function () {
  55188. return new this.constructor(this.geometry, this.material, this.useVertexTexture).copy(
  55189. this
  55190. )
  55191. }),
  55192. (n.LOD = function () {
  55193. n.Object3D.call(this),
  55194. (this.type = 'LOD'),
  55195. Object.defineProperties(this, {
  55196. levels: {
  55197. enumerable: !0,
  55198. value: []
  55199. },
  55200. objects: {
  55201. get: function () {
  55202. return (
  55203. console.warn('THREE.LOD: .objects has been renamed to .levels.'), this.levels
  55204. )
  55205. }
  55206. }
  55207. })
  55208. }),
  55209. (n.LOD.prototype = Object.create(n.Object3D.prototype)),
  55210. (n.LOD.prototype.constructor = n.LOD),
  55211. (n.LOD.prototype.addLevel = function (e, t) {
  55212. void 0 === t && (t = 0), (t = Math.abs(t))
  55213. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++);
  55214. i.splice(n, 0, {
  55215. distance: t,
  55216. object: e
  55217. }),
  55218. this.add(e)
  55219. }),
  55220. (n.LOD.prototype.getObjectForDistance = function (e) {
  55221. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++);
  55222. return t[i - 1].object
  55223. }),
  55224. (n.LOD.prototype.raycast = (function () {
  55225. var e = new n.Vector3()
  55226. return function (t, i) {
  55227. e.setFromMatrixPosition(this.matrixWorld)
  55228. var n = t.ray.origin.distanceTo(e)
  55229. this.getObjectForDistance(n).raycast(t, i)
  55230. }
  55231. })()),
  55232. (n.LOD.prototype.update = (function () {
  55233. var e = new n.Vector3(),
  55234. t = new n.Vector3()
  55235. return function (i) {
  55236. var n = this.levels
  55237. if (n.length > 1) {
  55238. e.setFromMatrixPosition(i.matrixWorld), t.setFromMatrixPosition(this.matrixWorld)
  55239. var r = e.distanceTo(t)
  55240. n[0].object.visible = !0
  55241. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  55242. (n[o - 1].object.visible = !1), (n[o].object.visible = !0)
  55243. for (; o < a; o++) n[o].object.visible = !1
  55244. }
  55245. }
  55246. })()),
  55247. (n.LOD.prototype.copy = function (e) {
  55248. n.Object3D.prototype.copy.call(this, e, !1)
  55249. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  55250. var o = t[i]
  55251. this.addLevel(o.object.clone(), o.distance)
  55252. }
  55253. return this
  55254. }),
  55255. (n.LOD.prototype.toJSON = function (e) {
  55256. var t = n.Object3D.prototype.toJSON.call(this, e)
  55257. t.object.levels = []
  55258. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  55259. var a = i[r]
  55260. t.object.levels.push({
  55261. object: a.object.uuid,
  55262. distance: a.distance
  55263. })
  55264. }
  55265. return t
  55266. }),
  55267. (n.Sprite = (function () {
  55268. var e = new Uint16Array([0, 1, 2, 0, 2, 3]),
  55269. t = new Float32Array([-0.5, -0.5, 0, 0.5, -0.5, 0, 0.5, 0.5, 0, -0.5, 0.5, 0]),
  55270. i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  55271. r = new n.BufferGeometry()
  55272. return (
  55273. r.setIndex(new n.BufferAttribute(e, 1)),
  55274. r.addAttribute('position', new n.BufferAttribute(t, 3)),
  55275. r.addAttribute('uv', new n.BufferAttribute(i, 2)),
  55276. function (e) {
  55277. n.Object3D.call(this),
  55278. (this.type = 'Sprite'),
  55279. (this.geometry = r),
  55280. (this.material = void 0 !== e ? e : new n.SpriteMaterial())
  55281. }
  55282. )
  55283. })()),
  55284. (n.Sprite.prototype = Object.create(n.Object3D.prototype)),
  55285. (n.Sprite.prototype.constructor = n.Sprite),
  55286. (n.Sprite.prototype.raycast = (function () {
  55287. var e = new n.Vector3()
  55288. return function (t, i) {
  55289. e.setFromMatrixPosition(this.matrixWorld)
  55290. var n = t.ray.distanceSqToPoint(e),
  55291. r = this.scale.x * this.scale.y
  55292. n > r ||
  55293. i.push({
  55294. distance: Math.sqrt(n),
  55295. point: this.position,
  55296. face: null,
  55297. object: this
  55298. })
  55299. }
  55300. })()),
  55301. (n.Sprite.prototype.clone = function () {
  55302. return new this.constructor(this.material).copy(this)
  55303. }),
  55304. (n.Particle = n.Sprite),
  55305. (n.LensFlare = function (e, t, i, r, o) {
  55306. n.Object3D.call(this),
  55307. (this.lensFlares = []),
  55308. (this.positionScreen = new n.Vector3()),
  55309. (this.customUpdateCallback = void 0),
  55310. void 0 !== e && this.add(e, t, i, r, o)
  55311. }),
  55312. (n.LensFlare.prototype = Object.create(n.Object3D.prototype)),
  55313. (n.LensFlare.prototype.constructor = n.LensFlare),
  55314. (n.LensFlare.prototype.add = function (e, t, i, r, o, a) {
  55315. void 0 === t && (t = -1),
  55316. void 0 === i && (i = 0),
  55317. void 0 === a && (a = 1),
  55318. void 0 === o && (o = new n.Color(16777215)),
  55319. void 0 === r && (r = n.NormalBlending),
  55320. (i = Math.min(i, Math.max(0, i))),
  55321. this.lensFlares.push({
  55322. texture: e,
  55323. size: t,
  55324. distance: i,
  55325. x: 0,
  55326. y: 0,
  55327. z: 0,
  55328. scale: 1,
  55329. rotation: 0,
  55330. opacity: a,
  55331. color: o,
  55332. blending: r
  55333. })
  55334. }),
  55335. (n.LensFlare.prototype.updateLensFlares = function () {
  55336. var e,
  55337. t,
  55338. i = this.lensFlares.length,
  55339. n = 2 * -this.positionScreen.x,
  55340. r = 2 * -this.positionScreen.y
  55341. for (e = 0; e < i; e++)
  55342. (t = this.lensFlares[e]),
  55343. (t.x = this.positionScreen.x + n * t.distance),
  55344. (t.y = this.positionScreen.y + r * t.distance),
  55345. (t.wantedRotation = t.x * Math.PI * 0.25),
  55346. (t.rotation += 0.25 * (t.wantedRotation - t.rotation))
  55347. }),
  55348. (n.LensFlare.prototype.copy = function (e) {
  55349. n.Object3D.prototype.copy.call(this, e),
  55350. this.positionScreen.copy(e.positionScreen),
  55351. (this.customUpdateCallback = e.customUpdateCallback)
  55352. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  55353. this.lensFlares.push(e.lensFlares[t])
  55354. return this
  55355. }),
  55356. (n.Scene = function () {
  55357. n.Object3D.call(this),
  55358. (this.type = 'Scene'),
  55359. (this.fog = null),
  55360. (this.overrideMaterial = null),
  55361. (this.autoUpdate = !0)
  55362. }),
  55363. (n.Scene.prototype = Object.create(n.Object3D.prototype)),
  55364. (n.Scene.prototype.constructor = n.Scene),
  55365. (n.Scene.prototype.copy = function (e, t) {
  55366. return (
  55367. n.Object3D.prototype.copy.call(this, e, t),
  55368. null !== e.fog && (this.fog = e.fog.clone()),
  55369. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  55370. (this.autoUpdate = e.autoUpdate),
  55371. (this.matrixAutoUpdate = e.matrixAutoUpdate),
  55372. this
  55373. )
  55374. }),
  55375. (n.Fog = function (e, t, i) {
  55376. ;(this.name = ''),
  55377. (this.color = new n.Color(e)),
  55378. (this.near = void 0 !== t ? t : 1),
  55379. (this.far = void 0 !== i ? i : 1e3)
  55380. }),
  55381. (n.Fog.prototype.clone = function () {
  55382. return new n.Fog(this.color.getHex(), this.near, this.far)
  55383. }),
  55384. (n.FogExp2 = function (e, t) {
  55385. ;(this.name = ''),
  55386. (this.color = new n.Color(e)),
  55387. (this.density = void 0 !== t ? t : 25e-5)
  55388. }),
  55389. (n.FogExp2.prototype.clone = function () {
  55390. return new n.FogExp2(this.color.getHex(), this.density)
  55391. }),
  55392. (n.ShaderChunk = {}),
  55393. (n.ShaderChunk.alphamap_fragment =
  55394. '#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n'),
  55395. (n.ShaderChunk.alphamap_pars_fragment =
  55396. '#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n'),
  55397. (n.ShaderChunk.alphatest_fragment =
  55398. '#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n'),
  55399. (n.ShaderChunk.aomap_fragment =
  55400. '#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'),
  55401. (n.ShaderChunk.aomap_pars_fragment =
  55402. '#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif'),
  55403. (n.ShaderChunk.begin_vertex = '\nvec3 transformed = vec3( position );\n'),
  55404. (n.ShaderChunk.beginnormal_vertex = '\nvec3 objectNormal = vec3( normal );\n'),
  55405. (n.ShaderChunk.bsdfs =
  55406. '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'),
  55407. (n.ShaderChunk.bumpmap_pars_fragment =
  55408. '#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'),
  55409. (n.ShaderChunk.color_fragment =
  55410. '#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif'),
  55411. (n.ShaderChunk.color_pars_fragment =
  55412. '#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n'),
  55413. (n.ShaderChunk.color_pars_vertex = '#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif'),
  55414. (n.ShaderChunk.color_vertex = '#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif'),
  55415. (n.ShaderChunk.common =
  55416. '#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'),
  55417. (n.ShaderChunk.cube_uv_reflection_fragment =
  55418. '#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'),
  55419. (n.ShaderChunk.defaultnormal_vertex =
  55420. '#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n'),
  55421. (n.ShaderChunk.displacementmap_vertex =
  55422. '#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n'),
  55423. (n.ShaderChunk.displacementmap_pars_vertex =
  55424. '#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n'),
  55425. (n.ShaderChunk.emissivemap_fragment =
  55426. '#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n'),
  55427. (n.ShaderChunk.emissivemap_pars_fragment =
  55428. '#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n'),
  55429. (n.ShaderChunk.encodings_pars_fragment =
  55430. '\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'),
  55431. (n.ShaderChunk.encodings_fragment =
  55432. ' gl_FragColor = linearToOutputTexel( gl_FragColor );\n'),
  55433. (n.ShaderChunk.envmap_fragment =
  55434. '#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'),
  55435. (n.ShaderChunk.envmap_pars_fragment =
  55436. '#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'),
  55437. (n.ShaderChunk.envmap_pars_vertex =
  55438. '#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'),
  55439. (n.ShaderChunk.envmap_vertex =
  55440. '#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'),
  55441. (n.ShaderChunk.fog_fragment =
  55442. '#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'),
  55443. (n.ShaderChunk.fog_pars_fragment =
  55444. '#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'),
  55445. (n.ShaderChunk.lightmap_fragment =
  55446. '#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n'),
  55447. (n.ShaderChunk.lightmap_pars_fragment =
  55448. '#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif'),
  55449. (n.ShaderChunk.lights_lambert_vertex =
  55450. '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'),
  55451. (n.ShaderChunk.lights_pars =
  55452. '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'),
  55453. (n.ShaderChunk.lights_phong_fragment =
  55454. 'BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n'),
  55455. (n.ShaderChunk.lights_phong_pars_fragment =
  55456. '#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'),
  55457. (n.ShaderChunk.lights_phong_pars_vertex =
  55458. '#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n'),
  55459. (n.ShaderChunk.lights_phong_vertex =
  55460. '#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n'),
  55461. (n.ShaderChunk.lights_standard_fragment =
  55462. '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'),
  55463. (n.ShaderChunk.lights_standard_pars_fragment =
  55464. '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'),
  55465. (n.ShaderChunk.lights_template =
  55466. '\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'),
  55467. (n.ShaderChunk.logdepthbuf_fragment =
  55468. '#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif'),
  55469. (n.ShaderChunk.logdepthbuf_pars_fragment =
  55470. '#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n'),
  55471. (n.ShaderChunk.logdepthbuf_pars_vertex =
  55472. '#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif'),
  55473. (n.ShaderChunk.logdepthbuf_vertex =
  55474. '#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'),
  55475. (n.ShaderChunk.map_fragment =
  55476. '#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n'),
  55477. (n.ShaderChunk.map_pars_fragment = '#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n'),
  55478. (n.ShaderChunk.map_particle_fragment =
  55479. '#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'),
  55480. (n.ShaderChunk.map_particle_pars_fragment =
  55481. '#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n'),
  55482. (n.ShaderChunk.metalnessmap_fragment =
  55483. 'float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n'),
  55484. (n.ShaderChunk.metalnessmap_pars_fragment =
  55485. '#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif'),
  55486. (n.ShaderChunk.morphnormal_vertex =
  55487. '#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'),
  55488. (n.ShaderChunk.morphtarget_pars_vertex =
  55489. '#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')
  55490. n.ShaderChunk.morphtarget_vertex =
  55491. '#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'
  55492. ;(n.ShaderChunk.normal_fragment =
  55493. '#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'),
  55494. (n.ShaderChunk.normalmap_pars_fragment =
  55495. '#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'),
  55496. (n.ShaderChunk.premultiplied_alpha_fragment =
  55497. '#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n'),
  55498. (n.ShaderChunk.project_vertex =
  55499. '#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'),
  55500. (n.ShaderChunk.roughnessmap_fragment =
  55501. 'float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n'),
  55502. (n.ShaderChunk.roughnessmap_pars_fragment =
  55503. '#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif'),
  55504. (n.ShaderChunk.shadowmap_pars_fragment =
  55505. '#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'),
  55506. (n.ShaderChunk.shadowmap_pars_vertex =
  55507. '#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'),
  55508. (n.ShaderChunk.shadowmap_vertex =
  55509. '#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'),
  55510. (n.ShaderChunk.shadowmask_pars_fragment =
  55511. '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'),
  55512. (n.ShaderChunk.skinbase_vertex =
  55513. '#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'),
  55514. (n.ShaderChunk.skinning_pars_vertex =
  55515. '#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'),
  55516. (n.ShaderChunk.skinning_vertex =
  55517. '#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'),
  55518. (n.ShaderChunk.skinnormal_vertex =
  55519. '#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'),
  55520. (n.ShaderChunk.specularmap_fragment =
  55521. 'float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif'),
  55522. (n.ShaderChunk.specularmap_pars_fragment =
  55523. '#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif'),
  55524. (n.ShaderChunk.tonemapping_fragment =
  55525. '#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n'),
  55526. (n.ShaderChunk.tonemapping_pars_fragment =
  55527. '#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'),
  55528. (n.ShaderChunk.uv2_pars_fragment =
  55529. '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif'),
  55530. (n.ShaderChunk.uv2_pars_vertex =
  55531. '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif'),
  55532. (n.ShaderChunk.uv2_vertex =
  55533. '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif'),
  55534. (n.ShaderChunk.uv_pars_fragment =
  55535. '#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'),
  55536. (n.ShaderChunk.uv_pars_vertex =
  55537. '#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'),
  55538. (n.ShaderChunk.uv_vertex =
  55539. '#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'),
  55540. (n.ShaderChunk.worldpos_vertex =
  55541. '#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'),
  55542. (n.UniformsUtils = {
  55543. merge: function (e) {
  55544. for (var t = {}, i = 0; i < e.length; i++) {
  55545. var n = this.clone(e[i])
  55546. for (var r in n) t[r] = n[r]
  55547. }
  55548. return t
  55549. },
  55550. clone: function (e) {
  55551. var t = {}
  55552. for (var i in e) {
  55553. t[i] = {}
  55554. for (var r in e[i]) {
  55555. var o = e[i][r]
  55556. o instanceof n.Color ||
  55557. o instanceof n.Vector2 ||
  55558. o instanceof n.Vector3 ||
  55559. o instanceof n.Vector4 ||
  55560. o instanceof n.Matrix3 ||
  55561. o instanceof n.Matrix4 ||
  55562. o instanceof n.Texture
  55563. ? (t[i][r] = o.clone())
  55564. : Array.isArray(o)
  55565. ? (t[i][r] = o.slice())
  55566. : (t[i][r] = o)
  55567. }
  55568. }
  55569. return t
  55570. }
  55571. }),
  55572. (n.UniformsLib = {
  55573. common: {
  55574. diffuse: {
  55575. type: 'c',
  55576. value: new n.Color(15658734)
  55577. },
  55578. opacity: {
  55579. type: 'f',
  55580. value: 1
  55581. },
  55582. map: {
  55583. type: 't',
  55584. value: null
  55585. },
  55586. offsetRepeat: {
  55587. type: 'v4',
  55588. value: new n.Vector4(0, 0, 1, 1)
  55589. },
  55590. specularMap: {
  55591. type: 't',
  55592. value: null
  55593. },
  55594. alphaMap: {
  55595. type: 't',
  55596. value: null
  55597. },
  55598. envMap: {
  55599. type: 't',
  55600. value: null
  55601. },
  55602. flipEnvMap: {
  55603. type: 'f',
  55604. value: -1
  55605. },
  55606. reflectivity: {
  55607. type: 'f',
  55608. value: 1
  55609. },
  55610. refractionRatio: {
  55611. type: 'f',
  55612. value: 0.98
  55613. }
  55614. },
  55615. aomap: {
  55616. aoMap: {
  55617. type: 't',
  55618. value: null
  55619. },
  55620. aoMapIntensity: {
  55621. type: 'f',
  55622. value: 1
  55623. }
  55624. },
  55625. lightmap: {
  55626. lightMap: {
  55627. type: 't',
  55628. value: null
  55629. },
  55630. lightMapIntensity: {
  55631. type: 'f',
  55632. value: 1
  55633. }
  55634. },
  55635. emissivemap: {
  55636. emissiveMap: {
  55637. type: 't',
  55638. value: null
  55639. }
  55640. },
  55641. bumpmap: {
  55642. bumpMap: {
  55643. type: 't',
  55644. value: null
  55645. },
  55646. bumpScale: {
  55647. type: 'f',
  55648. value: 1
  55649. }
  55650. },
  55651. normalmap: {
  55652. normalMap: {
  55653. type: 't',
  55654. value: null
  55655. },
  55656. normalScale: {
  55657. type: 'v2',
  55658. value: new n.Vector2(1, 1)
  55659. }
  55660. },
  55661. displacementmap: {
  55662. displacementMap: {
  55663. type: 't',
  55664. value: null
  55665. },
  55666. displacementScale: {
  55667. type: 'f',
  55668. value: 1
  55669. },
  55670. displacementBias: {
  55671. type: 'f',
  55672. value: 0
  55673. }
  55674. },
  55675. roughnessmap: {
  55676. roughnessMap: {
  55677. type: 't',
  55678. value: null
  55679. }
  55680. },
  55681. metalnessmap: {
  55682. metalnessMap: {
  55683. type: 't',
  55684. value: null
  55685. }
  55686. },
  55687. fog: {
  55688. fogDensity: {
  55689. type: 'f',
  55690. value: 25e-5
  55691. },
  55692. fogNear: {
  55693. type: 'f',
  55694. value: 1
  55695. },
  55696. fogFar: {
  55697. type: 'f',
  55698. value: 2e3
  55699. },
  55700. fogColor: {
  55701. type: 'c',
  55702. value: new n.Color(16777215)
  55703. }
  55704. },
  55705. lights: {
  55706. ambientLightColor: {
  55707. type: 'fv',
  55708. value: []
  55709. },
  55710. directionalLights: {
  55711. type: 'sa',
  55712. value: [],
  55713. properties: {
  55714. direction: {
  55715. type: 'v3'
  55716. },
  55717. color: {
  55718. type: 'c'
  55719. },
  55720. shadow: {
  55721. type: 'i'
  55722. },
  55723. shadowBias: {
  55724. type: 'f'
  55725. },
  55726. shadowRadius: {
  55727. type: 'f'
  55728. },
  55729. shadowMapSize: {
  55730. type: 'v2'
  55731. }
  55732. }
  55733. },
  55734. directionalShadowMap: {
  55735. type: 'tv',
  55736. value: []
  55737. },
  55738. directionalShadowMatrix: {
  55739. type: 'm4v',
  55740. value: []
  55741. },
  55742. spotLights: {
  55743. type: 'sa',
  55744. value: [],
  55745. properties: {
  55746. color: {
  55747. type: 'c'
  55748. },
  55749. position: {
  55750. type: 'v3'
  55751. },
  55752. direction: {
  55753. type: 'v3'
  55754. },
  55755. distance: {
  55756. type: 'f'
  55757. },
  55758. coneCos: {
  55759. type: 'f'
  55760. },
  55761. penumbraCos: {
  55762. type: 'f'
  55763. },
  55764. decay: {
  55765. type: 'f'
  55766. },
  55767. shadow: {
  55768. type: 'i'
  55769. },
  55770. shadowBias: {
  55771. type: 'f'
  55772. },
  55773. shadowRadius: {
  55774. type: 'f'
  55775. },
  55776. shadowMapSize: {
  55777. type: 'v2'
  55778. }
  55779. }
  55780. },
  55781. spotShadowMap: {
  55782. type: 'tv',
  55783. value: []
  55784. },
  55785. spotShadowMatrix: {
  55786. type: 'm4v',
  55787. value: []
  55788. },
  55789. pointLights: {
  55790. type: 'sa',
  55791. value: [],
  55792. properties: {
  55793. color: {
  55794. type: 'c'
  55795. },
  55796. position: {
  55797. type: 'v3'
  55798. },
  55799. decay: {
  55800. type: 'f'
  55801. },
  55802. distance: {
  55803. type: 'f'
  55804. },
  55805. shadow: {
  55806. type: 'i'
  55807. },
  55808. shadowBias: {
  55809. type: 'f'
  55810. },
  55811. shadowRadius: {
  55812. type: 'f'
  55813. },
  55814. shadowMapSize: {
  55815. type: 'v2'
  55816. }
  55817. }
  55818. },
  55819. pointShadowMap: {
  55820. type: 'tv',
  55821. value: []
  55822. },
  55823. pointShadowMatrix: {
  55824. type: 'm4v',
  55825. value: []
  55826. },
  55827. hemisphereLights: {
  55828. type: 'sa',
  55829. value: [],
  55830. properties: {
  55831. direction: {
  55832. type: 'v3'
  55833. },
  55834. skyColor: {
  55835. type: 'c'
  55836. },
  55837. groundColor: {
  55838. type: 'c'
  55839. }
  55840. }
  55841. }
  55842. },
  55843. points: {
  55844. diffuse: {
  55845. type: 'c',
  55846. value: new n.Color(15658734)
  55847. },
  55848. opacity: {
  55849. type: 'f',
  55850. value: 1
  55851. },
  55852. size: {
  55853. type: 'f',
  55854. value: 1
  55855. },
  55856. scale: {
  55857. type: 'f',
  55858. value: 1
  55859. },
  55860. map: {
  55861. type: 't',
  55862. value: null
  55863. },
  55864. offsetRepeat: {
  55865. type: 'v4',
  55866. value: new n.Vector4(0, 0, 1, 1)
  55867. }
  55868. }
  55869. }),
  55870. (n.ShaderChunk.cube_frag =
  55871. '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'),
  55872. (n.ShaderChunk.cube_vert =
  55873. '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'),
  55874. (n.ShaderChunk.depth_frag =
  55875. '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'),
  55876. (n.ShaderChunk.depth_vert =
  55877. '#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'),
  55878. (n.ShaderChunk.depthRGBA_frag =
  55879. '#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'),
  55880. (n.ShaderChunk.depthRGBA_vert =
  55881. '#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'),
  55882. (n.ShaderChunk.distanceRGBA_frag =
  55883. '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'),
  55884. (n.ShaderChunk.distanceRGBA_vert =
  55885. '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'),
  55886. (n.ShaderChunk.equirect_frag =
  55887. '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'),
  55888. (n.ShaderChunk.equirect_vert =
  55889. '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'),
  55890. (n.ShaderChunk.linedashed_frag =
  55891. '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'),
  55892. (n.ShaderChunk.linedashed_vert =
  55893. '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'),
  55894. (n.ShaderChunk.meshbasic_frag =
  55895. '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'),
  55896. (n.ShaderChunk.meshbasic_vert =
  55897. '#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'),
  55898. (n.ShaderChunk.meshlambert_frag =
  55899. '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'),
  55900. (n.ShaderChunk.meshlambert_vert =
  55901. '#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'),
  55902. (n.ShaderChunk.meshphong_frag =
  55903. '#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'),
  55904. (n.ShaderChunk.meshphong_vert =
  55905. '#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'),
  55906. (n.ShaderChunk.meshstandard_frag =
  55907. '#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'),
  55908. (n.ShaderChunk.meshstandard_vert =
  55909. '#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'),
  55910. (n.ShaderChunk.normal_frag =
  55911. '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'),
  55912. (n.ShaderChunk.normal_vert =
  55913. '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'),
  55914. (n.ShaderChunk.points_frag =
  55915. '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'),
  55916. (n.ShaderChunk.points_vert =
  55917. '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'),
  55918. (n.ShaderLib = {
  55919. basic: {
  55920. uniforms: n.UniformsUtils.merge([
  55921. n.UniformsLib.common,
  55922. n.UniformsLib.aomap,
  55923. n.UniformsLib.fog
  55924. ]),
  55925. vertexShader: n.ShaderChunk.meshbasic_vert,
  55926. fragmentShader: n.ShaderChunk.meshbasic_frag
  55927. },
  55928. lambert: {
  55929. uniforms: n.UniformsUtils.merge([
  55930. n.UniformsLib.common,
  55931. n.UniformsLib.aomap,
  55932. n.UniformsLib.lightmap,
  55933. n.UniformsLib.emissivemap,
  55934. n.UniformsLib.fog,
  55935. n.UniformsLib.lights,
  55936. {
  55937. emissive: {
  55938. type: 'c',
  55939. value: new n.Color(0)
  55940. }
  55941. }
  55942. ]),
  55943. vertexShader: n.ShaderChunk.meshlambert_vert,
  55944. fragmentShader: n.ShaderChunk.meshlambert_frag
  55945. },
  55946. phong: {
  55947. uniforms: n.UniformsUtils.merge([
  55948. n.UniformsLib.common,
  55949. n.UniformsLib.aomap,
  55950. n.UniformsLib.lightmap,
  55951. n.UniformsLib.emissivemap,
  55952. n.UniformsLib.bumpmap,
  55953. n.UniformsLib.normalmap,
  55954. n.UniformsLib.displacementmap,
  55955. n.UniformsLib.fog,
  55956. n.UniformsLib.lights,
  55957. {
  55958. emissive: {
  55959. type: 'c',
  55960. value: new n.Color(0)
  55961. },
  55962. specular: {
  55963. type: 'c',
  55964. value: new n.Color(1118481)
  55965. },
  55966. shininess: {
  55967. type: 'f',
  55968. value: 30
  55969. }
  55970. }
  55971. ]),
  55972. vertexShader: n.ShaderChunk.meshphong_vert,
  55973. fragmentShader: n.ShaderChunk.meshphong_frag
  55974. },
  55975. standard: {
  55976. uniforms: n.UniformsUtils.merge([
  55977. n.UniformsLib.common,
  55978. n.UniformsLib.aomap,
  55979. n.UniformsLib.lightmap,
  55980. n.UniformsLib.emissivemap,
  55981. n.UniformsLib.bumpmap,
  55982. n.UniformsLib.normalmap,
  55983. n.UniformsLib.displacementmap,
  55984. n.UniformsLib.roughnessmap,
  55985. n.UniformsLib.metalnessmap,
  55986. n.UniformsLib.fog,
  55987. n.UniformsLib.lights,
  55988. {
  55989. emissive: {
  55990. type: 'c',
  55991. value: new n.Color(0)
  55992. },
  55993. roughness: {
  55994. type: 'f',
  55995. value: 0.5
  55996. },
  55997. metalness: {
  55998. type: 'f',
  55999. value: 0
  56000. },
  56001. envMapIntensity: {
  56002. type: 'f',
  56003. value: 1
  56004. }
  56005. }
  56006. ]),
  56007. vertexShader: n.ShaderChunk.meshstandard_vert,
  56008. fragmentShader: n.ShaderChunk.meshstandard_frag
  56009. },
  56010. points: {
  56011. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  56012. vertexShader: n.ShaderChunk.points_vert,
  56013. fragmentShader: n.ShaderChunk.points_frag
  56014. },
  56015. dashed: {
  56016. uniforms: n.UniformsUtils.merge([
  56017. n.UniformsLib.common,
  56018. n.UniformsLib.fog,
  56019. {
  56020. scale: {
  56021. type: 'f',
  56022. value: 1
  56023. },
  56024. dashSize: {
  56025. type: 'f',
  56026. value: 1
  56027. },
  56028. totalSize: {
  56029. type: 'f',
  56030. value: 2
  56031. }
  56032. }
  56033. ]),
  56034. vertexShader: n.ShaderChunk.linedashed_vert,
  56035. fragmentShader: n.ShaderChunk.linedashed_frag
  56036. },
  56037. depth: {
  56038. uniforms: {
  56039. mNear: {
  56040. type: 'f',
  56041. value: 1
  56042. },
  56043. mFar: {
  56044. type: 'f',
  56045. value: 2e3
  56046. },
  56047. opacity: {
  56048. type: 'f',
  56049. value: 1
  56050. }
  56051. },
  56052. vertexShader: n.ShaderChunk.depth_vert,
  56053. fragmentShader: n.ShaderChunk.depth_frag
  56054. },
  56055. normal: {
  56056. uniforms: {
  56057. opacity: {
  56058. type: 'f',
  56059. value: 1
  56060. }
  56061. },
  56062. vertexShader: n.ShaderChunk.normal_vert,
  56063. fragmentShader: n.ShaderChunk.normal_frag
  56064. },
  56065. cube: {
  56066. uniforms: {
  56067. tCube: {
  56068. type: 't',
  56069. value: null
  56070. },
  56071. tFlip: {
  56072. type: 'f',
  56073. value: -1
  56074. }
  56075. },
  56076. vertexShader: n.ShaderChunk.cube_vert,
  56077. fragmentShader: n.ShaderChunk.cube_frag
  56078. },
  56079. equirect: {
  56080. uniforms: {
  56081. tEquirect: {
  56082. type: 't',
  56083. value: null
  56084. },
  56085. tFlip: {
  56086. type: 'f',
  56087. value: -1
  56088. }
  56089. },
  56090. vertexShader: n.ShaderChunk.equirect_vert,
  56091. fragmentShader: n.ShaderChunk.equirect_frag
  56092. },
  56093. depthRGBA: {
  56094. uniforms: {},
  56095. vertexShader: n.ShaderChunk.depthRGBA_vert,
  56096. fragmentShader: n.ShaderChunk.depthRGBA_frag
  56097. },
  56098. distanceRGBA: {
  56099. uniforms: {
  56100. lightPos: {
  56101. type: 'v3',
  56102. value: new n.Vector3(0, 0, 0)
  56103. }
  56104. },
  56105. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  56106. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  56107. }
  56108. }),
  56109. (n.WebGLRenderer = function (e) {
  56110. function t() {
  56111. return null === ye ? Oe : 1
  56112. }
  56113. function i(e, t, i, n) {
  56114. se === !0 && ((e *= n), (t *= n), (i *= n)), Ye.clearColor(e, t, i, n)
  56115. }
  56116. function r() {
  56117. Ye.init(),
  56118. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  56119. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  56120. i(Se.r, Se.g, Se.b, Me)
  56121. }
  56122. function o() {
  56123. ;(Ae = null), (be = null), (Ee = ''), (Ie = -1), Ye.reset()
  56124. }
  56125. function a(e) {
  56126. e.preventDefault(), o(), r(), Xe.clear()
  56127. }
  56128. function s(e) {
  56129. var t = e.target
  56130. t.removeEventListener('dispose', s), h(t), ke.textures--
  56131. }
  56132. function l(e) {
  56133. var t = e.target
  56134. t.removeEventListener('dispose', l), u(t), ke.textures--
  56135. }
  56136. function c(e) {
  56137. var t = e.target
  56138. t.removeEventListener('dispose', c), d(t)
  56139. }
  56140. function h(e) {
  56141. var t = Xe.get(e)
  56142. if (e.image && t.__image__webglTextureCube)
  56143. Ge.deleteTexture(t.__image__webglTextureCube)
  56144. else {
  56145. if (void 0 === t.__webglInit) return
  56146. Ge.deleteTexture(t.__webglTexture)
  56147. }
  56148. Xe.delete(e)
  56149. }
  56150. function u(e) {
  56151. var t = Xe.get(e),
  56152. i = Xe.get(e.texture)
  56153. if (e && void 0 !== i.__webglTexture) {
  56154. if ((Ge.deleteTexture(i.__webglTexture), e instanceof n.WebGLRenderTargetCube))
  56155. for (var r = 0; r < 6; r++)
  56156. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  56157. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r])
  56158. else
  56159. Ge.deleteFramebuffer(t.__webglFramebuffer),
  56160. Ge.deleteRenderbuffer(t.__webglDepthbuffer)
  56161. Xe.delete(e.texture), Xe.delete(e)
  56162. }
  56163. }
  56164. function d(e) {
  56165. p(e), Xe.delete(e)
  56166. }
  56167. function p(e) {
  56168. var t = Xe.get(e).program
  56169. ;(e.program = void 0), void 0 !== t && qe.releaseProgram(t)
  56170. }
  56171. function f(e, t, i, r) {
  56172. var o
  56173. if (
  56174. i instanceof n.InstancedBufferGeometry &&
  56175. ((o = We.get('ANGLE_instanced_arrays')), null === o)
  56176. )
  56177. return void console.error(
  56178. 'THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.'
  56179. )
  56180. void 0 === r && (r = 0), Ye.initAttributes()
  56181. var a = i.attributes,
  56182. s = t.getAttributes(),
  56183. l = e.defaultAttributeValues
  56184. for (var c in s) {
  56185. var h = s[c]
  56186. if (h >= 0) {
  56187. var u = a[c]
  56188. if (void 0 !== u) {
  56189. var d = u.itemSize,
  56190. p = Ze.getAttributeBuffer(u)
  56191. if (u instanceof n.InterleavedBufferAttribute) {
  56192. var f = u.data,
  56193. g = f.stride,
  56194. m = u.offset
  56195. f instanceof n.InstancedInterleavedBuffer
  56196. ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  56197. void 0 === i.maxInstancedCount &&
  56198. (i.maxInstancedCount = f.meshPerAttribute * f.count))
  56199. : Ye.enableAttribute(h),
  56200. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  56201. Ge.vertexAttribPointer(
  56202. h,
  56203. d,
  56204. Ge.FLOAT,
  56205. !1,
  56206. g * f.array.BYTES_PER_ELEMENT,
  56207. (r * g + m) * f.array.BYTES_PER_ELEMENT
  56208. )
  56209. } else
  56210. u instanceof n.InstancedBufferAttribute
  56211. ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  56212. void 0 === i.maxInstancedCount &&
  56213. (i.maxInstancedCount = u.meshPerAttribute * u.count))
  56214. : Ye.enableAttribute(h),
  56215. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  56216. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  56217. } else if (void 0 !== l) {
  56218. var v = l[c]
  56219. if (void 0 !== v)
  56220. switch (v.length) {
  56221. case 2:
  56222. Ge.vertexAttrib2fv(h, v)
  56223. break
  56224. case 3:
  56225. Ge.vertexAttrib3fv(h, v)
  56226. break
  56227. case 4:
  56228. Ge.vertexAttrib4fv(h, v)
  56229. break
  56230. default:
  56231. Ge.vertexAttrib1fv(h, v)
  56232. }
  56233. }
  56234. }
  56235. }
  56236. Ye.disableUnusedAttributes()
  56237. }
  56238. function g(e, t) {
  56239. return Math.abs(t[0]) - Math.abs(e[0])
  56240. }
  56241. function m(e, t) {
  56242. return e.object.renderOrder !== t.object.renderOrder
  56243. ? e.object.renderOrder - t.object.renderOrder
  56244. : e.material.id !== t.material.id
  56245. ? e.material.id - t.material.id
  56246. : e.z !== t.z
  56247. ? e.z - t.z
  56248. : e.id - t.id
  56249. }
  56250. function v(e, t) {
  56251. return e.object.renderOrder !== t.object.renderOrder
  56252. ? e.object.renderOrder - t.object.renderOrder
  56253. : e.z !== t.z
  56254. ? t.z - e.z
  56255. : e.id - t.id
  56256. }
  56257. function A(e, t, i, n, r) {
  56258. var o, a
  56259. i.transparent ? ((o = de), (a = ++pe)) : ((o = he), (a = ++ue))
  56260. var s = o[a]
  56261. void 0 !== s
  56262. ? ((s.id = e.id),
  56263. (s.object = e),
  56264. (s.geometry = t),
  56265. (s.material = i),
  56266. (s.z = Ve.z),
  56267. (s.group = r))
  56268. : ((s = {
  56269. id: e.id,
  56270. object: e,
  56271. geometry: t,
  56272. material: i,
  56273. z: Ve.z,
  56274. group: r
  56275. }),
  56276. o.push(s))
  56277. }
  56278. function y(e, t) {
  56279. if (e.visible !== !1) {
  56280. if (e.layers.test(t.layers))
  56281. if (e instanceof n.Light) ce.push(e)
  56282. else if (e instanceof n.Sprite)
  56283. (e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0) || ge.push(e)
  56284. else if (e instanceof n.LensFlare) me.push(e)
  56285. else if (e instanceof n.ImmediateRenderObject)
  56286. ve.sortObjects === !0 &&
  56287. (Ve.setFromMatrixPosition(e.matrixWorld), Ve.applyProjection(Fe)),
  56288. A(e, null, e.material, Ve.z, null)
  56289. else if (
  56290. (e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) &&
  56291. (e instanceof n.SkinnedMesh && e.skeleton.update(),
  56292. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)
  56293. ) {
  56294. var i = e.material
  56295. if (i.visible === !0) {
  56296. ve.sortObjects === !0 &&
  56297. (Ve.setFromMatrixPosition(e.matrixWorld), Ve.applyProjection(Fe))
  56298. var r = Ze.update(e)
  56299. if (i instanceof n.MultiMaterial)
  56300. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  56301. var c = o[s],
  56302. h = a[c.materialIndex]
  56303. h.visible === !0 && A(e, r, h, Ve.z, c)
  56304. }
  56305. else A(e, r, i, Ve.z, null)
  56306. }
  56307. }
  56308. for (var u = e.children, s = 0, l = u.length; s < l; s++) y(u[s], t)
  56309. }
  56310. }
  56311. function C(e, t, i, r) {
  56312. for (var o = 0, a = e.length; o < a; o++) {
  56313. var s = e[o],
  56314. l = s.object,
  56315. c = s.geometry,
  56316. h = void 0 === r ? s.material : r,
  56317. u = s.group
  56318. if (
  56319. (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  56320. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  56321. l instanceof n.ImmediateRenderObject)
  56322. ) {
  56323. E(h)
  56324. var d = w(t, i, h, l)
  56325. ;(Ee = ''),
  56326. l.render(function (e) {
  56327. ve.renderBufferImmediate(e, d, h)
  56328. })
  56329. } else ve.renderBufferDirect(t, i, c, h, l, u)
  56330. }
  56331. }
  56332. function I(e, t, i) {
  56333. var r = Xe.get(e),
  56334. o = qe.getParameters(e, Ue, t, i),
  56335. a = qe.getProgramCode(e, o),
  56336. s = r.program,
  56337. l = !0
  56338. if (void 0 === s) e.addEventListener('dispose', c)
  56339. else if (s.code !== a) p(e)
  56340. else {
  56341. if (void 0 !== o.shaderID) return
  56342. l = !1
  56343. }
  56344. if (l) {
  56345. if (o.shaderID) {
  56346. var h = n.ShaderLib[o.shaderID]
  56347. r.__webglShader = {
  56348. name: e.type,
  56349. uniforms: n.UniformsUtils.clone(h.uniforms),
  56350. vertexShader: h.vertexShader,
  56351. fragmentShader: h.fragmentShader
  56352. }
  56353. } else
  56354. r.__webglShader = {
  56355. name: e.type,
  56356. uniforms: e.uniforms,
  56357. vertexShader: e.vertexShader,
  56358. fragmentShader: e.fragmentShader
  56359. }
  56360. ;(e.__webglShader = r.__webglShader),
  56361. (s = qe.acquireProgram(e, o, a)),
  56362. (r.program = s),
  56363. (e.program = s)
  56364. }
  56365. var u = s.getAttributes()
  56366. if (e.morphTargets) {
  56367. e.numSupportedMorphTargets = 0
  56368. for (var d = 0; d < ve.maxMorphTargets; d++)
  56369. u['morphTarget' + d] >= 0 && e.numSupportedMorphTargets++
  56370. }
  56371. if (e.morphNormals) {
  56372. e.numSupportedMorphNormals = 0
  56373. for (var d = 0; d < ve.maxMorphNormals; d++)
  56374. u['morphNormal' + d] >= 0 && e.numSupportedMorphNormals++
  56375. }
  56376. r.uniformsList = []
  56377. var f = r.__webglShader.uniforms,
  56378. g = r.program.getUniforms()
  56379. for (var m in f) {
  56380. var v = g[m]
  56381. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  56382. }
  56383. ;(e instanceof n.MeshPhongMaterial ||
  56384. e instanceof n.MeshLambertMaterial ||
  56385. e instanceof n.MeshStandardMaterial ||
  56386. e.lights) &&
  56387. ((r.lightsHash = Ue.hash),
  56388. (f.ambientLightColor.value = Ue.ambient),
  56389. (f.directionalLights.value = Ue.directional),
  56390. (f.spotLights.value = Ue.spot),
  56391. (f.pointLights.value = Ue.point),
  56392. (f.hemisphereLights.value = Ue.hemi),
  56393. (f.directionalShadowMap.value = Ue.directionalShadowMap),
  56394. (f.directionalShadowMatrix.value = Ue.directionalShadowMatrix),
  56395. (f.spotShadowMap.value = Ue.spotShadowMap),
  56396. (f.spotShadowMatrix.value = Ue.spotShadowMatrix),
  56397. (f.pointShadowMap.value = Ue.pointShadowMap),
  56398. (f.pointShadowMatrix.value = Ue.pointShadowMatrix)),
  56399. (r.hasDynamicUniforms = !1)
  56400. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  56401. var C = r.uniformsList[A][0]
  56402. if (C.dynamic === !0) {
  56403. r.hasDynamicUniforms = !0
  56404. break
  56405. }
  56406. }
  56407. }
  56408. function E(e) {
  56409. b(e),
  56410. e.transparent === !0
  56411. ? Ye.setBlending(
  56412. e.blending,
  56413. e.blendEquation,
  56414. e.blendSrc,
  56415. e.blendDst,
  56416. e.blendEquationAlpha,
  56417. e.blendSrcAlpha,
  56418. e.blendDstAlpha,
  56419. e.premultipliedAlpha
  56420. )
  56421. : Ye.setBlending(n.NoBlending),
  56422. Ye.setDepthFunc(e.depthFunc),
  56423. Ye.setDepthTest(e.depthTest),
  56424. Ye.setDepthWrite(e.depthWrite),
  56425. Ye.setColorWrite(e.colorWrite),
  56426. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  56427. }
  56428. function b(e) {
  56429. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  56430. Ye.setFlipSided(e.side === n.BackSide)
  56431. }
  56432. function w(e, t, i, r) {
  56433. xe = 0
  56434. var o = Xe.get(i)
  56435. void 0 === o.program && (i.needsUpdate = !0),
  56436. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  56437. i.needsUpdate && (I(i, t, r), (i.needsUpdate = !1))
  56438. var a = !1,
  56439. s = !1,
  56440. l = !1,
  56441. c = o.program,
  56442. h = c.getUniforms(),
  56443. u = o.__webglShader.uniforms
  56444. if (
  56445. (c.id !== Ae &&
  56446. (Ge.useProgram(c.program), (Ae = c.id), (a = !0), (s = !0), (l = !0)),
  56447. i.id !== Ie && ((Ie = i.id), (s = !0)),
  56448. (a || e !== be) &&
  56449. (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  56450. je.logarithmicDepthBuffer &&
  56451. Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  56452. e !== be && ((be = e), (s = !0), (l = !0)),
  56453. (i instanceof n.ShaderMaterial ||
  56454. i instanceof n.MeshPhongMaterial ||
  56455. i instanceof n.MeshStandardMaterial ||
  56456. i.envMap) &&
  56457. void 0 !== h.cameraPosition &&
  56458. (Ve.setFromMatrixPosition(e.matrixWorld),
  56459. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  56460. (i instanceof n.MeshPhongMaterial ||
  56461. i instanceof n.MeshLambertMaterial ||
  56462. i instanceof n.MeshBasicMaterial ||
  56463. i instanceof n.MeshStandardMaterial ||
  56464. i instanceof n.ShaderMaterial ||
  56465. i.skinning) &&
  56466. void 0 !== h.viewMatrix &&
  56467. Ge.uniformMatrix4fv(h.viewMatrix, !1, e.matrixWorldInverse.elements),
  56468. void 0 !== h.toneMappingExposure &&
  56469. Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  56470. void 0 !== h.toneMappingWhitePoint &&
  56471. Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  56472. i.skinning)
  56473. )
  56474. if (
  56475. (r.bindMatrix &&
  56476. void 0 !== h.bindMatrix &&
  56477. Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  56478. r.bindMatrixInverse &&
  56479. void 0 !== h.bindMatrixInverse &&
  56480. Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  56481. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture)
  56482. ) {
  56483. if (void 0 !== h.boneTexture) {
  56484. var d = B()
  56485. Ge.uniform1i(h.boneTexture, d), ve.setTexture(r.skeleton.boneTexture, d)
  56486. }
  56487. void 0 !== h.boneTextureWidth &&
  56488. Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  56489. void 0 !== h.boneTextureHeight &&
  56490. Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  56491. } else
  56492. r.skeleton &&
  56493. r.skeleton.boneMatrices &&
  56494. void 0 !== h.boneGlobalMatrices &&
  56495. Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices)
  56496. return (
  56497. s &&
  56498. ((i instanceof n.MeshPhongMaterial ||
  56499. i instanceof n.MeshLambertMaterial ||
  56500. i instanceof n.MeshStandardMaterial ||
  56501. i.lights) &&
  56502. D(u, l),
  56503. t && i.fog && R(u, t),
  56504. (i instanceof n.MeshBasicMaterial ||
  56505. i instanceof n.MeshLambertMaterial ||
  56506. i instanceof n.MeshPhongMaterial ||
  56507. i instanceof n.MeshStandardMaterial) &&
  56508. T(u, i),
  56509. i instanceof n.LineBasicMaterial
  56510. ? x(u, i)
  56511. : i instanceof n.LineDashedMaterial
  56512. ? (x(u, i), S(u, i))
  56513. : i instanceof n.PointsMaterial
  56514. ? M(u, i)
  56515. : i instanceof n.MeshLambertMaterial
  56516. ? P(u, i)
  56517. : i instanceof n.MeshPhongMaterial
  56518. ? O(u, i)
  56519. : i instanceof n.MeshStandardMaterial
  56520. ? L(u, i)
  56521. : i instanceof n.MeshDepthMaterial
  56522. ? ((u.mNear.value = e.near),
  56523. (u.mFar.value = e.far),
  56524. (u.opacity.value = i.opacity))
  56525. : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  56526. V(o.uniformsList)),
  56527. N(h, r),
  56528. void 0 !== h.modelMatrix &&
  56529. Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  56530. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  56531. c
  56532. )
  56533. }
  56534. function _(e, t, i) {
  56535. for (var n = [], r = 0, o = e.length; r < o; r++) {
  56536. var a = e[r][0],
  56537. s = a.onUpdateCallback
  56538. void 0 !== s && (s.bind(a)(t, i), n.push(e[r]))
  56539. }
  56540. V(n)
  56541. }
  56542. function T(e, t) {
  56543. ;(e.opacity.value = t.opacity),
  56544. (e.diffuse.value = t.color),
  56545. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  56546. (e.map.value = t.map),
  56547. (e.specularMap.value = t.specularMap),
  56548. (e.alphaMap.value = t.alphaMap),
  56549. t.aoMap && ((e.aoMap.value = t.aoMap), (e.aoMapIntensity.value = t.aoMapIntensity))
  56550. var i
  56551. if (
  56552. (t.map
  56553. ? (i = t.map)
  56554. : t.specularMap
  56555. ? (i = t.specularMap)
  56556. : t.displacementMap
  56557. ? (i = t.displacementMap)
  56558. : t.normalMap
  56559. ? (i = t.normalMap)
  56560. : t.bumpMap
  56561. ? (i = t.bumpMap)
  56562. : t.roughnessMap
  56563. ? (i = t.roughnessMap)
  56564. : t.metalnessMap
  56565. ? (i = t.metalnessMap)
  56566. : t.alphaMap
  56567. ? (i = t.alphaMap)
  56568. : t.emissiveMap && (i = t.emissiveMap),
  56569. void 0 !== i)
  56570. ) {
  56571. i instanceof n.WebGLRenderTarget && (i = i.texture)
  56572. var r = i.offset,
  56573. o = i.repeat
  56574. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  56575. }
  56576. ;(e.envMap.value = t.envMap),
  56577. (e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1),
  56578. (e.reflectivity.value = t.reflectivity),
  56579. (e.refractionRatio.value = t.refractionRatio)
  56580. }
  56581. function x(e, t) {
  56582. ;(e.diffuse.value = t.color), (e.opacity.value = t.opacity)
  56583. }
  56584. function S(e, t) {
  56585. ;(e.dashSize.value = t.dashSize),
  56586. (e.totalSize.value = t.dashSize + t.gapSize),
  56587. (e.scale.value = t.scale)
  56588. }
  56589. function M(e, t) {
  56590. if (
  56591. ((e.diffuse.value = t.color),
  56592. (e.opacity.value = t.opacity),
  56593. (e.size.value = t.size * Oe),
  56594. (e.scale.value = te.clientHeight / 2),
  56595. (e.map.value = t.map),
  56596. null !== t.map)
  56597. ) {
  56598. var i = t.map.offset,
  56599. n = t.map.repeat
  56600. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  56601. }
  56602. }
  56603. function R(e, t) {
  56604. ;(e.fogColor.value = t.color),
  56605. t instanceof n.Fog
  56606. ? ((e.fogNear.value = t.near), (e.fogFar.value = t.far))
  56607. : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  56608. }
  56609. function P(e, t) {
  56610. t.lightMap &&
  56611. ((e.lightMap.value = t.lightMap),
  56612. (e.lightMapIntensity.value = t.lightMapIntensity)),
  56613. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  56614. }
  56615. function O(e, t) {
  56616. ;(e.specular.value = t.specular),
  56617. (e.shininess.value = Math.max(t.shininess, 1e-4)),
  56618. t.lightMap &&
  56619. ((e.lightMap.value = t.lightMap),
  56620. (e.lightMapIntensity.value = t.lightMapIntensity)),
  56621. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  56622. t.bumpMap && ((e.bumpMap.value = t.bumpMap), (e.bumpScale.value = t.bumpScale)),
  56623. t.normalMap &&
  56624. ((e.normalMap.value = t.normalMap), e.normalScale.value.copy(t.normalScale)),
  56625. t.displacementMap &&
  56626. ((e.displacementMap.value = t.displacementMap),
  56627. (e.displacementScale.value = t.displacementScale),
  56628. (e.displacementBias.value = t.displacementBias))
  56629. }
  56630. function L(e, t) {
  56631. ;(e.roughness.value = t.roughness),
  56632. (e.metalness.value = t.metalness),
  56633. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  56634. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  56635. t.lightMap &&
  56636. ((e.lightMap.value = t.lightMap),
  56637. (e.lightMapIntensity.value = t.lightMapIntensity)),
  56638. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  56639. t.bumpMap && ((e.bumpMap.value = t.bumpMap), (e.bumpScale.value = t.bumpScale)),
  56640. t.normalMap &&
  56641. ((e.normalMap.value = t.normalMap), e.normalScale.value.copy(t.normalScale)),
  56642. t.displacementMap &&
  56643. ((e.displacementMap.value = t.displacementMap),
  56644. (e.displacementScale.value = t.displacementScale),
  56645. (e.displacementBias.value = t.displacementBias)),
  56646. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  56647. }
  56648. function D(e, t) {
  56649. ;(e.ambientLightColor.needsUpdate = t),
  56650. (e.directionalLights.needsUpdate = t),
  56651. (e.pointLights.needsUpdate = t),
  56652. (e.spotLights.needsUpdate = t),
  56653. (e.hemisphereLights.needsUpdate = t)
  56654. }
  56655. function N(e, t) {
  56656. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  56657. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  56658. }
  56659. function B() {
  56660. var e = xe
  56661. return (
  56662. e >= je.maxTextures &&
  56663. console.warn(
  56664. 'WebGLRenderer: trying to use ' +
  56665. e +
  56666. ' texture units while this GPU supports only ' +
  56667. je.maxTextures
  56668. ),
  56669. (xe += 1),
  56670. e
  56671. )
  56672. }
  56673. function F(e, t, i, r) {
  56674. var o, a
  56675. if ('1i' === t) Ge.uniform1i(i, r)
  56676. else if ('1f' === t) Ge.uniform1f(i, r)
  56677. else if ('2f' === t) Ge.uniform2f(i, r[0], r[1])
  56678. else if ('3f' === t) Ge.uniform3f(i, r[0], r[1], r[2])
  56679. else if ('4f' === t) Ge.uniform4f(i, r[0], r[1], r[2], r[3])
  56680. else if ('1iv' === t) Ge.uniform1iv(i, r)
  56681. else if ('3iv' === t) Ge.uniform3iv(i, r)
  56682. else if ('1fv' === t) Ge.uniform1fv(i, r)
  56683. else if ('2fv' === t) Ge.uniform2fv(i, r)
  56684. else if ('3fv' === t) Ge.uniform3fv(i, r)
  56685. else if ('4fv' === t) Ge.uniform4fv(i, r)
  56686. else if ('Matrix2fv' === t) Ge.uniformMatrix2fv(i, !1, r)
  56687. else if ('Matrix3fv' === t) Ge.uniformMatrix3fv(i, !1, r)
  56688. else if ('Matrix4fv' === t) Ge.uniformMatrix4fv(i, !1, r)
  56689. else if ('i' === t) Ge.uniform1i(i, r)
  56690. else if ('f' === t) Ge.uniform1f(i, r)
  56691. else if ('v2' === t) Ge.uniform2f(i, r.x, r.y)
  56692. else if ('v3' === t) Ge.uniform3f(i, r.x, r.y, r.z)
  56693. else if ('v4' === t) Ge.uniform4f(i, r.x, r.y, r.z, r.w)
  56694. else if ('c' === t) Ge.uniform3f(i, r.r, r.g, r.b)
  56695. else if ('s' === t) {
  56696. var s = e.properties
  56697. for (var l in s) {
  56698. var c = s[l],
  56699. h = i[l],
  56700. u = r[l]
  56701. F(c, c.type, h, u)
  56702. }
  56703. } else if ('sa' === t)
  56704. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  56705. for (var l in s) {
  56706. var c = s[l],
  56707. h = i[d][l],
  56708. u = r[d][l]
  56709. F(c, c.type, h, u)
  56710. }
  56711. else if ('iv1' === t) Ge.uniform1iv(i, r)
  56712. else if ('iv' === t) Ge.uniform3iv(i, r)
  56713. else if ('fv1' === t) Ge.uniform1fv(i, r)
  56714. else if ('fv' === t) Ge.uniform3fv(i, r)
  56715. else if ('v2v' === t) {
  56716. void 0 === e._array && (e._array = new Float32Array(2 * r.length))
  56717. for (var d = 0, f = 0, g = r.length; d < g; d++, f += 2)
  56718. (e._array[f + 0] = r[d].x), (e._array[f + 1] = r[d].y)
  56719. Ge.uniform2fv(i, e._array)
  56720. } else if ('v3v' === t) {
  56721. void 0 === e._array && (e._array = new Float32Array(3 * r.length))
  56722. for (var d = 0, m = 0, g = r.length; d < g; d++, m += 3)
  56723. (e._array[m + 0] = r[d].x), (e._array[m + 1] = r[d].y), (e._array[m + 2] = r[d].z)
  56724. Ge.uniform3fv(i, e._array)
  56725. } else if ('v4v' === t) {
  56726. void 0 === e._array && (e._array = new Float32Array(4 * r.length))
  56727. for (var d = 0, v = 0, g = r.length; d < g; d++, v += 4)
  56728. (e._array[v + 0] = r[d].x),
  56729. (e._array[v + 1] = r[d].y),
  56730. (e._array[v + 2] = r[d].z),
  56731. (e._array[v + 3] = r[d].w)
  56732. Ge.uniform4fv(i, e._array)
  56733. } else if ('m2' === t) Ge.uniformMatrix2fv(i, !1, r.elements)
  56734. else if ('m3' === t) Ge.uniformMatrix3fv(i, !1, r.elements)
  56735. else if ('m3v' === t) {
  56736. void 0 === e._array && (e._array = new Float32Array(9 * r.length))
  56737. for (var d = 0, g = r.length; d < g; d++) r[d].flattenToArrayOffset(e._array, 9 * d)
  56738. Ge.uniformMatrix3fv(i, !1, e._array)
  56739. } else if ('m4' === t) Ge.uniformMatrix4fv(i, !1, r.elements)
  56740. else if ('m4v' === t) {
  56741. void 0 === e._array && (e._array = new Float32Array(16 * r.length))
  56742. for (var d = 0, g = r.length; d < g; d++)
  56743. r[d].flattenToArrayOffset(e._array, 16 * d)
  56744. Ge.uniformMatrix4fv(i, !1, e._array)
  56745. } else if ('t' === t) {
  56746. if (((o = r), (a = B()), Ge.uniform1i(i, a), !o)) return
  56747. o instanceof n.CubeTexture || (Array.isArray(o.image) && 6 === o.image.length)
  56748. ? Y(o, a)
  56749. : o instanceof n.WebGLRenderTargetCube
  56750. ? X(o.texture, a)
  56751. : o instanceof n.WebGLRenderTarget
  56752. ? ve.setTexture(o.texture, a)
  56753. : ve.setTexture(o, a)
  56754. } else if ('tv' === t) {
  56755. void 0 === e._array && (e._array = [])
  56756. for (var d = 0, g = e.value.length; d < g; d++) e._array[d] = B()
  56757. Ge.uniform1iv(i, e._array)
  56758. for (var d = 0, g = e.value.length; d < g; d++)
  56759. (o = e.value[d]),
  56760. (a = e._array[d]),
  56761. o &&
  56762. (o instanceof n.CubeTexture ||
  56763. (o.image instanceof Array && 6 === o.image.length)
  56764. ? Y(o, a)
  56765. : o instanceof n.WebGLRenderTarget
  56766. ? ve.setTexture(o.texture, a)
  56767. : o instanceof n.WebGLRenderTargetCube
  56768. ? X(o.texture, a)
  56769. : ve.setTexture(o, a))
  56770. } else console.warn('THREE.WebGLRenderer: Unknown uniform type: ' + t)
  56771. }
  56772. function V(e) {
  56773. for (var t = 0, i = e.length; t < i; t++) {
  56774. var n = e[t][0]
  56775. if (n.needsUpdate !== !1) {
  56776. var r = n.type,
  56777. o = e[t][1],
  56778. a = n.value
  56779. F(n, r, o, a)
  56780. }
  56781. }
  56782. }
  56783. function U(e, t) {
  56784. var i,
  56785. r,
  56786. o,
  56787. a,
  56788. s,
  56789. l,
  56790. c = 0,
  56791. h = 0,
  56792. u = 0,
  56793. d = t.matrixWorldInverse,
  56794. p = 0,
  56795. f = 0,
  56796. g = 0,
  56797. m = 0,
  56798. v = 0
  56799. for (Ue.shadowsPointLight = 0, i = 0, r = e.length; i < r; i++)
  56800. if (
  56801. ((o = e[i]),
  56802. (a = o.color),
  56803. (s = o.intensity),
  56804. (l = o.distance),
  56805. o instanceof n.AmbientLight)
  56806. )
  56807. (c += a.r * s), (h += a.g * s), (u += a.b * s)
  56808. else if (o instanceof n.DirectionalLight) {
  56809. var A = Ke.get(o)
  56810. A.color.copy(o.color).multiplyScalar(o.intensity),
  56811. A.direction.setFromMatrixPosition(o.matrixWorld),
  56812. Ve.setFromMatrixPosition(o.target.matrixWorld),
  56813. A.direction.sub(Ve),
  56814. A.direction.transformDirection(d),
  56815. (A.shadow = o.castShadow),
  56816. o.castShadow &&
  56817. ((A.shadowBias = o.shadow.bias),
  56818. (A.shadowRadius = o.shadow.radius),
  56819. (A.shadowMapSize = o.shadow.mapSize),
  56820. (Ue.shadows[v++] = o)),
  56821. (Ue.directionalShadowMap[p] = o.shadow.map),
  56822. (Ue.directionalShadowMatrix[p] = o.shadow.matrix),
  56823. (Ue.directional[p++] = A)
  56824. } else if (o instanceof n.SpotLight) {
  56825. var A = Ke.get(o)
  56826. A.position.setFromMatrixPosition(o.matrixWorld),
  56827. A.position.applyMatrix4(d),
  56828. A.color.copy(a).multiplyScalar(s),
  56829. (A.distance = l),
  56830. A.direction.setFromMatrixPosition(o.matrixWorld),
  56831. Ve.setFromMatrixPosition(o.target.matrixWorld),
  56832. A.direction.sub(Ve),
  56833. A.direction.transformDirection(d),
  56834. (A.coneCos = Math.cos(o.angle)),
  56835. (A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra))),
  56836. (A.decay = 0 === o.distance ? 0 : o.decay),
  56837. (A.shadow = o.castShadow),
  56838. o.castShadow &&
  56839. ((A.shadowBias = o.shadow.bias),
  56840. (A.shadowRadius = o.shadow.radius),
  56841. (A.shadowMapSize = o.shadow.mapSize),
  56842. (Ue.shadows[v++] = o)),
  56843. (Ue.spotShadowMap[g] = o.shadow.map),
  56844. (Ue.spotShadowMatrix[g] = o.shadow.matrix),
  56845. (Ue.spot[g++] = A)
  56846. } else if (o instanceof n.PointLight) {
  56847. var A = Ke.get(o)
  56848. A.position.setFromMatrixPosition(o.matrixWorld),
  56849. A.position.applyMatrix4(d),
  56850. A.color.copy(o.color).multiplyScalar(o.intensity),
  56851. (A.distance = o.distance),
  56852. (A.decay = 0 === o.distance ? 0 : o.decay),
  56853. (A.shadow = o.castShadow),
  56854. o.castShadow &&
  56855. ((A.shadowBias = o.shadow.bias),
  56856. (A.shadowRadius = o.shadow.radius),
  56857. (A.shadowMapSize = o.shadow.mapSize),
  56858. (Ue.shadows[v++] = o)),
  56859. (Ue.pointShadowMap[f] = o.shadow.map),
  56860. void 0 === Ue.pointShadowMatrix[f] &&
  56861. (Ue.pointShadowMatrix[f] = new n.Matrix4()),
  56862. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  56863. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  56864. (Ue.point[f++] = A)
  56865. } else if (o instanceof n.HemisphereLight) {
  56866. var A = Ke.get(o)
  56867. A.direction.setFromMatrixPosition(o.matrixWorld),
  56868. A.direction.transformDirection(d),
  56869. A.direction.normalize(),
  56870. A.skyColor.copy(o.color).multiplyScalar(s),
  56871. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  56872. (Ue.hemi[m++] = A)
  56873. }
  56874. ;(Ue.ambient[0] = c),
  56875. (Ue.ambient[1] = h),
  56876. (Ue.ambient[2] = u),
  56877. (Ue.directional.length = p),
  56878. (Ue.spot.length = g),
  56879. (Ue.point.length = f),
  56880. (Ue.hemi.length = m),
  56881. (Ue.shadows.length = v),
  56882. (Ue.hash = p + ',' + f + ',' + g + ',' + m + ',' + v)
  56883. }
  56884. function k(e, t, i) {
  56885. var r
  56886. if (
  56887. (i
  56888. ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  56889. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  56890. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  56891. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter)))
  56892. : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  56893. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  56894. (t.wrapS === n.ClampToEdgeWrapping && t.wrapT === n.ClampToEdgeWrapping) ||
  56895. console.warn(
  56896. 'THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.',
  56897. t
  56898. ),
  56899. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  56900. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  56901. t.minFilter !== n.NearestFilter &&
  56902. t.minFilter !== n.LinearFilter &&
  56903. console.warn(
  56904. 'THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.',
  56905. t
  56906. )),
  56907. (r = We.get('EXT_texture_filter_anisotropic')))
  56908. ) {
  56909. if (t.type === n.FloatType && null === We.get('OES_texture_float_linear')) return
  56910. if (t.type === n.HalfFloatType && null === We.get('OES_texture_half_float_linear'))
  56911. return
  56912. ;(t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) &&
  56913. (Ge.texParameterf(
  56914. e,
  56915. r.TEXTURE_MAX_ANISOTROPY_EXT,
  56916. Math.min(t.anisotropy, ve.getMaxAnisotropy())
  56917. ),
  56918. (Xe.get(t).__currentAnisotropy = t.anisotropy))
  56919. }
  56920. }
  56921. function H(e, t, i) {
  56922. void 0 === e.__webglInit &&
  56923. ((e.__webglInit = !0),
  56924. t.addEventListener('dispose', s),
  56925. (e.__webglTexture = Ge.createTexture()),
  56926. ke.textures++),
  56927. Ye.activeTexture(Ge.TEXTURE0 + i),
  56928. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  56929. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  56930. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  56931. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment)
  56932. var r = G(t.image, je.maxTextureSize)
  56933. W(t) && z(r) === !1 && (r = j(r))
  56934. var o = z(r),
  56935. a = ee(t.format),
  56936. l = ee(t.type)
  56937. k(Ge.TEXTURE_2D, t, o)
  56938. var c,
  56939. h = t.mipmaps
  56940. if (t instanceof n.DataTexture)
  56941. if (h.length > 0 && o) {
  56942. for (var u = 0, d = h.length; u < d; u++)
  56943. (c = h[u]),
  56944. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data)
  56945. t.generateMipmaps = !1
  56946. } else Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data)
  56947. else if (t instanceof n.CompressedTexture)
  56948. for (var u = 0, d = h.length; u < d; u++)
  56949. (c = h[u]),
  56950. t.format !== n.RGBAFormat && t.format !== n.RGBFormat
  56951. ? Ye.getCompressedTextureFormats().indexOf(a) > -1
  56952. ? Ye.compressedTexImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, c.data)
  56953. : console.warn(
  56954. 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()'
  56955. )
  56956. : Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data)
  56957. else if (h.length > 0 && o) {
  56958. for (var u = 0, d = h.length; u < d; u++)
  56959. (c = h[u]), Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c)
  56960. t.generateMipmaps = !1
  56961. } else Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r)
  56962. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  56963. (e.__version = t.version),
  56964. t.onUpdate && t.onUpdate(t)
  56965. }
  56966. function G(e, t) {
  56967. if (e.width > t || e.height > t) {
  56968. var i = t / Math.max(e.width, e.height),
  56969. n = document.createElement('canvas')
  56970. ;(n.width = Math.floor(e.width * i)), (n.height = Math.floor(e.height * i))
  56971. var r = n.getContext('2d')
  56972. return (
  56973. r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  56974. console.warn(
  56975. 'THREE.WebGLRenderer: image is too big (' +
  56976. e.width +
  56977. 'x' +
  56978. e.height +
  56979. '). Resized to ' +
  56980. n.width +
  56981. 'x' +
  56982. n.height,
  56983. e
  56984. ),
  56985. n
  56986. )
  56987. }
  56988. return e
  56989. }
  56990. function z(e) {
  56991. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  56992. }
  56993. function W(e) {
  56994. return (
  56995. e.wrapS !== n.ClampToEdgeWrapping ||
  56996. e.wrapT !== n.ClampToEdgeWrapping ||
  56997. (e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter)
  56998. )
  56999. }
  57000. function j(e) {
  57001. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  57002. var t = document.createElement('canvas')
  57003. ;(t.width = n.Math.nearestPowerOfTwo(e.width)),
  57004. (t.height = n.Math.nearestPowerOfTwo(e.height))
  57005. var i = t.getContext('2d')
  57006. return (
  57007. i.drawImage(e, 0, 0, t.width, t.height),
  57008. console.warn(
  57009. 'THREE.WebGLRenderer: image is not power of two (' +
  57010. e.width +
  57011. 'x' +
  57012. e.height +
  57013. '). Resized to ' +
  57014. t.width +
  57015. 'x' +
  57016. t.height,
  57017. e
  57018. ),
  57019. t
  57020. )
  57021. }
  57022. return e
  57023. }
  57024. function Y(e, t) {
  57025. var i = Xe.get(e)
  57026. if (6 === e.image.length)
  57027. if (e.version > 0 && i.__version !== e.version) {
  57028. i.__image__webglTextureCube ||
  57029. (e.addEventListener('dispose', s),
  57030. (i.__image__webglTextureCube = Ge.createTexture()),
  57031. ke.textures++),
  57032. Ye.activeTexture(Ge.TEXTURE0 + t),
  57033. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  57034. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY)
  57035. for (
  57036. var r = e instanceof n.CompressedTexture,
  57037. o = e.image[0] instanceof n.DataTexture,
  57038. a = [],
  57039. l = 0;
  57040. l < 6;
  57041. l++
  57042. )
  57043. !ve.autoScaleCubemaps || r || o
  57044. ? (a[l] = o ? e.image[l].image : e.image[l])
  57045. : (a[l] = G(e.image[l], je.maxCubemapSize))
  57046. var c = a[0],
  57047. h = z(c),
  57048. u = ee(e.format),
  57049. d = ee(e.type)
  57050. k(Ge.TEXTURE_CUBE_MAP, e, h)
  57051. for (var l = 0; l < 6; l++)
  57052. if (r)
  57053. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  57054. (p = f[g]),
  57055. e.format !== n.RGBAFormat && e.format !== n.RGBFormat
  57056. ? Ye.getCompressedTextureFormats().indexOf(u) > -1
  57057. ? Ye.compressedTexImage2D(
  57058. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l,
  57059. g,
  57060. u,
  57061. p.width,
  57062. p.height,
  57063. 0,
  57064. p.data
  57065. )
  57066. : console.warn(
  57067. 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()'
  57068. )
  57069. : Ye.texImage2D(
  57070. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l,
  57071. g,
  57072. u,
  57073. p.width,
  57074. p.height,
  57075. 0,
  57076. u,
  57077. d,
  57078. p.data
  57079. )
  57080. else
  57081. o
  57082. ? Ye.texImage2D(
  57083. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l,
  57084. 0,
  57085. u,
  57086. a[l].width,
  57087. a[l].height,
  57088. 0,
  57089. u,
  57090. d,
  57091. a[l].data
  57092. )
  57093. : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, 0, u, u, d, a[l])
  57094. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  57095. (i.__version = e.version),
  57096. e.onUpdate && e.onUpdate(e)
  57097. } else
  57098. Ye.activeTexture(Ge.TEXTURE0 + t),
  57099. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  57100. }
  57101. function X(e, t) {
  57102. Ye.activeTexture(Ge.TEXTURE0 + t),
  57103. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  57104. }
  57105. function Z(e, t, i, n) {
  57106. var r = ee(t.texture.format),
  57107. o = ee(t.texture.type)
  57108. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  57109. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  57110. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  57111. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  57112. }
  57113. function q(e, t) {
  57114. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  57115. t.depthBuffer && !t.stencilBuffer
  57116. ? (Ge.renderbufferStorage(
  57117. Ge.RENDERBUFFER,
  57118. Ge.DEPTH_COMPONENT16,
  57119. t.width,
  57120. t.height
  57121. ),
  57122. Ge.framebufferRenderbuffer(
  57123. Ge.FRAMEBUFFER,
  57124. Ge.DEPTH_ATTACHMENT,
  57125. Ge.RENDERBUFFER,
  57126. e
  57127. ))
  57128. : t.depthBuffer && t.stencilBuffer
  57129. ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_STENCIL, t.width, t.height),
  57130. Ge.framebufferRenderbuffer(
  57131. Ge.FRAMEBUFFER,
  57132. Ge.DEPTH_STENCIL_ATTACHMENT,
  57133. Ge.RENDERBUFFER,
  57134. e
  57135. ))
  57136. : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  57137. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  57138. }
  57139. function K(e) {
  57140. var t = Xe.get(e),
  57141. i = e instanceof n.WebGLRenderTargetCube
  57142. if (i) {
  57143. t.__webglDepthbuffer = []
  57144. for (var r = 0; r < 6; r++)
  57145. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  57146. (t.__webglDepthbuffer[r] = Ge.createRenderbuffer()),
  57147. q(t.__webglDepthbuffer[r], e)
  57148. } else
  57149. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  57150. (t.__webglDepthbuffer = Ge.createRenderbuffer()),
  57151. q(t.__webglDepthbuffer, e)
  57152. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  57153. }
  57154. function Q(e) {
  57155. var t = Xe.get(e),
  57156. i = Xe.get(e.texture)
  57157. e.addEventListener('dispose', l),
  57158. (i.__webglTexture = Ge.createTexture()),
  57159. ke.textures++
  57160. var r = e instanceof n.WebGLRenderTargetCube,
  57161. o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  57162. if (r) {
  57163. t.__webglFramebuffer = []
  57164. for (var a = 0; a < 6; a++) t.__webglFramebuffer[a] = Ge.createFramebuffer()
  57165. } else t.__webglFramebuffer = Ge.createFramebuffer()
  57166. if (r) {
  57167. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  57168. k(Ge.TEXTURE_CUBE_MAP, e.texture, o)
  57169. for (var a = 0; a < 6; a++)
  57170. Z(
  57171. t.__webglFramebuffer[a],
  57172. e,
  57173. Ge.COLOR_ATTACHMENT0,
  57174. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a
  57175. )
  57176. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  57177. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  57178. } else
  57179. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  57180. k(Ge.TEXTURE_2D, e.texture, o),
  57181. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  57182. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  57183. Ye.bindTexture(Ge.TEXTURE_2D, null)
  57184. e.depthBuffer && K(e)
  57185. }
  57186. function J(e) {
  57187. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D,
  57188. i = Xe.get(e.texture).__webglTexture
  57189. Ye.bindTexture(t, i), Ge.generateMipmap(t), Ye.bindTexture(t, null)
  57190. }
  57191. function $(e) {
  57192. return e === n.NearestFilter ||
  57193. e === n.NearestMipMapNearestFilter ||
  57194. e === n.NearestMipMapLinearFilter
  57195. ? Ge.NEAREST
  57196. : Ge.LINEAR
  57197. }
  57198. function ee(e) {
  57199. var t
  57200. if (e === n.RepeatWrapping) return Ge.REPEAT
  57201. if (e === n.ClampToEdgeWrapping) return Ge.CLAMP_TO_EDGE
  57202. if (e === n.MirroredRepeatWrapping) return Ge.MIRRORED_REPEAT
  57203. if (e === n.NearestFilter) return Ge.NEAREST
  57204. if (e === n.NearestMipMapNearestFilter) return Ge.NEAREST_MIPMAP_NEAREST
  57205. if (e === n.NearestMipMapLinearFilter) return Ge.NEAREST_MIPMAP_LINEAR
  57206. if (e === n.LinearFilter) return Ge.LINEAR
  57207. if (e === n.LinearMipMapNearestFilter) return Ge.LINEAR_MIPMAP_NEAREST
  57208. if (e === n.LinearMipMapLinearFilter) return Ge.LINEAR_MIPMAP_LINEAR
  57209. if (e === n.UnsignedByteType) return Ge.UNSIGNED_BYTE
  57210. if (e === n.UnsignedShort4444Type) return Ge.UNSIGNED_SHORT_4_4_4_4
  57211. if (e === n.UnsignedShort5551Type) return Ge.UNSIGNED_SHORT_5_5_5_1
  57212. if (e === n.UnsignedShort565Type) return Ge.UNSIGNED_SHORT_5_6_5
  57213. if (e === n.ByteType) return Ge.BYTE
  57214. if (e === n.ShortType) return Ge.SHORT
  57215. if (e === n.UnsignedShortType) return Ge.UNSIGNED_SHORT
  57216. if (e === n.IntType) return Ge.INT
  57217. if (e === n.UnsignedIntType) return Ge.UNSIGNED_INT
  57218. if (e === n.FloatType) return Ge.FLOAT
  57219. if (((t = We.get('OES_texture_half_float')), null !== t && e === n.HalfFloatType))
  57220. return t.HALF_FLOAT_OES
  57221. if (e === n.AlphaFormat) return Ge.ALPHA
  57222. if (e === n.RGBFormat) return Ge.RGB
  57223. if (e === n.RGBAFormat) return Ge.RGBA
  57224. if (e === n.LuminanceFormat) return Ge.LUMINANCE
  57225. if (e === n.LuminanceAlphaFormat) return Ge.LUMINANCE_ALPHA
  57226. if (e === n.AddEquation) return Ge.FUNC_ADD
  57227. if (e === n.SubtractEquation) return Ge.FUNC_SUBTRACT
  57228. if (e === n.ReverseSubtractEquation) return Ge.FUNC_REVERSE_SUBTRACT
  57229. if (e === n.ZeroFactor) return Ge.ZERO
  57230. if (e === n.OneFactor) return Ge.ONE
  57231. if (e === n.SrcColorFactor) return Ge.SRC_COLOR
  57232. if (e === n.OneMinusSrcColorFactor) return Ge.ONE_MINUS_SRC_COLOR
  57233. if (e === n.SrcAlphaFactor) return Ge.SRC_ALPHA
  57234. if (e === n.OneMinusSrcAlphaFactor) return Ge.ONE_MINUS_SRC_ALPHA
  57235. if (e === n.DstAlphaFactor) return Ge.DST_ALPHA
  57236. if (e === n.OneMinusDstAlphaFactor) return Ge.ONE_MINUS_DST_ALPHA
  57237. if (e === n.DstColorFactor) return Ge.DST_COLOR
  57238. if (e === n.OneMinusDstColorFactor) return Ge.ONE_MINUS_DST_COLOR
  57239. if (e === n.SrcAlphaSaturateFactor) return Ge.SRC_ALPHA_SATURATE
  57240. if (((t = We.get('WEBGL_compressed_texture_s3tc')), null !== t)) {
  57241. if (e === n.RGB_S3TC_DXT1_Format) return t.COMPRESSED_RGB_S3TC_DXT1_EXT
  57242. if (e === n.RGBA_S3TC_DXT1_Format) return t.COMPRESSED_RGBA_S3TC_DXT1_EXT
  57243. if (e === n.RGBA_S3TC_DXT3_Format) return t.COMPRESSED_RGBA_S3TC_DXT3_EXT
  57244. if (e === n.RGBA_S3TC_DXT5_Format) return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  57245. }
  57246. if (((t = We.get('WEBGL_compressed_texture_pvrtc')), null !== t)) {
  57247. if (e === n.RGB_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG
  57248. if (e === n.RGB_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG
  57249. if (e === n.RGBA_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
  57250. if (e === n.RGBA_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  57251. }
  57252. if (
  57253. ((t = We.get('WEBGL_compressed_texture_etc1')),
  57254. null !== t && e === n.RGB_ETC1_Format)
  57255. )
  57256. return t.COMPRESSED_RGB_ETC1_WEBGL
  57257. if (((t = We.get('EXT_blend_minmax')), null !== t)) {
  57258. if (e === n.MinEquation) return t.MIN_EXT
  57259. if (e === n.MaxEquation) return t.MAX_EXT
  57260. }
  57261. return 0
  57262. }
  57263. console.log('THREE.WebGLRenderer', n.REVISION), (e = e || {})
  57264. var te = void 0 !== e.canvas ? e.canvas : document.createElement('canvas'),
  57265. ie = void 0 !== e.context ? e.context : null,
  57266. ne = void 0 !== e.alpha && e.alpha,
  57267. re = void 0 === e.depth || e.depth,
  57268. oe = void 0 === e.stencil || e.stencil,
  57269. ae = void 0 !== e.antialias && e.antialias,
  57270. se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha,
  57271. le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer,
  57272. ce = [],
  57273. he = [],
  57274. ue = -1,
  57275. de = [],
  57276. pe = -1,
  57277. fe = new Float32Array(8),
  57278. ge = [],
  57279. me = []
  57280. ;(this.domElement = te),
  57281. (this.context = null),
  57282. (this.autoClear = !0),
  57283. (this.autoClearColor = !0),
  57284. (this.autoClearDepth = !0),
  57285. (this.autoClearStencil = !0),
  57286. (this.sortObjects = !0),
  57287. (this.gammaFactor = 2),
  57288. (this.gammaInput = !1),
  57289. (this.gammaOutput = !1),
  57290. (this.physicallyCorrectLights = !1),
  57291. (this.toneMapping = n.LinearToneMapping),
  57292. (this.toneMappingExposure = 1),
  57293. (this.toneMappingWhitePoint = 1),
  57294. (this.maxMorphTargets = 8),
  57295. (this.maxMorphNormals = 4),
  57296. (this.autoScaleCubemaps = !0)
  57297. var ve = this,
  57298. Ae = null,
  57299. ye = null,
  57300. Ce = null,
  57301. Ie = -1,
  57302. Ee = '',
  57303. be = null,
  57304. we = new n.Vector4(),
  57305. _e = null,
  57306. Te = new n.Vector4(),
  57307. xe = 0,
  57308. Se = new n.Color(0),
  57309. Me = 0,
  57310. Re = te.width,
  57311. Pe = te.height,
  57312. Oe = 1,
  57313. Le = new n.Vector4(0, 0, Re, Pe),
  57314. De = !1,
  57315. Ne = new n.Vector4(0, 0, Re, Pe),
  57316. Be = new n.Frustum(),
  57317. Fe = new n.Matrix4(),
  57318. Ve = new n.Vector3(),
  57319. Ue = {
  57320. hash: '',
  57321. ambient: [0, 0, 0],
  57322. directional: [],
  57323. directionalShadowMap: [],
  57324. directionalShadowMatrix: [],
  57325. spot: [],
  57326. spotShadowMap: [],
  57327. spotShadowMatrix: [],
  57328. point: [],
  57329. pointShadowMap: [],
  57330. pointShadowMatrix: [],
  57331. hemi: [],
  57332. shadows: [],
  57333. shadowsPointLight: 0
  57334. },
  57335. ke = {
  57336. geometries: 0,
  57337. textures: 0
  57338. },
  57339. He = {
  57340. calls: 0,
  57341. vertices: 0,
  57342. faces: 0,
  57343. points: 0
  57344. }
  57345. this.info = {
  57346. render: He,
  57347. memory: ke,
  57348. programs: null
  57349. }
  57350. var Ge
  57351. try {
  57352. var ze = {
  57353. alpha: ne,
  57354. depth: re,
  57355. stencil: oe,
  57356. antialias: ae,
  57357. premultipliedAlpha: se,
  57358. preserveDrawingBuffer: le
  57359. }
  57360. if (
  57361. ((Ge = ie || te.getContext('webgl', ze) || te.getContext('experimental-webgl', ze)),
  57362. null === Ge)
  57363. )
  57364. throw null !== te.getContext('webgl')
  57365. ? 'Error creating WebGL context with your selected attributes.'
  57366. : 'Error creating WebGL context.'
  57367. void 0 === Ge.getShaderPrecisionFormat &&
  57368. (Ge.getShaderPrecisionFormat = function () {
  57369. return {
  57370. rangeMin: 1,
  57371. rangeMax: 1,
  57372. precision: 1
  57373. }
  57374. }),
  57375. te.addEventListener('webglcontextlost', a, !1)
  57376. } catch (e) {
  57377. console.error('THREE.WebGLRenderer: ' + e)
  57378. }
  57379. var We = new n.WebGLExtensions(Ge)
  57380. We.get('OES_texture_float'),
  57381. We.get('OES_texture_float_linear'),
  57382. We.get('OES_texture_half_float'),
  57383. We.get('OES_texture_half_float_linear'),
  57384. We.get('OES_standard_derivatives'),
  57385. We.get('ANGLE_instanced_arrays'),
  57386. We.get('OES_element_index_uint') && (n.BufferGeometry.MaxIndex = 4294967296)
  57387. var je = new n.WebGLCapabilities(Ge, We, e),
  57388. Ye = new n.WebGLState(Ge, We, ee),
  57389. Xe = new n.WebGLProperties(),
  57390. Ze = new n.WebGLObjects(Ge, Xe, this.info),
  57391. qe = new n.WebGLPrograms(this, je),
  57392. Ke = new n.WebGLLights()
  57393. this.info.programs = qe.programs
  57394. var Qe = new n.WebGLBufferRenderer(Ge, We, He),
  57395. Je = new n.WebGLIndexedBufferRenderer(Ge, We, He)
  57396. r(),
  57397. (this.context = Ge),
  57398. (this.capabilities = je),
  57399. (this.extensions = We),
  57400. (this.properties = Xe),
  57401. (this.state = Ye)
  57402. var $e = new n.WebGLShadowMap(this, Ue, Ze)
  57403. this.shadowMap = $e
  57404. var et = new n.SpritePlugin(this, ge),
  57405. tt = new n.LensFlarePlugin(this, me)
  57406. ;(this.getContext = function () {
  57407. return Ge
  57408. }),
  57409. (this.getContextAttributes = function () {
  57410. return Ge.getContextAttributes()
  57411. }),
  57412. (this.forceContextLoss = function () {
  57413. We.get('WEBGL_lose_context').loseContext()
  57414. }),
  57415. (this.getMaxAnisotropy = (function () {
  57416. var e
  57417. return function () {
  57418. if (void 0 !== e) return e
  57419. var t = We.get('EXT_texture_filter_anisotropic')
  57420. return (e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0)
  57421. }
  57422. })()),
  57423. (this.getPrecision = function () {
  57424. return je.precision
  57425. }),
  57426. (this.getPixelRatio = function () {
  57427. return Oe
  57428. }),
  57429. (this.setPixelRatio = function (e) {
  57430. void 0 !== e && ((Oe = e), this.setSize(Ne.z, Ne.w, !1))
  57431. }),
  57432. (this.getSize = function () {
  57433. return {
  57434. width: Re,
  57435. height: Pe
  57436. }
  57437. }),
  57438. (this.setSize = function (e, t, i, devicePixelRatio) {
  57439. if (devicePixelRatio != void 0)
  57440. Oe = devicePixelRatio //xzw add 改分辨率 始终保持清晰
  57441. ;(Re = e),
  57442. (Pe = t),
  57443. (te.width = e * Oe),
  57444. (te.height = t * Oe),
  57445. i !== !1 && ((te.style.width = e + 'px'), (te.style.height = t + 'px')),
  57446. this.setViewport(0, 0, e, t)
  57447. }),
  57448. (this.setViewport = function (e, t, i, n) {
  57449. Ye.viewport(Ne.set(e, t, i, n))
  57450. }),
  57451. (this.setScissor = function (e, t, i, n) {
  57452. Ye.scissor(Le.set(e, t, i, n))
  57453. }),
  57454. (this.setScissorTest = function (e) {
  57455. Ye.setScissorTest((De = e))
  57456. }),
  57457. (this.getClearColor = function () {
  57458. return Se
  57459. }),
  57460. (this.setClearColor = function (e, t) {
  57461. Se.set(e), (Me = void 0 !== t ? t : 1), i(Se.r, Se.g, Se.b, Me)
  57462. }),
  57463. (this.getClearAlpha = function () {
  57464. return Me
  57465. }),
  57466. (this.setClearAlpha = function (e) {
  57467. ;(Me = e), i(Se.r, Se.g, Se.b, Me)
  57468. }),
  57469. (this.clear = function (e, t, i) {
  57470. var n = 0
  57471. ;(void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  57472. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  57473. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  57474. Ge.clear(n)
  57475. }),
  57476. (this.clearColor = function () {
  57477. this.clear(!0, !1, !1)
  57478. }),
  57479. (this.clearDepth = function () {
  57480. this.clear(!1, !0, !1)
  57481. }),
  57482. (this.clearStencil = function () {
  57483. this.clear(!1, !1, !0)
  57484. }),
  57485. (this.clearTarget = function (e, t, i, n) {
  57486. this.setRenderTarget(e), this.clear(t, i, n)
  57487. }),
  57488. (this.resetGLState = o),
  57489. (this.dispose = function () {
  57490. te.removeEventListener('webglcontextlost', a, !1)
  57491. }),
  57492. (this.renderBufferImmediate = function (e, t, i) {
  57493. Ye.initAttributes()
  57494. var r = Xe.get(e)
  57495. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  57496. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  57497. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  57498. e.hasColors && !r.color && (r.color = Ge.createBuffer())
  57499. var o = t.getAttributes()
  57500. if (
  57501. (e.hasPositions &&
  57502. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  57503. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  57504. Ye.enableAttribute(o.position),
  57505. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  57506. e.hasNormals)
  57507. ) {
  57508. if (
  57509. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  57510. 'MeshPhongMaterial' !== i.type &&
  57511. 'MeshStandardMaterial' !== i.type &&
  57512. i.shading === n.FlatShading)
  57513. )
  57514. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  57515. var l = e.normalArray,
  57516. c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3,
  57517. h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3,
  57518. u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3
  57519. ;(l[a + 0] = c),
  57520. (l[a + 1] = h),
  57521. (l[a + 2] = u),
  57522. (l[a + 3] = c),
  57523. (l[a + 4] = h),
  57524. (l[a + 5] = u),
  57525. (l[a + 6] = c),
  57526. (l[a + 7] = h),
  57527. (l[a + 8] = u)
  57528. }
  57529. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  57530. Ye.enableAttribute(o.normal),
  57531. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  57532. }
  57533. e.hasUvs &&
  57534. i.map &&
  57535. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  57536. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  57537. Ye.enableAttribute(o.uv),
  57538. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  57539. e.hasColors &&
  57540. i.vertexColors !== n.NoColors &&
  57541. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  57542. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  57543. Ye.enableAttribute(o.color),
  57544. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  57545. Ye.disableUnusedAttributes(),
  57546. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  57547. (e.count = 0)
  57548. }),
  57549. (this.renderBufferDirect = function (e, i, r, o, a, s) {
  57550. E(o)
  57551. var l = w(e, i, o, a),
  57552. c = !1,
  57553. h = r.id + '_' + l.id + '_' + o.wireframe
  57554. h !== Ee && ((Ee = h), (c = !0))
  57555. var u = a.morphTargetInfluences
  57556. if (void 0 !== u) {
  57557. for (var d = [], p = 0, m = u.length; p < m; p++) {
  57558. var v = u[p]
  57559. d.push([v, p])
  57560. }
  57561. d.sort(g), d.length > 8 && (d.length = 8)
  57562. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  57563. var v = d[p]
  57564. if (((fe[p] = v[0]), 0 !== v[0])) {
  57565. var y = v[1]
  57566. o.morphTargets === !0 &&
  57567. A.position &&
  57568. r.addAttribute('morphTarget' + p, A.position[y]),
  57569. o.morphNormals === !0 &&
  57570. A.normal &&
  57571. r.addAttribute('morphNormal' + p, A.normal[y])
  57572. } else
  57573. o.morphTargets === !0 && r.removeAttribute('morphTarget' + p),
  57574. o.morphNormals === !0 && r.removeAttribute('morphNormal' + p)
  57575. }
  57576. var C = l.getUniforms()
  57577. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  57578. (c = !0)
  57579. }
  57580. var y = r.index,
  57581. I = r.attributes.position
  57582. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r))
  57583. var b
  57584. null !== y ? ((b = Je), b.setIndex(y)) : (b = Qe),
  57585. c &&
  57586. (f(o, l, r),
  57587. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)))
  57588. var _ = 0,
  57589. T = 1 / 0
  57590. null !== y ? (T = y.count) : void 0 !== I && (T = I.count)
  57591. var x = r.drawRange.start,
  57592. S = r.drawRange.count,
  57593. M = null !== s ? s.start : 0,
  57594. R = null !== s ? s.count : 1 / 0,
  57595. P = Math.max(_, x, M),
  57596. O = Math.min(_ + T, x + S, M + R) - 1,
  57597. L = Math.max(0, O - P + 1)
  57598. if (a instanceof n.Mesh)
  57599. if (o.wireframe === !0)
  57600. Ye.setLineWidth(o.wireframeLinewidth * t()), b.setMode(Ge.LINES)
  57601. else
  57602. switch (a.drawMode) {
  57603. case n.TrianglesDrawMode:
  57604. b.setMode(Ge.TRIANGLES)
  57605. break
  57606. case n.TriangleStripDrawMode:
  57607. b.setMode(Ge.TRIANGLE_STRIP)
  57608. break
  57609. case n.TriangleFanDrawMode:
  57610. b.setMode(Ge.TRIANGLE_FAN)
  57611. }
  57612. else if (a instanceof n.Line) {
  57613. var D = o.linewidth
  57614. void 0 === D && (D = 1),
  57615. Ye.setLineWidth(D * t()),
  57616. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  57617. } else a instanceof n.Points && b.setMode(Ge.POINTS)
  57618. r instanceof n.InstancedBufferGeometry
  57619. ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L)
  57620. : b.render(P, L)
  57621. }),
  57622. (this.render = function (e, t, i, r) {
  57623. if (t instanceof n.Camera == !1)
  57624. return void console.error(
  57625. 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.'
  57626. )
  57627. var o = e.fog
  57628. if (
  57629. ((Ee = ''),
  57630. (Ie = -1),
  57631. (be = null),
  57632. e.autoUpdate === !0 && e.updateMatrixWorld(),
  57633. null === t.parent && t.updateMatrixWorld(),
  57634. t.matrixWorldInverse.getInverse(t.matrixWorld),
  57635. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  57636. Be.setFromMatrix(Fe),
  57637. (ce.length = 0),
  57638. (ue = -1),
  57639. (pe = -1),
  57640. (ge.length = 0),
  57641. (me.length = 0),
  57642. y(e, t),
  57643. (he.length = ue + 1),
  57644. (de.length = pe + 1),
  57645. ve.sortObjects === !0 && (he.sort(m), de.sort(v)),
  57646. U(ce, t),
  57647. $e.render(e, t),
  57648. (He.calls = 0),
  57649. (He.vertices = 0),
  57650. (He.faces = 0),
  57651. (He.points = 0),
  57652. void 0 === i && (i = null),
  57653. this.setRenderTarget(i),
  57654. (this.autoClear || r) &&
  57655. this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  57656. e.overrideMaterial)
  57657. ) {
  57658. var a = e.overrideMaterial
  57659. C(he, t, o, a), C(de, t, o, a)
  57660. } else Ye.setBlending(n.NoBlending), C(he, t, o), C(de, t, o)
  57661. if ((et.render(e, t), tt.render(e, t, Te), i)) {
  57662. var s = i.texture
  57663. s.generateMipmaps &&
  57664. z(i) &&
  57665. s.minFilter !== n.NearestFilter &&
  57666. s.minFilter !== n.LinearFilter &&
  57667. J(i)
  57668. }
  57669. Ye.setDepthTest(!0), Ye.setDepthWrite(!0), Ye.setColorWrite(!0)
  57670. }),
  57671. (this.setFaceCulling = function (e, t) {
  57672. e === n.CullFaceNone
  57673. ? Ye.disable(Ge.CULL_FACE)
  57674. : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  57675. e === n.CullFaceBack
  57676. ? Ge.cullFace(Ge.BACK)
  57677. : e === n.CullFaceFront
  57678. ? Ge.cullFace(Ge.FRONT)
  57679. : Ge.cullFace(Ge.FRONT_AND_BACK),
  57680. Ye.enable(Ge.CULL_FACE))
  57681. }),
  57682. (this.setTexture = function (e, t) {
  57683. var i = Xe.get(e)
  57684. if (e.version > 0 && i.__version !== e.version) {
  57685. var n = e.image
  57686. return void 0 === n
  57687. ? void console.warn(
  57688. 'THREE.WebGLRenderer: Texture marked for update but image is undefined',
  57689. e
  57690. )
  57691. : n.complete === !1
  57692. ? void console.warn(
  57693. 'THREE.WebGLRenderer: Texture marked for update but image is incomplete',
  57694. e
  57695. )
  57696. : void H(i, e, t)
  57697. }
  57698. Ye.activeTexture(Ge.TEXTURE0 + t), Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  57699. }),
  57700. (this.getCurrentRenderTarget = function () {
  57701. return ye
  57702. }),
  57703. (this.setRenderTargetFramebuffer = function (renderTarget, defaultFramebuffer) {
  57704. //add
  57705. const renderTargetProperties = Xe.get(renderTarget)
  57706. renderTargetProperties.__webglFramebuffer = defaultFramebuffer
  57707. renderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === undefined
  57708. }),
  57709. (this.setFramebuffer = function (value) {
  57710. //add
  57711. if (Ce !== value && ye === null) Ge.bindFramebuffer(36160, value)
  57712. Ce = value
  57713. }),
  57714. (this.setRenderTarget = function (e) {
  57715. ;(ye = e), e && void 0 === Xe.get(e).__webglFramebuffer && Q(e)
  57716. var t,
  57717. i = e instanceof n.WebGLRenderTargetCube
  57718. if (e) {
  57719. var r = Xe.get(e)
  57720. ;(t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer),
  57721. we.copy(e.scissor),
  57722. (_e = e.scissorTest),
  57723. Te.copy(e.viewport)
  57724. } else
  57725. (t = null),
  57726. we.copy(Le).multiplyScalar(Oe),
  57727. (_e = De),
  57728. Te.copy(Ne).multiplyScalar(Oe)
  57729. if (
  57730. (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t), (Ce = t)),
  57731. Ye.scissor(we),
  57732. Ye.setScissorTest(_e),
  57733. Ye.viewport(Te),
  57734. i)
  57735. ) {
  57736. var o = Xe.get(e.texture)
  57737. Ge.framebufferTexture2D(
  57738. Ge.FRAMEBUFFER,
  57739. Ge.COLOR_ATTACHMENT0,
  57740. Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace,
  57741. o.__webglTexture,
  57742. e.activeMipMapLevel
  57743. )
  57744. }
  57745. }),
  57746. (this.readRenderTargetPixels = function (e, t, i, r, o, a) {
  57747. if (e instanceof n.WebGLRenderTarget == !1)
  57748. return void console.error(
  57749. 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.'
  57750. )
  57751. var s = Xe.get(e).__webglFramebuffer
  57752. if (s) {
  57753. var l = !1
  57754. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s), (l = !0))
  57755. try {
  57756. var c = e.texture
  57757. if (
  57758. c.format !== n.RGBAFormat &&
  57759. ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT)
  57760. )
  57761. return void console.error(
  57762. 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.'
  57763. )
  57764. if (
  57765. !(
  57766. c.type === n.UnsignedByteType ||
  57767. ee(c.type) === Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_TYPE) ||
  57768. (c.type === n.FloatType && We.get('WEBGL_color_buffer_float')) ||
  57769. (c.type === n.HalfFloatType && We.get('EXT_color_buffer_half_float'))
  57770. )
  57771. )
  57772. return void console.error(
  57773. 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.'
  57774. )
  57775. Ge.checkFramebufferStatus(Ge.FRAMEBUFFER) === Ge.FRAMEBUFFER_COMPLETE
  57776. ? Ge.readPixels(t, i, r, o, ee(c.format), ee(c.type), a)
  57777. : console.error(
  57778. 'THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.'
  57779. )
  57780. } finally {
  57781. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  57782. }
  57783. }
  57784. })
  57785. }),
  57786. (n.WebGLRenderTarget = function (e, t, i) {
  57787. ;(this.uuid = n.Math.generateUUID()),
  57788. (this.width = e),
  57789. (this.height = t),
  57790. (this.scissor = new n.Vector4(0, 0, e, t)),
  57791. (this.scissorTest = !1),
  57792. (this.viewport = new n.Vector4(0, 0, e, t)),
  57793. (i = i || {}),
  57794. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  57795. (this.texture = new n.Texture(
  57796. void 0,
  57797. void 0,
  57798. i.wrapS,
  57799. i.wrapT,
  57800. i.magFilter,
  57801. i.minFilter,
  57802. i.format,
  57803. i.type,
  57804. i.anisotropy
  57805. )),
  57806. (this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer),
  57807. (this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer)
  57808. }),
  57809. (n.WebGLRenderTarget.prototype = {
  57810. constructor: n.WebGLRenderTarget,
  57811. setSize: function (e, t) {
  57812. ;(this.width === e && this.height === t) ||
  57813. ((this.width = e), (this.height = t), this.dispose()),
  57814. this.viewport.set(0, 0, e, t),
  57815. this.scissor.set(0, 0, e, t)
  57816. },
  57817. clone: function () {
  57818. return new this.constructor().copy(this)
  57819. },
  57820. copy: function (e) {
  57821. return (
  57822. (this.width = e.width),
  57823. (this.height = e.height),
  57824. this.viewport.copy(e.viewport),
  57825. (this.texture = e.texture.clone()),
  57826. (this.depthBuffer = e.depthBuffer),
  57827. (this.stencilBuffer = e.stencilBuffer),
  57828. this
  57829. )
  57830. },
  57831. dispose: function () {
  57832. this.dispatchEvent({
  57833. type: 'dispose'
  57834. })
  57835. }
  57836. }),
  57837. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  57838. (n.WebGLRenderTargetCube = function (e, t, i) {
  57839. n.WebGLRenderTarget.call(this, e, t, i),
  57840. (this.activeCubeFace = 0),
  57841. (this.activeMipMapLevel = 0)
  57842. }),
  57843. (n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype)),
  57844. (n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube),
  57845. (n.WebGLBufferRenderer = function (e, t, i) {
  57846. function r(e) {
  57847. s = e
  57848. }
  57849. function o(t, n) {
  57850. e.drawArrays(s, t, n),
  57851. i.calls++,
  57852. (i.vertices += n),
  57853. s === e.TRIANGLES && (i.faces += n / 3)
  57854. }
  57855. function a(r) {
  57856. var o = t.get('ANGLE_instanced_arrays')
  57857. if (null === o)
  57858. return void console.error(
  57859. 'THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.'
  57860. )
  57861. var a = r.attributes.position,
  57862. l = 0
  57863. a instanceof n.InterleavedBufferAttribute
  57864. ? ((l = a.data.count), o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount))
  57865. : ((l = a.count), o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  57866. i.calls++,
  57867. (i.vertices += l * r.maxInstancedCount),
  57868. s === e.TRIANGLES && (i.faces += (r.maxInstancedCount * l) / 3)
  57869. }
  57870. var s
  57871. ;(this.setMode = r), (this.render = o), (this.renderInstances = a)
  57872. }),
  57873. (n.WebGLIndexedBufferRenderer = function (e, t, i) {
  57874. function n(e) {
  57875. s = e
  57876. }
  57877. function r(i) {
  57878. i.array instanceof Uint32Array && t.get('OES_element_index_uint')
  57879. ? ((l = e.UNSIGNED_INT), (c = 4))
  57880. : ((l = e.UNSIGNED_SHORT), (c = 2))
  57881. }
  57882. function o(t, n) {
  57883. e.drawElements(s, n, l, t * c),
  57884. i.calls++,
  57885. (i.vertices += n),
  57886. s === e.TRIANGLES && (i.faces += n / 3)
  57887. }
  57888. function a(n, r, o) {
  57889. var a = t.get('ANGLE_instanced_arrays')
  57890. return null === a
  57891. ? void console.error(
  57892. 'THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.'
  57893. )
  57894. : (a.drawElementsInstancedANGLE(s, o, l, r * c, n.maxInstancedCount),
  57895. i.calls++,
  57896. (i.vertices += o * n.maxInstancedCount),
  57897. void (s === e.TRIANGLES && (i.faces += (n.maxInstancedCount * o) / 3)))
  57898. }
  57899. var s, l, c
  57900. ;(this.setMode = n), (this.setIndex = r), (this.render = o), (this.renderInstances = a)
  57901. }),
  57902. (n.WebGLExtensions = function (e) {
  57903. var t = {}
  57904. this.get = function (i) {
  57905. if (void 0 !== t[i]) return t[i]
  57906. var n
  57907. switch (i) {
  57908. case 'EXT_texture_filter_anisotropic':
  57909. n =
  57910. e.getExtension('EXT_texture_filter_anisotropic') ||
  57911. e.getExtension('MOZ_EXT_texture_filter_anisotropic') ||
  57912. e.getExtension('WEBKIT_EXT_texture_filter_anisotropic')
  57913. break
  57914. case 'WEBGL_compressed_texture_s3tc':
  57915. n =
  57916. e.getExtension('WEBGL_compressed_texture_s3tc') ||
  57917. e.getExtension('MOZ_WEBGL_compressed_texture_s3tc') ||
  57918. e.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc')
  57919. break
  57920. case 'WEBGL_compressed_texture_pvrtc':
  57921. n =
  57922. e.getExtension('WEBGL_compressed_texture_pvrtc') ||
  57923. e.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc')
  57924. break
  57925. case 'WEBGL_compressed_texture_etc1':
  57926. n = e.getExtension('WEBGL_compressed_texture_etc1')
  57927. break
  57928. default:
  57929. n = e.getExtension(i)
  57930. }
  57931. return (
  57932. null === n &&
  57933. console.warn('THREE.WebGLRenderer: ' + i + ' extension not supported.'),
  57934. (t[i] = n),
  57935. n
  57936. )
  57937. }
  57938. }),
  57939. (n.WebGLCapabilities = function (e, t, i) {
  57940. function n(t) {
  57941. if ('highp' === t) {
  57942. if (
  57943. e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 &&
  57944. e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0
  57945. )
  57946. return 'highp'
  57947. t = 'mediump'
  57948. }
  57949. return 'mediump' === t &&
  57950. e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 &&
  57951. e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0
  57952. ? 'mediump'
  57953. : 'lowp'
  57954. }
  57955. ;(this.getMaxPrecision = n),
  57956. (this.precision = void 0 !== i.precision ? i.precision : 'highp'),
  57957. (this.logarithmicDepthBuffer =
  57958. void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer),
  57959. (this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),
  57960. (this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),
  57961. (this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE)),
  57962. (this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE)),
  57963. (this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS)),
  57964. (this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS)),
  57965. (this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS)),
  57966. (this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS)),
  57967. (this.vertexTextures = this.maxVertexTextures > 0),
  57968. (this.floatFragmentTextures = !!t.get('OES_texture_float')),
  57969. (this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures)
  57970. var r = n(this.precision)
  57971. r !== this.precision &&
  57972. (console.warn(
  57973. 'THREE.WebGLRenderer:',
  57974. this.precision,
  57975. 'not supported, using',
  57976. r,
  57977. 'instead.'
  57978. ),
  57979. (this.precision = r)),
  57980. this.logarithmicDepthBuffer &&
  57981. (this.logarithmicDepthBuffer = !!t.get('EXT_frag_depth'))
  57982. }),
  57983. (n.WebGLGeometries = function (e, t, i) {
  57984. function r(e) {
  57985. var t = e.geometry
  57986. if (void 0 !== h[t.id]) return h[t.id]
  57987. t.addEventListener('dispose', o)
  57988. var r
  57989. return (
  57990. t instanceof n.BufferGeometry
  57991. ? (r = t)
  57992. : t instanceof n.Geometry &&
  57993. (void 0 === t._bufferGeometry &&
  57994. (t._bufferGeometry = new n.BufferGeometry().setFromObject(e)),
  57995. (r = t._bufferGeometry)),
  57996. (h[t.id] = r),
  57997. i.memory.geometries++,
  57998. r
  57999. )
  58000. }
  58001. function o(e) {
  58002. var n = e.target,
  58003. r = h[n.id]
  58004. null !== r.index && s(r.index),
  58005. l(r.attributes),
  58006. n.removeEventListener('dispose', o),
  58007. delete h[n.id]
  58008. var a = t.get(n)
  58009. a.wireframe && s(a.wireframe), t.delete(n)
  58010. var c = t.get(r)
  58011. c.wireframe && s(c.wireframe), t.delete(r), i.memory.geometries--
  58012. }
  58013. function a(e) {
  58014. return e instanceof n.InterleavedBufferAttribute
  58015. ? t.get(e.data).__webglBuffer
  58016. : t.get(e).__webglBuffer
  58017. }
  58018. function s(t) {
  58019. var i = a(t)
  58020. void 0 !== i && (e.deleteBuffer(i), c(t))
  58021. }
  58022. function l(e) {
  58023. for (var t in e) s(e[t])
  58024. }
  58025. function c(e) {
  58026. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  58027. }
  58028. var h = {}
  58029. this.get = r
  58030. }),
  58031. (n.WebGLLights = function () {
  58032. var e = {}
  58033. this.get = function (t) {
  58034. if (void 0 !== e[t.id]) return e[t.id]
  58035. var i
  58036. switch (t.type) {
  58037. case 'DirectionalLight':
  58038. i = {
  58039. direction: new n.Vector3(),
  58040. color: new n.Color(),
  58041. shadow: !1,
  58042. shadowBias: 0,
  58043. shadowRadius: 1,
  58044. shadowMapSize: new n.Vector2()
  58045. }
  58046. break
  58047. case 'SpotLight':
  58048. i = {
  58049. position: new n.Vector3(),
  58050. direction: new n.Vector3(),
  58051. color: new n.Color(),
  58052. distance: 0,
  58053. coneCos: 0,
  58054. penumbraCos: 0,
  58055. decay: 0,
  58056. shadow: !1,
  58057. shadowBias: 0,
  58058. shadowRadius: 1,
  58059. shadowMapSize: new n.Vector2()
  58060. }
  58061. break
  58062. case 'PointLight':
  58063. i = {
  58064. position: new n.Vector3(),
  58065. color: new n.Color(),
  58066. distance: 0,
  58067. decay: 0,
  58068. shadow: !1,
  58069. shadowBias: 0,
  58070. shadowRadius: 1,
  58071. shadowMapSize: new n.Vector2()
  58072. }
  58073. break
  58074. case 'HemisphereLight':
  58075. i = {
  58076. direction: new n.Vector3(),
  58077. skyColor: new n.Color(),
  58078. groundColor: new n.Color()
  58079. }
  58080. }
  58081. return (e[t.id] = i), i
  58082. }
  58083. }),
  58084. (n.WebGLObjects = function (e, t, i) {
  58085. function r(t) {
  58086. var i = u.get(t)
  58087. t.geometry instanceof n.Geometry && i.updateFromObject(t)
  58088. var r = i.index,
  58089. a = i.attributes
  58090. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER)
  58091. for (var s in a) o(a[s], e.ARRAY_BUFFER)
  58092. var l = i.morphAttributes
  58093. for (var s in l)
  58094. for (var c = l[s], h = 0, d = c.length; h < d; h++) o(c[h], e.ARRAY_BUFFER)
  58095. return i
  58096. }
  58097. function o(e, i) {
  58098. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e,
  58099. o = t.get(r)
  58100. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  58101. }
  58102. function a(t, i, n) {
  58103. ;(t.__webglBuffer = e.createBuffer()), e.bindBuffer(n, t.__webglBuffer)
  58104. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW
  58105. e.bufferData(n, i.array, r), (t.version = i.version)
  58106. }
  58107. function s(t, i, n) {
  58108. e.bindBuffer(n, t.__webglBuffer),
  58109. i.dynamic === !1 || i.updateRange.count === -1
  58110. ? e.bufferSubData(n, 0, i.array)
  58111. : 0 === i.updateRange.count
  58112. ? console.error(
  58113. 'THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.'
  58114. )
  58115. : (e.bufferSubData(
  58116. n,
  58117. i.updateRange.offset * i.array.BYTES_PER_ELEMENT,
  58118. i.array.subarray(
  58119. i.updateRange.offset,
  58120. i.updateRange.offset + i.updateRange.count
  58121. )
  58122. ),
  58123. (i.updateRange.count = 0)),
  58124. (t.version = i.version)
  58125. }
  58126. function l(e) {
  58127. return e instanceof n.InterleavedBufferAttribute
  58128. ? t.get(e.data).__webglBuffer
  58129. : t.get(e).__webglBuffer
  58130. }
  58131. function c(i) {
  58132. var r = t.get(i)
  58133. if (void 0 !== r.wireframe) return r.wireframe
  58134. var a = [],
  58135. s = i.index,
  58136. l = i.attributes,
  58137. c = l.position
  58138. if (null !== s)
  58139. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  58140. var g = d[p + 0],
  58141. m = d[p + 1],
  58142. v = d[p + 2]
  58143. h(u, g, m) && a.push(g, m), h(u, m, v) && a.push(m, v), h(u, v, g) && a.push(v, g)
  58144. }
  58145. else
  58146. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  58147. var g = p + 0,
  58148. m = p + 1,
  58149. v = p + 2
  58150. a.push(g, m, m, v, v, g)
  58151. }
  58152. var A = c.count > 65535 ? Uint32Array : Uint16Array,
  58153. y = new n.BufferAttribute(new A(a), 1)
  58154. return o(y, e.ELEMENT_ARRAY_BUFFER), (r.wireframe = y), y
  58155. }
  58156. function h(e, t, i) {
  58157. if (t > i) {
  58158. var n = t
  58159. ;(t = i), (i = n)
  58160. }
  58161. var r = e[t]
  58162. return void 0 === r ? ((e[t] = [i]), !0) : r.indexOf(i) === -1 && (r.push(i), !0)
  58163. }
  58164. var u = new n.WebGLGeometries(e, t, i)
  58165. ;(this.getAttributeBuffer = l), (this.getWireframeAttribute = c), (this.update = r)
  58166. }),
  58167. (n.WebGLProgram = (function () {
  58168. function e(e) {
  58169. switch (e) {
  58170. case n.LinearEncoding:
  58171. return ['Linear', '( value )']
  58172. case n.sRGBEncoding:
  58173. return ['sRGB', '( value )']
  58174. case n.RGBEEncoding:
  58175. return ['RGBE', '( value )']
  58176. case n.RGBM7Encoding:
  58177. return ['RGBM', '( value, 7.0 )']
  58178. case n.RGBM16Encoding:
  58179. return ['RGBM', '( value, 16.0 )']
  58180. case n.RGBDEncoding:
  58181. return ['RGBD', '( value, 256.0 )']
  58182. case n.GammaEncoding:
  58183. return ['Gamma', '( value, float( GAMMA_FACTOR ) )']
  58184. default:
  58185. throw new Error('unsupported encoding: ' + e)
  58186. }
  58187. }
  58188. function t(t, i) {
  58189. var n = e(i)
  58190. return 'vec4 ' + t + '( vec4 value ) { return ' + n[0] + 'ToLinear' + n[1] + '; }'
  58191. }
  58192. function i(t, i) {
  58193. var n = e(i)
  58194. return 'vec4 ' + t + '( vec4 value ) { return LinearTo' + n[0] + n[1] + '; }'
  58195. }
  58196. function r(e, t) {
  58197. var i
  58198. switch (t) {
  58199. case n.LinearToneMapping:
  58200. i = 'Linear'
  58201. break
  58202. case n.ReinhardToneMapping:
  58203. i = 'Reinhard'
  58204. break
  58205. case n.Uncharted2ToneMapping:
  58206. i = 'Uncharted2'
  58207. break
  58208. case n.CineonToneMapping:
  58209. i = 'OptimizedCineon'
  58210. break
  58211. default:
  58212. throw new Error('unsupported toneMapping: ' + t)
  58213. }
  58214. return 'vec3 ' + e + '( vec3 color ) { return ' + i + 'ToneMapping( color ); }'
  58215. }
  58216. function o(e, t, i) {
  58217. e = e || {}
  58218. var n = [
  58219. e.derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading
  58220. ? '#extension GL_OES_standard_derivatives : enable'
  58221. : '',
  58222. (e.fragDepth || t.logarithmicDepthBuffer) && i.get('EXT_frag_depth')
  58223. ? '#extension GL_EXT_frag_depth : enable'
  58224. : '',
  58225. e.drawBuffers && i.get('WEBGL_draw_buffers')
  58226. ? '#extension GL_EXT_draw_buffers : require'
  58227. : '',
  58228. (e.shaderTextureLOD || t.envMap) && i.get('EXT_shader_texture_lod')
  58229. ? '#extension GL_EXT_shader_texture_lod : enable'
  58230. : ''
  58231. ]
  58232. return n.filter(c).join('\n')
  58233. }
  58234. function a(e) {
  58235. var t = []
  58236. for (var i in e) {
  58237. var n = e[i]
  58238. n !== !1 && t.push('#define ' + i + ' ' + n)
  58239. }
  58240. return t.join('\n')
  58241. }
  58242. function s(e, t, i) {
  58243. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  58244. var a = e.getActiveUniform(t, o),
  58245. s = a.name,
  58246. l = e.getUniformLocation(t, s),
  58247. c = f.exec(s)
  58248. if (c) {
  58249. var h = c[1],
  58250. u = c[2],
  58251. d = n[h]
  58252. d || (d = n[h] = {}), (d[u] = l)
  58253. } else if ((c = g.exec(s))) {
  58254. var p = c[1],
  58255. v = c[2],
  58256. A = c[3],
  58257. y = n[p]
  58258. y || (y = n[p] = [])
  58259. var C = y[v]
  58260. C || (C = y[v] = {}), (C[A] = l)
  58261. } else if ((c = m.exec(s))) {
  58262. var p = c[1]
  58263. n[p] = l
  58264. } else n[s] = l
  58265. }
  58266. return n
  58267. }
  58268. function l(e, t, i) {
  58269. for (
  58270. var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0;
  58271. o < r;
  58272. o++
  58273. ) {
  58274. var a = e.getActiveAttrib(t, o),
  58275. s = a.name
  58276. n[s] = e.getAttribLocation(t, s)
  58277. }
  58278. return n
  58279. }
  58280. function c(e) {
  58281. return '' !== e
  58282. }
  58283. function h(e, t) {
  58284. return e
  58285. .replace(/NUM_DIR_LIGHTS/g, t.numDirLights)
  58286. .replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights)
  58287. .replace(/NUM_POINT_LIGHTS/g, t.numPointLights)
  58288. .replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights)
  58289. }
  58290. function u(e) {
  58291. function t(e, t) {
  58292. var i = n.ShaderChunk[t]
  58293. if (void 0 === i) throw new Error('Can not resolve #include <' + t + '>')
  58294. return u(i)
  58295. }
  58296. var i = /#include +<([\w\d.]+)>/g
  58297. return e.replace(i, t)
  58298. }
  58299. function d(e) {
  58300. function t(e, t, i, n) {
  58301. for (var r = '', o = parseInt(t); o < parseInt(i); o++)
  58302. r += n.replace(/\[ i \]/g, '[ ' + o + ' ]')
  58303. return r
  58304. }
  58305. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g
  58306. return e.replace(i, t)
  58307. }
  58308. var p = 0,
  58309. f = /^([\w\d_]+)\.([\w\d_]+)$/,
  58310. g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  58311. m = /^([\w\d_]+)\[0\]$/
  58312. return function (e, f, g, m) {
  58313. var v = e.context,
  58314. A = g.extensions,
  58315. y = g.defines,
  58316. C = g.__webglShader.vertexShader,
  58317. I = g.__webglShader.fragmentShader,
  58318. E = 'SHADOWMAP_TYPE_BASIC'
  58319. m.shadowMapType === n.PCFShadowMap
  58320. ? (E = 'SHADOWMAP_TYPE_PCF')
  58321. : m.shadowMapType === n.PCFSoftShadowMap && (E = 'SHADOWMAP_TYPE_PCF_SOFT')
  58322. var b = 'ENVMAP_TYPE_CUBE',
  58323. w = 'ENVMAP_MODE_REFLECTION',
  58324. _ = 'ENVMAP_BLENDING_MULTIPLY'
  58325. if (m.envMap) {
  58326. switch (g.envMap.mapping) {
  58327. case n.CubeReflectionMapping:
  58328. case n.CubeRefractionMapping:
  58329. b = 'ENVMAP_TYPE_CUBE'
  58330. break
  58331. case n.CubeUVReflectionMapping:
  58332. case n.CubeUVRefractionMapping:
  58333. b = 'ENVMAP_TYPE_CUBE_UV'
  58334. break
  58335. case n.EquirectangularReflectionMapping:
  58336. case n.EquirectangularRefractionMapping:
  58337. b = 'ENVMAP_TYPE_EQUIREC'
  58338. break
  58339. case n.SphericalReflectionMapping:
  58340. b = 'ENVMAP_TYPE_SPHERE'
  58341. }
  58342. switch (g.envMap.mapping) {
  58343. case n.CubeRefractionMapping:
  58344. case n.EquirectangularRefractionMapping:
  58345. w = 'ENVMAP_MODE_REFRACTION'
  58346. }
  58347. switch (g.combine) {
  58348. case n.MultiplyOperation:
  58349. _ = 'ENVMAP_BLENDING_MULTIPLY'
  58350. break
  58351. case n.MixOperation:
  58352. _ = 'ENVMAP_BLENDING_MIX'
  58353. break
  58354. case n.AddOperation:
  58355. _ = 'ENVMAP_BLENDING_ADD'
  58356. }
  58357. }
  58358. var T,
  58359. x,
  58360. S = e.gammaFactor > 0 ? e.gammaFactor : 1,
  58361. M = o(A, m, e.extensions),
  58362. R = a(y),
  58363. P = v.createProgram()
  58364. g instanceof n.RawShaderMaterial
  58365. ? ((T = ''), (x = ''))
  58366. : ((T = [
  58367. 'precision ' + m.precision + ' float;',
  58368. 'precision ' + m.precision + ' int;',
  58369. '#define SHADER_NAME ' + g.__webglShader.name,
  58370. R,
  58371. m.supportsVertexTextures ? '#define VERTEX_TEXTURES' : '',
  58372. '#define GAMMA_FACTOR ' + S,
  58373. '#define MAX_BONES ' + m.maxBones,
  58374. m.map ? '#define USE_MAP' : '',
  58375. m.envMap ? '#define USE_ENVMAP' : '',
  58376. m.envMap ? '#define ' + w : '',
  58377. m.lightMap ? '#define USE_LIGHTMAP' : '',
  58378. m.aoMap ? '#define USE_AOMAP' : '',
  58379. m.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
  58380. m.bumpMap ? '#define USE_BUMPMAP' : '',
  58381. m.normalMap ? '#define USE_NORMALMAP' : '',
  58382. m.displacementMap && m.supportsVertexTextures
  58383. ? '#define USE_DISPLACEMENTMAP'
  58384. : '',
  58385. m.specularMap ? '#define USE_SPECULARMAP' : '',
  58386. m.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
  58387. m.metalnessMap ? '#define USE_METALNESSMAP' : '',
  58388. m.alphaMap ? '#define USE_ALPHAMAP' : '',
  58389. m.vertexColors ? '#define USE_COLOR' : '',
  58390. m.flatShading ? '#define FLAT_SHADED' : '',
  58391. m.skinning ? '#define USE_SKINNING' : '',
  58392. m.useVertexTexture ? '#define BONE_TEXTURE' : '',
  58393. m.morphTargets ? '#define USE_MORPHTARGETS' : '',
  58394. m.morphNormals && m.flatShading === !1 ? '#define USE_MORPHNORMALS' : '',
  58395. m.doubleSided ? '#define DOUBLE_SIDED' : '',
  58396. m.flipSided ? '#define FLIP_SIDED' : '',
  58397. m.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',
  58398. m.shadowMapEnabled ? '#define ' + E : '',
  58399. m.pointLightShadows > 0 ? '#define POINT_LIGHT_SHADOWS' : '',
  58400. m.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '',
  58401. m.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
  58402. m.logarithmicDepthBuffer && e.extensions.get('EXT_frag_depth')
  58403. ? '#define USE_LOGDEPTHBUF_EXT'
  58404. : '',
  58405. 'uniform mat4 modelMatrix;',
  58406. 'uniform mat4 modelViewMatrix;',
  58407. 'uniform mat4 projectionMatrix;',
  58408. 'uniform mat4 viewMatrix;',
  58409. 'uniform mat3 normalMatrix;',
  58410. 'uniform vec3 cameraPosition;',
  58411. 'attribute vec3 position;',
  58412. 'attribute vec3 normal;',
  58413. 'attribute vec2 uv;',
  58414. '#ifdef USE_COLOR',
  58415. '\tattribute vec3 color;',
  58416. '#endif',
  58417. '#ifdef USE_MORPHTARGETS',
  58418. '\tattribute vec3 morphTarget0;',
  58419. '\tattribute vec3 morphTarget1;',
  58420. '\tattribute vec3 morphTarget2;',
  58421. '\tattribute vec3 morphTarget3;',
  58422. '\t#ifdef USE_MORPHNORMALS',
  58423. '\t\tattribute vec3 morphNormal0;',
  58424. '\t\tattribute vec3 morphNormal1;',
  58425. '\t\tattribute vec3 morphNormal2;',
  58426. '\t\tattribute vec3 morphNormal3;',
  58427. '\t#else',
  58428. '\t\tattribute vec3 morphTarget4;',
  58429. '\t\tattribute vec3 morphTarget5;',
  58430. '\t\tattribute vec3 morphTarget6;',
  58431. '\t\tattribute vec3 morphTarget7;',
  58432. '\t#endif',
  58433. '#endif',
  58434. '#ifdef USE_SKINNING',
  58435. '\tattribute vec4 skinIndex;',
  58436. '\tattribute vec4 skinWeight;',
  58437. '#endif',
  58438. '\n'
  58439. ]
  58440. .filter(c)
  58441. .join('\n')),
  58442. (x = [
  58443. M,
  58444. 'precision ' + m.precision + ' float;',
  58445. 'precision ' + m.precision + ' int;',
  58446. '#define SHADER_NAME ' + g.__webglShader.name,
  58447. R,
  58448. m.alphaTest ? '#define ALPHATEST ' + m.alphaTest : '',
  58449. '#define GAMMA_FACTOR ' + S,
  58450. m.useFog && m.fog ? '#define USE_FOG' : '',
  58451. m.useFog && m.fogExp ? '#define FOG_EXP2' : '',
  58452. m.map ? '#define USE_MAP' : '',
  58453. m.envMap ? '#define USE_ENVMAP' : '',
  58454. m.envMap ? '#define ' + b : '',
  58455. m.envMap ? '#define ' + w : '',
  58456. m.envMap ? '#define ' + _ : '',
  58457. m.lightMap ? '#define USE_LIGHTMAP' : '',
  58458. m.aoMap ? '#define USE_AOMAP' : '',
  58459. m.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
  58460. m.bumpMap ? '#define USE_BUMPMAP' : '',
  58461. m.normalMap ? '#define USE_NORMALMAP' : '',
  58462. m.specularMap ? '#define USE_SPECULARMAP' : '',
  58463. m.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
  58464. m.metalnessMap ? '#define USE_METALNESSMAP' : '',
  58465. m.alphaMap ? '#define USE_ALPHAMAP' : '',
  58466. m.vertexColors ? '#define USE_COLOR' : '',
  58467. m.flatShading ? '#define FLAT_SHADED' : '',
  58468. m.doubleSided ? '#define DOUBLE_SIDED' : '',
  58469. m.flipSided ? '#define FLIP_SIDED' : '',
  58470. m.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',
  58471. m.shadowMapEnabled ? '#define ' + E : '',
  58472. m.pointLightShadows > 0 ? '#define POINT_LIGHT_SHADOWS' : '',
  58473. m.premultipliedAlpha ? '#define PREMULTIPLIED_ALPHA' : '',
  58474. m.physicallyCorrectLights ? '#define PHYSICALLY_CORRECT_LIGHTS' : '',
  58475. m.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
  58476. m.logarithmicDepthBuffer && e.extensions.get('EXT_frag_depth')
  58477. ? '#define USE_LOGDEPTHBUF_EXT'
  58478. : '',
  58479. m.envMap && e.extensions.get('EXT_shader_texture_lod')
  58480. ? '#define TEXTURE_LOD_EXT'
  58481. : '',
  58482. 'uniform mat4 viewMatrix;',
  58483. 'uniform vec3 cameraPosition;',
  58484. m.toneMapping !== n.NoToneMapping ? '#define TONE_MAPPING' : '',
  58485. m.toneMapping !== n.NoToneMapping
  58486. ? n.ShaderChunk.tonemapping_pars_fragment
  58487. : '',
  58488. m.toneMapping !== n.NoToneMapping ? r('toneMapping', m.toneMapping) : '',
  58489. m.outputEncoding || m.mapEncoding || m.envMapEncoding || m.emissiveMapEncoding
  58490. ? n.ShaderChunk.encodings_pars_fragment
  58491. : '',
  58492. m.mapEncoding ? t('mapTexelToLinear', m.mapEncoding) : '',
  58493. m.envMapEncoding ? t('envMapTexelToLinear', m.envMapEncoding) : '',
  58494. m.emissiveMapEncoding
  58495. ? t('emissiveMapTexelToLinear', m.emissiveMapEncoding)
  58496. : '',
  58497. m.outputEncoding ? i('linearToOutputTexel', m.outputEncoding) : '',
  58498. '\n'
  58499. ]
  58500. .filter(c)
  58501. .join('\n'))),
  58502. (C = u(C, m)),
  58503. (C = h(C, m)),
  58504. (I = u(I, m)),
  58505. (I = h(I, m)),
  58506. g instanceof n.ShaderMaterial == !1 && ((C = d(C)), (I = d(I)))
  58507. var O = T + C,
  58508. L = x + I,
  58509. D = n.WebGLShader(v, v.VERTEX_SHADER, O),
  58510. N = n.WebGLShader(v, v.FRAGMENT_SHADER, L)
  58511. v.attachShader(P, D),
  58512. v.attachShader(P, N),
  58513. void 0 !== g.index0AttributeName
  58514. ? v.bindAttribLocation(P, 0, g.index0AttributeName)
  58515. : m.morphTargets === !0 && v.bindAttribLocation(P, 0, 'position'),
  58516. v.linkProgram(P)
  58517. var B = v.getProgramInfoLog(P),
  58518. F = v.getShaderInfoLog(D),
  58519. V = v.getShaderInfoLog(N),
  58520. U = !0,
  58521. k = !0
  58522. v.getProgramParameter(P, v.LINK_STATUS) === !1
  58523. ? ((U = !1),
  58524. console.error(
  58525. 'THREE.WebGLProgram: shader error: ',
  58526. v.getError(),
  58527. 'gl.VALIDATE_STATUS',
  58528. v.getProgramParameter(P, v.VALIDATE_STATUS),
  58529. 'gl.getProgramInfoLog',
  58530. B,
  58531. F,
  58532. V
  58533. ))
  58534. : '' !== B
  58535. ? console.warn('THREE.WebGLProgram: gl.getProgramInfoLog()', B)
  58536. : ('' !== F && '' !== V) || (k = !1),
  58537. k &&
  58538. (this.diagnostics = {
  58539. runnable: U,
  58540. material: g,
  58541. programLog: B,
  58542. vertexShader: {
  58543. log: F,
  58544. prefix: T
  58545. },
  58546. fragmentShader: {
  58547. log: V,
  58548. prefix: x
  58549. }
  58550. }),
  58551. v.deleteShader(D),
  58552. v.deleteShader(N)
  58553. var H
  58554. this.getUniforms = function () {
  58555. return void 0 === H && (H = s(v, P)), H
  58556. }
  58557. var G
  58558. return (
  58559. (this.getAttributes = function () {
  58560. return void 0 === G && (G = l(v, P)), G
  58561. }),
  58562. (this.destroy = function () {
  58563. v.deleteProgram(P), (this.program = void 0)
  58564. }),
  58565. Object.defineProperties(this, {
  58566. uniforms: {
  58567. get: function () {
  58568. return (
  58569. console.warn('THREE.WebGLProgram: .uniforms is now .getUniforms().'),
  58570. this.getUniforms()
  58571. )
  58572. }
  58573. },
  58574. attributes: {
  58575. get: function () {
  58576. return (
  58577. console.warn('THREE.WebGLProgram: .attributes is now .getAttributes().'),
  58578. this.getAttributes()
  58579. )
  58580. }
  58581. }
  58582. }),
  58583. (this.id = p++),
  58584. (this.code = f),
  58585. (this.usedTimes = 1),
  58586. (this.program = P),
  58587. (this.vertexShader = D),
  58588. (this.fragmentShader = N),
  58589. this
  58590. )
  58591. }
  58592. })()),
  58593. (n.WebGLPrograms = function (e, t) {
  58594. function i(e) {
  58595. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  58596. return 1024
  58597. var i = t.maxVertexUniforms,
  58598. r = Math.floor((i - 20) / 4),
  58599. o = r
  58600. return (
  58601. void 0 !== e &&
  58602. e instanceof n.SkinnedMesh &&
  58603. ((o = Math.min(e.skeleton.bones.length, o)),
  58604. o < e.skeleton.bones.length &&
  58605. console.warn(
  58606. 'WebGLRenderer: too many bones - ' +
  58607. e.skeleton.bones.length +
  58608. ', this GPU supports just ' +
  58609. o +
  58610. ' (try OpenGL instead of ANGLE)'
  58611. )),
  58612. o
  58613. )
  58614. }
  58615. function r(e, t) {
  58616. var i
  58617. return (
  58618. e
  58619. ? e instanceof n.Texture
  58620. ? (i = e.encoding)
  58621. : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding)
  58622. : (i = n.LinearEncoding),
  58623. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  58624. i
  58625. )
  58626. }
  58627. var o = [],
  58628. a = {
  58629. MeshDepthMaterial: 'depth',
  58630. MeshNormalMaterial: 'normal',
  58631. MeshBasicMaterial: 'basic',
  58632. MeshLambertMaterial: 'lambert',
  58633. MeshPhongMaterial: 'phong',
  58634. MeshStandardMaterial: 'standard',
  58635. LineBasicMaterial: 'basic',
  58636. LineDashedMaterial: 'dashed',
  58637. PointsMaterial: 'points'
  58638. },
  58639. s = [
  58640. 'precision',
  58641. 'supportsVertexTextures',
  58642. 'map',
  58643. 'mapEncoding',
  58644. 'envMap',
  58645. 'envMapMode',
  58646. 'envMapEncoding',
  58647. 'lightMap',
  58648. 'aoMap',
  58649. 'emissiveMap',
  58650. 'emissiveMapEncoding',
  58651. 'bumpMap',
  58652. 'normalMap',
  58653. 'displacementMap',
  58654. 'specularMap',
  58655. 'roughnessMap',
  58656. 'metalnessMap',
  58657. 'alphaMap',
  58658. 'combine',
  58659. 'vertexColors',
  58660. 'fog',
  58661. 'useFog',
  58662. 'fogExp',
  58663. 'flatShading',
  58664. 'sizeAttenuation',
  58665. 'logarithmicDepthBuffer',
  58666. 'skinning',
  58667. 'maxBones',
  58668. 'useVertexTexture',
  58669. 'morphTargets',
  58670. 'morphNormals',
  58671. 'maxMorphTargets',
  58672. 'maxMorphNormals',
  58673. 'premultipliedAlpha',
  58674. 'numDirLights',
  58675. 'numPointLights',
  58676. 'numSpotLights',
  58677. 'numHemiLights',
  58678. 'shadowMapEnabled',
  58679. 'pointLightShadows',
  58680. 'toneMapping',
  58681. 'physicallyCorrectLights',
  58682. 'shadowMapType',
  58683. 'alphaTest',
  58684. 'doubleSided',
  58685. 'flipSided'
  58686. ]
  58687. ;(this.getParameters = function (o, s, l, c) {
  58688. var h = a[o.type],
  58689. u = i(c),
  58690. d = e.getPrecision()
  58691. null !== o.precision &&
  58692. ((d = t.getMaxPrecision(o.precision)),
  58693. d !== o.precision &&
  58694. console.warn(
  58695. 'THREE.WebGLProgram.getParameters:',
  58696. o.precision,
  58697. 'not supported, using',
  58698. d,
  58699. 'instead.'
  58700. ))
  58701. var p = {
  58702. shaderID: h,
  58703. precision: d,
  58704. supportsVertexTextures: t.vertexTextures,
  58705. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  58706. map: !!o.map,
  58707. mapEncoding: r(o.map, e.gammaInput),
  58708. envMap: !!o.envMap,
  58709. envMapMode: o.envMap && o.envMap.mapping,
  58710. envMapEncoding: r(o.envMap, e.gammaInput),
  58711. envMapCubeUV:
  58712. !!o.envMap &&
  58713. (o.envMap.mapping === n.CubeUVReflectionMapping ||
  58714. o.envMap.mapping === n.CubeUVRefractionMapping),
  58715. lightMap: !!o.lightMap,
  58716. aoMap: !!o.aoMap,
  58717. emissiveMap: !!o.emissiveMap,
  58718. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  58719. bumpMap: !!o.bumpMap,
  58720. normalMap: !!o.normalMap,
  58721. displacementMap: !!o.displacementMap,
  58722. roughnessMap: !!o.roughnessMap,
  58723. metalnessMap: !!o.metalnessMap,
  58724. specularMap: !!o.specularMap,
  58725. alphaMap: !!o.alphaMap,
  58726. combine: o.combine,
  58727. vertexColors: o.vertexColors,
  58728. fog: l,
  58729. useFog: o.fog,
  58730. fogExp: l instanceof n.FogExp2,
  58731. flatShading: o.shading === n.FlatShading,
  58732. sizeAttenuation: o.sizeAttenuation,
  58733. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  58734. skinning: o.skinning,
  58735. maxBones: u,
  58736. useVertexTexture:
  58737. t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  58738. morphTargets: o.morphTargets,
  58739. morphNormals: o.morphNormals,
  58740. maxMorphTargets: e.maxMorphTargets,
  58741. maxMorphNormals: e.maxMorphNormals,
  58742. numDirLights: s.directional.length,
  58743. numPointLights: s.point.length,
  58744. numSpotLights: s.spot.length,
  58745. numHemiLights: s.hemi.length,
  58746. pointLightShadows: s.shadowsPointLight,
  58747. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  58748. shadowMapType: e.shadowMap.type,
  58749. toneMapping: e.toneMapping,
  58750. physicallyCorrectLights: e.physicallyCorrectLights,
  58751. premultipliedAlpha: o.premultipliedAlpha,
  58752. alphaTest: o.alphaTest,
  58753. doubleSided: o.side === n.DoubleSide,
  58754. flipSided: o.side === n.BackSide
  58755. }
  58756. return p
  58757. }),
  58758. (this.getProgramCode = function (e, t) {
  58759. var i = []
  58760. if (
  58761. (t.shaderID
  58762. ? i.push(t.shaderID)
  58763. : (i.push(e.fragmentShader), i.push(e.vertexShader)),
  58764. void 0 !== e.defines)
  58765. )
  58766. for (var n in e.defines) i.push(n), i.push(e.defines[n])
  58767. for (var r = 0; r < s.length; r++) {
  58768. var o = s[r]
  58769. i.push(o), i.push(t[o])
  58770. }
  58771. return i.join()
  58772. }),
  58773. (this.acquireProgram = function (t, i, r) {
  58774. for (var a, s = 0, l = o.length; s < l; s++) {
  58775. var c = o[s]
  58776. if (c.code === r) {
  58777. ;(a = c), ++a.usedTimes
  58778. break
  58779. }
  58780. }
  58781. return void 0 === a && ((a = new n.WebGLProgram(e, r, t, i)), o.push(a)), a
  58782. }),
  58783. (this.releaseProgram = function (e) {
  58784. if (0 === --e.usedTimes) {
  58785. var t = o.indexOf(e)
  58786. ;(o[t] = o[o.length - 1]), o.pop(), e.destroy()
  58787. }
  58788. }),
  58789. (this.programs = o)
  58790. }),
  58791. (n.WebGLProperties = function () {
  58792. var e = {}
  58793. ;(this.get = function (t) {
  58794. var i = t.uuid,
  58795. n = e[i]
  58796. return void 0 === n && ((n = {}), (e[i] = n)), n
  58797. }),
  58798. (this.delete = function (t) {
  58799. delete e[t.uuid]
  58800. }),
  58801. (this.clear = function () {
  58802. e = {}
  58803. })
  58804. }),
  58805. (n.WebGLShader = (function () {
  58806. function e(e) {
  58807. for (var t = e.split('\n'), i = 0; i < t.length; i++) t[i] = i + 1 + ': ' + t[i]
  58808. return t.join('\n')
  58809. }
  58810. return function (t, i, n) {
  58811. var r = t.createShader(i)
  58812. return (
  58813. t.shaderSource(r, n),
  58814. t.compileShader(r),
  58815. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 &&
  58816. console.error("THREE.WebGLShader: Shader couldn't compile."),
  58817. '' !== t.getShaderInfoLog(r) &&
  58818. console.warn(
  58819. 'THREE.WebGLShader: gl.getShaderInfoLog()',
  58820. i === t.VERTEX_SHADER ? 'vertex' : 'fragment',
  58821. t.getShaderInfoLog(r),
  58822. e(n)
  58823. ),
  58824. r
  58825. )
  58826. }
  58827. })()),
  58828. (n.WebGLShadowMap = function (e, t, i) {
  58829. function r(e, t, i, r) {
  58830. var o = e.geometry,
  58831. a = null,
  58832. s = v,
  58833. l = e.customDepthMaterial
  58834. if ((i && ((s = A), (l = e.customDistanceMaterial)), l)) a = l
  58835. else {
  58836. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets,
  58837. h = e instanceof n.SkinnedMesh && t.skinning,
  58838. u = 0
  58839. c && (u |= f), h && (u |= g), (a = s[u])
  58840. }
  58841. return (
  58842. (a.visible = t.visible),
  58843. (a.wireframe = t.wireframe),
  58844. (a.wireframeLinewidth = t.wireframeLinewidth),
  58845. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  58846. a
  58847. )
  58848. }
  58849. function o(e, t, i) {
  58850. if (e.visible !== !1) {
  58851. if (
  58852. e.layers.test(t.layers) &&
  58853. (e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) &&
  58854. e.castShadow &&
  58855. (e.frustumCulled === !1 || l.intersectsObject(e) === !0)
  58856. ) {
  58857. var r = e.material
  58858. r.visible === !0 &&
  58859. (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  58860. p.push(e))
  58861. }
  58862. for (var a = e.children, s = 0, c = a.length; s < c; s++) o(a[s], t, i)
  58863. }
  58864. }
  58865. for (
  58866. var a = e.context,
  58867. s = e.state,
  58868. l = new n.Frustum(),
  58869. c = new n.Matrix4(),
  58870. h = new n.Vector2(),
  58871. u = new n.Vector3(),
  58872. d = new n.Vector3(),
  58873. p = [],
  58874. f = 1,
  58875. g = 2,
  58876. m = (f | g) + 1,
  58877. v = new Array(m),
  58878. A = new Array(m),
  58879. y = [
  58880. new n.Vector3(1, 0, 0),
  58881. new n.Vector3(-1, 0, 0),
  58882. new n.Vector3(0, 0, 1),
  58883. new n.Vector3(0, 0, -1),
  58884. new n.Vector3(0, 1, 0),
  58885. new n.Vector3(0, -1, 0)
  58886. ],
  58887. C = [
  58888. new n.Vector3(0, 1, 0),
  58889. new n.Vector3(0, 1, 0),
  58890. new n.Vector3(0, 1, 0),
  58891. new n.Vector3(0, 1, 0),
  58892. new n.Vector3(0, 0, 1),
  58893. new n.Vector3(0, 0, -1)
  58894. ],
  58895. I = [
  58896. new n.Vector4(),
  58897. new n.Vector4(),
  58898. new n.Vector4(),
  58899. new n.Vector4(),
  58900. new n.Vector4(),
  58901. new n.Vector4()
  58902. ],
  58903. E = n.ShaderLib.depthRGBA,
  58904. b = n.UniformsUtils.clone(E.uniforms),
  58905. w = n.ShaderLib.distanceRGBA,
  58906. _ = n.UniformsUtils.clone(w.uniforms),
  58907. T = 0;
  58908. T !== m;
  58909. ++T
  58910. ) {
  58911. var x = 0 !== (T & f),
  58912. S = 0 !== (T & g),
  58913. M = new n.ShaderMaterial({
  58914. uniforms: b,
  58915. vertexShader: E.vertexShader,
  58916. fragmentShader: E.fragmentShader,
  58917. morphTargets: x,
  58918. skinning: S
  58919. })
  58920. v[T] = M
  58921. var R = new n.ShaderMaterial({
  58922. defines: {
  58923. USE_SHADOWMAP: ''
  58924. },
  58925. uniforms: _,
  58926. vertexShader: w.vertexShader,
  58927. fragmentShader: w.fragmentShader,
  58928. morphTargets: x,
  58929. skinning: S
  58930. })
  58931. A[T] = R
  58932. }
  58933. var P = this
  58934. ;(this.enabled = !1),
  58935. (this.autoUpdate = !0),
  58936. (this.needsUpdate = !1),
  58937. (this.type = n.PCFShadowMap),
  58938. (this.cullFace = n.CullFaceFront),
  58939. (this.render = function (f, g) {
  58940. var m,
  58941. v,
  58942. A = t.shadows
  58943. if (
  58944. 0 !== A.length &&
  58945. P.enabled !== !1 &&
  58946. (P.autoUpdate !== !1 || P.needsUpdate !== !1)
  58947. ) {
  58948. s.clearColor(1, 1, 1, 1),
  58949. s.disable(a.BLEND),
  58950. s.enable(a.CULL_FACE),
  58951. a.frontFace(a.CCW),
  58952. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  58953. s.setDepthTest(!0),
  58954. s.setScissorTest(!1)
  58955. for (var E = 0, b = A.length; E < b; E++) {
  58956. var w = A[E],
  58957. _ = w.shadow,
  58958. T = _.camera
  58959. if ((h.copy(_.mapSize), w instanceof n.PointLight)) {
  58960. ;(m = 6), (v = !0)
  58961. var x = h.x,
  58962. S = h.y
  58963. I[0].set(2 * x, S, x, S),
  58964. I[1].set(0, S, x, S),
  58965. I[2].set(3 * x, S, x, S),
  58966. I[3].set(x, S, x, S),
  58967. I[4].set(3 * x, 0, x, S),
  58968. I[5].set(x, 0, x, S),
  58969. (h.x *= 4),
  58970. (h.y *= 2)
  58971. } else (m = 1), (v = !1)
  58972. if (null === _.map) {
  58973. var M = {
  58974. minFilter: n.NearestFilter,
  58975. magFilter: n.NearestFilter,
  58976. format: n.RGBAFormat
  58977. }
  58978. ;(_.map = new n.WebGLRenderTarget(h.x, h.y, M)),
  58979. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  58980. T.updateProjectionMatrix()
  58981. }
  58982. var R = _.map,
  58983. O = _.matrix
  58984. d.setFromMatrixPosition(w.matrixWorld),
  58985. T.position.copy(d),
  58986. e.setRenderTarget(R),
  58987. e.clear()
  58988. for (var L = 0; L < m; L++) {
  58989. if (v) {
  58990. u.copy(T.position), u.add(y[L]), T.up.copy(C[L]), T.lookAt(u)
  58991. var D = I[L]
  58992. s.viewport(D)
  58993. } else u.setFromMatrixPosition(w.target.matrixWorld), T.lookAt(u)
  58994. T.updateMatrixWorld(),
  58995. T.matrixWorldInverse.getInverse(T.matrixWorld),
  58996. O.set(0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1),
  58997. O.multiply(T.projectionMatrix),
  58998. O.multiply(T.matrixWorldInverse),
  58999. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  59000. l.setFromMatrix(c),
  59001. (p.length = 0),
  59002. o(f, g, T)
  59003. for (var N = 0, B = p.length; N < B; N++) {
  59004. var F = p[N],
  59005. V = i.update(F),
  59006. U = F.material
  59007. if (U instanceof n.MultiMaterial)
  59008. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  59009. var W = k[G],
  59010. j = H[W.materialIndex]
  59011. if (j.visible === !0) {
  59012. var Y = r(F, j, v, d)
  59013. e.renderBufferDirect(T, null, V, Y, F, W)
  59014. }
  59015. }
  59016. else {
  59017. var Y = r(F, U, v, d)
  59018. e.renderBufferDirect(T, null, V, Y, F, null)
  59019. }
  59020. }
  59021. }
  59022. }
  59023. var X = e.getClearColor(),
  59024. Z = e.getClearAlpha()
  59025. e.setClearColor(X, Z),
  59026. s.enable(a.BLEND),
  59027. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  59028. (P.needsUpdate = !1)
  59029. }
  59030. })
  59031. }),
  59032. (n.WebGLState = function (e, t, i) {
  59033. var r = this,
  59034. o = new n.Vector4(),
  59035. a = new Uint8Array(16),
  59036. s = new Uint8Array(16),
  59037. l = new Uint8Array(16),
  59038. c = {},
  59039. h = null,
  59040. u = null,
  59041. d = null,
  59042. p = null,
  59043. f = null,
  59044. g = null,
  59045. m = null,
  59046. v = null,
  59047. A = !1,
  59048. y = null,
  59049. C = null,
  59050. I = null,
  59051. E = null,
  59052. b = null,
  59053. w = null,
  59054. _ = null,
  59055. T = null,
  59056. x = null,
  59057. S = null,
  59058. M = null,
  59059. R = null,
  59060. P = null,
  59061. O = null,
  59062. L = null,
  59063. D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  59064. N = void 0,
  59065. B = {},
  59066. F = new n.Vector4(),
  59067. V = null,
  59068. U = null,
  59069. k = new n.Vector4(),
  59070. H = new n.Vector4(),
  59071. G = e.createTexture()
  59072. e.bindTexture(e.TEXTURE_2D, G),
  59073. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  59074. e.texImage2D(
  59075. e.TEXTURE_2D,
  59076. 0,
  59077. e.RGB,
  59078. 1,
  59079. 1,
  59080. 0,
  59081. e.RGB,
  59082. e.UNSIGNED_BYTE,
  59083. new Uint8Array(3)
  59084. ),
  59085. (this.init = function () {
  59086. this.clearColor(0, 0, 0, 1),
  59087. this.clearDepth(1),
  59088. this.clearStencil(0),
  59089. this.enable(e.DEPTH_TEST),
  59090. e.depthFunc(e.LEQUAL),
  59091. e.frontFace(e.CCW),
  59092. e.cullFace(e.BACK),
  59093. this.enable(e.CULL_FACE),
  59094. this.enable(e.BLEND),
  59095. e.blendEquation(e.FUNC_ADD),
  59096. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  59097. }),
  59098. (this.initAttributes = function () {
  59099. for (var e = 0, t = a.length; e < t; e++) a[e] = 0
  59100. }),
  59101. (this.enableAttribute = function (i) {
  59102. if (
  59103. ((a[i] = 1), 0 === s[i] && (e.enableVertexAttribArray(i), (s[i] = 1)), 0 !== l[i])
  59104. ) {
  59105. var n = t.get('ANGLE_instanced_arrays')
  59106. n.vertexAttribDivisorANGLE(i, 0), (l[i] = 0)
  59107. }
  59108. }),
  59109. (this.enableAttributeAndDivisor = function (t, i, n) {
  59110. ;(a[t] = 1),
  59111. 0 === s[t] && (e.enableVertexAttribArray(t), (s[t] = 1)),
  59112. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i), (l[t] = i))
  59113. }),
  59114. (this.disableUnusedAttributes = function () {
  59115. for (var t = 0, i = s.length; t < i; t++)
  59116. s[t] !== a[t] && (e.disableVertexAttribArray(t), (s[t] = 0))
  59117. }),
  59118. (this.enable = function (t) {
  59119. c[t] !== !0 && (e.enable(t), (c[t] = !0))
  59120. }),
  59121. (this.disable = function (t) {
  59122. c[t] !== !1 && (e.disable(t), (c[t] = !1))
  59123. }),
  59124. (this.getCompressedTextureFormats = function () {
  59125. if (
  59126. null === h &&
  59127. ((h = []),
  59128. t.get('WEBGL_compressed_texture_pvrtc') ||
  59129. t.get('WEBGL_compressed_texture_s3tc') ||
  59130. t.get('WEBGL_compressed_texture_etc1'))
  59131. )
  59132. for (
  59133. var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0;
  59134. n < i.length;
  59135. n++
  59136. )
  59137. h.push(i[n])
  59138. return h
  59139. }),
  59140. (this.setBlending = function (t, r, o, a, s, l, c, h) {
  59141. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  59142. (t === u && h === A) ||
  59143. (t === n.AdditiveBlending
  59144. ? h
  59145. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  59146. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE))
  59147. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.SRC_ALPHA, e.ONE))
  59148. : t === n.SubtractiveBlending
  59149. ? h
  59150. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  59151. e.blendFuncSeparate(
  59152. e.ZERO,
  59153. e.ZERO,
  59154. e.ONE_MINUS_SRC_COLOR,
  59155. e.ONE_MINUS_SRC_ALPHA
  59156. ))
  59157. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR))
  59158. : t === n.MultiplyBlending
  59159. ? h
  59160. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  59161. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA))
  59162. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.SRC_COLOR))
  59163. : h
  59164. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  59165. e.blendFuncSeparate(
  59166. e.ONE,
  59167. e.ONE_MINUS_SRC_ALPHA,
  59168. e.ONE,
  59169. e.ONE_MINUS_SRC_ALPHA
  59170. ))
  59171. : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  59172. e.blendFuncSeparate(
  59173. e.SRC_ALPHA,
  59174. e.ONE_MINUS_SRC_ALPHA,
  59175. e.ONE,
  59176. e.ONE_MINUS_SRC_ALPHA
  59177. )),
  59178. (u = t),
  59179. (A = h)),
  59180. t === n.CustomBlending
  59181. ? ((s = s || r),
  59182. (l = l || o),
  59183. (c = c || a),
  59184. (r === d && s === g) ||
  59185. (e.blendEquationSeparate(i(r), i(s)), (d = r), (g = s)),
  59186. (o === p && a === f && l === m && c === v) ||
  59187. (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  59188. (p = o),
  59189. (f = a),
  59190. (m = l),
  59191. (v = c)))
  59192. : ((d = null), (p = null), (f = null), (g = null), (m = null), (v = null))
  59193. }),
  59194. (this.setDepthFunc = function (t) {
  59195. if (y !== t) {
  59196. if (t)
  59197. switch (t) {
  59198. case n.NeverDepth:
  59199. e.depthFunc(e.NEVER)
  59200. break
  59201. case n.AlwaysDepth:
  59202. e.depthFunc(e.ALWAYS)
  59203. break
  59204. case n.LessDepth:
  59205. e.depthFunc(e.LESS)
  59206. break
  59207. case n.LessEqualDepth:
  59208. e.depthFunc(e.LEQUAL)
  59209. break
  59210. case n.EqualDepth:
  59211. e.depthFunc(e.EQUAL)
  59212. break
  59213. case n.GreaterEqualDepth:
  59214. e.depthFunc(e.GEQUAL)
  59215. break
  59216. case n.GreaterDepth:
  59217. e.depthFunc(e.GREATER)
  59218. break
  59219. case n.NotEqualDepth:
  59220. e.depthFunc(e.NOTEQUAL)
  59221. break
  59222. default:
  59223. e.depthFunc(e.LEQUAL)
  59224. }
  59225. else e.depthFunc(e.LEQUAL)
  59226. y = t
  59227. }
  59228. }),
  59229. (this.setDepthTest = function (t) {
  59230. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  59231. }),
  59232. (this.setDepthWrite = function (t) {
  59233. C !== t && (e.depthMask(t), (C = t))
  59234. }),
  59235. (this.setColorWrite = function (t) {
  59236. I !== t && (e.colorMask(t, t, t, t), (I = t))
  59237. }),
  59238. (this.setStencilFunc = function (t, i, n) {
  59239. ;(b === t && w === i && _ === n) ||
  59240. (e.stencilFunc(t, i, n), (b = t), (w = i), (_ = n))
  59241. }),
  59242. (this.setStencilOp = function (t, i, n) {
  59243. ;(T === t && x === i && S === n) ||
  59244. (e.stencilOp(t, i, n), (T = t), (x = i), (S = n))
  59245. }),
  59246. (this.setStencilTest = function (t) {
  59247. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  59248. }),
  59249. (this.setStencilWrite = function (t) {
  59250. E !== t && (e.stencilMask(t), (E = t))
  59251. }),
  59252. (this.setFlipSided = function (t) {
  59253. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), (M = t))
  59254. }),
  59255. (this.setLineWidth = function (t) {
  59256. t !== R && (e.lineWidth(t), (R = t))
  59257. }),
  59258. (this.setPolygonOffset = function (t, i, n) {
  59259. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  59260. !t || (P === i && O === n) || (e.polygonOffset(i, n), (P = i), (O = n))
  59261. }),
  59262. (this.getScissorTest = function () {
  59263. return L
  59264. }),
  59265. (this.setScissorTest = function (t) {
  59266. ;(L = t), t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  59267. }),
  59268. (this.activeTexture = function (t) {
  59269. void 0 === t && (t = e.TEXTURE0 + D - 1), N !== t && (e.activeTexture(t), (N = t))
  59270. }),
  59271. (this.bindTexture = function (t, i) {
  59272. void 0 === N && r.activeTexture()
  59273. var n = B[N]
  59274. void 0 === n &&
  59275. ((n = {
  59276. type: void 0,
  59277. texture: void 0
  59278. }),
  59279. (B[N] = n)),
  59280. (n.type === t && n.texture === i) ||
  59281. (e.bindTexture(t, i || G), (n.type = t), (n.texture = i))
  59282. }),
  59283. (this.compressedTexImage2D = function () {
  59284. try {
  59285. e.compressedTexImage2D.apply(e, arguments)
  59286. } catch (e) {
  59287. console.error(e)
  59288. }
  59289. }),
  59290. (this.texImage2D = function () {
  59291. try {
  59292. e.texImage2D.apply(e, arguments)
  59293. } catch (e) {
  59294. console.error(e)
  59295. }
  59296. }),
  59297. (this.clearColor = function (t, i, n, r) {
  59298. o.set(t, i, n, r), F.equals(o) === !1 && (e.clearColor(t, i, n, r), F.copy(o))
  59299. }),
  59300. (this.clearDepth = function (t) {
  59301. V !== t && (e.clearDepth(t), (V = t))
  59302. }),
  59303. (this.clearStencil = function (t) {
  59304. U !== t && (e.clearStencil(t), (U = t))
  59305. }),
  59306. (this.scissor = function (t) {
  59307. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), k.copy(t))
  59308. }),
  59309. (this.viewport = function (t) {
  59310. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), H.copy(t))
  59311. }),
  59312. (this.reset = function () {
  59313. for (var t = 0; t < s.length; t++)
  59314. 1 === s[t] && (e.disableVertexAttribArray(t), (s[t] = 0))
  59315. ;(c = {}),
  59316. (h = null),
  59317. (N = void 0),
  59318. (B = {}),
  59319. (u = null),
  59320. (I = null),
  59321. (C = null),
  59322. (E = null),
  59323. (M = null)
  59324. })
  59325. }),
  59326. (n.LensFlarePlugin = function (e, t) {
  59327. function i() {
  59328. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1]),
  59329. t = new Uint16Array([0, 1, 2, 0, 2, 3])
  59330. ;(o = p.createBuffer()),
  59331. (a = p.createBuffer()),
  59332. p.bindBuffer(p.ARRAY_BUFFER, o),
  59333. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  59334. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  59335. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  59336. (u = p.createTexture()),
  59337. (d = p.createTexture()),
  59338. f.bindTexture(p.TEXTURE_2D, u),
  59339. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  59340. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  59341. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  59342. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  59343. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  59344. f.bindTexture(p.TEXTURE_2D, d),
  59345. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  59346. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  59347. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  59348. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  59349. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  59350. (h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0)
  59351. var i
  59352. ;(i = h
  59353. ? {
  59354. vertexShader: [
  59355. 'uniform lowp int renderType;',
  59356. 'uniform vec3 screenPosition;',
  59357. 'uniform vec2 scale;',
  59358. 'uniform float rotation;',
  59359. 'uniform sampler2D occlusionMap;',
  59360. 'attribute vec2 position;',
  59361. 'attribute vec2 uv;',
  59362. 'varying vec2 vUV;',
  59363. 'varying float vVisibility;',
  59364. 'void main() {',
  59365. 'vUV = uv;',
  59366. 'vec2 pos = position;',
  59367. 'if ( renderType == 2 ) {',
  59368. 'vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );',
  59369. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );',
  59370. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );',
  59371. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );',
  59372. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );',
  59373. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );',
  59374. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );',
  59375. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );',
  59376. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );',
  59377. 'vVisibility = visibility.r / 9.0;',
  59378. 'vVisibility *= 1.0 - visibility.g / 9.0;',
  59379. 'vVisibility *= visibility.b / 9.0;',
  59380. 'vVisibility *= 1.0 - visibility.a / 9.0;',
  59381. 'pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;',
  59382. 'pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;',
  59383. '}',
  59384. 'gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );',
  59385. '}'
  59386. ].join('\n'),
  59387. fragmentShader: [
  59388. 'uniform lowp int renderType;',
  59389. 'uniform sampler2D map;',
  59390. 'uniform float opacity;',
  59391. 'uniform vec3 color;',
  59392. 'varying vec2 vUV;',
  59393. 'varying float vVisibility;',
  59394. 'void main() {',
  59395. 'if ( renderType == 0 ) {',
  59396. 'gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );',
  59397. '} else if ( renderType == 1 ) {',
  59398. 'gl_FragColor = texture2D( map, vUV );',
  59399. '} else {',
  59400. 'vec4 texture = texture2D( map, vUV );',
  59401. 'texture.a *= opacity * vVisibility;',
  59402. 'gl_FragColor = texture;',
  59403. 'gl_FragColor.rgb *= color;',
  59404. '}',
  59405. '}'
  59406. ].join('\n')
  59407. }
  59408. : {
  59409. vertexShader: [
  59410. 'uniform lowp int renderType;',
  59411. 'uniform vec3 screenPosition;',
  59412. 'uniform vec2 scale;',
  59413. 'uniform float rotation;',
  59414. 'attribute vec2 position;',
  59415. 'attribute vec2 uv;',
  59416. 'varying vec2 vUV;',
  59417. 'void main() {',
  59418. 'vUV = uv;',
  59419. 'vec2 pos = position;',
  59420. 'if ( renderType == 2 ) {',
  59421. 'pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;',
  59422. 'pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;',
  59423. '}',
  59424. 'gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );',
  59425. '}'
  59426. ].join('\n'),
  59427. fragmentShader: [
  59428. 'precision mediump float;',
  59429. 'uniform lowp int renderType;',
  59430. 'uniform sampler2D map;',
  59431. 'uniform sampler2D occlusionMap;',
  59432. 'uniform float opacity;',
  59433. 'uniform vec3 color;',
  59434. 'varying vec2 vUV;',
  59435. 'void main() {',
  59436. 'if ( renderType == 0 ) {',
  59437. 'gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );',
  59438. '} else if ( renderType == 1 ) {',
  59439. 'gl_FragColor = texture2D( map, vUV );',
  59440. '} else {',
  59441. 'float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;',
  59442. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;',
  59443. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;',
  59444. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;',
  59445. 'visibility = ( 1.0 - visibility / 4.0 );',
  59446. 'vec4 texture = texture2D( map, vUV );',
  59447. 'texture.a *= opacity * visibility;',
  59448. 'gl_FragColor = texture;',
  59449. 'gl_FragColor.rgb *= color;',
  59450. '}',
  59451. '}'
  59452. ].join('\n')
  59453. }),
  59454. (s = r(i)),
  59455. (l = {
  59456. vertex: p.getAttribLocation(s, 'position'),
  59457. uv: p.getAttribLocation(s, 'uv')
  59458. }),
  59459. (c = {
  59460. renderType: p.getUniformLocation(s, 'renderType'),
  59461. map: p.getUniformLocation(s, 'map'),
  59462. occlusionMap: p.getUniformLocation(s, 'occlusionMap'),
  59463. opacity: p.getUniformLocation(s, 'opacity'),
  59464. color: p.getUniformLocation(s, 'color'),
  59465. scale: p.getUniformLocation(s, 'scale'),
  59466. rotation: p.getUniformLocation(s, 'rotation'),
  59467. screenPosition: p.getUniformLocation(s, 'screenPosition')
  59468. })
  59469. }
  59470. function r(t) {
  59471. var i = p.createProgram(),
  59472. n = p.createShader(p.FRAGMENT_SHADER),
  59473. r = p.createShader(p.VERTEX_SHADER),
  59474. o = 'precision ' + e.getPrecision() + ' float;\n'
  59475. return (
  59476. p.shaderSource(n, o + t.fragmentShader),
  59477. p.shaderSource(r, o + t.vertexShader),
  59478. p.compileShader(n),
  59479. p.compileShader(r),
  59480. p.attachShader(i, n),
  59481. p.attachShader(i, r),
  59482. p.linkProgram(i),
  59483. i
  59484. )
  59485. }
  59486. var o,
  59487. a,
  59488. s,
  59489. l,
  59490. c,
  59491. h,
  59492. u,
  59493. d,
  59494. p = e.context,
  59495. f = e.state
  59496. this.render = function (r, g, m) {
  59497. if (0 !== t.length) {
  59498. var v = new n.Vector3(),
  59499. A = m.w / m.z,
  59500. y = 0.5 * m.z,
  59501. C = 0.5 * m.w,
  59502. I = 16 / m.w,
  59503. E = new n.Vector2(I * A, I),
  59504. b = new n.Vector3(1, 1, 0),
  59505. w = new n.Vector2(1, 1)
  59506. void 0 === s && i(),
  59507. p.useProgram(s),
  59508. f.initAttributes(),
  59509. f.enableAttribute(l.vertex),
  59510. f.enableAttribute(l.uv),
  59511. f.disableUnusedAttributes(),
  59512. p.uniform1i(c.occlusionMap, 0),
  59513. p.uniform1i(c.map, 1),
  59514. p.bindBuffer(p.ARRAY_BUFFER, o),
  59515. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  59516. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  59517. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  59518. f.disable(p.CULL_FACE),
  59519. f.setDepthWrite(!1)
  59520. for (var _ = 0, T = t.length; _ < T; _++) {
  59521. ;(I = 16 / m.w), E.set(I * A, I)
  59522. var x = t[_]
  59523. if (
  59524. (v.set(
  59525. x.matrixWorld.elements[12],
  59526. x.matrixWorld.elements[13],
  59527. x.matrixWorld.elements[14]
  59528. ),
  59529. v.applyMatrix4(g.matrixWorldInverse),
  59530. v.applyProjection(g.projectionMatrix),
  59531. b.copy(v),
  59532. (w.x = b.x * y + y),
  59533. (w.y = b.y * C + C),
  59534. h || (w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w))
  59535. ) {
  59536. f.activeTexture(p.TEXTURE0),
  59537. f.bindTexture(p.TEXTURE_2D, null),
  59538. f.activeTexture(p.TEXTURE1),
  59539. f.bindTexture(p.TEXTURE_2D, u),
  59540. p.copyTexImage2D(
  59541. p.TEXTURE_2D,
  59542. 0,
  59543. p.RGB,
  59544. m.x + w.x - 8,
  59545. m.y + w.y - 8,
  59546. 16,
  59547. 16,
  59548. 0
  59549. ),
  59550. p.uniform1i(c.renderType, 0),
  59551. p.uniform2f(c.scale, E.x, E.y),
  59552. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  59553. f.disable(p.BLEND),
  59554. f.enable(p.DEPTH_TEST),
  59555. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  59556. f.activeTexture(p.TEXTURE0),
  59557. f.bindTexture(p.TEXTURE_2D, d),
  59558. p.copyTexImage2D(
  59559. p.TEXTURE_2D,
  59560. 0,
  59561. p.RGBA,
  59562. m.x + w.x - 8,
  59563. m.y + w.y - 8,
  59564. 16,
  59565. 16,
  59566. 0
  59567. ),
  59568. p.uniform1i(c.renderType, 1),
  59569. f.disable(p.DEPTH_TEST),
  59570. f.activeTexture(p.TEXTURE1),
  59571. f.bindTexture(p.TEXTURE_2D, u),
  59572. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  59573. x.positionScreen.copy(b),
  59574. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  59575. p.uniform1i(c.renderType, 2),
  59576. f.enable(p.BLEND)
  59577. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  59578. var R = x.lensFlares[S]
  59579. R.opacity > 0.001 &&
  59580. R.scale > 0.001 &&
  59581. ((b.x = R.x),
  59582. (b.y = R.y),
  59583. (b.z = R.z),
  59584. (I = (R.size * R.scale) / m.w),
  59585. (E.x = I * A),
  59586. (E.y = I),
  59587. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  59588. p.uniform2f(c.scale, E.x, E.y),
  59589. p.uniform1f(c.rotation, R.rotation),
  59590. p.uniform1f(c.opacity, R.opacity),
  59591. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  59592. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  59593. e.setTexture(R.texture, 1),
  59594. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  59595. }
  59596. }
  59597. }
  59598. f.enable(p.CULL_FACE), f.enable(p.DEPTH_TEST), f.setDepthWrite(!0), e.resetGLState()
  59599. }
  59600. }
  59601. }),
  59602. (n.SpritePlugin = function (e, t) {
  59603. function i() {
  59604. var e = new Float32Array([
  59605. -0.5, -0.5, 0, 0, 0.5, -0.5, 1, 0, 0.5, 0.5, 1, 1, -0.5, 0.5, 0, 1
  59606. ]),
  59607. t = new Uint16Array([0, 1, 2, 0, 2, 3])
  59608. ;(a = d.createBuffer()),
  59609. (s = d.createBuffer()),
  59610. d.bindBuffer(d.ARRAY_BUFFER, a),
  59611. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  59612. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  59613. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  59614. (l = r()),
  59615. (c = {
  59616. position: d.getAttribLocation(l, 'position'),
  59617. uv: d.getAttribLocation(l, 'uv')
  59618. }),
  59619. (h = {
  59620. uvOffset: d.getUniformLocation(l, 'uvOffset'),
  59621. uvScale: d.getUniformLocation(l, 'uvScale'),
  59622. rotation: d.getUniformLocation(l, 'rotation'),
  59623. scale: d.getUniformLocation(l, 'scale'),
  59624. color: d.getUniformLocation(l, 'color'),
  59625. map: d.getUniformLocation(l, 'map'),
  59626. opacity: d.getUniformLocation(l, 'opacity'),
  59627. modelViewMatrix: d.getUniformLocation(l, 'modelViewMatrix'),
  59628. projectionMatrix: d.getUniformLocation(l, 'projectionMatrix'),
  59629. fogType: d.getUniformLocation(l, 'fogType'),
  59630. fogDensity: d.getUniformLocation(l, 'fogDensity'),
  59631. fogNear: d.getUniformLocation(l, 'fogNear'),
  59632. fogFar: d.getUniformLocation(l, 'fogFar'),
  59633. fogColor: d.getUniformLocation(l, 'fogColor'),
  59634. alphaTest: d.getUniformLocation(l, 'alphaTest')
  59635. })
  59636. var i = document.createElement('canvas')
  59637. ;(i.width = 8), (i.height = 8)
  59638. var o = i.getContext('2d')
  59639. ;(o.fillStyle = 'white'),
  59640. o.fillRect(0, 0, 8, 8),
  59641. (u = new n.Texture(i)),
  59642. (u.needsUpdate = !0)
  59643. }
  59644. function r() {
  59645. var t = d.createProgram(),
  59646. i = d.createShader(d.VERTEX_SHADER),
  59647. n = d.createShader(d.FRAGMENT_SHADER)
  59648. return (
  59649. d.shaderSource(
  59650. i,
  59651. [
  59652. 'precision ' + e.getPrecision() + ' float;',
  59653. 'uniform mat4 modelViewMatrix;',
  59654. 'uniform mat4 projectionMatrix;',
  59655. 'uniform float rotation;',
  59656. 'uniform vec2 scale;',
  59657. 'uniform vec2 uvOffset;',
  59658. 'uniform vec2 uvScale;',
  59659. 'attribute vec2 position;',
  59660. 'attribute vec2 uv;',
  59661. 'varying vec2 vUV;',
  59662. 'void main() {',
  59663. 'vUV = uvOffset + uv * uvScale;',
  59664. 'vec2 alignedPosition = position * scale;',
  59665. 'vec2 rotatedPosition;',
  59666. 'rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;',
  59667. 'rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;',
  59668. 'vec4 finalPosition;',
  59669. 'finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );',
  59670. 'finalPosition.xy += rotatedPosition;',
  59671. 'finalPosition = projectionMatrix * finalPosition;',
  59672. 'gl_Position = finalPosition;',
  59673. '}'
  59674. ].join('\n')
  59675. ),
  59676. d.shaderSource(
  59677. n,
  59678. [
  59679. 'precision ' + e.getPrecision() + ' float;',
  59680. 'uniform vec3 color;',
  59681. 'uniform sampler2D map;',
  59682. 'uniform float opacity;',
  59683. 'uniform int fogType;',
  59684. 'uniform vec3 fogColor;',
  59685. 'uniform float fogDensity;',
  59686. 'uniform float fogNear;',
  59687. 'uniform float fogFar;',
  59688. 'uniform float alphaTest;',
  59689. 'varying vec2 vUV;',
  59690. 'void main() {',
  59691. 'vec4 texture = texture2D( map, vUV );',
  59692. 'if ( texture.a < alphaTest ) discard;',
  59693. 'gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );',
  59694. 'if ( fogType > 0 ) {',
  59695. 'float depth = gl_FragCoord.z / gl_FragCoord.w;',
  59696. 'float fogFactor = 0.0;',
  59697. 'if ( fogType == 1 ) {',
  59698. 'fogFactor = smoothstep( fogNear, fogFar, depth );',
  59699. '} else {',
  59700. 'const float LOG2 = 1.442695;',
  59701. 'fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );',
  59702. 'fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );',
  59703. '}',
  59704. 'gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );',
  59705. '}',
  59706. '}'
  59707. ].join('\n')
  59708. ),
  59709. d.compileShader(i),
  59710. d.compileShader(n),
  59711. d.attachShader(t, i),
  59712. d.attachShader(t, n),
  59713. d.linkProgram(t),
  59714. t
  59715. )
  59716. }
  59717. function o(e, t) {
  59718. return e.renderOrder !== t.renderOrder
  59719. ? e.renderOrder - t.renderOrder
  59720. : e.z !== t.z
  59721. ? t.z - e.z
  59722. : t.id - e.id
  59723. }
  59724. var a,
  59725. s,
  59726. l,
  59727. c,
  59728. h,
  59729. u,
  59730. d = e.context,
  59731. p = e.state,
  59732. f = new n.Vector3(),
  59733. g = new n.Quaternion(),
  59734. m = new n.Vector3()
  59735. this.render = function (r, v) {
  59736. if (0 !== t.length) {
  59737. void 0 === l && i(),
  59738. d.useProgram(l),
  59739. p.initAttributes(),
  59740. p.enableAttribute(c.position),
  59741. p.enableAttribute(c.uv),
  59742. p.disableUnusedAttributes(),
  59743. p.disable(d.CULL_FACE),
  59744. p.enable(d.BLEND),
  59745. d.bindBuffer(d.ARRAY_BUFFER, a),
  59746. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  59747. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  59748. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  59749. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  59750. p.activeTexture(d.TEXTURE0),
  59751. d.uniform1i(h.map, 0)
  59752. var A = 0,
  59753. y = 0,
  59754. C = r.fog
  59755. C
  59756. ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  59757. C instanceof n.Fog
  59758. ? (d.uniform1f(h.fogNear, C.near),
  59759. d.uniform1f(h.fogFar, C.far),
  59760. d.uniform1i(h.fogType, 1),
  59761. (A = 1),
  59762. (y = 1))
  59763. : C instanceof n.FogExp2 &&
  59764. (d.uniform1f(h.fogDensity, C.density),
  59765. d.uniform1i(h.fogType, 2),
  59766. (A = 2),
  59767. (y = 2)))
  59768. : (d.uniform1i(h.fogType, 0), (A = 0), (y = 0))
  59769. for (var I = 0, E = t.length; I < E; I++) {
  59770. var b = t[I]
  59771. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  59772. (b.z = -b.modelViewMatrix.elements[14])
  59773. }
  59774. t.sort(o)
  59775. for (var w = [], I = 0, E = t.length; I < E; I++) {
  59776. var b = t[I],
  59777. _ = b.material
  59778. d.uniform1f(h.alphaTest, _.alphaTest),
  59779. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  59780. b.matrixWorld.decompose(f, g, m),
  59781. (w[0] = m.x),
  59782. (w[1] = m.y)
  59783. var T = 0
  59784. r.fog && _.fog && (T = y),
  59785. A !== T && (d.uniform1i(h.fogType, T), (A = T)),
  59786. null !== _.map
  59787. ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  59788. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y))
  59789. : (d.uniform2f(h.uvOffset, 0, 0), d.uniform2f(h.uvScale, 1, 1)),
  59790. d.uniform1f(h.opacity, _.opacity),
  59791. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  59792. d.uniform1f(h.rotation, _.rotation),
  59793. d.uniform2fv(h.scale, w),
  59794. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  59795. p.setDepthTest(_.depthTest),
  59796. p.setDepthWrite(_.depthWrite),
  59797. _.map && _.map.image && _.map.image.width
  59798. ? e.setTexture(_.map, 0)
  59799. : e.setTexture(u, 0),
  59800. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  59801. }
  59802. p.enable(d.CULL_FACE), e.resetGLState()
  59803. }
  59804. }
  59805. }),
  59806. Object.defineProperties(n.Box2.prototype, {
  59807. empty: {
  59808. value: function () {
  59809. return (
  59810. console.warn('THREE.Box2: .empty() has been renamed to .isEmpty().'),
  59811. this.isEmpty()
  59812. )
  59813. }
  59814. },
  59815. isIntersectionBox: {
  59816. value: function (e) {
  59817. return (
  59818. console.warn(
  59819. 'THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().'
  59820. ),
  59821. this.intersectsBox(e)
  59822. )
  59823. }
  59824. }
  59825. }),
  59826. Object.defineProperties(n.Box3.prototype, {
  59827. empty: {
  59828. value: function () {
  59829. return (
  59830. console.warn('THREE.Box3: .empty() has been renamed to .isEmpty().'),
  59831. this.isEmpty()
  59832. )
  59833. }
  59834. },
  59835. isIntersectionBox: {
  59836. value: function (e) {
  59837. return (
  59838. console.warn(
  59839. 'THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().'
  59840. ),
  59841. this.intersectsBox(e)
  59842. )
  59843. }
  59844. },
  59845. isIntersectionSphere: {
  59846. value: function (e) {
  59847. return (
  59848. console.warn(
  59849. 'THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().'
  59850. ),
  59851. this.intersectsSphere(e)
  59852. )
  59853. }
  59854. }
  59855. }),
  59856. Object.defineProperties(n.Matrix3.prototype, {
  59857. multiplyVector3: {
  59858. value: function (e) {
  59859. return (
  59860. console.warn(
  59861. 'THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.'
  59862. ),
  59863. e.applyMatrix3(this)
  59864. )
  59865. }
  59866. },
  59867. multiplyVector3Array: {
  59868. value: function (e) {
  59869. return (
  59870. console.warn(
  59871. 'THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.'
  59872. ),
  59873. this.applyToVector3Array(e)
  59874. )
  59875. }
  59876. }
  59877. }),
  59878. Object.defineProperties(n.Matrix4.prototype, {
  59879. extractPosition: {
  59880. value: function (e) {
  59881. return (
  59882. console.warn(
  59883. 'THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().'
  59884. ),
  59885. this.copyPosition(e)
  59886. )
  59887. }
  59888. },
  59889. setRotationFromQuaternion: {
  59890. value: function (e) {
  59891. return (
  59892. console.warn(
  59893. 'THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().'
  59894. ),
  59895. this.makeRotationFromQuaternion(e)
  59896. )
  59897. }
  59898. },
  59899. multiplyVector3: {
  59900. value: function (e) {
  59901. return (
  59902. console.warn(
  59903. 'THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.'
  59904. ),
  59905. e.applyProjection(this)
  59906. )
  59907. }
  59908. },
  59909. multiplyVector4: {
  59910. value: function (e) {
  59911. return (
  59912. console.warn(
  59913. 'THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.'
  59914. ),
  59915. e.applyMatrix4(this)
  59916. )
  59917. }
  59918. },
  59919. multiplyVector3Array: {
  59920. value: function (e) {
  59921. return (
  59922. console.warn(
  59923. 'THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.'
  59924. ),
  59925. this.applyToVector3Array(e)
  59926. )
  59927. }
  59928. },
  59929. rotateAxis: {
  59930. value: function (e) {
  59931. console.warn(
  59932. 'THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.'
  59933. ),
  59934. e.transformDirection(this)
  59935. }
  59936. },
  59937. crossVector: {
  59938. value: function (e) {
  59939. return (
  59940. console.warn(
  59941. 'THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.'
  59942. ),
  59943. e.applyMatrix4(this)
  59944. )
  59945. }
  59946. },
  59947. translate: {
  59948. value: function (e) {
  59949. console.error('THREE.Matrix4: .translate() has been removed.')
  59950. }
  59951. },
  59952. rotateX: {
  59953. value: function (e) {
  59954. console.error('THREE.Matrix4: .rotateX() has been removed.')
  59955. }
  59956. },
  59957. rotateY: {
  59958. value: function (e) {
  59959. console.error('THREE.Matrix4: .rotateY() has been removed.')
  59960. }
  59961. },
  59962. rotateZ: {
  59963. value: function (e) {
  59964. console.error('THREE.Matrix4: .rotateZ() has been removed.')
  59965. }
  59966. },
  59967. rotateByAxis: {
  59968. value: function (e, t) {
  59969. console.error('THREE.Matrix4: .rotateByAxis() has been removed.')
  59970. }
  59971. }
  59972. }),
  59973. Object.defineProperties(n.Plane.prototype, {
  59974. isIntersectionLine: {
  59975. value: function (e) {
  59976. return (
  59977. console.warn(
  59978. 'THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().'
  59979. ),
  59980. this.intersectsLine(e)
  59981. )
  59982. }
  59983. }
  59984. }),
  59985. Object.defineProperties(n.Quaternion.prototype, {
  59986. multiplyVector3: {
  59987. value: function (e) {
  59988. return (
  59989. console.warn(
  59990. 'THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.'
  59991. ),
  59992. e.applyQuaternion(this)
  59993. )
  59994. }
  59995. }
  59996. }),
  59997. Object.defineProperties(n.Ray.prototype, {
  59998. isIntersectionBox: {
  59999. value: function (e) {
  60000. return (
  60001. console.warn(
  60002. 'THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().'
  60003. ),
  60004. this.intersectsBox(e)
  60005. )
  60006. }
  60007. },
  60008. isIntersectionPlane: {
  60009. value: function (e) {
  60010. return (
  60011. console.warn(
  60012. 'THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().'
  60013. ),
  60014. this.intersectsPlane(e)
  60015. )
  60016. }
  60017. },
  60018. isIntersectionSphere: {
  60019. value: function (e) {
  60020. return (
  60021. console.warn(
  60022. 'THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().'
  60023. ),
  60024. this.intersectsSphere(e)
  60025. )
  60026. }
  60027. }
  60028. }),
  60029. Object.defineProperties(n.Vector3.prototype, {
  60030. setEulerFromRotationMatrix: {
  60031. value: function () {
  60032. console.error(
  60033. 'THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.'
  60034. )
  60035. }
  60036. },
  60037. setEulerFromQuaternion: {
  60038. value: function () {
  60039. console.error(
  60040. 'THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.'
  60041. )
  60042. }
  60043. },
  60044. getPositionFromMatrix: {
  60045. value: function (e) {
  60046. return (
  60047. console.warn(
  60048. 'THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().'
  60049. ),
  60050. this.setFromMatrixPosition(e)
  60051. )
  60052. }
  60053. },
  60054. getScaleFromMatrix: {
  60055. value: function (e) {
  60056. return (
  60057. console.warn(
  60058. 'THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().'
  60059. ),
  60060. this.setFromMatrixScale(e)
  60061. )
  60062. }
  60063. },
  60064. getColumnFromMatrix: {
  60065. value: function (e, t) {
  60066. return (
  60067. console.warn(
  60068. 'THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().'
  60069. ),
  60070. this.setFromMatrixColumn(e, t)
  60071. )
  60072. }
  60073. }
  60074. }),
  60075. (n.Face4 = function (e, t, i, r, o, a, s) {
  60076. return (
  60077. console.warn('THREE.Face4 has been removed. A THREE.Face3 will be created instead.'),
  60078. new n.Face3(e, t, i, o, a, s)
  60079. )
  60080. }),
  60081. (n.Vertex = function (e, t, i) {
  60082. return (
  60083. console.warn('THREE.Vertex has been removed. Use THREE.Vector3 instead.'),
  60084. new n.Vector3(e, t, i)
  60085. )
  60086. }),
  60087. Object.defineProperties(n.Object3D.prototype, {
  60088. eulerOrder: {
  60089. get: function () {
  60090. return (
  60091. console.warn('THREE.Object3D: .eulerOrder is now .rotation.order.'),
  60092. this.rotation.order
  60093. )
  60094. },
  60095. set: function (e) {
  60096. console.warn('THREE.Object3D: .eulerOrder is now .rotation.order.'),
  60097. (this.rotation.order = e)
  60098. }
  60099. },
  60100. getChildByName: {
  60101. value: function (e) {
  60102. return (
  60103. console.warn(
  60104. 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().'
  60105. ),
  60106. this.getObjectByName(e)
  60107. )
  60108. }
  60109. },
  60110. renderDepth: {
  60111. set: function (e) {
  60112. console.warn(
  60113. 'THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.'
  60114. )
  60115. }
  60116. },
  60117. translate: {
  60118. value: function (e, t) {
  60119. return (
  60120. console.warn(
  60121. 'THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.'
  60122. ),
  60123. this.translateOnAxis(t, e)
  60124. )
  60125. }
  60126. },
  60127. useQuaternion: {
  60128. get: function () {
  60129. console.warn(
  60130. 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.'
  60131. )
  60132. },
  60133. set: function (e) {
  60134. console.warn(
  60135. 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.'
  60136. )
  60137. }
  60138. }
  60139. }),
  60140. Object.defineProperties(n, {
  60141. PointCloud: {
  60142. value: function (e, t) {
  60143. return (
  60144. console.warn('THREE.PointCloud has been renamed to THREE.Points.'),
  60145. new n.Points(e, t)
  60146. )
  60147. }
  60148. },
  60149. ParticleSystem: {
  60150. value: function (e, t) {
  60151. return (
  60152. console.warn('THREE.ParticleSystem has been renamed to THREE.Points.'),
  60153. new n.Points(e, t)
  60154. )
  60155. }
  60156. }
  60157. }),
  60158. Object.defineProperties(n.Light.prototype, {
  60159. onlyShadow: {
  60160. set: function (e) {
  60161. console.warn('THREE.Light: .onlyShadow has been removed.')
  60162. }
  60163. },
  60164. shadowCameraFov: {
  60165. set: function (e) {
  60166. console.warn('THREE.Light: .shadowCameraFov is now .shadow.camera.fov.'),
  60167. (this.shadow.camera.fov = e)
  60168. }
  60169. },
  60170. shadowCameraLeft: {
  60171. set: function (e) {
  60172. console.warn('THREE.Light: .shadowCameraLeft is now .shadow.camera.left.'),
  60173. (this.shadow.camera.left = e)
  60174. }
  60175. },
  60176. shadowCameraRight: {
  60177. set: function (e) {
  60178. console.warn('THREE.Light: .shadowCameraRight is now .shadow.camera.right.'),
  60179. (this.shadow.camera.right = e)
  60180. }
  60181. },
  60182. shadowCameraTop: {
  60183. set: function (e) {
  60184. console.warn('THREE.Light: .shadowCameraTop is now .shadow.camera.top.'),
  60185. (this.shadow.camera.top = e)
  60186. }
  60187. },
  60188. shadowCameraBottom: {
  60189. set: function (e) {
  60190. console.warn('THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.'),
  60191. (this.shadow.camera.bottom = e)
  60192. }
  60193. },
  60194. shadowCameraNear: {
  60195. set: function (e) {
  60196. console.warn('THREE.Light: .shadowCameraNear is now .shadow.camera.near.'),
  60197. (this.shadow.camera.near = e)
  60198. }
  60199. },
  60200. shadowCameraFar: {
  60201. set: function (e) {
  60202. console.warn('THREE.Light: .shadowCameraFar is now .shadow.camera.far.'),
  60203. (this.shadow.camera.far = e)
  60204. }
  60205. },
  60206. shadowCameraVisible: {
  60207. set: function (e) {
  60208. console.warn(
  60209. 'THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.'
  60210. )
  60211. }
  60212. },
  60213. shadowBias: {
  60214. set: function (e) {
  60215. console.warn('THREE.Light: .shadowBias is now .shadow.bias.'),
  60216. (this.shadow.bias = e)
  60217. }
  60218. },
  60219. shadowDarkness: {
  60220. set: function (e) {
  60221. console.warn('THREE.Light: .shadowDarkness has been removed.')
  60222. }
  60223. },
  60224. shadowMapWidth: {
  60225. set: function (e) {
  60226. console.warn('THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.'),
  60227. (this.shadow.mapSize.width = e)
  60228. }
  60229. },
  60230. shadowMapHeight: {
  60231. set: function (e) {
  60232. console.warn('THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.'),
  60233. (this.shadow.mapSize.height = e)
  60234. }
  60235. }
  60236. }),
  60237. Object.defineProperties(n.BufferAttribute.prototype, {
  60238. length: {
  60239. get: function () {
  60240. return (
  60241. console.warn(
  60242. 'THREE.BufferAttribute: .length has been deprecated. Please use .count.'
  60243. ),
  60244. this.array.length
  60245. )
  60246. }
  60247. }
  60248. }),
  60249. Object.defineProperties(n.BufferGeometry.prototype, {
  60250. drawcalls: {
  60251. get: function () {
  60252. return (
  60253. console.error('THREE.BufferGeometry: .drawcalls has been renamed to .groups.'),
  60254. this.groups
  60255. )
  60256. }
  60257. },
  60258. offsets: {
  60259. get: function () {
  60260. return (
  60261. console.warn('THREE.BufferGeometry: .offsets has been renamed to .groups.'),
  60262. this.groups
  60263. )
  60264. }
  60265. },
  60266. addIndex: {
  60267. value: function (e) {
  60268. console.warn('THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().'),
  60269. this.setIndex(e)
  60270. }
  60271. },
  60272. addDrawCall: {
  60273. value: function (e, t, i) {
  60274. void 0 !== i &&
  60275. console.warn(
  60276. 'THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.'
  60277. ),
  60278. console.warn('THREE.BufferGeometry: .addDrawCall() is now .addGroup().'),
  60279. this.addGroup(e, t)
  60280. }
  60281. },
  60282. clearDrawCalls: {
  60283. value: function () {
  60284. console.warn('THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().'),
  60285. this.clearGroups()
  60286. }
  60287. },
  60288. computeTangents: {
  60289. value: function () {
  60290. console.warn('THREE.BufferGeometry: .computeTangents() has been removed.')
  60291. }
  60292. },
  60293. computeOffsets: {
  60294. value: function () {
  60295. console.warn('THREE.BufferGeometry: .computeOffsets() has been removed.')
  60296. }
  60297. }
  60298. }),
  60299. Object.defineProperties(n.Material.prototype, {
  60300. wrapAround: {
  60301. get: function () {
  60302. console.warn('THREE.' + this.type + ': .wrapAround has been removed.')
  60303. },
  60304. set: function (e) {
  60305. console.warn('THREE.' + this.type + ': .wrapAround has been removed.')
  60306. }
  60307. },
  60308. wrapRGB: {
  60309. get: function () {
  60310. return (
  60311. console.warn('THREE.' + this.type + ': .wrapRGB has been removed.'), new n.Color()
  60312. )
  60313. }
  60314. }
  60315. }),
  60316. Object.defineProperties(n, {
  60317. PointCloudMaterial: {
  60318. value: function (e) {
  60319. return (
  60320. console.warn(
  60321. 'THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.'
  60322. ),
  60323. new n.PointsMaterial(e)
  60324. )
  60325. }
  60326. },
  60327. ParticleBasicMaterial: {
  60328. value: function (e) {
  60329. return (
  60330. console.warn(
  60331. 'THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.'
  60332. ),
  60333. new n.PointsMaterial(e)
  60334. )
  60335. }
  60336. },
  60337. ParticleSystemMaterial: {
  60338. value: function (e) {
  60339. return (
  60340. console.warn(
  60341. 'THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.'
  60342. ),
  60343. new n.PointsMaterial(e)
  60344. )
  60345. }
  60346. }
  60347. }),
  60348. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  60349. metal: {
  60350. get: function () {
  60351. return (
  60352. console.warn(
  60353. 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.'
  60354. ),
  60355. !1
  60356. )
  60357. },
  60358. set: function (e) {
  60359. console.warn(
  60360. 'THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead'
  60361. )
  60362. }
  60363. }
  60364. }),
  60365. Object.defineProperties(n.ShaderMaterial.prototype, {
  60366. derivatives: {
  60367. get: function () {
  60368. return (
  60369. console.warn(
  60370. 'THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.'
  60371. ),
  60372. this.extensions.derivatives
  60373. )
  60374. },
  60375. set: function (e) {
  60376. console.warn(
  60377. 'THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.'
  60378. ),
  60379. (this.extensions.derivatives = e)
  60380. }
  60381. }
  60382. }),
  60383. Object.defineProperties(n.WebGLRenderer.prototype, {
  60384. supportsFloatTextures: {
  60385. value: function () {
  60386. return (
  60387. console.warn(
  60388. "THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."
  60389. ),
  60390. this.extensions.get('OES_texture_float')
  60391. )
  60392. }
  60393. },
  60394. supportsHalfFloatTextures: {
  60395. value: function () {
  60396. return (
  60397. console.warn(
  60398. "THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."
  60399. ),
  60400. this.extensions.get('OES_texture_half_float')
  60401. )
  60402. }
  60403. },
  60404. supportsStandardDerivatives: {
  60405. value: function () {
  60406. return (
  60407. console.warn(
  60408. "THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."
  60409. ),
  60410. this.extensions.get('OES_standard_derivatives')
  60411. )
  60412. }
  60413. },
  60414. supportsCompressedTextureS3TC: {
  60415. value: function () {
  60416. return (
  60417. console.warn(
  60418. "THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."
  60419. ),
  60420. this.extensions.get('WEBGL_compressed_texture_s3tc')
  60421. )
  60422. }
  60423. },
  60424. supportsCompressedTexturePVRTC: {
  60425. value: function () {
  60426. return (
  60427. console.warn(
  60428. "THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."
  60429. ),
  60430. this.extensions.get('WEBGL_compressed_texture_pvrtc')
  60431. )
  60432. }
  60433. },
  60434. supportsBlendMinMax: {
  60435. value: function () {
  60436. return (
  60437. console.warn(
  60438. "THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."
  60439. ),
  60440. this.extensions.get('EXT_blend_minmax')
  60441. )
  60442. }
  60443. },
  60444. supportsVertexTextures: {
  60445. value: function () {
  60446. return this.capabilities.vertexTextures
  60447. }
  60448. },
  60449. supportsInstancedArrays: {
  60450. value: function () {
  60451. return (
  60452. console.warn(
  60453. "THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."
  60454. ),
  60455. this.extensions.get('ANGLE_instanced_arrays')
  60456. )
  60457. }
  60458. },
  60459. enableScissorTest: {
  60460. value: function (e) {
  60461. console.warn('THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().'),
  60462. this.setScissorTest(e)
  60463. }
  60464. },
  60465. initMaterial: {
  60466. value: function () {
  60467. console.warn('THREE.WebGLRenderer: .initMaterial() has been removed.')
  60468. }
  60469. },
  60470. addPrePlugin: {
  60471. value: function () {
  60472. console.warn('THREE.WebGLRenderer: .addPrePlugin() has been removed.')
  60473. }
  60474. },
  60475. addPostPlugin: {
  60476. value: function () {
  60477. console.warn('THREE.WebGLRenderer: .addPostPlugin() has been removed.')
  60478. }
  60479. },
  60480. updateShadowMap: {
  60481. value: function () {
  60482. console.warn('THREE.WebGLRenderer: .updateShadowMap() has been removed.')
  60483. }
  60484. },
  60485. shadowMapEnabled: {
  60486. get: function () {
  60487. return this.shadowMap.enabled
  60488. },
  60489. set: function (e) {
  60490. console.warn('THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.'),
  60491. (this.shadowMap.enabled = e)
  60492. }
  60493. },
  60494. shadowMapType: {
  60495. get: function () {
  60496. return this.shadowMap.type
  60497. },
  60498. set: function (e) {
  60499. console.warn('THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.'),
  60500. (this.shadowMap.type = e)
  60501. }
  60502. },
  60503. shadowMapCullFace: {
  60504. get: function () {
  60505. return this.shadowMap.cullFace
  60506. },
  60507. set: function (e) {
  60508. console.warn('THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.'),
  60509. (this.shadowMap.cullFace = e)
  60510. }
  60511. }
  60512. }),
  60513. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  60514. wrapS: {
  60515. get: function () {
  60516. return (
  60517. console.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.'),
  60518. this.texture.wrapS
  60519. )
  60520. },
  60521. set: function (e) {
  60522. console.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.'),
  60523. (this.texture.wrapS = e)
  60524. }
  60525. },
  60526. wrapT: {
  60527. get: function () {
  60528. return (
  60529. console.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.'),
  60530. this.texture.wrapT
  60531. )
  60532. },
  60533. set: function (e) {
  60534. console.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.'),
  60535. (this.texture.wrapT = e)
  60536. }
  60537. },
  60538. magFilter: {
  60539. get: function () {
  60540. return (
  60541. console.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.'),
  60542. this.texture.magFilter
  60543. )
  60544. },
  60545. set: function (e) {
  60546. console.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.'),
  60547. (this.texture.magFilter = e)
  60548. }
  60549. },
  60550. minFilter: {
  60551. get: function () {
  60552. return (
  60553. console.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.'),
  60554. this.texture.minFilter
  60555. )
  60556. },
  60557. set: function (e) {
  60558. console.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.'),
  60559. (this.texture.minFilter = e)
  60560. }
  60561. },
  60562. anisotropy: {
  60563. get: function () {
  60564. return (
  60565. console.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.'),
  60566. this.texture.anisotropy
  60567. )
  60568. },
  60569. set: function (e) {
  60570. console.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.'),
  60571. (this.texture.anisotropy = e)
  60572. }
  60573. },
  60574. offset: {
  60575. get: function () {
  60576. return (
  60577. console.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.'),
  60578. this.texture.offset
  60579. )
  60580. },
  60581. set: function (e) {
  60582. console.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.'),
  60583. (this.texture.offset = e)
  60584. }
  60585. },
  60586. repeat: {
  60587. get: function () {
  60588. return (
  60589. console.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.'),
  60590. this.texture.repeat
  60591. )
  60592. },
  60593. set: function (e) {
  60594. console.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.'),
  60595. (this.texture.repeat = e)
  60596. }
  60597. },
  60598. format: {
  60599. get: function () {
  60600. return (
  60601. console.warn('THREE.WebGLRenderTarget: .format is now .texture.format.'),
  60602. this.texture.format
  60603. )
  60604. },
  60605. set: function (e) {
  60606. console.warn('THREE.WebGLRenderTarget: .format is now .texture.format.'),
  60607. (this.texture.format = e)
  60608. }
  60609. },
  60610. type: {
  60611. get: function () {
  60612. return (
  60613. console.warn('THREE.WebGLRenderTarget: .type is now .texture.type.'),
  60614. this.texture.type
  60615. )
  60616. },
  60617. set: function (e) {
  60618. console.warn('THREE.WebGLRenderTarget: .type is now .texture.type.'),
  60619. (this.texture.type = e)
  60620. }
  60621. },
  60622. generateMipmaps: {
  60623. get: function () {
  60624. return (
  60625. console.warn(
  60626. 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.'
  60627. ),
  60628. this.texture.generateMipmaps
  60629. )
  60630. },
  60631. set: function (e) {
  60632. console.warn(
  60633. 'THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.'
  60634. ),
  60635. (this.texture.generateMipmaps = e)
  60636. }
  60637. }
  60638. }),
  60639. (n.GeometryUtils = {
  60640. merge: function (e, t, i) {
  60641. console.warn(
  60642. 'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.'
  60643. )
  60644. var r
  60645. t instanceof n.Mesh &&
  60646. (t.matrixAutoUpdate && t.updateMatrix(), (r = t.matrix), (t = t.geometry)),
  60647. e.merge(t, r, i)
  60648. },
  60649. center: function (e) {
  60650. return (
  60651. console.warn(
  60652. 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.'
  60653. ),
  60654. e.center()
  60655. )
  60656. }
  60657. }),
  60658. (n.ImageUtils = {
  60659. crossOrigin: void 0,
  60660. loadTexture: function (e, t, i, r) {
  60661. console.warn(
  60662. 'THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.'
  60663. )
  60664. var o = new n.TextureLoader()
  60665. o.setCrossOrigin(this.crossOrigin)
  60666. var a = o.load(e, i, void 0, r)
  60667. return t && (a.mapping = t), a
  60668. },
  60669. loadTextureCube: function (e, t, i, r) {
  60670. console.warn(
  60671. 'THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.'
  60672. )
  60673. var o = new n.CubeTextureLoader()
  60674. o.setCrossOrigin(this.crossOrigin)
  60675. var a = o.load(e, i, void 0, r)
  60676. return t && (a.mapping = t), a
  60677. },
  60678. loadCompressedTexture: function () {
  60679. console.error(
  60680. 'THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.'
  60681. )
  60682. },
  60683. loadCompressedTextureCube: function () {
  60684. console.error(
  60685. 'THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.'
  60686. )
  60687. }
  60688. }),
  60689. (n.Projector = function () {
  60690. console.error('THREE.Projector has been moved to /examples/js/renderers/Projector.js.'),
  60691. (this.projectVector = function (e, t) {
  60692. console.warn('THREE.Projector: .projectVector() is now vector.project().'),
  60693. e.project(t)
  60694. }),
  60695. (this.unprojectVector = function (e, t) {
  60696. console.warn('THREE.Projector: .unprojectVector() is now vector.unproject().'),
  60697. e.unproject(t)
  60698. }),
  60699. (this.pickingRay = function (e, t) {
  60700. console.error('THREE.Projector: .pickingRay() is now raycaster.setFromCamera().')
  60701. })
  60702. }),
  60703. (n.CanvasRenderer = function () {
  60704. console.error(
  60705. 'THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js'
  60706. ),
  60707. (this.domElement = document.createElement('canvas')),
  60708. (this.clear = function () {}),
  60709. (this.render = function () {}),
  60710. (this.setClearColor = function () {}),
  60711. (this.setSize = function () {})
  60712. }),
  60713. (n.MeshFaceMaterial = n.MultiMaterial),
  60714. (n.CurveUtils = {
  60715. tangentQuadraticBezier: function (e, t, i, n) {
  60716. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  60717. },
  60718. tangentCubicBezier: function (e, t, i, n, r) {
  60719. return (
  60720. -3 * t * (1 - e) * (1 - e) +
  60721. 3 * i * (1 - e) * (1 - e) -
  60722. 6 * e * i * (1 - e) +
  60723. 6 * e * n * (1 - e) -
  60724. 3 * e * e * n +
  60725. 3 * e * e * r
  60726. )
  60727. },
  60728. tangentSpline: function (e, t, i, n, r) {
  60729. var o = 6 * e * e - 6 * e,
  60730. a = 3 * e * e - 4 * e + 1,
  60731. s = -6 * e * e + 6 * e,
  60732. l = 3 * e * e - 2 * e
  60733. return o + a + s + l
  60734. },
  60735. interpolate: function (e, t, i, n, r) {
  60736. var o = 0.5 * (i - e),
  60737. a = 0.5 * (n - t),
  60738. s = r * r,
  60739. l = r * s
  60740. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  60741. }
  60742. }),
  60743. (n.SceneUtils = {
  60744. createMultiMaterialObject: function (e, t) {
  60745. for (var i = new n.Group(), r = 0, o = t.length; r < o; r++)
  60746. i.add(new n.Mesh(e, t[r]))
  60747. return i
  60748. },
  60749. detach: function (e, t, i) {
  60750. e.applyMatrix(t.matrixWorld), t.remove(e), i.add(e)
  60751. },
  60752. attach: function (e, t, i) {
  60753. var r = new n.Matrix4()
  60754. r.getInverse(i.matrixWorld), e.applyMatrix(r), t.remove(e), i.add(e)
  60755. }
  60756. }),
  60757. (n.ShapeUtils = {
  60758. area: function (e) {
  60759. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  60760. i += e[n].x * e[r].y - e[r].x * e[n].y
  60761. return 0.5 * i
  60762. },
  60763. triangulate: (function () {
  60764. function e(e, t, i, n, r, o) {
  60765. var a, s, l, c, h, u, d, p, f
  60766. if (
  60767. ((s = e[o[t]].x),
  60768. (l = e[o[t]].y),
  60769. (c = e[o[i]].x),
  60770. (h = e[o[i]].y),
  60771. (u = e[o[n]].x),
  60772. (d = e[o[n]].y),
  60773. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  60774. )
  60775. return !1
  60776. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M
  60777. for (
  60778. g = u - c, m = d - h, v = s - u, A = l - d, y = c - s, C = h - l, a = 0;
  60779. a < r;
  60780. a++
  60781. )
  60782. if (
  60783. ((p = e[o[a]].x),
  60784. (f = e[o[a]].y),
  60785. !((p === s && f === l) || (p === c && f === h) || (p === u && f === d)) &&
  60786. ((I = p - s),
  60787. (E = f - l),
  60788. (b = p - c),
  60789. (w = f - h),
  60790. (_ = p - u),
  60791. (T = f - d),
  60792. (M = g * w - m * b),
  60793. (x = y * E - C * I),
  60794. (S = v * T - A * _),
  60795. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  60796. )
  60797. return !1
  60798. return !0
  60799. }
  60800. return function (t, i) {
  60801. var r = t.length
  60802. if (r < 3) return null
  60803. var o,
  60804. a,
  60805. s,
  60806. l = [],
  60807. c = [],
  60808. h = []
  60809. if (n.ShapeUtils.area(t) > 0) for (a = 0; a < r; a++) c[a] = a
  60810. else for (a = 0; a < r; a++) c[a] = r - 1 - a
  60811. var u = r,
  60812. d = 2 * u
  60813. for (a = u - 1; u > 2; ) {
  60814. if (d-- <= 0)
  60815. return (
  60816. console.warn(
  60817. 'THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()'
  60818. ),
  60819. i ? h : l
  60820. )
  60821. if (
  60822. ((o = a),
  60823. u <= o && (o = 0),
  60824. (a = o + 1),
  60825. u <= a && (a = 0),
  60826. (s = a + 1),
  60827. u <= s && (s = 0),
  60828. e(t, o, a, s, u, c))
  60829. ) {
  60830. var p, f, g, m, v
  60831. for (
  60832. p = c[o],
  60833. f = c[a],
  60834. g = c[s],
  60835. l.push([t[p], t[f], t[g]]),
  60836. h.push([c[o], c[a], c[s]]),
  60837. m = a,
  60838. v = a + 1;
  60839. v < u;
  60840. m++, v++
  60841. )
  60842. c[m] = c[v]
  60843. u--, (d = 2 * u)
  60844. }
  60845. }
  60846. return i ? h : l
  60847. }
  60848. })(),
  60849. triangulateShape: function (e, t) {
  60850. function i(e, t, i) {
  60851. return e.x !== t.x
  60852. ? e.x < t.x
  60853. ? e.x <= i.x && i.x <= t.x
  60854. : t.x <= i.x && i.x <= e.x
  60855. : e.y < t.y
  60856. ? e.y <= i.y && i.y <= t.y
  60857. : t.y <= i.y && i.y <= e.y
  60858. }
  60859. function r(e, t, n, r, o) {
  60860. var a = t.x - e.x,
  60861. s = t.y - e.y,
  60862. l = r.x - n.x,
  60863. c = r.y - n.y,
  60864. h = e.x - n.x,
  60865. u = e.y - n.y,
  60866. d = s * l - a * c,
  60867. p = s * h - a * u
  60868. if (Math.abs(d) > Number.EPSILON) {
  60869. var f
  60870. if (d > 0) {
  60871. if (p < 0 || p > d) return []
  60872. if (((f = c * h - l * u), f < 0 || f > d)) return []
  60873. } else {
  60874. if (p > 0 || p < d) return []
  60875. if (((f = c * h - l * u), f > 0 || f < d)) return []
  60876. }
  60877. if (0 === f) return !o || (0 !== p && p !== d) ? [e] : []
  60878. if (f === d) return !o || (0 !== p && p !== d) ? [t] : []
  60879. if (0 === p) return [n]
  60880. if (p === d) return [r]
  60881. var g = f / d
  60882. return [
  60883. {
  60884. x: e.x + g * a,
  60885. y: e.y + g * s
  60886. }
  60887. ]
  60888. }
  60889. if (0 !== p || c * h !== l * u) return []
  60890. var m = 0 === a && 0 === s,
  60891. v = 0 === l && 0 === c
  60892. if (m && v) return e.x !== n.x || e.y !== n.y ? [] : [e]
  60893. if (m) return i(n, r, e) ? [e] : []
  60894. if (v) return i(e, t, n) ? [n] : []
  60895. var A, y, C, I, E, b, w, _
  60896. return (
  60897. 0 !== a
  60898. ? (e.x < t.x
  60899. ? ((A = e), (C = e.x), (y = t), (I = t.x))
  60900. : ((A = t), (C = t.x), (y = e), (I = e.x)),
  60901. n.x < r.x
  60902. ? ((E = n), (w = n.x), (b = r), (_ = r.x))
  60903. : ((E = r), (w = r.x), (b = n), (_ = n.x)))
  60904. : (e.y < t.y
  60905. ? ((A = e), (C = e.y), (y = t), (I = t.y))
  60906. : ((A = t), (C = t.y), (y = e), (I = e.y)),
  60907. n.y < r.y
  60908. ? ((E = n), (w = n.y), (b = r), (_ = r.y))
  60909. : ((E = r), (w = r.y), (b = n), (_ = n.y))),
  60910. C <= w
  60911. ? I < w
  60912. ? []
  60913. : I === w
  60914. ? o
  60915. ? []
  60916. : [E]
  60917. : I <= _
  60918. ? [E, y]
  60919. : [E, b]
  60920. : C > _
  60921. ? []
  60922. : C === _
  60923. ? o
  60924. ? []
  60925. : [A]
  60926. : I <= _
  60927. ? [A, y]
  60928. : [A, b]
  60929. )
  60930. }
  60931. function o(e, t, i, n) {
  60932. var r = t.x - e.x,
  60933. o = t.y - e.y,
  60934. a = i.x - e.x,
  60935. s = i.y - e.y,
  60936. l = n.x - e.x,
  60937. c = n.y - e.y,
  60938. h = r * s - o * a,
  60939. u = r * c - o * l
  60940. if (Math.abs(h) > Number.EPSILON) {
  60941. var d = l * s - c * a
  60942. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  60943. }
  60944. return u > 0
  60945. }
  60946. function a(e, t) {
  60947. function i(e, t) {
  60948. var i = A.length - 1,
  60949. n = e - 1
  60950. n < 0 && (n = i)
  60951. var r = e + 1
  60952. r > i && (r = 0)
  60953. var a = o(A[e], A[n], A[r], s[t])
  60954. if (!a) return !1
  60955. var l = s.length - 1,
  60956. c = t - 1
  60957. c < 0 && (c = l)
  60958. var h = t + 1
  60959. return h > l && (h = 0), (a = o(s[t], s[c], s[h], A[e])), !!a
  60960. }
  60961. function n(e, t) {
  60962. var i, n, o
  60963. for (i = 0; i < A.length; i++)
  60964. if (((n = i + 1), (n %= A.length), (o = r(e, t, A[i], A[n], !0)), o.length > 0))
  60965. return !0
  60966. return !1
  60967. }
  60968. function a(e, i) {
  60969. var n, o, a, s, l
  60970. for (n = 0; n < y.length; n++)
  60971. for (o = t[y[n]], a = 0; a < o.length; a++)
  60972. if (
  60973. ((s = a + 1), (s %= o.length), (l = r(e, i, o[a], o[s], !0)), l.length > 0)
  60974. )
  60975. return !0
  60976. return !1
  60977. }
  60978. for (
  60979. var s,
  60980. l,
  60981. c,
  60982. h,
  60983. u,
  60984. d,
  60985. p,
  60986. f,
  60987. g,
  60988. m,
  60989. v,
  60990. A = e.concat(),
  60991. y = [],
  60992. C = [],
  60993. I = 0,
  60994. E = t.length;
  60995. I < E;
  60996. I++
  60997. )
  60998. y.push(I)
  60999. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  61000. if ((w--, w < 0)) {
  61001. console.log(
  61002. 'Infinite Loop! Holes left:' + y.length + ', Probably Hole outside Shape!'
  61003. )
  61004. break
  61005. }
  61006. for (c = b; c < A.length; c++) {
  61007. ;(h = A[c]), (l = -1)
  61008. for (var I = 0; I < y.length; I++)
  61009. if (((d = y[I]), (p = h.x + ':' + h.y + ':' + d), void 0 === C[p])) {
  61010. s = t[d]
  61011. for (var _ = 0; _ < s.length; _++)
  61012. if (((u = s[_]), i(c, _) && !n(h, u) && !a(h, u))) {
  61013. ;(l = _),
  61014. y.splice(I, 1),
  61015. (f = A.slice(0, c + 1)),
  61016. (g = A.slice(c)),
  61017. (m = s.slice(l)),
  61018. (v = s.slice(0, l + 1)),
  61019. (A = f.concat(m).concat(v).concat(g)),
  61020. (b = c)
  61021. break
  61022. }
  61023. if (l >= 0) break
  61024. C[p] = !0
  61025. }
  61026. if (l >= 0) break
  61027. }
  61028. }
  61029. return A
  61030. }
  61031. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  61032. Array.prototype.push.apply(f, t[g])
  61033. for (s = 0, l = f.length; s < l; s++)
  61034. (u = f[s].x + ':' + f[s].y),
  61035. void 0 !== p[u] && console.warn('THREE.Shape: Duplicate point', u),
  61036. (p[u] = s)
  61037. var v = a(e, t),
  61038. A = n.ShapeUtils.triangulate(v, !1)
  61039. for (s = 0, l = A.length; s < l; s++)
  61040. for (h = A[s], c = 0; c < 3; c++)
  61041. (u = h[c].x + ':' + h[c].y), (d = p[u]), void 0 !== d && (h[c] = d)
  61042. return A.concat()
  61043. },
  61044. isClockWise: function (e) {
  61045. return n.ShapeUtils.area(e) < 0
  61046. },
  61047. b2: (function () {
  61048. function e(e, t) {
  61049. var i = 1 - e
  61050. return i * i * t
  61051. }
  61052. function t(e, t) {
  61053. return 2 * (1 - e) * e * t
  61054. }
  61055. function i(e, t) {
  61056. return e * e * t
  61057. }
  61058. return function (n, r, o, a) {
  61059. return e(n, r) + t(n, o) + i(n, a)
  61060. }
  61061. })(),
  61062. b3: (function () {
  61063. function e(e, t) {
  61064. var i = 1 - e
  61065. return i * i * i * t
  61066. }
  61067. function t(e, t) {
  61068. var i = 1 - e
  61069. return 3 * i * i * e * t
  61070. }
  61071. function i(e, t) {
  61072. var i = 1 - e
  61073. return 3 * i * e * e * t
  61074. }
  61075. function n(e, t) {
  61076. return e * e * e * t
  61077. }
  61078. return function (r, o, a, s, l) {
  61079. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  61080. }
  61081. })()
  61082. }),
  61083. (n.Curve = function () {}),
  61084. (n.Curve.prototype = {
  61085. constructor: n.Curve,
  61086. getPoint: function (e) {
  61087. return console.warn('THREE.Curve: Warning, getPoint() not implemented!'), null
  61088. },
  61089. getPointAt: function (e) {
  61090. var t = this.getUtoTmapping(e)
  61091. return this.getPoint(t)
  61092. },
  61093. getPoints: function (e) {
  61094. e || (e = 5)
  61095. var t,
  61096. i = []
  61097. for (t = 0; t <= e; t++) i.push(this.getPoint(t / e))
  61098. return i
  61099. },
  61100. getSpacedPoints: function (e) {
  61101. e || (e = 5)
  61102. var t,
  61103. i = []
  61104. for (t = 0; t <= e; t++) i.push(this.getPointAt(t / e))
  61105. return i
  61106. },
  61107. getLength: function () {
  61108. var e = this.getLengths()
  61109. return e[e.length - 1]
  61110. },
  61111. getLengths: function (e) {
  61112. if (
  61113. (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  61114. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  61115. )
  61116. return this.cacheArcLengths
  61117. this.needsUpdate = !1
  61118. var t,
  61119. i,
  61120. n = [],
  61121. r = this.getPoint(0),
  61122. o = 0
  61123. for (n.push(0), i = 1; i <= e; i++)
  61124. (t = this.getPoint(i / e)), (o += t.distanceTo(r)), n.push(o), (r = t)
  61125. return (this.cacheArcLengths = n), n
  61126. },
  61127. updateArcLengths: function () {
  61128. ;(this.needsUpdate = !0), this.getLengths()
  61129. },
  61130. getUtoTmapping: function (e, t) {
  61131. var i,
  61132. n = this.getLengths(),
  61133. r = 0,
  61134. o = n.length
  61135. i = t ? t : e * n[o - 1]
  61136. for (var a, s = 0, l = o - 1; s <= l; )
  61137. if (((r = Math.floor(s + (l - s) / 2)), (a = n[r] - i), a < 0)) s = r + 1
  61138. else {
  61139. if (!(a > 0)) {
  61140. l = r
  61141. break
  61142. }
  61143. l = r - 1
  61144. }
  61145. if (((r = l), n[r] === i)) {
  61146. var c = r / (o - 1)
  61147. return c
  61148. }
  61149. var h = n[r],
  61150. u = n[r + 1],
  61151. d = u - h,
  61152. p = (i - h) / d,
  61153. c = (r + p) / (o - 1)
  61154. return c
  61155. },
  61156. getTangent: function (e) {
  61157. var t = 1e-4,
  61158. i = e - t,
  61159. n = e + t
  61160. i < 0 && (i = 0), n > 1 && (n = 1)
  61161. var r = this.getPoint(i),
  61162. o = this.getPoint(n),
  61163. a = o.clone().sub(r)
  61164. return a.normalize()
  61165. },
  61166. getTangentAt: function (e) {
  61167. var t = this.getUtoTmapping(e)
  61168. return this.getTangent(t)
  61169. }
  61170. }),
  61171. (n.Curve.create = function (e, t) {
  61172. return (
  61173. (e.prototype = Object.create(n.Curve.prototype)),
  61174. (e.prototype.constructor = e),
  61175. (e.prototype.getPoint = t),
  61176. e
  61177. )
  61178. }),
  61179. (n.CurvePath = function () {
  61180. ;(this.curves = []), (this.autoClose = !1)
  61181. }),
  61182. (n.CurvePath.prototype = Object.create(n.Curve.prototype)),
  61183. (n.CurvePath.prototype.constructor = n.CurvePath),
  61184. (n.CurvePath.prototype.add = function (e) {
  61185. this.curves.push(e)
  61186. }),
  61187. (n.CurvePath.prototype.closePath = function () {
  61188. var e = this.curves[0].getPoint(0),
  61189. t = this.curves[this.curves.length - 1].getPoint(1)
  61190. e.equals(t) || this.curves.push(new n.LineCurve(t, e))
  61191. }),
  61192. (n.CurvePath.prototype.getPoint = function (e) {
  61193. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  61194. if (i[n] >= t) {
  61195. var r = i[n] - t,
  61196. o = this.curves[n],
  61197. a = 1 - r / o.getLength()
  61198. return o.getPointAt(a)
  61199. }
  61200. n++
  61201. }
  61202. return null
  61203. }),
  61204. (n.CurvePath.prototype.getLength = function () {
  61205. var e = this.getCurveLengths()
  61206. return e[e.length - 1]
  61207. }),
  61208. (n.CurvePath.prototype.getCurveLengths = function () {
  61209. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  61210. return this.cacheLengths
  61211. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  61212. (t += this.curves[i].getLength()), e.push(t)
  61213. return (this.cacheLengths = e), e
  61214. }),
  61215. (n.CurvePath.prototype.createPointsGeometry = function (e) {
  61216. var t = this.getPoints(e)
  61217. return this.createGeometry(t)
  61218. }),
  61219. (n.CurvePath.prototype.createSpacedPointsGeometry = function (e) {
  61220. var t = this.getSpacedPoints(e)
  61221. return this.createGeometry(t)
  61222. }),
  61223. (n.CurvePath.prototype.createGeometry = function (e) {
  61224. for (var t = new n.Geometry(), i = 0, r = e.length; i < r; i++) {
  61225. var o = e[i]
  61226. t.vertices.push(new n.Vector3(o.x, o.y, o.z || 0))
  61227. }
  61228. return t
  61229. }),
  61230. (n.Font = function (e) {
  61231. this.data = e
  61232. }),
  61233. (n.Font.prototype = {
  61234. constructor: n.Font,
  61235. generateShapes: function (e, t, i) {
  61236. function r(e) {
  61237. for (
  61238. var i = String(e).split(''), n = t / a.resolution, r = 0, s = [], l = 0;
  61239. l < i.length;
  61240. l++
  61241. ) {
  61242. var c = o(i[l], n, r)
  61243. ;(r += c.offset), s.push(c.path)
  61244. }
  61245. return s
  61246. }
  61247. function o(e, t, r) {
  61248. var o = a.glyphs[e] || a.glyphs['?']
  61249. if (o) {
  61250. var s,
  61251. l,
  61252. c,
  61253. h,
  61254. u,
  61255. d,
  61256. p,
  61257. f,
  61258. g,
  61259. m,
  61260. v,
  61261. A = new n.Path(),
  61262. y = [],
  61263. C = n.ShapeUtils.b2,
  61264. I = n.ShapeUtils.b3
  61265. if (o.o)
  61266. for (
  61267. var E = o._cachedOutline || (o._cachedOutline = o.o.split(' ')),
  61268. b = 0,
  61269. w = E.length;
  61270. b < w;
  61271. ) {
  61272. var _ = E[b++]
  61273. switch (_) {
  61274. case 'm':
  61275. ;(s = E[b++] * t + r), (l = E[b++] * t), A.moveTo(s, l)
  61276. break
  61277. case 'l':
  61278. ;(s = E[b++] * t + r), (l = E[b++] * t), A.lineTo(s, l)
  61279. break
  61280. case 'q':
  61281. if (
  61282. ((c = E[b++] * t + r),
  61283. (h = E[b++] * t),
  61284. (p = E[b++] * t + r),
  61285. (f = E[b++] * t),
  61286. A.quadraticCurveTo(p, f, c, h),
  61287. (v = y[y.length - 1]))
  61288. ) {
  61289. ;(u = v.x), (d = v.y)
  61290. for (var T = 1; T <= i; T++) {
  61291. var x = T / i
  61292. C(x, u, p, c), C(x, d, f, h)
  61293. }
  61294. }
  61295. break
  61296. case 'b':
  61297. if (
  61298. ((c = E[b++] * t + r),
  61299. (h = E[b++] * t),
  61300. (p = E[b++] * t + r),
  61301. (f = E[b++] * t),
  61302. (g = E[b++] * t + r),
  61303. (m = E[b++] * t),
  61304. A.bezierCurveTo(p, f, g, m, c, h),
  61305. (v = y[y.length - 1]))
  61306. ) {
  61307. ;(u = v.x), (d = v.y)
  61308. for (var T = 1; T <= i; T++) {
  61309. var x = T / i
  61310. I(x, u, p, g, c), I(x, d, f, m, h)
  61311. }
  61312. }
  61313. }
  61314. }
  61315. return {
  61316. offset: o.ha * t,
  61317. path: A
  61318. }
  61319. }
  61320. }
  61321. void 0 === t && (t = 100), void 0 === i && (i = 4)
  61322. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  61323. Array.prototype.push.apply(l, s[c].toShapes())
  61324. return l
  61325. }
  61326. }),
  61327. (n.Path = function (e) {
  61328. n.CurvePath.call(this), (this.actions = []), e && this.fromPoints(e)
  61329. }),
  61330. (n.Path.prototype = Object.create(n.CurvePath.prototype)),
  61331. (n.Path.prototype.constructor = n.Path),
  61332. (n.Path.prototype.fromPoints = function (e) {
  61333. this.moveTo(e[0].x, e[0].y)
  61334. for (var t = 1, i = e.length; t < i; t++) this.lineTo(e[t].x, e[t].y)
  61335. }),
  61336. (n.Path.prototype.moveTo = function (e, t) {
  61337. this.actions.push({
  61338. action: 'moveTo',
  61339. args: [e, t]
  61340. })
  61341. }),
  61342. (n.Path.prototype.lineTo = function (e, t) {
  61343. var i = this.actions[this.actions.length - 1].args,
  61344. r = i[i.length - 2],
  61345. o = i[i.length - 1],
  61346. a = new n.LineCurve(new n.Vector2(r, o), new n.Vector2(e, t))
  61347. this.curves.push(a),
  61348. this.actions.push({
  61349. action: 'lineTo',
  61350. args: [e, t]
  61351. })
  61352. }),
  61353. (n.Path.prototype.quadraticCurveTo = function (e, t, i, r) {
  61354. var o = this.actions[this.actions.length - 1].args,
  61355. a = o[o.length - 2],
  61356. s = o[o.length - 1],
  61357. l = new n.QuadraticBezierCurve(
  61358. new n.Vector2(a, s),
  61359. new n.Vector2(e, t),
  61360. new n.Vector2(i, r)
  61361. )
  61362. this.curves.push(l),
  61363. this.actions.push({
  61364. action: 'quadraticCurveTo',
  61365. args: [e, t, i, r]
  61366. })
  61367. }),
  61368. (n.Path.prototype.bezierCurveTo = function (e, t, i, r, o, a) {
  61369. var s = this.actions[this.actions.length - 1].args,
  61370. l = s[s.length - 2],
  61371. c = s[s.length - 1],
  61372. h = new n.CubicBezierCurve(
  61373. new n.Vector2(l, c),
  61374. new n.Vector2(e, t),
  61375. new n.Vector2(i, r),
  61376. new n.Vector2(o, a)
  61377. )
  61378. this.curves.push(h),
  61379. this.actions.push({
  61380. action: 'bezierCurveTo',
  61381. args: [e, t, i, r, o, a]
  61382. })
  61383. }),
  61384. (n.Path.prototype.splineThru = function (e) {
  61385. var t = Array.prototype.slice.call(arguments),
  61386. i = this.actions[this.actions.length - 1].args,
  61387. r = i[i.length - 2],
  61388. o = i[i.length - 1],
  61389. a = [new n.Vector2(r, o)]
  61390. Array.prototype.push.apply(a, e)
  61391. var s = new n.SplineCurve(a)
  61392. this.curves.push(s),
  61393. this.actions.push({
  61394. action: 'splineThru',
  61395. args: t
  61396. })
  61397. }),
  61398. (n.Path.prototype.arc = function (e, t, i, n, r, o) {
  61399. var a = this.actions[this.actions.length - 1].args,
  61400. s = a[a.length - 2],
  61401. l = a[a.length - 1]
  61402. this.absarc(e + s, t + l, i, n, r, o)
  61403. }),
  61404. (n.Path.prototype.absarc = function (e, t, i, n, r, o) {
  61405. this.absellipse(e, t, i, i, n, r, o)
  61406. }),
  61407. (n.Path.prototype.ellipse = function (e, t, i, n, r, o, a, s) {
  61408. var l = this.actions[this.actions.length - 1].args,
  61409. c = l[l.length - 2],
  61410. h = l[l.length - 1]
  61411. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  61412. }),
  61413. (n.Path.prototype.absellipse = function (e, t, i, r, o, a, s, l) {
  61414. var c = [e, t, i, r, o, a, s, l || 0],
  61415. h = new n.EllipseCurve(e, t, i, r, o, a, s, l)
  61416. this.curves.push(h)
  61417. var u = h.getPoint(1)
  61418. c.push(u.x),
  61419. c.push(u.y),
  61420. this.actions.push({
  61421. action: 'ellipse',
  61422. args: c
  61423. })
  61424. }),
  61425. (n.Path.prototype.getSpacedPoints = function (e) {
  61426. e || (e = 40)
  61427. for (var t = [], i = 0; i < e; i++) t.push(this.getPoint(i / e))
  61428. return this.autoClose && t.push(t[0]), t
  61429. }),
  61430. (n.Path.prototype.getPoints = function (e) {
  61431. e = e || 12
  61432. for (
  61433. var t,
  61434. i,
  61435. r,
  61436. o,
  61437. a,
  61438. s,
  61439. l,
  61440. c,
  61441. h,
  61442. u,
  61443. d,
  61444. p = n.ShapeUtils.b2,
  61445. f = n.ShapeUtils.b3,
  61446. g = [],
  61447. m = 0,
  61448. v = this.actions.length;
  61449. m < v;
  61450. m++
  61451. ) {
  61452. var A = this.actions[m],
  61453. y = A.action,
  61454. C = A.args
  61455. switch (y) {
  61456. case 'moveTo':
  61457. g.push(new n.Vector2(C[0], C[1]))
  61458. break
  61459. case 'lineTo':
  61460. g.push(new n.Vector2(C[0], C[1]))
  61461. break
  61462. case 'quadraticCurveTo':
  61463. ;(t = C[2]),
  61464. (i = C[3]),
  61465. (a = C[0]),
  61466. (s = C[1]),
  61467. g.length > 0
  61468. ? ((h = g[g.length - 1]), (l = h.x), (c = h.y))
  61469. : ((h = this.actions[m - 1].args),
  61470. (l = h[h.length - 2]),
  61471. (c = h[h.length - 1]))
  61472. for (var I = 1; I <= e; I++) {
  61473. var E = I / e
  61474. ;(u = p(E, l, a, t)), (d = p(E, c, s, i)), g.push(new n.Vector2(u, d))
  61475. }
  61476. break
  61477. case 'bezierCurveTo':
  61478. ;(t = C[4]),
  61479. (i = C[5]),
  61480. (a = C[0]),
  61481. (s = C[1]),
  61482. (r = C[2]),
  61483. (o = C[3]),
  61484. g.length > 0
  61485. ? ((h = g[g.length - 1]), (l = h.x), (c = h.y))
  61486. : ((h = this.actions[m - 1].args),
  61487. (l = h[h.length - 2]),
  61488. (c = h[h.length - 1]))
  61489. for (var I = 1; I <= e; I++) {
  61490. var E = I / e
  61491. ;(u = f(E, l, a, r, t)), (d = f(E, c, s, o, i)), g.push(new n.Vector2(u, d))
  61492. }
  61493. break
  61494. case 'splineThru':
  61495. h = this.actions[m - 1].args
  61496. var b = new n.Vector2(h[h.length - 2], h[h.length - 1]),
  61497. w = [b],
  61498. _ = e * C[0].length
  61499. w = w.concat(C[0])
  61500. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++) g.push(T.getPointAt(I / _))
  61501. break
  61502. case 'arc':
  61503. for (
  61504. var x,
  61505. S = C[0],
  61506. M = C[1],
  61507. R = C[2],
  61508. P = C[3],
  61509. O = C[4],
  61510. L = !!C[5],
  61511. D = O - P,
  61512. N = 2 * e,
  61513. I = 1;
  61514. I <= N;
  61515. I++
  61516. ) {
  61517. var E = I / N
  61518. L || (E = 1 - E),
  61519. (x = P + E * D),
  61520. (u = S + R * Math.cos(x)),
  61521. (d = M + R * Math.sin(x)),
  61522. g.push(new n.Vector2(u, d))
  61523. }
  61524. break
  61525. case 'ellipse':
  61526. var x,
  61527. B,
  61528. F,
  61529. S = C[0],
  61530. M = C[1],
  61531. V = C[2],
  61532. U = C[3],
  61533. P = C[4],
  61534. O = C[5],
  61535. L = !!C[6],
  61536. k = C[7],
  61537. D = O - P,
  61538. N = 2 * e
  61539. 0 !== k && ((B = Math.cos(k)), (F = Math.sin(k)))
  61540. for (var I = 1; I <= N; I++) {
  61541. var E = I / N
  61542. if (
  61543. (L || (E = 1 - E),
  61544. (x = P + E * D),
  61545. (u = S + V * Math.cos(x)),
  61546. (d = M + U * Math.sin(x)),
  61547. 0 !== k)
  61548. ) {
  61549. var H = u,
  61550. G = d
  61551. ;(u = (H - S) * B - (G - M) * F + S), (d = (H - S) * F + (G - M) * B + M)
  61552. }
  61553. g.push(new n.Vector2(u, d))
  61554. }
  61555. }
  61556. }
  61557. var z = g[g.length - 1]
  61558. return (
  61559. Math.abs(z.x - g[0].x) < Number.EPSILON &&
  61560. Math.abs(z.y - g[0].y) < Number.EPSILON &&
  61561. g.splice(g.length - 1, 1),
  61562. this.autoClose && g.push(g[0]),
  61563. g
  61564. )
  61565. }),
  61566. (n.Path.prototype.toShapes = function (e, t) {
  61567. function i(e) {
  61568. for (var t = [], i = new n.Path(), r = 0, o = e.length; r < o; r++) {
  61569. var a = e[r],
  61570. s = a.args,
  61571. l = a.action
  61572. 'moveTo' === l && 0 !== i.actions.length && (t.push(i), (i = new n.Path())),
  61573. i[l].apply(i, s)
  61574. }
  61575. return 0 !== i.actions.length && t.push(i), t
  61576. }
  61577. function r(e) {
  61578. for (var t = [], i = 0, r = e.length; i < r; i++) {
  61579. var o = e[i],
  61580. a = new n.Shape()
  61581. ;(a.actions = o.actions), (a.curves = o.curves), t.push(a)
  61582. }
  61583. return t
  61584. }
  61585. function o(e, t) {
  61586. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  61587. var a = t[r],
  61588. s = t[o],
  61589. l = s.x - a.x,
  61590. c = s.y - a.y
  61591. if (Math.abs(c) > Number.EPSILON) {
  61592. if (
  61593. (c < 0 && ((a = t[o]), (l = -l), (s = t[r]), (c = -c)), e.y < a.y || e.y > s.y)
  61594. )
  61595. continue
  61596. if (e.y === a.y) {
  61597. if (e.x === a.x) return !0
  61598. } else {
  61599. var h = c * (e.x - a.x) - l * (e.y - a.y)
  61600. if (0 === h) return !0
  61601. if (h < 0) continue
  61602. n = !n
  61603. }
  61604. } else {
  61605. if (e.y !== a.y) continue
  61606. if ((s.x <= e.x && e.x <= a.x) || (a.x <= e.x && e.x <= s.x)) return !0
  61607. }
  61608. }
  61609. return n
  61610. }
  61611. var a = n.ShapeUtils.isClockWise,
  61612. s = i(this.actions)
  61613. if (0 === s.length) return []
  61614. if (t === !0) return r(s)
  61615. var l,
  61616. c,
  61617. h,
  61618. u = []
  61619. if (1 === s.length)
  61620. return (
  61621. (c = s[0]),
  61622. (h = new n.Shape()),
  61623. (h.actions = c.actions),
  61624. (h.curves = c.curves),
  61625. u.push(h),
  61626. u
  61627. )
  61628. var d = !a(s[0].getPoints())
  61629. d = e ? !d : d
  61630. var p,
  61631. f = [],
  61632. g = [],
  61633. m = [],
  61634. v = 0
  61635. ;(g[v] = void 0), (m[v] = [])
  61636. for (var A = 0, y = s.length; A < y; A++)
  61637. (c = s[A]),
  61638. (p = c.getPoints()),
  61639. (l = a(p)),
  61640. (l = e ? !l : l),
  61641. l
  61642. ? (!d && g[v] && v++,
  61643. (g[v] = {
  61644. s: new n.Shape(),
  61645. p: p
  61646. }),
  61647. (g[v].s.actions = c.actions),
  61648. (g[v].s.curves = c.curves),
  61649. d && v++,
  61650. (m[v] = []))
  61651. : m[v].push({
  61652. h: c,
  61653. p: p[0]
  61654. })
  61655. if (!g[0]) return r(s)
  61656. if (g.length > 1) {
  61657. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++) f[E] = []
  61658. for (var E = 0, b = g.length; E < b; E++)
  61659. for (var w = m[E], _ = 0; _ < w.length; _++) {
  61660. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  61661. o(T.p, g[S].p) &&
  61662. (E !== S &&
  61663. I.push({
  61664. froms: E,
  61665. tos: S,
  61666. hole: _
  61667. }),
  61668. x ? ((x = !1), f[S].push(T)) : (C = !0))
  61669. x && f[E].push(T)
  61670. }
  61671. I.length > 0 && (C || (m = f))
  61672. }
  61673. for (var M, A = 0, R = g.length; A < R; A++) {
  61674. ;(h = g[A].s), u.push(h), (M = m[A])
  61675. for (var P = 0, O = M.length; P < O; P++) h.holes.push(M[P].h)
  61676. }
  61677. return u
  61678. }),
  61679. (n.Shape = function () {
  61680. n.Path.apply(this, arguments), (this.holes = [])
  61681. }),
  61682. (n.Shape.prototype = Object.create(n.Path.prototype)),
  61683. (n.Shape.prototype.constructor = n.Shape),
  61684. (n.Shape.prototype.extrude = function (e) {
  61685. return new n.ExtrudeGeometry(this, e)
  61686. }),
  61687. (n.Shape.prototype.makeGeometry = function (e) {
  61688. return new n.ShapeGeometry(this, e)
  61689. }),
  61690. (n.Shape.prototype.getPointsHoles = function (e) {
  61691. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  61692. t[i] = this.holes[i].getPoints(e)
  61693. return t
  61694. }),
  61695. (n.Shape.prototype.extractAllPoints = function (e) {
  61696. return {
  61697. shape: this.getPoints(e),
  61698. holes: this.getPointsHoles(e)
  61699. }
  61700. }),
  61701. (n.Shape.prototype.extractPoints = function (e) {
  61702. return this.extractAllPoints(e)
  61703. }),
  61704. (n.LineCurve = function (e, t) {
  61705. ;(this.v1 = e), (this.v2 = t)
  61706. }),
  61707. (n.LineCurve.prototype = Object.create(n.Curve.prototype)),
  61708. (n.LineCurve.prototype.constructor = n.LineCurve),
  61709. (n.LineCurve.prototype.getPoint = function (e) {
  61710. var t = this.v2.clone().sub(this.v1)
  61711. return t.multiplyScalar(e).add(this.v1), t
  61712. }),
  61713. (n.LineCurve.prototype.getPointAt = function (e) {
  61714. return this.getPoint(e)
  61715. }),
  61716. (n.LineCurve.prototype.getTangent = function (e) {
  61717. var t = this.v2.clone().sub(this.v1)
  61718. return t.normalize()
  61719. }),
  61720. (n.QuadraticBezierCurve = function (e, t, i) {
  61721. ;(this.v0 = e), (this.v1 = t), (this.v2 = i)
  61722. }),
  61723. (n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype)),
  61724. (n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve),
  61725. (n.QuadraticBezierCurve.prototype.getPoint = function (e) {
  61726. var t = n.ShapeUtils.b2
  61727. return new n.Vector2(
  61728. t(e, this.v0.x, this.v1.x, this.v2.x),
  61729. t(e, this.v0.y, this.v1.y, this.v2.y)
  61730. )
  61731. }),
  61732. (n.QuadraticBezierCurve.prototype.getTangent = function (e) {
  61733. var t = n.CurveUtils.tangentQuadraticBezier
  61734. return new n.Vector2(
  61735. t(e, this.v0.x, this.v1.x, this.v2.x),
  61736. t(e, this.v0.y, this.v1.y, this.v2.y)
  61737. ).normalize()
  61738. }),
  61739. (n.CubicBezierCurve = function (e, t, i, n) {
  61740. ;(this.v0 = e), (this.v1 = t), (this.v2 = i), (this.v3 = n)
  61741. }),
  61742. (n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype)),
  61743. (n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve),
  61744. (n.CubicBezierCurve.prototype.getPoint = function (e) {
  61745. var t = n.ShapeUtils.b3
  61746. return new n.Vector2(
  61747. t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),
  61748. t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)
  61749. )
  61750. }),
  61751. (n.CubicBezierCurve.prototype.getTangent = function (e) {
  61752. var t = n.CurveUtils.tangentCubicBezier
  61753. return new n.Vector2(
  61754. t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),
  61755. t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y)
  61756. ).normalize()
  61757. }),
  61758. (n.SplineCurve = function (e) {
  61759. this.points = void 0 == e ? [] : e
  61760. }),
  61761. (n.SplineCurve.prototype = Object.create(n.Curve.prototype)),
  61762. (n.SplineCurve.prototype.constructor = n.SplineCurve),
  61763. (n.SplineCurve.prototype.getPoint = function (e) {
  61764. var t = this.points,
  61765. i = (t.length - 1) * e,
  61766. r = Math.floor(i),
  61767. o = i - r,
  61768. a = t[0 === r ? r : r - 1],
  61769. s = t[r],
  61770. l = t[r > t.length - 2 ? t.length - 1 : r + 1],
  61771. c = t[r > t.length - 3 ? t.length - 1 : r + 2],
  61772. h = n.CurveUtils.interpolate
  61773. return new n.Vector2(h(a.x, s.x, l.x, c.x, o), h(a.y, s.y, l.y, c.y, o))
  61774. }),
  61775. (n.EllipseCurve = function (e, t, i, n, r, o, a, s) {
  61776. ;(this.aX = e),
  61777. (this.aY = t),
  61778. (this.xRadius = i),
  61779. (this.yRadius = n),
  61780. (this.aStartAngle = r),
  61781. (this.aEndAngle = o),
  61782. (this.aClockwise = a),
  61783. (this.aRotation = s || 0)
  61784. }),
  61785. (n.EllipseCurve.prototype = Object.create(n.Curve.prototype)),
  61786. (n.EllipseCurve.prototype.constructor = n.EllipseCurve),
  61787. (n.EllipseCurve.prototype.getPoint = function (e) {
  61788. var t = this.aEndAngle - this.aStartAngle
  61789. t < 0 && (t += 2 * Math.PI), t > 2 * Math.PI && (t -= 2 * Math.PI)
  61790. var i
  61791. i =
  61792. this.aClockwise === !0
  61793. ? this.aEndAngle + (1 - e) * (2 * Math.PI - t)
  61794. : this.aStartAngle + e * t
  61795. var r = this.aX + this.xRadius * Math.cos(i),
  61796. o = this.aY + this.yRadius * Math.sin(i)
  61797. if (0 !== this.aRotation) {
  61798. var a = Math.cos(this.aRotation),
  61799. s = Math.sin(this.aRotation),
  61800. l = r,
  61801. c = o
  61802. ;(r = (l - this.aX) * a - (c - this.aY) * s + this.aX),
  61803. (o = (l - this.aX) * s + (c - this.aY) * a + this.aY)
  61804. }
  61805. return new n.Vector2(r, o)
  61806. }),
  61807. (n.ArcCurve = function (e, t, i, r, o, a) {
  61808. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  61809. }),
  61810. (n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype)),
  61811. (n.ArcCurve.prototype.constructor = n.ArcCurve),
  61812. (n.LineCurve3 = n.Curve.create(
  61813. function (e, t) {
  61814. ;(this.v1 = e), (this.v2 = t)
  61815. },
  61816. function (e) {
  61817. var t = new n.Vector3()
  61818. return t.subVectors(this.v2, this.v1), t.multiplyScalar(e), t.add(this.v1), t
  61819. }
  61820. )),
  61821. (n.QuadraticBezierCurve3 = n.Curve.create(
  61822. function (e, t, i) {
  61823. ;(this.v0 = e), (this.v1 = t), (this.v2 = i)
  61824. },
  61825. function (e) {
  61826. var t = n.ShapeUtils.b2
  61827. return new n.Vector3(
  61828. t(e, this.v0.x, this.v1.x, this.v2.x),
  61829. t(e, this.v0.y, this.v1.y, this.v2.y),
  61830. t(e, this.v0.z, this.v1.z, this.v2.z)
  61831. )
  61832. }
  61833. )),
  61834. (n.CubicBezierCurve3 = n.Curve.create(
  61835. function (e, t, i, n) {
  61836. ;(this.v0 = e), (this.v1 = t), (this.v2 = i), (this.v3 = n)
  61837. },
  61838. function (e) {
  61839. var t = n.ShapeUtils.b3
  61840. return new n.Vector3(
  61841. t(e, this.v0.x, this.v1.x, this.v2.x, this.v3.x),
  61842. t(e, this.v0.y, this.v1.y, this.v2.y, this.v3.y),
  61843. t(e, this.v0.z, this.v1.z, this.v2.z, this.v3.z)
  61844. )
  61845. }
  61846. )),
  61847. (n.SplineCurve3 = n.Curve.create(
  61848. function (e) {
  61849. console.warn(
  61850. 'THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3'
  61851. ),
  61852. (this.points = void 0 == e ? [] : e)
  61853. },
  61854. function (e) {
  61855. var t = this.points,
  61856. i = (t.length - 1) * e,
  61857. r = Math.floor(i),
  61858. o = i - r,
  61859. a = t[0 == r ? r : r - 1],
  61860. s = t[r],
  61861. l = t[r > t.length - 2 ? t.length - 1 : r + 1],
  61862. c = t[r > t.length - 3 ? t.length - 1 : r + 2],
  61863. h = n.CurveUtils.interpolate
  61864. return new n.Vector3(
  61865. h(a.x, s.x, l.x, c.x, o),
  61866. h(a.y, s.y, l.y, c.y, o),
  61867. h(a.z, s.z, l.z, c.z, o)
  61868. )
  61869. }
  61870. )),
  61871. (n.CatmullRomCurve3 = (function () {
  61872. function e() {}
  61873. var t = new n.Vector3(),
  61874. i = new e(),
  61875. r = new e(),
  61876. o = new e()
  61877. return (
  61878. (e.prototype.init = function (e, t, i, n) {
  61879. ;(this.c0 = e),
  61880. (this.c1 = i),
  61881. (this.c2 = -3 * e + 3 * t - 2 * i - n),
  61882. (this.c3 = 2 * e - 2 * t + i + n)
  61883. }),
  61884. (e.prototype.initNonuniformCatmullRom = function (e, t, i, n, r, o, a) {
  61885. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o,
  61886. l = (i - t) / o - (n - t) / (o + a) + (n - i) / a
  61887. ;(s *= o), (l *= o), this.init(t, i, s, l)
  61888. }),
  61889. (e.prototype.initCatmullRom = function (e, t, i, n, r) {
  61890. this.init(t, i, r * (i - e), r * (n - t))
  61891. }),
  61892. (e.prototype.calc = function (e) {
  61893. var t = e * e,
  61894. i = t * e
  61895. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  61896. }),
  61897. n.Curve.create(
  61898. function (e) {
  61899. ;(this.points = e || []), (this.closed = !1)
  61900. },
  61901. function (e) {
  61902. var a,
  61903. s,
  61904. l,
  61905. c,
  61906. h = this.points
  61907. ;(c = h.length),
  61908. c < 2 && console.log('duh, you need at least 2 points'),
  61909. (a = (c - (this.closed ? 0 : 1)) * e),
  61910. (s = Math.floor(a)),
  61911. (l = a - s),
  61912. this.closed
  61913. ? (s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length)
  61914. : 0 === l && s === c - 1 && ((s = c - 2), (l = 1))
  61915. var u, d, p, f
  61916. if (
  61917. (this.closed || s > 0
  61918. ? (u = h[(s - 1) % c])
  61919. : (t.subVectors(h[0], h[1]).add(h[0]), (u = t)),
  61920. (d = h[s % c]),
  61921. (p = h[(s + 1) % c]),
  61922. this.closed || s + 2 < c
  61923. ? (f = h[(s + 2) % c])
  61924. : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]), (f = t)),
  61925. void 0 === this.type || 'centripetal' === this.type || 'chordal' === this.type)
  61926. ) {
  61927. var g = 'chordal' === this.type ? 0.5 : 0.25,
  61928. m = Math.pow(u.distanceToSquared(d), g),
  61929. v = Math.pow(d.distanceToSquared(p), g),
  61930. A = Math.pow(p.distanceToSquared(f), g)
  61931. v < 1e-4 && (v = 1),
  61932. m < 1e-4 && (m = v),
  61933. A < 1e-4 && (A = v),
  61934. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  61935. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  61936. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  61937. } else if ('catmullrom' === this.type) {
  61938. var y = void 0 !== this.tension ? this.tension : 0.5
  61939. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  61940. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  61941. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  61942. }
  61943. var C = new n.Vector3(i.calc(l), r.calc(l), o.calc(l))
  61944. return C
  61945. }
  61946. )
  61947. )
  61948. })()),
  61949. (n.ClosedSplineCurve3 = function (e) {
  61950. console.warn(
  61951. 'THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3.'
  61952. ),
  61953. n.CatmullRomCurve3.call(this, e),
  61954. (this.type = 'catmullrom'),
  61955. (this.closed = !0)
  61956. }),
  61957. (n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype)),
  61958. (n.BoxGeometry = function (e, t, i, r, o, a) {
  61959. n.Geometry.call(this),
  61960. (this.type = 'BoxGeometry'),
  61961. (this.parameters = {
  61962. width: e,
  61963. height: t,
  61964. depth: i,
  61965. widthSegments: r,
  61966. heightSegments: o,
  61967. depthSegments: a
  61968. }),
  61969. this.fromBufferGeometry(new n.BoxBufferGeometry(e, t, i, r, o, a)),
  61970. this.mergeVertices()
  61971. }),
  61972. (n.BoxGeometry.prototype = Object.create(n.Geometry.prototype)),
  61973. (n.BoxGeometry.prototype.constructor = n.BoxGeometry),
  61974. (n.CubeGeometry = n.BoxGeometry),
  61975. (n.BoxBufferGeometry = function (e, t, i, r, o, a) {
  61976. function s(e, t, i) {
  61977. var n = 0
  61978. return (n += e * t * 2), (n += e * i * 2), (n += i * t * 2), 4 * n
  61979. }
  61980. function l(e, t, i, r, o, a, s, l, h, u, I) {
  61981. for (
  61982. var E = a / h,
  61983. b = s / u,
  61984. w = a / 2,
  61985. _ = s / 2,
  61986. T = l / 2,
  61987. x = h + 1,
  61988. S = u + 1,
  61989. M = 0,
  61990. R = 0,
  61991. P = new n.Vector3(),
  61992. O = 0;
  61993. O < S;
  61994. O++
  61995. )
  61996. for (var L = O * b - _, D = 0; D < x; D++) {
  61997. var N = D * E - w
  61998. ;(P[e] = N * r),
  61999. (P[t] = L * o),
  62000. (P[i] = T),
  62001. (p[m] = P.x),
  62002. (p[m + 1] = P.y),
  62003. (p[m + 2] = P.z),
  62004. (P[e] = 0),
  62005. (P[t] = 0),
  62006. (P[i] = l > 0 ? 1 : -1),
  62007. (f[m] = P.x),
  62008. (f[m + 1] = P.y),
  62009. (f[m + 2] = P.z),
  62010. (g[v] = D / h),
  62011. (g[v + 1] = 1 - O / u),
  62012. (m += 3),
  62013. (v += 2),
  62014. (M += 1)
  62015. }
  62016. for (O = 0; O < u; O++)
  62017. for (D = 0; D < h; D++) {
  62018. var B = y + D + x * O,
  62019. F = y + D + x * (O + 1),
  62020. V = y + (D + 1) + x * (O + 1),
  62021. U = y + (D + 1) + x * O
  62022. ;(d[A] = B),
  62023. (d[A + 1] = F),
  62024. (d[A + 2] = U),
  62025. (d[A + 3] = F),
  62026. (d[A + 4] = V),
  62027. (d[A + 5] = U),
  62028. (A += 6),
  62029. (R += 6)
  62030. }
  62031. c.addGroup(C, R, I), (C += R), (y += M)
  62032. }
  62033. n.BufferGeometry.call(this),
  62034. (this.type = 'BoxBufferGeometry'),
  62035. (this.parameters = {
  62036. width: e,
  62037. height: t,
  62038. depth: i,
  62039. widthSegments: r,
  62040. heightSegments: o,
  62041. depthSegments: a
  62042. })
  62043. var c = this
  62044. ;(r = Math.floor(r) || 1), (o = Math.floor(o) || 1), (a = Math.floor(a) || 1)
  62045. var h = s(r, o, a),
  62046. u = (h / 4) * 6,
  62047. d = new (u > 65535 ? Uint32Array : Uint16Array)(u),
  62048. p = new Float32Array(3 * h),
  62049. f = new Float32Array(3 * h),
  62050. g = new Float32Array(2 * h),
  62051. m = 0,
  62052. v = 0,
  62053. A = 0,
  62054. y = 0,
  62055. C = 0
  62056. l('z', 'y', 'x', -1, -1, i, t, e, a, o, 0),
  62057. l('z', 'y', 'x', 1, -1, i, t, -e, a, o, 1),
  62058. l('x', 'z', 'y', 1, 1, e, i, t, r, a, 2),
  62059. l('x', 'z', 'y', 1, -1, e, i, -t, r, a, 3),
  62060. l('x', 'y', 'z', 1, -1, e, t, i, r, o, 4),
  62061. l('x', 'y', 'z', -1, -1, e, t, -i, r, o, 5),
  62062. this.setIndex(new n.BufferAttribute(d, 1)),
  62063. this.addAttribute('position', new n.BufferAttribute(p, 3)),
  62064. this.addAttribute('normal', new n.BufferAttribute(f, 3)),
  62065. this.addAttribute('uv', new n.BufferAttribute(g, 2))
  62066. }),
  62067. (n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62068. (n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry),
  62069. (n.CircleGeometry = function (e, t, i, r) {
  62070. n.Geometry.call(this),
  62071. (this.type = 'CircleGeometry'),
  62072. (this.parameters = {
  62073. radius: e,
  62074. segments: t,
  62075. thetaStart: i,
  62076. thetaLength: r
  62077. }),
  62078. this.fromBufferGeometry(new n.CircleBufferGeometry(e, t, i, r))
  62079. }),
  62080. (n.CircleGeometry.prototype = Object.create(n.Geometry.prototype)),
  62081. (n.CircleGeometry.prototype.constructor = n.CircleGeometry),
  62082. (n.CircleBufferGeometry = function (e, t, i, r) {
  62083. n.BufferGeometry.call(this),
  62084. (this.type = 'CircleBufferGeometry'),
  62085. (this.parameters = {
  62086. radius: e,
  62087. segments: t,
  62088. thetaStart: i,
  62089. thetaLength: r
  62090. }),
  62091. (e = e || 50),
  62092. (t = void 0 !== t ? Math.max(3, t) : 8),
  62093. (i = void 0 !== i ? i : 0),
  62094. (r = void 0 !== r ? r : 2 * Math.PI)
  62095. var o = t + 2,
  62096. a = new Float32Array(3 * o),
  62097. s = new Float32Array(3 * o),
  62098. l = new Float32Array(2 * o)
  62099. ;(s[2] = 1), (l[0] = 0.5), (l[1] = 0.5)
  62100. for (var c = 0, h = 3, u = 2; c <= t; c++, h += 3, u += 2) {
  62101. var d = i + (c / t) * r
  62102. ;(a[h] = e * Math.cos(d)),
  62103. (a[h + 1] = e * Math.sin(d)),
  62104. (s[h + 2] = 1),
  62105. (l[u] = (a[h] / e + 1) / 2),
  62106. (l[u + 1] = (a[h + 1] / e + 1) / 2)
  62107. }
  62108. for (var p = [], h = 1; h <= t; h++) p.push(h, h + 1, 0)
  62109. this.setIndex(new n.BufferAttribute(new Uint16Array(p), 1)),
  62110. this.addAttribute('position', new n.BufferAttribute(a, 3)),
  62111. this.addAttribute('normal', new n.BufferAttribute(s, 3)),
  62112. this.addAttribute('uv', new n.BufferAttribute(l, 2)),
  62113. (this.boundingSphere = new n.Sphere(new n.Vector3(), e))
  62114. }),
  62115. (n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62116. (n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry),
  62117. (n.CylinderBufferGeometry = function (e, t, i, r, o, a, s, l) {
  62118. function c() {
  62119. var e = (r + 1) * (o + 1)
  62120. return a === !1 && (e += 2 * (r + 1) + 2 * r), e
  62121. }
  62122. function h() {
  62123. var e = r * o * 2 * 3
  62124. return a === !1 && (e += 2 * r * 3), e
  62125. }
  62126. function u() {
  62127. var a,
  62128. c,
  62129. h = new n.Vector3(),
  62130. u = new n.Vector3(),
  62131. d = (t - e) / i
  62132. for (c = 0; c <= o; c++) {
  62133. var p = [],
  62134. f = c / o,
  62135. b = f * (t - e) + e
  62136. for (a = 0; a <= r; a++) {
  62137. var w = a / r
  62138. ;(u.x = b * Math.sin(w * l + s)),
  62139. (u.y = -f * i + E),
  62140. (u.z = b * Math.cos(w * l + s)),
  62141. m.setXYZ(y, u.x, u.y, u.z),
  62142. h.copy(u),
  62143. ((0 === e && 0 === c) || (0 === t && c === o)) &&
  62144. ((h.x = Math.sin(w * l + s)), (h.z = Math.cos(w * l + s))),
  62145. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  62146. v.setXYZ(y, h.x, h.y, h.z),
  62147. A.setXY(y, w, 1 - f),
  62148. p.push(y),
  62149. y++
  62150. }
  62151. I.push(p)
  62152. }
  62153. for (a = 0; a < r; a++)
  62154. for (c = 0; c < o; c++) {
  62155. var _ = I[c][a],
  62156. T = I[c + 1][a],
  62157. x = I[c + 1][a + 1],
  62158. S = I[c][a + 1]
  62159. g.setX(C, _),
  62160. C++,
  62161. g.setX(C, T),
  62162. C++,
  62163. g.setX(C, S),
  62164. C++,
  62165. g.setX(C, T),
  62166. C++,
  62167. g.setX(C, x),
  62168. C++,
  62169. g.setX(C, S),
  62170. C++
  62171. }
  62172. }
  62173. function d(i) {
  62174. var o,
  62175. a,
  62176. c,
  62177. h = new n.Vector2(),
  62178. u = new n.Vector3(),
  62179. d = i === !0 ? e : t,
  62180. p = i === !0 ? 1 : -1
  62181. for (a = y, o = 1; o <= r; o++)
  62182. m.setXYZ(y, 0, E * p, 0),
  62183. v.setXYZ(y, 0, p, 0),
  62184. i === !0 ? ((h.x = o / r), (h.y = 0)) : ((h.x = (o - 1) / r), (h.y = 1)),
  62185. A.setXY(y, h.x, h.y),
  62186. y++
  62187. for (c = y, o = 0; o <= r; o++) {
  62188. var f = o / r
  62189. ;(u.x = d * Math.sin(f * l + s)),
  62190. (u.y = E * p),
  62191. (u.z = d * Math.cos(f * l + s)),
  62192. m.setXYZ(y, u.x, u.y, u.z),
  62193. v.setXYZ(y, 0, p, 0),
  62194. A.setXY(y, f, i === !0 ? 1 : 0),
  62195. y++
  62196. }
  62197. for (o = 0; o < r; o++) {
  62198. var I = a + o,
  62199. b = c + o
  62200. i === !0
  62201. ? (g.setX(C, b), C++, g.setX(C, b + 1), C++, g.setX(C, I), C++)
  62202. : (g.setX(C, b + 1), C++, g.setX(C, b), C++, g.setX(C, I), C++)
  62203. }
  62204. }
  62205. n.BufferGeometry.call(this),
  62206. (this.type = 'CylinderBufferGeometry'),
  62207. (this.parameters = {
  62208. radiusTop: e,
  62209. radiusBottom: t,
  62210. height: i,
  62211. radialSegments: r,
  62212. heightSegments: o,
  62213. openEnded: a,
  62214. thetaStart: s,
  62215. thetaLength: l
  62216. }),
  62217. (e = void 0 !== e ? e : 20),
  62218. (t = void 0 !== t ? t : 20),
  62219. (i = void 0 !== i ? i : 100),
  62220. (r = Math.floor(r) || 8),
  62221. (o = Math.floor(o) || 1),
  62222. (a = void 0 !== a && a),
  62223. (s = void 0 !== s ? s : 0),
  62224. (l = void 0 !== l ? l : 2 * Math.PI)
  62225. var p = c(),
  62226. f = h(),
  62227. g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f), 1),
  62228. m = new n.BufferAttribute(new Float32Array(3 * p), 3),
  62229. v = new n.BufferAttribute(new Float32Array(3 * p), 3),
  62230. A = new n.BufferAttribute(new Float32Array(2 * p), 2),
  62231. y = 0,
  62232. C = 0,
  62233. I = [],
  62234. E = i / 2
  62235. u(),
  62236. a === !1 && (e > 0 && d(!0), t > 0 && d(!1)),
  62237. this.setIndex(g),
  62238. this.addAttribute('position', m),
  62239. this.addAttribute('normal', v),
  62240. this.addAttribute('uv', A)
  62241. }),
  62242. (n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62243. (n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry),
  62244. (n.CylinderGeometry = function (e, t, i, r, o, a, s, l) {
  62245. n.Geometry.call(this),
  62246. (this.type = 'CylinderGeometry'),
  62247. (this.parameters = {
  62248. radiusTop: e,
  62249. radiusBottom: t,
  62250. height: i,
  62251. radialSegments: r,
  62252. heightSegments: o,
  62253. openEnded: a,
  62254. thetaStart: s,
  62255. thetaLength: l
  62256. }),
  62257. this.fromBufferGeometry(new n.CylinderBufferGeometry(e, t, i, r, o, a, s, l)),
  62258. this.mergeVertices()
  62259. }),
  62260. (n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype)),
  62261. (n.CylinderGeometry.prototype.constructor = n.CylinderGeometry),
  62262. (n.EdgesGeometry = function (e, t) {
  62263. function i(e, t) {
  62264. return e - t
  62265. }
  62266. n.BufferGeometry.call(this), (t = void 0 !== t ? t : 1)
  62267. var r,
  62268. o = Math.cos(n.Math.degToRad(t)),
  62269. a = [0, 0],
  62270. s = {},
  62271. l = ['a', 'b', 'c']
  62272. e instanceof n.BufferGeometry
  62273. ? ((r = new n.Geometry()), r.fromBufferGeometry(e))
  62274. : (r = e.clone()),
  62275. r.mergeVertices(),
  62276. r.computeFaceNormals()
  62277. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  62278. for (var p = h[u], f = 0; f < 3; f++) {
  62279. ;(a[0] = p[l[f]]), (a[1] = p[l[(f + 1) % 3]]), a.sort(i)
  62280. var g = a.toString()
  62281. void 0 === s[g]
  62282. ? (s[g] = {
  62283. vert1: a[0],
  62284. vert2: a[1],
  62285. face1: u,
  62286. face2: void 0
  62287. })
  62288. : (s[g].face2 = u)
  62289. }
  62290. var m = []
  62291. for (var g in s) {
  62292. var v = s[g]
  62293. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  62294. var A = c[v.vert1]
  62295. m.push(A.x),
  62296. m.push(A.y),
  62297. m.push(A.z),
  62298. (A = c[v.vert2]),
  62299. m.push(A.x),
  62300. m.push(A.y),
  62301. m.push(A.z)
  62302. }
  62303. }
  62304. this.addAttribute('position', new n.BufferAttribute(new Float32Array(m), 3))
  62305. }),
  62306. (n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62307. (n.EdgesGeometry.prototype.constructor = n.EdgesGeometry),
  62308. (n.ExtrudeGeometry = function (e, t) {
  62309. return 'undefined' == typeof e
  62310. ? void (e = [])
  62311. : (n.Geometry.call(this),
  62312. (this.type = 'ExtrudeGeometry'),
  62313. (e = Array.isArray(e) ? e : [e]),
  62314. this.addShapeList(e, t),
  62315. void this.computeFaceNormals())
  62316. })
  62317. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype)
  62318. ;(n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry),
  62319. (n.ExtrudeGeometry.prototype.addShapeList = function (e, t) {
  62320. for (var i = e.length, n = 0; n < i; n++) {
  62321. var r = e[n]
  62322. this.addShape(r, t)
  62323. }
  62324. }),
  62325. (n.ExtrudeGeometry.prototype.addShape = function (e, t) {
  62326. function i(e, t, i) {
  62327. return (
  62328. t || console.error('THREE.ExtrudeGeometry: vec does not exist'),
  62329. t.clone().multiplyScalar(i).add(e)
  62330. )
  62331. }
  62332. function r(e, t, i) {
  62333. var r,
  62334. o,
  62335. a = 1,
  62336. s = e.x - t.x,
  62337. l = e.y - t.y,
  62338. c = i.x - e.x,
  62339. h = i.y - e.y,
  62340. u = s * s + l * l,
  62341. d = s * h - l * c
  62342. if (Math.abs(d) > Number.EPSILON) {
  62343. var p = Math.sqrt(u),
  62344. f = Math.sqrt(c * c + h * h),
  62345. g = t.x - l / p,
  62346. m = t.y + s / p,
  62347. v = i.x - h / f,
  62348. A = i.y + c / f,
  62349. y = ((v - g) * h - (A - m) * c) / (s * h - l * c)
  62350. ;(r = g + s * y - e.x), (o = m + l * y - e.y)
  62351. var C = r * r + o * o
  62352. if (C <= 2) return new n.Vector2(r, o)
  62353. a = Math.sqrt(C / 2)
  62354. } else {
  62355. var I = !1
  62356. s > Number.EPSILON
  62357. ? c > Number.EPSILON && (I = !0)
  62358. : s < -Number.EPSILON
  62359. ? c < -Number.EPSILON && (I = !0)
  62360. : Math.sign(l) === Math.sign(h) && (I = !0),
  62361. I
  62362. ? ((r = -l), (o = s), (a = Math.sqrt(u)))
  62363. : ((r = s), (o = l), (a = Math.sqrt(u / 2)))
  62364. }
  62365. return new n.Vector2(r / a, o / a)
  62366. }
  62367. function o() {
  62368. if (C) {
  62369. var e = 0,
  62370. t = z * e
  62371. for (Y = 0; Y < W; Y++) (G = N[Y]), c(G[2] + t, G[1] + t, G[0] + t)
  62372. for (e = E + 2 * y, t = z * e, Y = 0; Y < W; Y++)
  62373. (G = N[Y]), c(G[0] + t, G[1] + t, G[2] + t)
  62374. } else {
  62375. for (Y = 0; Y < W; Y++) (G = N[Y]), c(G[2], G[1], G[0])
  62376. for (Y = 0; Y < W; Y++) (G = N[Y]), c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  62377. }
  62378. }
  62379. function a() {
  62380. var e = 0
  62381. for (s(B, e), e += B.length, x = 0, S = L.length; x < S; x++)
  62382. (T = L[x]), s(T, e), (e += T.length)
  62383. }
  62384. function s(e, t) {
  62385. var i, n
  62386. for (Y = e.length; --Y >= 0; ) {
  62387. ;(i = Y), (n = Y - 1), n < 0 && (n = e.length - 1)
  62388. var r = 0,
  62389. o = E + 2 * y
  62390. for (r = 0; r < o; r++) {
  62391. var a = z * r,
  62392. s = z * (r + 1),
  62393. l = t + i + a,
  62394. c = t + n + a,
  62395. u = t + n + s,
  62396. d = t + i + s
  62397. h(l, c, u, d, e, r, o, i, n)
  62398. }
  62399. }
  62400. }
  62401. function l(e, t, i) {
  62402. M.vertices.push(new n.Vector3(e, t, i))
  62403. }
  62404. function c(e, t, i) {
  62405. ;(e += R), (t += R), (i += R), M.faces.push(new n.Face3(e, t, i, null, null, 0))
  62406. var r = _.generateTopUV(M, e, t, i)
  62407. M.faceVertexUvs[0].push(r)
  62408. }
  62409. function h(e, t, i, r, o, a, s, l, c) {
  62410. ;(e += R),
  62411. (t += R),
  62412. (i += R),
  62413. (r += R),
  62414. M.faces.push(new n.Face3(e, t, r, null, null, 1)),
  62415. M.faces.push(new n.Face3(t, i, r, null, null, 1))
  62416. var h = _.generateSideWallUV(M, e, t, i, r)
  62417. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  62418. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  62419. }
  62420. var u,
  62421. d,
  62422. p,
  62423. f,
  62424. g,
  62425. m = void 0 !== t.amount ? t.amount : 100,
  62426. v = void 0 !== t.bevelThickness ? t.bevelThickness : 6,
  62427. A = void 0 !== t.bevelSize ? t.bevelSize : v - 2,
  62428. y = void 0 !== t.bevelSegments ? t.bevelSegments : 3,
  62429. C = void 0 === t.bevelEnabled || t.bevelEnabled,
  62430. I = void 0 !== t.curveSegments ? t.curveSegments : 12,
  62431. E = void 0 !== t.steps ? t.steps : 1,
  62432. b = t.extrudePath,
  62433. w = !1,
  62434. _ = void 0 !== t.UVGenerator ? t.UVGenerator : n.ExtrudeGeometry.WorldUVGenerator
  62435. b &&
  62436. ((u = b.getSpacedPoints(E)),
  62437. (w = !0),
  62438. (C = !1),
  62439. (d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b, E, !1)),
  62440. (p = new n.Vector3()),
  62441. (f = new n.Vector3()),
  62442. (g = new n.Vector3())),
  62443. C || ((y = 0), (v = 0), (A = 0))
  62444. var T,
  62445. x,
  62446. S,
  62447. M = this,
  62448. R = this.vertices.length,
  62449. P = e.extractPoints(I),
  62450. O = P.shape,
  62451. L = P.holes,
  62452. D = !n.ShapeUtils.isClockWise(O)
  62453. if (D) {
  62454. for (O = O.reverse(), x = 0, S = L.length; x < S; x++)
  62455. (T = L[x]), n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse())
  62456. D = !1
  62457. }
  62458. var N = n.ShapeUtils.triangulateShape(O, L),
  62459. B = O
  62460. for (x = 0, S = L.length; x < S; x++) (T = L[x]), (O = O.concat(T))
  62461. for (
  62462. var F,
  62463. V,
  62464. U,
  62465. k,
  62466. H,
  62467. G,
  62468. z = O.length,
  62469. W = N.length,
  62470. j = [],
  62471. Y = 0,
  62472. X = B.length,
  62473. Z = X - 1,
  62474. q = Y + 1;
  62475. Y < X;
  62476. Y++, Z++, q++
  62477. )
  62478. Z === X && (Z = 0), q === X && (q = 0), (j[Y] = r(B[Y], B[Z], B[q]))
  62479. var K,
  62480. Q = [],
  62481. J = j.concat()
  62482. for (x = 0, S = L.length; x < S; x++) {
  62483. for (
  62484. T = L[x], K = [], Y = 0, X = T.length, Z = X - 1, q = Y + 1;
  62485. Y < X;
  62486. Y++, Z++, q++
  62487. )
  62488. Z === X && (Z = 0), q === X && (q = 0), (K[Y] = r(T[Y], T[Z], T[q]))
  62489. Q.push(K), (J = J.concat(K))
  62490. }
  62491. for (F = 0; F < y; F++) {
  62492. for (
  62493. U = F / y,
  62494. k = v * (1 - U),
  62495. V = A * Math.sin((U * Math.PI) / 2),
  62496. Y = 0,
  62497. X = B.length;
  62498. Y < X;
  62499. Y++
  62500. )
  62501. (H = i(B[Y], j[Y], V)), l(H.x, H.y, -k)
  62502. for (x = 0, S = L.length; x < S; x++)
  62503. for (T = L[x], K = Q[x], Y = 0, X = T.length; Y < X; Y++)
  62504. (H = i(T[Y], K[Y], V)), l(H.x, H.y, -k)
  62505. }
  62506. for (V = A, Y = 0; Y < z; Y++)
  62507. (H = C ? i(O[Y], J[Y], V) : O[Y]),
  62508. w
  62509. ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  62510. p.copy(d.binormals[0]).multiplyScalar(H.y),
  62511. g.copy(u[0]).add(f).add(p),
  62512. l(g.x, g.y, g.z))
  62513. : l(H.x, H.y, 0)
  62514. var $
  62515. for ($ = 1; $ <= E; $++)
  62516. for (Y = 0; Y < z; Y++)
  62517. (H = C ? i(O[Y], J[Y], V) : O[Y]),
  62518. w
  62519. ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  62520. p.copy(d.binormals[$]).multiplyScalar(H.y),
  62521. g.copy(u[$]).add(f).add(p),
  62522. l(g.x, g.y, g.z))
  62523. : l(H.x, H.y, (m / E) * $)
  62524. for (F = y - 1; F >= 0; F--) {
  62525. for (
  62526. U = F / y,
  62527. k = v * (1 - U),
  62528. V = A * Math.sin((U * Math.PI) / 2),
  62529. Y = 0,
  62530. X = B.length;
  62531. Y < X;
  62532. Y++
  62533. )
  62534. (H = i(B[Y], j[Y], V)), l(H.x, H.y, m + k)
  62535. for (x = 0, S = L.length; x < S; x++)
  62536. for (T = L[x], K = Q[x], Y = 0, X = T.length; Y < X; Y++)
  62537. (H = i(T[Y], K[Y], V)),
  62538. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  62539. }
  62540. o(), a()
  62541. }),
  62542. (n.ExtrudeGeometry.WorldUVGenerator = {
  62543. generateTopUV: function (e, t, i, r) {
  62544. var o = e.vertices,
  62545. a = o[t],
  62546. s = o[i],
  62547. l = o[r]
  62548. return [new n.Vector2(a.x, a.y), new n.Vector2(s.x, s.y), new n.Vector2(l.x, l.y)]
  62549. },
  62550. generateSideWallUV: function (e, t, i, r, o) {
  62551. var a = e.vertices,
  62552. s = a[t],
  62553. l = a[i],
  62554. c = a[r],
  62555. h = a[o]
  62556. return Math.abs(s.y - l.y) < 0.01
  62557. ? [
  62558. new n.Vector2(s.x, 1 - s.z),
  62559. new n.Vector2(l.x, 1 - l.z),
  62560. new n.Vector2(c.x, 1 - c.z),
  62561. new n.Vector2(h.x, 1 - h.z)
  62562. ]
  62563. : [
  62564. new n.Vector2(s.y, 1 - s.z),
  62565. new n.Vector2(l.y, 1 - l.z),
  62566. new n.Vector2(c.y, 1 - c.z),
  62567. new n.Vector2(h.y, 1 - h.z)
  62568. ]
  62569. }
  62570. }),
  62571. (n.ShapeGeometry = function (e, t) {
  62572. n.Geometry.call(this),
  62573. (this.type = 'ShapeGeometry'),
  62574. Array.isArray(e) === !1 && (e = [e]),
  62575. this.addShapeList(e, t),
  62576. this.computeFaceNormals()
  62577. }),
  62578. (n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype)),
  62579. (n.ShapeGeometry.prototype.constructor = n.ShapeGeometry),
  62580. (n.ShapeGeometry.prototype.addShapeList = function (e, t) {
  62581. for (var i = 0, n = e.length; i < n; i++) this.addShape(e[i], t)
  62582. return this
  62583. }),
  62584. (n.ShapeGeometry.prototype.addShape = function (e, t) {
  62585. void 0 === t && (t = {})
  62586. var i,
  62587. r,
  62588. o,
  62589. a = void 0 !== t.curveSegments ? t.curveSegments : 12,
  62590. s = t.material,
  62591. l = void 0 === t.UVGenerator ? n.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator,
  62592. c = this.vertices.length,
  62593. h = e.extractPoints(a),
  62594. u = h.shape,
  62595. d = h.holes,
  62596. p = !n.ShapeUtils.isClockWise(u)
  62597. if (p) {
  62598. for (u = u.reverse(), i = 0, r = d.length; i < r; i++)
  62599. (o = d[i]), n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse())
  62600. p = !1
  62601. }
  62602. var f = n.ShapeUtils.triangulateShape(u, d)
  62603. for (i = 0, r = d.length; i < r; i++) (o = d[i]), (u = u.concat(o))
  62604. var g,
  62605. m,
  62606. v = u.length,
  62607. A = f.length
  62608. for (i = 0; i < v; i++) (g = u[i]), this.vertices.push(new n.Vector3(g.x, g.y, 0))
  62609. for (i = 0; i < A; i++) {
  62610. m = f[i]
  62611. var y = m[0] + c,
  62612. C = m[1] + c,
  62613. I = m[2] + c
  62614. this.faces.push(new n.Face3(y, C, I, null, null, s)),
  62615. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  62616. }
  62617. }),
  62618. (n.LatheBufferGeometry = function (e, t, i, r) {
  62619. n.BufferGeometry.call(this),
  62620. (this.type = 'LatheBufferGeometry'),
  62621. (this.parameters = {
  62622. points: e,
  62623. segments: t,
  62624. phiStart: i,
  62625. phiLength: r
  62626. }),
  62627. (t = Math.floor(t) || 12),
  62628. (i = i || 0),
  62629. (r = r || 2 * Math.PI),
  62630. (r = n.Math.clamp(r, 0, 2 * Math.PI))
  62631. var o,
  62632. a,
  62633. s,
  62634. l = (t + 1) * e.length,
  62635. c = t * e.length * 2 * 3,
  62636. h = new n.BufferAttribute(new (c > 65535 ? Uint32Array : Uint16Array)(c), 1),
  62637. u = new n.BufferAttribute(new Float32Array(3 * l), 3),
  62638. d = new n.BufferAttribute(new Float32Array(2 * l), 2),
  62639. p = 0,
  62640. f = 0,
  62641. g = (1 / (e.length - 1), 1 / t),
  62642. m = new n.Vector3(),
  62643. v = new n.Vector2()
  62644. for (a = 0; a <= t; a++) {
  62645. var A = i + a * g * r,
  62646. y = Math.sin(A),
  62647. C = Math.cos(A)
  62648. for (s = 0; s <= e.length - 1; s++)
  62649. (m.x = e[s].x * y),
  62650. (m.y = e[s].y),
  62651. (m.z = e[s].x * C),
  62652. u.setXYZ(p, m.x, m.y, m.z),
  62653. (v.x = a / t),
  62654. (v.y = s / (e.length - 1)),
  62655. d.setXY(p, v.x, v.y),
  62656. p++
  62657. }
  62658. for (a = 0; a < t; a++)
  62659. for (s = 0; s < e.length - 1; s++) {
  62660. o = s + a * e.length
  62661. var I = o,
  62662. E = o + e.length,
  62663. b = o + e.length + 1,
  62664. w = o + 1
  62665. h.setX(f, I),
  62666. f++,
  62667. h.setX(f, E),
  62668. f++,
  62669. h.setX(f, w),
  62670. f++,
  62671. h.setX(f, E),
  62672. f++,
  62673. h.setX(f, b),
  62674. f++,
  62675. h.setX(f, w),
  62676. f++
  62677. }
  62678. if (
  62679. (this.setIndex(h),
  62680. this.addAttribute('position', u),
  62681. this.addAttribute('uv', d),
  62682. this.computeVertexNormals(),
  62683. r === 2 * Math.PI)
  62684. ) {
  62685. var _ = this.attributes.normal.array,
  62686. T = new n.Vector3(),
  62687. x = new n.Vector3(),
  62688. S = new n.Vector3()
  62689. for (o = t * e.length * 3, a = 0, s = 0; a < e.length; a++, s += 3)
  62690. (T.x = _[s + 0]),
  62691. (T.y = _[s + 1]),
  62692. (T.z = _[s + 2]),
  62693. (x.x = _[o + s + 0]),
  62694. (x.y = _[o + s + 1]),
  62695. (x.z = _[o + s + 2]),
  62696. S.addVectors(T, x).normalize(),
  62697. (_[s + 0] = _[o + s + 0] = S.x),
  62698. (_[s + 1] = _[o + s + 1] = S.y),
  62699. (_[s + 2] = _[o + s + 2] = S.z)
  62700. }
  62701. }),
  62702. (n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62703. (n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry),
  62704. (n.LatheGeometry = function (e, t, i, r) {
  62705. n.Geometry.call(this),
  62706. (this.type = 'LatheGeometry'),
  62707. (this.parameters = {
  62708. points: e,
  62709. segments: t,
  62710. phiStart: i,
  62711. phiLength: r
  62712. }),
  62713. this.fromBufferGeometry(new n.LatheBufferGeometry(e, t, i, r)),
  62714. this.mergeVertices()
  62715. }),
  62716. (n.LatheGeometry.prototype = Object.create(n.Geometry.prototype)),
  62717. (n.LatheGeometry.prototype.constructor = n.LatheGeometry),
  62718. (n.PlaneGeometry = function (e, t, i, r) {
  62719. n.Geometry.call(this),
  62720. (this.type = 'PlaneGeometry'),
  62721. (this.parameters = {
  62722. width: e,
  62723. height: t,
  62724. widthSegments: i,
  62725. heightSegments: r
  62726. }),
  62727. this.fromBufferGeometry(new n.PlaneBufferGeometry(e, t, i, r))
  62728. }),
  62729. (n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype)),
  62730. (n.PlaneGeometry.prototype.constructor = n.PlaneGeometry),
  62731. (n.PlaneBufferGeometry = function (e, t, i, r) {
  62732. n.BufferGeometry.call(this),
  62733. (this.type = 'PlaneBufferGeometry'),
  62734. (this.parameters = {
  62735. width: e,
  62736. height: t,
  62737. widthSegments: i,
  62738. heightSegments: r
  62739. })
  62740. for (
  62741. var o = e / 2,
  62742. a = t / 2,
  62743. s = Math.floor(i) || 1,
  62744. l = Math.floor(r) || 1,
  62745. c = s + 1,
  62746. h = l + 1,
  62747. u = e / s,
  62748. d = t / l,
  62749. p = new Float32Array(c * h * 3),
  62750. f = new Float32Array(c * h * 3),
  62751. g = new Float32Array(c * h * 2),
  62752. m = 0,
  62753. v = 0,
  62754. A = 0;
  62755. A < h;
  62756. A++
  62757. )
  62758. for (var y = A * d - a, C = 0; C < c; C++) {
  62759. var I = C * u - o
  62760. ;(p[m] = I),
  62761. (p[m + 1] = -y),
  62762. (f[m + 2] = 1),
  62763. (g[v] = C / s),
  62764. (g[v + 1] = 1 - A / l),
  62765. (m += 3),
  62766. (v += 2)
  62767. }
  62768. m = 0
  62769. for (
  62770. var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0;
  62771. A < l;
  62772. A++
  62773. )
  62774. for (var C = 0; C < s; C++) {
  62775. var b = C + c * A,
  62776. w = C + c * (A + 1),
  62777. _ = C + 1 + c * (A + 1),
  62778. T = C + 1 + c * A
  62779. ;(E[m] = b),
  62780. (E[m + 1] = w),
  62781. (E[m + 2] = T),
  62782. (E[m + 3] = w),
  62783. (E[m + 4] = _),
  62784. (E[m + 5] = T),
  62785. (m += 6)
  62786. }
  62787. this.setIndex(new n.BufferAttribute(E, 1)),
  62788. this.addAttribute('position', new n.BufferAttribute(p, 3)),
  62789. this.addAttribute('normal', new n.BufferAttribute(f, 3)),
  62790. this.addAttribute('uv', new n.BufferAttribute(g, 2))
  62791. }),
  62792. (n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62793. (n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry),
  62794. (n.RingBufferGeometry = function (e, t, i, r, o, a) {
  62795. n.BufferGeometry.call(this),
  62796. (this.type = 'RingBufferGeometry'),
  62797. (this.parameters = {
  62798. innerRadius: e,
  62799. outerRadius: t,
  62800. thetaSegments: i,
  62801. phiSegments: r,
  62802. thetaStart: o,
  62803. thetaLength: a
  62804. }),
  62805. (e = e || 20),
  62806. (t = t || 50),
  62807. (o = void 0 !== o ? o : 0),
  62808. (a = void 0 !== a ? a : 2 * Math.PI),
  62809. (i = void 0 !== i ? Math.max(3, i) : 8),
  62810. (r = void 0 !== r ? Math.max(1, r) : 1)
  62811. var s,
  62812. l,
  62813. c,
  62814. h = (i + 1) * (r + 1),
  62815. u = i * r * 2 * 3,
  62816. d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u), 1),
  62817. p = new n.BufferAttribute(new Float32Array(3 * h), 3),
  62818. f = new n.BufferAttribute(new Float32Array(3 * h), 3),
  62819. g = new n.BufferAttribute(new Float32Array(2 * h), 2),
  62820. m = 0,
  62821. v = 0,
  62822. A = e,
  62823. y = (t - e) / r,
  62824. C = new n.Vector3(),
  62825. I = new n.Vector2()
  62826. for (l = 0; l <= r; l++) {
  62827. for (c = 0; c <= i; c++)
  62828. (s = o + (c / i) * a),
  62829. (C.x = A * Math.cos(s)),
  62830. (C.y = A * Math.sin(s)),
  62831. p.setXYZ(m, C.x, C.y, C.z),
  62832. f.setXYZ(m, 0, 0, 1),
  62833. (I.x = (C.x / t + 1) / 2),
  62834. (I.y = (C.y / t + 1) / 2),
  62835. g.setXY(m, I.x, I.y),
  62836. m++
  62837. A += y
  62838. }
  62839. for (l = 0; l < r; l++) {
  62840. var E = l * (i + 1)
  62841. for (c = 0; c < i; c++) {
  62842. s = c + E
  62843. var b = s,
  62844. w = s + i + 1,
  62845. _ = s + i + 2,
  62846. T = s + 1
  62847. d.setX(v, b),
  62848. v++,
  62849. d.setX(v, w),
  62850. v++,
  62851. d.setX(v, _),
  62852. v++,
  62853. d.setX(v, b),
  62854. v++,
  62855. d.setX(v, _),
  62856. v++,
  62857. d.setX(v, T),
  62858. v++
  62859. }
  62860. }
  62861. this.setIndex(d),
  62862. this.addAttribute('position', p),
  62863. this.addAttribute('normal', f),
  62864. this.addAttribute('uv', g)
  62865. }),
  62866. (n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62867. (n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry),
  62868. (n.RingGeometry = function (e, t, i, r, o, a) {
  62869. n.Geometry.call(this),
  62870. (this.type = 'RingGeometry'),
  62871. (this.parameters = {
  62872. innerRadius: e,
  62873. outerRadius: t,
  62874. thetaSegments: i,
  62875. phiSegments: r,
  62876. thetaStart: o,
  62877. thetaLength: a
  62878. }),
  62879. this.fromBufferGeometry(new n.RingBufferGeometry(e, t, i, r, o, a))
  62880. }),
  62881. (n.RingGeometry.prototype = Object.create(n.Geometry.prototype)),
  62882. (n.RingGeometry.prototype.constructor = n.RingGeometry),
  62883. (n.SphereGeometry = function (e, t, i, r, o, a, s) {
  62884. n.Geometry.call(this),
  62885. (this.type = 'SphereGeometry'),
  62886. (this.parameters = {
  62887. radius: e,
  62888. widthSegments: t,
  62889. heightSegments: i,
  62890. phiStart: r,
  62891. phiLength: o,
  62892. thetaStart: a,
  62893. thetaLength: s
  62894. }),
  62895. this.fromBufferGeometry(new n.SphereBufferGeometry(e, t, i, r, o, a, s))
  62896. }),
  62897. (n.SphereGeometry.prototype = Object.create(n.Geometry.prototype)),
  62898. (n.SphereGeometry.prototype.constructor = n.SphereGeometry),
  62899. (n.SphereBufferGeometry = function (e, t, i, r, o, a, s) {
  62900. n.BufferGeometry.call(this),
  62901. (this.type = 'SphereBufferGeometry'),
  62902. (this.parameters = {
  62903. radius: e,
  62904. widthSegments: t,
  62905. heightSegments: i,
  62906. phiStart: r,
  62907. phiLength: o,
  62908. thetaStart: a,
  62909. thetaLength: s
  62910. }),
  62911. (e = e || 50),
  62912. (t = Math.max(3, Math.floor(t) || 8)),
  62913. (i = Math.max(2, Math.floor(i) || 6)),
  62914. (r = void 0 !== r ? r : 0),
  62915. (o = void 0 !== o ? o : 2 * Math.PI),
  62916. (a = void 0 !== a ? a : 0),
  62917. (s = void 0 !== s ? s : Math.PI)
  62918. for (
  62919. var l = a + s,
  62920. c = (t + 1) * (i + 1),
  62921. h = new n.BufferAttribute(new Float32Array(3 * c), 3),
  62922. u = new n.BufferAttribute(new Float32Array(3 * c), 3),
  62923. d = new n.BufferAttribute(new Float32Array(2 * c), 2),
  62924. p = 0,
  62925. f = [],
  62926. g = new n.Vector3(),
  62927. m = 0;
  62928. m <= i;
  62929. m++
  62930. ) {
  62931. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  62932. var C = y / t,
  62933. I = -e * Math.cos(r + C * o) * Math.sin(a + A * s),
  62934. E = e * Math.cos(a + A * s),
  62935. b = e * Math.sin(r + C * o) * Math.sin(a + A * s)
  62936. g.set(I, E, b).normalize(),
  62937. h.setXYZ(p, I, E, b),
  62938. u.setXYZ(p, g.x, g.y, g.z),
  62939. d.setXY(p, C, 1 - A),
  62940. v.push(p),
  62941. p++
  62942. }
  62943. f.push(v)
  62944. }
  62945. for (var w = [], m = 0; m < i; m++)
  62946. for (var y = 0; y < t; y++) {
  62947. var _ = f[m][y + 1],
  62948. T = f[m][y],
  62949. x = f[m + 1][y],
  62950. S = f[m + 1][y + 1]
  62951. ;(0 !== m || a > 0) && w.push(_, T, S),
  62952. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  62953. }
  62954. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w, 1)),
  62955. this.addAttribute('position', h),
  62956. this.addAttribute('normal', u),
  62957. this.addAttribute('uv', d),
  62958. (this.boundingSphere = new n.Sphere(new n.Vector3(), e))
  62959. }),
  62960. (n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  62961. (n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry),
  62962. (n.TextGeometry = function (e, t) {
  62963. t = t || {}
  62964. var i = t.font
  62965. if (i instanceof n.Font == !1)
  62966. return (
  62967. console.error(
  62968. 'THREE.TextGeometry: font parameter is not an instance of THREE.Font.'
  62969. ),
  62970. new n.Geometry()
  62971. )
  62972. var r = i.generateShapes(e, t.size, t.curveSegments)
  62973. ;(t.amount = void 0 !== t.height ? t.height : 50),
  62974. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  62975. void 0 === t.bevelSize && (t.bevelSize = 8),
  62976. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  62977. n.ExtrudeGeometry.call(this, r, t),
  62978. (this.type = 'TextGeometry')
  62979. }),
  62980. (n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype)),
  62981. (n.TextGeometry.prototype.constructor = n.TextGeometry),
  62982. (n.TorusBufferGeometry = function (e, t, i, r, o) {
  62983. n.BufferGeometry.call(this),
  62984. (this.type = 'TorusBufferGeometry'),
  62985. (this.parameters = {
  62986. radius: e,
  62987. tube: t,
  62988. radialSegments: i,
  62989. tubularSegments: r,
  62990. arc: o
  62991. }),
  62992. (e = e || 100),
  62993. (t = t || 40),
  62994. (i = Math.floor(i) || 8),
  62995. (r = Math.floor(r) || 6),
  62996. (o = o || 2 * Math.PI)
  62997. var a,
  62998. s,
  62999. l = (i + 1) * (r + 1),
  63000. c = i * r * 2 * 3,
  63001. h = new (c > 65535 ? Uint32Array : Uint16Array)(c),
  63002. u = new Float32Array(3 * l),
  63003. d = new Float32Array(3 * l),
  63004. p = new Float32Array(2 * l),
  63005. f = 0,
  63006. g = 0,
  63007. m = 0,
  63008. v = new n.Vector3(),
  63009. A = new n.Vector3(),
  63010. y = new n.Vector3()
  63011. for (a = 0; a <= i; a++)
  63012. for (s = 0; s <= r; s++) {
  63013. var C = (s / r) * o,
  63014. I = (a / i) * Math.PI * 2
  63015. ;(A.x = (e + t * Math.cos(I)) * Math.cos(C)),
  63016. (A.y = (e + t * Math.cos(I)) * Math.sin(C)),
  63017. (A.z = t * Math.sin(I)),
  63018. (u[f] = A.x),
  63019. (u[f + 1] = A.y),
  63020. (u[f + 2] = A.z),
  63021. (v.x = e * Math.cos(C)),
  63022. (v.y = e * Math.sin(C)),
  63023. y.subVectors(A, v).normalize(),
  63024. (d[f] = y.x),
  63025. (d[f + 1] = y.y),
  63026. (d[f + 2] = y.z),
  63027. (p[g] = s / r),
  63028. (p[g + 1] = a / i),
  63029. (f += 3),
  63030. (g += 2)
  63031. }
  63032. for (a = 1; a <= i; a++)
  63033. for (s = 1; s <= r; s++) {
  63034. var E = (r + 1) * a + s - 1,
  63035. b = (r + 1) * (a - 1) + s - 1,
  63036. w = (r + 1) * (a - 1) + s,
  63037. _ = (r + 1) * a + s
  63038. ;(h[m] = E),
  63039. (h[m + 1] = b),
  63040. (h[m + 2] = _),
  63041. (h[m + 3] = b),
  63042. (h[m + 4] = w),
  63043. (h[m + 5] = _),
  63044. (m += 6)
  63045. }
  63046. this.setIndex(new n.BufferAttribute(h, 1)),
  63047. this.addAttribute('position', new n.BufferAttribute(u, 3)),
  63048. this.addAttribute('normal', new n.BufferAttribute(d, 3)),
  63049. this.addAttribute('uv', new n.BufferAttribute(p, 2))
  63050. }),
  63051. (n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  63052. (n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry),
  63053. (n.TorusGeometry = function (e, t, i, r, o) {
  63054. n.Geometry.call(this),
  63055. (this.type = 'TorusGeometry'),
  63056. (this.parameters = {
  63057. radius: e,
  63058. tube: t,
  63059. radialSegments: i,
  63060. tubularSegments: r,
  63061. arc: o
  63062. }),
  63063. this.fromBufferGeometry(new n.TorusBufferGeometry(e, t, i, r, o))
  63064. }),
  63065. (n.TorusGeometry.prototype = Object.create(n.Geometry.prototype)),
  63066. (n.TorusGeometry.prototype.constructor = n.TorusGeometry),
  63067. (n.TorusKnotBufferGeometry = function (e, t, i, r, o, a) {
  63068. function s(e, t, i, n, r) {
  63069. var o = Math.cos(e),
  63070. a = Math.sin(e),
  63071. s = (i / t) * e,
  63072. l = Math.cos(s)
  63073. ;(r.x = n * (2 + l) * 0.5 * o),
  63074. (r.y = n * (2 + l) * a * 0.5),
  63075. (r.z = n * Math.sin(s) * 0.5)
  63076. }
  63077. n.BufferGeometry.call(this),
  63078. (this.type = 'TorusKnotBufferGeometry'),
  63079. (this.parameters = {
  63080. radius: e,
  63081. tube: t,
  63082. tubularSegments: i,
  63083. radialSegments: r,
  63084. p: o,
  63085. q: a
  63086. }),
  63087. (e = e || 100),
  63088. (t = t || 40),
  63089. (i = Math.floor(i) || 64),
  63090. (r = Math.floor(r) || 8),
  63091. (o = o || 2),
  63092. (a = a || 3)
  63093. var l,
  63094. c,
  63095. h = (r + 1) * (i + 1),
  63096. u = r * i * 2 * 3,
  63097. d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u), 1),
  63098. p = new n.BufferAttribute(new Float32Array(3 * h), 3),
  63099. f = new n.BufferAttribute(new Float32Array(3 * h), 3),
  63100. g = new n.BufferAttribute(new Float32Array(2 * h), 2),
  63101. m = 0,
  63102. v = 0,
  63103. A = new n.Vector3(),
  63104. y = new n.Vector3(),
  63105. C = new n.Vector2(),
  63106. I = new n.Vector3(),
  63107. E = new n.Vector3(),
  63108. b = new n.Vector3(),
  63109. w = new n.Vector3(),
  63110. _ = new n.Vector3()
  63111. for (l = 0; l <= i; ++l) {
  63112. var T = (l / i) * o * Math.PI * 2
  63113. for (
  63114. s(T, o, a, e, I),
  63115. s(T + 0.01, o, a, e, E),
  63116. w.subVectors(E, I),
  63117. _.addVectors(E, I),
  63118. b.crossVectors(w, _),
  63119. _.crossVectors(b, w),
  63120. b.normalize(),
  63121. _.normalize(),
  63122. c = 0;
  63123. c <= r;
  63124. ++c
  63125. ) {
  63126. var x = (c / r) * Math.PI * 2,
  63127. S = -t * Math.cos(x),
  63128. M = t * Math.sin(x)
  63129. ;(A.x = I.x + (S * _.x + M * b.x)),
  63130. (A.y = I.y + (S * _.y + M * b.y)),
  63131. (A.z = I.z + (S * _.z + M * b.z)),
  63132. p.setXYZ(m, A.x, A.y, A.z),
  63133. y.subVectors(A, I).normalize(),
  63134. f.setXYZ(m, y.x, y.y, y.z),
  63135. (C.x = l / i),
  63136. (C.y = c / r),
  63137. g.setXY(m, C.x, C.y),
  63138. m++
  63139. }
  63140. }
  63141. for (c = 1; c <= i; c++)
  63142. for (l = 1; l <= r; l++) {
  63143. var R = (r + 1) * (c - 1) + (l - 1),
  63144. P = (r + 1) * c + (l - 1),
  63145. O = (r + 1) * c + l,
  63146. L = (r + 1) * (c - 1) + l
  63147. d.setX(v, R),
  63148. v++,
  63149. d.setX(v, P),
  63150. v++,
  63151. d.setX(v, L),
  63152. v++,
  63153. d.setX(v, P),
  63154. v++,
  63155. d.setX(v, O),
  63156. v++,
  63157. d.setX(v, L),
  63158. v++
  63159. }
  63160. this.setIndex(d),
  63161. this.addAttribute('position', p),
  63162. this.addAttribute('normal', f),
  63163. this.addAttribute('uv', g)
  63164. }),
  63165. (n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  63166. (n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry),
  63167. (n.TorusKnotGeometry = function (e, t, i, r, o, a, s) {
  63168. n.Geometry.call(this),
  63169. (this.type = 'TorusKnotGeometry'),
  63170. (this.parameters = {
  63171. radius: e,
  63172. tube: t,
  63173. tubularSegments: i,
  63174. radialSegments: r,
  63175. p: o,
  63176. q: a
  63177. }),
  63178. void 0 !== s &&
  63179. console.warn(
  63180. 'THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.'
  63181. ),
  63182. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e, t, i, r, o, a)),
  63183. this.mergeVertices()
  63184. }),
  63185. (n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype)),
  63186. (n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry),
  63187. (n.TubeGeometry = function (e, t, i, r, o, a) {
  63188. function s(e, t, i) {
  63189. return R.vertices.push(new n.Vector3(e, t, i)) - 1
  63190. }
  63191. n.Geometry.call(this),
  63192. (this.type = 'TubeGeometry'),
  63193. (this.parameters = {
  63194. path: e,
  63195. segments: t,
  63196. radius: i,
  63197. radialSegments: r,
  63198. closed: o,
  63199. taper: a
  63200. }),
  63201. (t = t || 64),
  63202. (i = i || 1),
  63203. (r = r || 8),
  63204. (o = o || !1),
  63205. (a = a || n.TubeGeometry.NoTaper)
  63206. var l,
  63207. c,
  63208. h,
  63209. u,
  63210. d,
  63211. p,
  63212. f,
  63213. g,
  63214. m,
  63215. v,
  63216. A,
  63217. y,
  63218. C,
  63219. I,
  63220. E,
  63221. b,
  63222. w,
  63223. _,
  63224. T,
  63225. x,
  63226. S,
  63227. M = [],
  63228. R = this,
  63229. P = t + 1,
  63230. O = new n.Vector3(),
  63231. L = new n.TubeGeometry.FrenetFrames(e, t, o),
  63232. D = L.tangents,
  63233. N = L.normals,
  63234. B = L.binormals
  63235. for (this.tangents = D, this.normals = N, this.binormals = B, v = 0; v < P; v++)
  63236. for (
  63237. M[v] = [],
  63238. u = v / (P - 1),
  63239. m = e.getPointAt(u),
  63240. l = D[v],
  63241. c = N[v],
  63242. h = B[v],
  63243. p = i * a(u),
  63244. A = 0;
  63245. A < r;
  63246. A++
  63247. )
  63248. (d = (A / r) * 2 * Math.PI),
  63249. (f = -p * Math.cos(d)),
  63250. (g = p * Math.sin(d)),
  63251. O.copy(m),
  63252. (O.x += f * c.x + g * h.x),
  63253. (O.y += f * c.y + g * h.y),
  63254. (O.z += f * c.z + g * h.z),
  63255. (M[v][A] = s(O.x, O.y, O.z))
  63256. for (v = 0; v < t; v++)
  63257. for (A = 0; A < r; A++)
  63258. (y = o ? (v + 1) % t : v + 1),
  63259. (C = (A + 1) % r),
  63260. (I = M[v][A]),
  63261. (E = M[y][A]),
  63262. (b = M[y][C]),
  63263. (w = M[v][C]),
  63264. (_ = new n.Vector2(v / t, A / r)),
  63265. (T = new n.Vector2((v + 1) / t, A / r)),
  63266. (x = new n.Vector2((v + 1) / t, (A + 1) / r)),
  63267. (S = new n.Vector2(v / t, (A + 1) / r)),
  63268. this.faces.push(new n.Face3(I, E, w)),
  63269. this.faceVertexUvs[0].push([_, T, S]),
  63270. this.faces.push(new n.Face3(E, b, w)),
  63271. this.faceVertexUvs[0].push([T.clone(), x, S.clone()])
  63272. this.computeFaceNormals(), this.computeVertexNormals()
  63273. }),
  63274. (n.TubeGeometry.prototype = Object.create(n.Geometry.prototype)),
  63275. (n.TubeGeometry.prototype.constructor = n.TubeGeometry),
  63276. (n.TubeGeometry.NoTaper = function (e) {
  63277. return 1
  63278. }),
  63279. (n.TubeGeometry.SinusoidalTaper = function (e) {
  63280. return Math.sin(Math.PI * e)
  63281. }),
  63282. (n.TubeGeometry.FrenetFrames = function (e, t, i) {
  63283. function r() {
  63284. ;(f[0] = new n.Vector3()),
  63285. (g[0] = new n.Vector3()),
  63286. (a = Number.MAX_VALUE),
  63287. (s = Math.abs(p[0].x)),
  63288. (l = Math.abs(p[0].y)),
  63289. (c = Math.abs(p[0].z)),
  63290. s <= a && ((a = s), d.set(1, 0, 0)),
  63291. l <= a && ((a = l), d.set(0, 1, 0)),
  63292. c <= a && d.set(0, 0, 1),
  63293. m.crossVectors(p[0], d).normalize(),
  63294. f[0].crossVectors(p[0], m),
  63295. g[0].crossVectors(p[0], f[0])
  63296. }
  63297. var o,
  63298. a,
  63299. s,
  63300. l,
  63301. c,
  63302. h,
  63303. u,
  63304. d = new n.Vector3(),
  63305. p = [],
  63306. f = [],
  63307. g = [],
  63308. m = new n.Vector3(),
  63309. v = new n.Matrix4(),
  63310. A = t + 1
  63311. for (this.tangents = p, this.normals = f, this.binormals = g, h = 0; h < A; h++)
  63312. (u = h / (A - 1)), (p[h] = e.getTangentAt(u)), p[h].normalize()
  63313. for (r(), h = 1; h < A; h++)
  63314. (f[h] = f[h - 1].clone()),
  63315. (g[h] = g[h - 1].clone()),
  63316. m.crossVectors(p[h - 1], p[h]),
  63317. m.length() > Number.EPSILON &&
  63318. (m.normalize(),
  63319. (o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1))),
  63320. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  63321. g[h].crossVectors(p[h], f[h])
  63322. if (i)
  63323. for (
  63324. o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  63325. o /= A - 1,
  63326. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  63327. h = 1;
  63328. h < A;
  63329. h++
  63330. )
  63331. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)), g[h].crossVectors(p[h], f[h])
  63332. }),
  63333. (n.PolyhedronGeometry = function (e, t, i, r) {
  63334. function o(e) {
  63335. var t = e.normalize().clone()
  63336. t.index = u.vertices.push(t) - 1
  63337. var i = l(e) / 2 / Math.PI + 0.5,
  63338. r = c(e) / Math.PI + 0.5
  63339. return (t.uv = new n.Vector2(i, 1 - r)), t
  63340. }
  63341. function a(e, t, i, r) {
  63342. var o = new n.Face3(
  63343. e.index,
  63344. t.index,
  63345. i.index,
  63346. [e.clone(), t.clone(), i.clone()],
  63347. void 0,
  63348. r
  63349. )
  63350. u.faces.push(o), C.copy(e).add(t).add(i).divideScalar(3)
  63351. var a = l(C)
  63352. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  63353. }
  63354. function s(e, t) {
  63355. for (
  63356. var i = Math.pow(2, t),
  63357. n = o(u.vertices[e.a]),
  63358. r = o(u.vertices[e.b]),
  63359. s = o(u.vertices[e.c]),
  63360. l = [],
  63361. c = e.materialIndex,
  63362. h = 0;
  63363. h <= i;
  63364. h++
  63365. ) {
  63366. l[h] = []
  63367. for (
  63368. var d = o(n.clone().lerp(s, h / i)),
  63369. p = o(r.clone().lerp(s, h / i)),
  63370. f = i - h,
  63371. g = 0;
  63372. g <= f;
  63373. g++
  63374. )
  63375. 0 === g && h === i ? (l[h][g] = d) : (l[h][g] = o(d.clone().lerp(p, g / f)))
  63376. }
  63377. for (var h = 0; h < i; h++)
  63378. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  63379. var m = Math.floor(g / 2)
  63380. g % 2 === 0
  63381. ? a(l[h][m + 1], l[h + 1][m], l[h][m], c)
  63382. : a(l[h][m + 1], l[h + 1][m + 1], l[h + 1][m], c)
  63383. }
  63384. }
  63385. function l(e) {
  63386. return Math.atan2(e.z, -e.x)
  63387. }
  63388. function c(e) {
  63389. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  63390. }
  63391. function h(e, t, i) {
  63392. return (
  63393. i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1, e.y)),
  63394. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + 0.5, e.y)),
  63395. e.clone()
  63396. )
  63397. }
  63398. n.Geometry.call(this),
  63399. (this.type = 'PolyhedronGeometry'),
  63400. (this.parameters = {
  63401. vertices: e,
  63402. indices: t,
  63403. radius: i,
  63404. detail: r
  63405. }),
  63406. (i = i || 1),
  63407. (r = r || 0)
  63408. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  63409. o(new n.Vector3(e[d], e[d + 1], e[d + 2]))
  63410. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3, m++) {
  63411. var v = f[t[d]],
  63412. A = f[t[d + 1]],
  63413. y = f[t[d + 2]]
  63414. g[m] = new n.Face3(
  63415. v.index,
  63416. A.index,
  63417. y.index,
  63418. [v.clone(), A.clone(), y.clone()],
  63419. void 0,
  63420. m
  63421. )
  63422. }
  63423. for (var C = new n.Vector3(), d = 0, p = g.length; d < p; d++) s(g[d], r)
  63424. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  63425. var I = this.faceVertexUvs[0][d],
  63426. E = I[0].x,
  63427. b = I[1].x,
  63428. w = I[2].x,
  63429. _ = Math.max(E, b, w),
  63430. T = Math.min(E, b, w)
  63431. _ > 0.9 &&
  63432. T < 0.1 &&
  63433. (E < 0.2 && (I[0].x += 1), b < 0.2 && (I[1].x += 1), w < 0.2 && (I[2].x += 1))
  63434. }
  63435. for (var d = 0, p = this.vertices.length; d < p; d++) this.vertices[d].multiplyScalar(i)
  63436. this.mergeVertices(),
  63437. this.computeFaceNormals(),
  63438. (this.boundingSphere = new n.Sphere(new n.Vector3(), i))
  63439. }),
  63440. (n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype)),
  63441. (n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry),
  63442. (n.DodecahedronGeometry = function (e, t) {
  63443. var i = (1 + Math.sqrt(5)) / 2,
  63444. r = 1 / i,
  63445. o = [
  63446. -1,
  63447. -1,
  63448. -1,
  63449. -1,
  63450. -1,
  63451. 1,
  63452. -1,
  63453. 1,
  63454. -1,
  63455. -1,
  63456. 1,
  63457. 1,
  63458. 1,
  63459. -1,
  63460. -1,
  63461. 1,
  63462. -1,
  63463. 1,
  63464. 1,
  63465. 1,
  63466. -1,
  63467. 1,
  63468. 1,
  63469. 1,
  63470. 0,
  63471. -r,
  63472. -i,
  63473. 0,
  63474. -r,
  63475. i,
  63476. 0,
  63477. r,
  63478. -i,
  63479. 0,
  63480. r,
  63481. i,
  63482. -r,
  63483. -i,
  63484. 0,
  63485. -r,
  63486. i,
  63487. 0,
  63488. r,
  63489. -i,
  63490. 0,
  63491. r,
  63492. i,
  63493. 0,
  63494. -i,
  63495. 0,
  63496. -r,
  63497. i,
  63498. 0,
  63499. -r,
  63500. -i,
  63501. 0,
  63502. r,
  63503. i,
  63504. 0,
  63505. r
  63506. ],
  63507. a = [
  63508. 3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10,
  63509. 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,
  63510. 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4,
  63511. 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19,
  63512. 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9
  63513. ]
  63514. n.PolyhedronGeometry.call(this, o, a, e, t),
  63515. (this.type = 'DodecahedronGeometry'),
  63516. (this.parameters = {
  63517. radius: e,
  63518. detail: t
  63519. })
  63520. }),
  63521. (n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  63522. (n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry),
  63523. (n.IcosahedronGeometry = function (e, t) {
  63524. var i = (1 + Math.sqrt(5)) / 2,
  63525. r = [
  63526. -1,
  63527. i,
  63528. 0,
  63529. 1,
  63530. i,
  63531. 0,
  63532. -1,
  63533. -i,
  63534. 0,
  63535. 1,
  63536. -i,
  63537. 0,
  63538. 0,
  63539. -1,
  63540. i,
  63541. 0,
  63542. 1,
  63543. i,
  63544. 0,
  63545. -1,
  63546. -i,
  63547. 0,
  63548. 1,
  63549. -i,
  63550. i,
  63551. 0,
  63552. -1,
  63553. i,
  63554. 0,
  63555. 1,
  63556. -i,
  63557. 0,
  63558. -1,
  63559. -i,
  63560. 0,
  63561. 1
  63562. ],
  63563. o = [
  63564. 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,
  63565. 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,
  63566. 10, 8, 6, 7, 9, 8, 1
  63567. ]
  63568. n.PolyhedronGeometry.call(this, r, o, e, t),
  63569. (this.type = 'IcosahedronGeometry'),
  63570. (this.parameters = {
  63571. radius: e,
  63572. detail: t
  63573. })
  63574. }),
  63575. (n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  63576. (n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry),
  63577. (n.OctahedronGeometry = function (e, t) {
  63578. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1],
  63579. r = [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2]
  63580. n.PolyhedronGeometry.call(this, i, r, e, t),
  63581. (this.type = 'OctahedronGeometry'),
  63582. (this.parameters = {
  63583. radius: e,
  63584. detail: t
  63585. })
  63586. }),
  63587. (n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  63588. (n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry),
  63589. (n.TetrahedronGeometry = function (e, t) {
  63590. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1],
  63591. r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1]
  63592. n.PolyhedronGeometry.call(this, i, r, e, t),
  63593. (this.type = 'TetrahedronGeometry'),
  63594. (this.parameters = {
  63595. radius: e,
  63596. detail: t
  63597. })
  63598. }),
  63599. (n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  63600. (n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry),
  63601. (n.ParametricGeometry = function (e, t, i) {
  63602. n.Geometry.call(this),
  63603. (this.type = 'ParametricGeometry'),
  63604. (this.parameters = {
  63605. func: e,
  63606. slices: t,
  63607. stacks: i
  63608. })
  63609. var r,
  63610. o,
  63611. a,
  63612. s,
  63613. l,
  63614. c = this.vertices,
  63615. h = this.faces,
  63616. u = this.faceVertexUvs[0],
  63617. d = t + 1
  63618. for (r = 0; r <= i; r++)
  63619. for (l = r / i, o = 0; o <= t; o++) (s = o / t), (a = e(s, l)), c.push(a)
  63620. var p, f, g, m, v, A, y, C
  63621. for (r = 0; r < i; r++)
  63622. for (o = 0; o < t; o++)
  63623. (p = r * d + o),
  63624. (f = r * d + o + 1),
  63625. (g = (r + 1) * d + o + 1),
  63626. (m = (r + 1) * d + o),
  63627. (v = new n.Vector2(o / t, r / i)),
  63628. (A = new n.Vector2((o + 1) / t, r / i)),
  63629. (y = new n.Vector2((o + 1) / t, (r + 1) / i)),
  63630. (C = new n.Vector2(o / t, (r + 1) / i)),
  63631. h.push(new n.Face3(p, f, m)),
  63632. u.push([v, A, C]),
  63633. h.push(new n.Face3(f, g, m)),
  63634. u.push([A.clone(), y, C.clone()])
  63635. this.computeFaceNormals(), this.computeVertexNormals()
  63636. }),
  63637. (n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype)),
  63638. (n.ParametricGeometry.prototype.constructor = n.ParametricGeometry),
  63639. (n.WireframeGeometry = function (e) {
  63640. function t(e, t) {
  63641. return e - t
  63642. }
  63643. n.BufferGeometry.call(this)
  63644. var i = [0, 0],
  63645. r = {},
  63646. o = ['a', 'b', 'c']
  63647. if (e instanceof n.Geometry) {
  63648. for (
  63649. var a = e.vertices,
  63650. s = e.faces,
  63651. l = 0,
  63652. c = new Uint32Array(6 * s.length),
  63653. h = 0,
  63654. u = s.length;
  63655. h < u;
  63656. h++
  63657. )
  63658. for (var d = s[h], p = 0; p < 3; p++) {
  63659. ;(i[0] = d[o[p]]), (i[1] = d[o[(p + 1) % 3]]), i.sort(t)
  63660. var f = i.toString()
  63661. void 0 === r[f] && ((c[2 * l] = i[0]), (c[2 * l + 1] = i[1]), (r[f] = !0), l++)
  63662. }
  63663. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  63664. for (var p = 0; p < 2; p++) {
  63665. var m = a[c[2 * h + p]],
  63666. v = 6 * h + 3 * p
  63667. ;(g[v + 0] = m.x), (g[v + 1] = m.y), (g[v + 2] = m.z)
  63668. }
  63669. this.addAttribute('position', new n.BufferAttribute(g, 3))
  63670. } else if (e instanceof n.BufferGeometry)
  63671. if (null !== e.index) {
  63672. var A = e.index.array,
  63673. a = e.attributes.position,
  63674. y = e.groups,
  63675. l = 0
  63676. 0 === y.length && e.addGroup(0, A.length)
  63677. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  63678. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  63679. for (var p = 0; p < 3; p++) {
  63680. ;(i[0] = A[h + p]), (i[1] = A[h + ((p + 1) % 3)]), i.sort(t)
  63681. var f = i.toString()
  63682. void 0 === r[f] &&
  63683. ((c[2 * l] = i[0]), (c[2 * l + 1] = i[1]), (r[f] = !0), l++)
  63684. }
  63685. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  63686. for (var p = 0; p < 2; p++) {
  63687. var v = 6 * h + 3 * p,
  63688. T = c[2 * h + p]
  63689. ;(g[v + 0] = a.getX(T)), (g[v + 1] = a.getY(T)), (g[v + 2] = a.getZ(T))
  63690. }
  63691. this.addAttribute('position', new n.BufferAttribute(g, 3))
  63692. } else {
  63693. for (
  63694. var a = e.attributes.position.array,
  63695. l = a.length / 3,
  63696. x = l / 3,
  63697. g = new Float32Array(2 * l * 3),
  63698. h = 0,
  63699. u = x;
  63700. h < u;
  63701. h++
  63702. )
  63703. for (var p = 0; p < 3; p++) {
  63704. var v = 18 * h + 6 * p,
  63705. S = 9 * h + 3 * p
  63706. ;(g[v + 0] = a[S]), (g[v + 1] = a[S + 1]), (g[v + 2] = a[S + 2])
  63707. var T = 9 * h + 3 * ((p + 1) % 3)
  63708. ;(g[v + 3] = a[T]), (g[v + 4] = a[T + 1]), (g[v + 5] = a[T + 2])
  63709. }
  63710. this.addAttribute('position', new n.BufferAttribute(g, 3))
  63711. }
  63712. }),
  63713. (n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  63714. (n.WireframeGeometry.prototype.constructor = n.WireframeGeometry),
  63715. (n.AxisHelper = function (e) {
  63716. e = e || 1
  63717. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e]),
  63718. i = new Float32Array([1, 0, 0, 1, 0.6, 0, 0, 1, 0, 0.6, 1, 0, 0, 0, 1, 0, 0.6, 1]),
  63719. r = new n.BufferGeometry()
  63720. r.addAttribute('position', new n.BufferAttribute(t, 3)),
  63721. r.addAttribute('color', new n.BufferAttribute(i, 3))
  63722. var o = new n.LineBasicMaterial({
  63723. vertexColors: n.VertexColors
  63724. })
  63725. n.LineSegments.call(this, r, o)
  63726. }),
  63727. (n.AxisHelper.prototype = Object.create(n.LineSegments.prototype)),
  63728. (n.AxisHelper.prototype.constructor = n.AxisHelper),
  63729. (n.ArrowHelper = (function () {
  63730. var e = new n.Geometry()
  63731. e.vertices.push(new n.Vector3(0, 0, 0), new n.Vector3(0, 1, 0))
  63732. var t = new n.CylinderGeometry(0, 0.5, 1, 5, 1)
  63733. return (
  63734. t.translate(0, -0.5, 0),
  63735. function (i, r, o, a, s, l) {
  63736. n.Object3D.call(this),
  63737. void 0 === a && (a = 16776960),
  63738. void 0 === o && (o = 1),
  63739. void 0 === s && (s = 0.2 * o),
  63740. void 0 === l && (l = 0.2 * s),
  63741. this.position.copy(r),
  63742. (this.line = new n.Line(
  63743. e,
  63744. new n.LineBasicMaterial({
  63745. color: a
  63746. })
  63747. )),
  63748. (this.line.matrixAutoUpdate = !1),
  63749. this.add(this.line),
  63750. (this.cone = new n.Mesh(
  63751. t,
  63752. new n.MeshBasicMaterial({
  63753. color: a
  63754. })
  63755. )),
  63756. (this.cone.matrixAutoUpdate = !1),
  63757. this.add(this.cone),
  63758. this.setDirection(i),
  63759. this.setLength(o, s, l)
  63760. }
  63761. )
  63762. })()),
  63763. (n.ArrowHelper.prototype = Object.create(n.Object3D.prototype)),
  63764. (n.ArrowHelper.prototype.constructor = n.ArrowHelper),
  63765. (n.ArrowHelper.prototype.setDirection = (function () {
  63766. var e,
  63767. t = new n.Vector3()
  63768. return function (i) {
  63769. i.y > 0.99999
  63770. ? this.quaternion.set(0, 0, 0, 1)
  63771. : i.y < -0.99999
  63772. ? this.quaternion.set(1, 0, 0, 0)
  63773. : (t.set(i.z, 0, -i.x).normalize(),
  63774. (e = Math.acos(i.y)),
  63775. this.quaternion.setFromAxisAngle(t, e))
  63776. }
  63777. })()),
  63778. (n.ArrowHelper.prototype.setLength = function (e, t, i) {
  63779. void 0 === t && (t = 0.2 * e),
  63780. void 0 === i && (i = 0.2 * t),
  63781. this.line.scale.set(1, Math.max(0, e - t), 1),
  63782. this.line.updateMatrix(),
  63783. this.cone.scale.set(i, t, i),
  63784. (this.cone.position.y = e),
  63785. this.cone.updateMatrix()
  63786. }),
  63787. (n.ArrowHelper.prototype.setColor = function (e) {
  63788. this.line.material.color.set(e), this.cone.material.color.set(e)
  63789. }),
  63790. (n.BoxHelper = function (e) {
  63791. var t = new Uint16Array([
  63792. 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7
  63793. ]),
  63794. i = new Float32Array(24),
  63795. r = new n.BufferGeometry()
  63796. r.setIndex(new n.BufferAttribute(t, 1)),
  63797. r.addAttribute('position', new n.BufferAttribute(i, 3)),
  63798. n.LineSegments.call(
  63799. this,
  63800. r,
  63801. new n.LineBasicMaterial({
  63802. color: 16776960
  63803. })
  63804. ),
  63805. void 0 !== e && this.update(e)
  63806. }),
  63807. (n.BoxHelper.prototype = Object.create(n.LineSegments.prototype)),
  63808. (n.BoxHelper.prototype.constructor = n.BoxHelper),
  63809. (n.BoxHelper.prototype.update = (function () {
  63810. var e = new n.Box3()
  63811. return function (t) {
  63812. if ((e.setFromObject(t), !e.isEmpty())) {
  63813. var i = e.min,
  63814. n = e.max,
  63815. r = this.geometry.attributes.position,
  63816. o = r.array
  63817. ;(o[0] = n.x),
  63818. (o[1] = n.y),
  63819. (o[2] = n.z),
  63820. (o[3] = i.x),
  63821. (o[4] = n.y),
  63822. (o[5] = n.z),
  63823. (o[6] = i.x),
  63824. (o[7] = i.y),
  63825. (o[8] = n.z),
  63826. (o[9] = n.x),
  63827. (o[10] = i.y),
  63828. (o[11] = n.z),
  63829. (o[12] = n.x),
  63830. (o[13] = n.y),
  63831. (o[14] = i.z),
  63832. (o[15] = i.x),
  63833. (o[16] = n.y),
  63834. (o[17] = i.z),
  63835. (o[18] = i.x),
  63836. (o[19] = i.y),
  63837. (o[20] = i.z),
  63838. (o[21] = n.x),
  63839. (o[22] = i.y),
  63840. (o[23] = i.z),
  63841. (r.needsUpdate = !0),
  63842. this.geometry.computeBoundingSphere()
  63843. }
  63844. }
  63845. })()),
  63846. (n.BoundingBoxHelper = function (e, t) {
  63847. var i = void 0 !== t ? t : 8947848
  63848. ;(this.object = e),
  63849. (this.box = new n.Box3()),
  63850. n.Mesh.call(
  63851. this,
  63852. new n.BoxGeometry(1, 1, 1),
  63853. new n.MeshBasicMaterial({
  63854. color: i,
  63855. wireframe: !0
  63856. })
  63857. )
  63858. }),
  63859. (n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype)),
  63860. (n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper),
  63861. (n.BoundingBoxHelper.prototype.update = function () {
  63862. this.box.setFromObject(this.object),
  63863. this.box.size(this.scale),
  63864. this.box.center(this.position)
  63865. }),
  63866. (n.CameraHelper = function (e) {
  63867. function t(e, t, n) {
  63868. i(e, n), i(t, n)
  63869. }
  63870. function i(e, t) {
  63871. r.vertices.push(new n.Vector3()),
  63872. r.colors.push(new n.Color(t)),
  63873. void 0 === a[e] && (a[e] = []),
  63874. a[e].push(r.vertices.length - 1)
  63875. }
  63876. var r = new n.Geometry(),
  63877. o = new n.LineBasicMaterial({
  63878. color: 16777215,
  63879. vertexColors: n.FaceColors
  63880. }),
  63881. a = {},
  63882. s = 16755200,
  63883. l = 16711680,
  63884. c = 43775,
  63885. h = 16777215,
  63886. u = 3355443
  63887. t('n1', 'n2', s),
  63888. t('n2', 'n4', s),
  63889. t('n4', 'n3', s),
  63890. t('n3', 'n1', s),
  63891. t('f1', 'f2', s),
  63892. t('f2', 'f4', s),
  63893. t('f4', 'f3', s),
  63894. t('f3', 'f1', s),
  63895. t('n1', 'f1', s),
  63896. t('n2', 'f2', s),
  63897. t('n3', 'f3', s),
  63898. t('n4', 'f4', s),
  63899. t('p', 'n1', l),
  63900. t('p', 'n2', l),
  63901. t('p', 'n3', l),
  63902. t('p', 'n4', l),
  63903. t('u1', 'u2', c),
  63904. t('u2', 'u3', c),
  63905. t('u3', 'u1', c),
  63906. t('c', 't', h),
  63907. t('p', 'c', u),
  63908. t('cn1', 'cn2', u),
  63909. t('cn3', 'cn4', u),
  63910. t('cf1', 'cf2', u),
  63911. t('cf3', 'cf4', u),
  63912. n.LineSegments.call(this, r, o),
  63913. (this.camera = e),
  63914. this.camera.updateProjectionMatrix(),
  63915. (this.matrix = e.matrixWorld),
  63916. (this.matrixAutoUpdate = !1),
  63917. (this.pointMap = a),
  63918. this.update()
  63919. }),
  63920. (n.CameraHelper.prototype = Object.create(n.LineSegments.prototype)),
  63921. (n.CameraHelper.prototype.constructor = n.CameraHelper),
  63922. (n.CameraHelper.prototype.update = (function () {
  63923. function e(e, n, a, s) {
  63924. r.set(n, a, s).unproject(o)
  63925. var l = i[e]
  63926. if (void 0 !== l) for (var c = 0, h = l.length; c < h; c++) t.vertices[l[c]].copy(r)
  63927. }
  63928. var t,
  63929. i,
  63930. r = new n.Vector3(),
  63931. o = new n.Camera()
  63932. return function () {
  63933. ;(t = this.geometry), (i = this.pointMap)
  63934. var n = 1,
  63935. r = 1
  63936. o.projectionMatrix.copy(this.camera.projectionMatrix),
  63937. e('c', 0, 0, -1),
  63938. e('t', 0, 0, 1),
  63939. e('n1', -n, -r, -1),
  63940. e('n2', n, -r, -1),
  63941. e('n3', -n, r, -1),
  63942. e('n4', n, r, -1),
  63943. e('f1', -n, -r, 1),
  63944. e('f2', n, -r, 1),
  63945. e('f3', -n, r, 1),
  63946. e('f4', n, r, 1),
  63947. e('u1', 0.7 * n, 1.1 * r, -1),
  63948. e('u2', 0.7 * -n, 1.1 * r, -1),
  63949. e('u3', 0, 2 * r, -1),
  63950. e('cf1', -n, 0, 1),
  63951. e('cf2', n, 0, 1),
  63952. e('cf3', 0, -r, 1),
  63953. e('cf4', 0, r, 1),
  63954. e('cn1', -n, 0, -1),
  63955. e('cn2', n, 0, -1),
  63956. e('cn3', 0, -r, -1),
  63957. e('cn4', 0, r, -1),
  63958. (t.verticesNeedUpdate = !0)
  63959. }
  63960. })()),
  63961. (n.DirectionalLightHelper = function (e, t) {
  63962. n.Object3D.call(this),
  63963. (this.light = e),
  63964. this.light.updateMatrixWorld(),
  63965. (this.matrix = e.matrixWorld),
  63966. (this.matrixAutoUpdate = !1),
  63967. (t = t || 1)
  63968. var i = new n.Geometry()
  63969. i.vertices.push(
  63970. new n.Vector3(-t, t, 0),
  63971. new n.Vector3(t, t, 0),
  63972. new n.Vector3(t, -t, 0),
  63973. new n.Vector3(-t, -t, 0),
  63974. new n.Vector3(-t, t, 0)
  63975. )
  63976. var r = new n.LineBasicMaterial({
  63977. fog: !1
  63978. })
  63979. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  63980. (this.lightPlane = new n.Line(i, r)),
  63981. this.add(this.lightPlane),
  63982. (i = new n.Geometry()),
  63983. i.vertices.push(new n.Vector3(), new n.Vector3()),
  63984. (r = new n.LineBasicMaterial({
  63985. fog: !1
  63986. })),
  63987. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  63988. (this.targetLine = new n.Line(i, r)),
  63989. this.add(this.targetLine),
  63990. this.update()
  63991. }),
  63992. (n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype)),
  63993. (n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper),
  63994. (n.DirectionalLightHelper.prototype.dispose = function () {
  63995. this.lightPlane.geometry.dispose(),
  63996. this.lightPlane.material.dispose(),
  63997. this.targetLine.geometry.dispose(),
  63998. this.targetLine.material.dispose()
  63999. }),
  64000. (n.DirectionalLightHelper.prototype.update = (function () {
  64001. var e = new n.Vector3(),
  64002. t = new n.Vector3(),
  64003. i = new n.Vector3()
  64004. return function () {
  64005. e.setFromMatrixPosition(this.light.matrixWorld),
  64006. t.setFromMatrixPosition(this.light.target.matrixWorld),
  64007. i.subVectors(t, e),
  64008. this.lightPlane.lookAt(i),
  64009. this.lightPlane.material.color
  64010. .copy(this.light.color)
  64011. .multiplyScalar(this.light.intensity),
  64012. this.targetLine.geometry.vertices[1].copy(i),
  64013. (this.targetLine.geometry.verticesNeedUpdate = !0),
  64014. this.targetLine.material.color.copy(this.lightPlane.material.color)
  64015. }
  64016. })()),
  64017. (n.EdgesHelper = function (e, t, i) {
  64018. var r = void 0 !== t ? t : 16777215
  64019. n.LineSegments.call(
  64020. this,
  64021. new n.EdgesGeometry(e.geometry, i),
  64022. new n.LineBasicMaterial({
  64023. color: r
  64024. })
  64025. ),
  64026. (this.matrix = e.matrixWorld),
  64027. (this.matrixAutoUpdate = !1)
  64028. }),
  64029. (n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype)),
  64030. (n.EdgesHelper.prototype.constructor = n.EdgesHelper),
  64031. (n.FaceNormalsHelper = function (e, t, i, r) {
  64032. ;(this.object = e), (this.size = void 0 !== t ? t : 1)
  64033. var o = void 0 !== i ? i : 16776960,
  64034. a = void 0 !== r ? r : 1,
  64035. s = 0,
  64036. l = this.object.geometry
  64037. l instanceof n.Geometry
  64038. ? (s = l.faces.length)
  64039. : console.warn(
  64040. 'THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.'
  64041. )
  64042. var c = new n.BufferGeometry(),
  64043. h = new n.Float32Attribute(2 * s * 3, 3)
  64044. c.addAttribute('position', h),
  64045. n.LineSegments.call(
  64046. this,
  64047. c,
  64048. new n.LineBasicMaterial({
  64049. color: o,
  64050. linewidth: a
  64051. })
  64052. ),
  64053. (this.matrixAutoUpdate = !1),
  64054. this.update()
  64055. }),
  64056. (n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype)),
  64057. (n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper),
  64058. (n.FaceNormalsHelper.prototype.update = (function () {
  64059. var e = new n.Vector3(),
  64060. t = new n.Vector3(),
  64061. i = new n.Matrix3()
  64062. return function () {
  64063. this.object.updateMatrixWorld(!0), i.getNormalMatrix(this.object.matrixWorld)
  64064. for (
  64065. var n = this.object.matrixWorld,
  64066. r = this.geometry.attributes.position,
  64067. o = this.object.geometry,
  64068. a = o.vertices,
  64069. s = o.faces,
  64070. l = 0,
  64071. c = 0,
  64072. h = s.length;
  64073. c < h;
  64074. c++
  64075. ) {
  64076. var u = s[c],
  64077. d = u.normal
  64078. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  64079. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  64080. r.setXYZ(l, e.x, e.y, e.z),
  64081. (l += 1),
  64082. r.setXYZ(l, t.x, t.y, t.z),
  64083. (l += 1)
  64084. }
  64085. return (r.needsUpdate = !0), this
  64086. }
  64087. })()),
  64088. (n.GridHelper = function (e, t) {
  64089. var i = new n.Geometry(),
  64090. r = new n.LineBasicMaterial({
  64091. vertexColors: n.VertexColors
  64092. })
  64093. ;(this.color1 = new n.Color(4473924)), (this.color2 = new n.Color(8947848))
  64094. for (var o = -e; o <= e; o += t) {
  64095. i.vertices.push(
  64096. new n.Vector3(-e, 0, o),
  64097. new n.Vector3(e, 0, o),
  64098. new n.Vector3(o, 0, -e),
  64099. new n.Vector3(o, 0, e)
  64100. )
  64101. var a = 0 === o ? this.color1 : this.color2
  64102. i.colors.push(a, a, a, a)
  64103. }
  64104. n.LineSegments.call(this, i, r)
  64105. }),
  64106. (n.GridHelper.prototype = Object.create(n.LineSegments.prototype)),
  64107. (n.GridHelper.prototype.constructor = n.GridHelper),
  64108. (n.GridHelper.prototype.setColors = function (e, t) {
  64109. this.color1.set(e), this.color2.set(t), (this.geometry.colorsNeedUpdate = !0)
  64110. }),
  64111. (n.HemisphereLightHelper = function (e, t) {
  64112. n.Object3D.call(this),
  64113. (this.light = e),
  64114. this.light.updateMatrixWorld(),
  64115. (this.matrix = e.matrixWorld),
  64116. (this.matrixAutoUpdate = !1),
  64117. (this.colors = [new n.Color(), new n.Color()])
  64118. var i = new n.SphereGeometry(t, 4, 2)
  64119. i.rotateX(-Math.PI / 2)
  64120. for (var r = 0, o = 8; r < o; r++) i.faces[r].color = this.colors[r < 4 ? 0 : 1]
  64121. var a = new n.MeshBasicMaterial({
  64122. vertexColors: n.FaceColors,
  64123. wireframe: !0
  64124. })
  64125. ;(this.lightSphere = new n.Mesh(i, a)), this.add(this.lightSphere), this.update()
  64126. }),
  64127. (n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype)),
  64128. (n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper),
  64129. (n.HemisphereLightHelper.prototype.dispose = function () {
  64130. this.lightSphere.geometry.dispose(), this.lightSphere.material.dispose()
  64131. }),
  64132. (n.HemisphereLightHelper.prototype.update = (function () {
  64133. var e = new n.Vector3()
  64134. return function () {
  64135. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  64136. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  64137. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  64138. (this.lightSphere.geometry.colorsNeedUpdate = !0)
  64139. }
  64140. })()),
  64141. (n.PointLightHelper = function (e, t) {
  64142. ;(this.light = e), this.light.updateMatrixWorld()
  64143. var i = new n.SphereGeometry(t, 4, 2),
  64144. r = new n.MeshBasicMaterial({
  64145. wireframe: !0,
  64146. fog: !1
  64147. })
  64148. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  64149. n.Mesh.call(this, i, r),
  64150. (this.matrix = this.light.matrixWorld),
  64151. (this.matrixAutoUpdate = !1)
  64152. }),
  64153. (n.PointLightHelper.prototype = Object.create(n.Mesh.prototype)),
  64154. (n.PointLightHelper.prototype.constructor = n.PointLightHelper),
  64155. (n.PointLightHelper.prototype.dispose = function () {
  64156. this.geometry.dispose(), this.material.dispose()
  64157. }),
  64158. (n.PointLightHelper.prototype.update = function () {
  64159. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  64160. }),
  64161. (n.SkeletonHelper = function (e) {
  64162. this.bones = this.getBoneList(e)
  64163. for (var t = new n.Geometry(), i = 0; i < this.bones.length; i++) {
  64164. var r = this.bones[i]
  64165. r.parent instanceof n.Bone &&
  64166. (t.vertices.push(new n.Vector3()),
  64167. t.vertices.push(new n.Vector3()),
  64168. t.colors.push(new n.Color(0, 0, 1)),
  64169. t.colors.push(new n.Color(0, 1, 0)))
  64170. }
  64171. t.dynamic = !0
  64172. var o = new n.LineBasicMaterial({
  64173. vertexColors: n.VertexColors,
  64174. depthTest: !1,
  64175. depthWrite: !1,
  64176. transparent: !0
  64177. })
  64178. n.LineSegments.call(this, t, o),
  64179. (this.root = e),
  64180. (this.matrix = e.matrixWorld),
  64181. (this.matrixAutoUpdate = !1),
  64182. this.update()
  64183. }),
  64184. (n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype)),
  64185. (n.SkeletonHelper.prototype.constructor = n.SkeletonHelper),
  64186. (n.SkeletonHelper.prototype.getBoneList = function (e) {
  64187. var t = []
  64188. e instanceof n.Bone && t.push(e)
  64189. for (var i = 0; i < e.children.length; i++)
  64190. t.push.apply(t, this.getBoneList(e.children[i]))
  64191. return t
  64192. }),
  64193. (n.SkeletonHelper.prototype.update = function () {
  64194. for (
  64195. var e = this.geometry,
  64196. t = new n.Matrix4().getInverse(this.root.matrixWorld),
  64197. i = new n.Matrix4(),
  64198. r = 0,
  64199. o = 0;
  64200. o < this.bones.length;
  64201. o++
  64202. ) {
  64203. var a = this.bones[o]
  64204. a.parent instanceof n.Bone &&
  64205. (i.multiplyMatrices(t, a.matrixWorld),
  64206. e.vertices[r].setFromMatrixPosition(i),
  64207. i.multiplyMatrices(t, a.parent.matrixWorld),
  64208. e.vertices[r + 1].setFromMatrixPosition(i),
  64209. (r += 2))
  64210. }
  64211. ;(e.verticesNeedUpdate = !0), e.computeBoundingSphere()
  64212. }),
  64213. (n.SpotLightHelper = function (e) {
  64214. n.Object3D.call(this),
  64215. (this.light = e),
  64216. this.light.updateMatrixWorld(),
  64217. (this.matrix = e.matrixWorld),
  64218. (this.matrixAutoUpdate = !1)
  64219. var t = new n.CylinderGeometry(0, 1, 1, 8, 1, !0)
  64220. t.translate(0, -0.5, 0), t.rotateX(-Math.PI / 2)
  64221. var i = new n.MeshBasicMaterial({
  64222. wireframe: !0,
  64223. fog: !1
  64224. })
  64225. ;(this.cone = new n.Mesh(t, i)), this.add(this.cone), this.update()
  64226. }),
  64227. (n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype)),
  64228. (n.SpotLightHelper.prototype.constructor = n.SpotLightHelper),
  64229. (n.SpotLightHelper.prototype.dispose = function () {
  64230. this.cone.geometry.dispose(), this.cone.material.dispose()
  64231. }),
  64232. (n.SpotLightHelper.prototype.update = (function () {
  64233. var e = new n.Vector3(),
  64234. t = new n.Vector3()
  64235. return function () {
  64236. var i = this.light.distance ? this.light.distance : 1e4,
  64237. n = i * Math.tan(this.light.angle)
  64238. this.cone.scale.set(n, n, i),
  64239. e.setFromMatrixPosition(this.light.matrixWorld),
  64240. t.setFromMatrixPosition(this.light.target.matrixWorld),
  64241. this.cone.lookAt(t.sub(e)),
  64242. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  64243. }
  64244. })()),
  64245. (n.VertexNormalsHelper = function (e, t, i, r) {
  64246. ;(this.object = e), (this.size = void 0 !== t ? t : 1)
  64247. var o = void 0 !== i ? i : 16711680,
  64248. a = void 0 !== r ? r : 1,
  64249. s = 0,
  64250. l = this.object.geometry
  64251. l instanceof n.Geometry
  64252. ? (s = 3 * l.faces.length)
  64253. : l instanceof n.BufferGeometry && (s = l.attributes.normal.count)
  64254. var c = new n.BufferGeometry(),
  64255. h = new n.Float32Attribute(2 * s * 3, 3)
  64256. c.addAttribute('position', h),
  64257. n.LineSegments.call(
  64258. this,
  64259. c,
  64260. new n.LineBasicMaterial({
  64261. color: o,
  64262. linewidth: a
  64263. })
  64264. ),
  64265. (this.matrixAutoUpdate = !1),
  64266. this.update()
  64267. }),
  64268. (n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype)),
  64269. (n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper),
  64270. (n.VertexNormalsHelper.prototype.update = (function () {
  64271. var e = new n.Vector3(),
  64272. t = new n.Vector3(),
  64273. i = new n.Matrix3()
  64274. return function () {
  64275. var r = ['a', 'b', 'c']
  64276. this.object.updateMatrixWorld(!0), i.getNormalMatrix(this.object.matrixWorld)
  64277. var o = this.object.matrixWorld,
  64278. a = this.geometry.attributes.position,
  64279. s = this.object.geometry
  64280. if (s instanceof n.Geometry)
  64281. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  64282. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  64283. var m = l[p[r[f]]],
  64284. v = p.vertexNormals[f]
  64285. e.copy(m).applyMatrix4(o),
  64286. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  64287. a.setXYZ(h, e.x, e.y, e.z),
  64288. (h += 1),
  64289. a.setXYZ(h, t.x, t.y, t.z),
  64290. (h += 1)
  64291. }
  64292. else if (s instanceof n.BufferGeometry)
  64293. for (
  64294. var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count;
  64295. f < g;
  64296. f++
  64297. )
  64298. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  64299. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  64300. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  64301. a.setXYZ(h, e.x, e.y, e.z),
  64302. (h += 1),
  64303. a.setXYZ(h, t.x, t.y, t.z),
  64304. (h += 1)
  64305. return (a.needsUpdate = !0), this
  64306. }
  64307. })()),
  64308. (n.WireframeHelper = function (e, t) {
  64309. var i = void 0 !== t ? t : 16777215
  64310. n.LineSegments.call(
  64311. this,
  64312. new n.WireframeGeometry(e.geometry),
  64313. new n.LineBasicMaterial({
  64314. color: i
  64315. })
  64316. ),
  64317. (this.matrix = e.matrixWorld),
  64318. (this.matrixAutoUpdate = !1)
  64319. }),
  64320. (n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype)),
  64321. (n.WireframeHelper.prototype.constructor = n.WireframeHelper),
  64322. (n.ImmediateRenderObject = function (e) {
  64323. n.Object3D.call(this), (this.material = e), (this.render = function (e) {})
  64324. }),
  64325. (n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype)),
  64326. (n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject),
  64327. (n.MorphBlendMesh = function (e, t) {
  64328. n.Mesh.call(this, e, t), (this.animationsMap = {}), (this.animationsList = [])
  64329. var i = this.geometry.morphTargets.length,
  64330. r = '__default',
  64331. o = 0,
  64332. a = i - 1,
  64333. s = i / 1
  64334. this.createAnimation(r, o, a, s), this.setAnimationWeight(r, 1)
  64335. }),
  64336. (n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype)),
  64337. (n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh),
  64338. (n.MorphBlendMesh.prototype.createAnimation = function (e, t, i, n) {
  64339. var r = {
  64340. start: t,
  64341. end: i,
  64342. length: i - t + 1,
  64343. fps: n,
  64344. duration: (i - t) / n,
  64345. lastFrame: 0,
  64346. currentFrame: 0,
  64347. active: !1,
  64348. time: 0,
  64349. direction: 1,
  64350. weight: 1,
  64351. directionBackwards: !1,
  64352. mirroredLoop: !1
  64353. }
  64354. ;(this.animationsMap[e] = r), this.animationsList.push(r)
  64355. }),
  64356. (n.MorphBlendMesh.prototype.autoCreateAnimations = function (e) {
  64357. for (
  64358. var t,
  64359. i = /([a-z]+)_?(\d+)/i,
  64360. n = {},
  64361. r = this.geometry,
  64362. o = 0,
  64363. a = r.morphTargets.length;
  64364. o < a;
  64365. o++
  64366. ) {
  64367. var s = r.morphTargets[o],
  64368. l = s.name.match(i)
  64369. if (l && l.length > 1) {
  64370. var c = l[1]
  64371. n[c] ||
  64372. (n[c] = {
  64373. start: 1 / 0,
  64374. end: -(1 / 0)
  64375. })
  64376. var h = n[c]
  64377. o < h.start && (h.start = o), o > h.end && (h.end = o), t || (t = c)
  64378. }
  64379. }
  64380. for (var c in n) {
  64381. var h = n[c]
  64382. this.createAnimation(c, h.start, h.end, e)
  64383. }
  64384. this.firstAnimation = t
  64385. }),
  64386. (n.MorphBlendMesh.prototype.setAnimationDirectionForward = function (e) {
  64387. var t = this.animationsMap[e]
  64388. t && ((t.direction = 1), (t.directionBackwards = !1))
  64389. }),
  64390. (n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function (e) {
  64391. var t = this.animationsMap[e]
  64392. t && ((t.direction = -1), (t.directionBackwards = !0))
  64393. }),
  64394. (n.MorphBlendMesh.prototype.setAnimationFPS = function (e, t) {
  64395. var i = this.animationsMap[e]
  64396. i && ((i.fps = t), (i.duration = (i.end - i.start) / i.fps))
  64397. }),
  64398. (n.MorphBlendMesh.prototype.setAnimationDuration = function (e, t) {
  64399. var i = this.animationsMap[e]
  64400. i && ((i.duration = t), (i.fps = (i.end - i.start) / i.duration))
  64401. }),
  64402. (n.MorphBlendMesh.prototype.setAnimationWeight = function (e, t) {
  64403. var i = this.animationsMap[e]
  64404. i && (i.weight = t)
  64405. }),
  64406. (n.MorphBlendMesh.prototype.setAnimationTime = function (e, t) {
  64407. var i = this.animationsMap[e]
  64408. i && (i.time = t)
  64409. }),
  64410. (n.MorphBlendMesh.prototype.getAnimationTime = function (e) {
  64411. var t = 0,
  64412. i = this.animationsMap[e]
  64413. return i && (t = i.time), t
  64414. }),
  64415. (n.MorphBlendMesh.prototype.getAnimationDuration = function (e) {
  64416. var t = -1,
  64417. i = this.animationsMap[e]
  64418. return i && (t = i.duration), t
  64419. }),
  64420. (n.MorphBlendMesh.prototype.playAnimation = function (e) {
  64421. var t = this.animationsMap[e]
  64422. t
  64423. ? ((t.time = 0), (t.active = !0))
  64424. : console.warn(
  64425. 'THREE.MorphBlendMesh: animation[' + e + '] undefined in .playAnimation()'
  64426. )
  64427. }),
  64428. (n.MorphBlendMesh.prototype.stopAnimation = function (e) {
  64429. var t = this.animationsMap[e]
  64430. t && (t.active = !1)
  64431. }),
  64432. (n.MorphBlendMesh.prototype.update = function (e) {
  64433. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  64434. var r = this.animationsList[t]
  64435. if (r.active) {
  64436. var o = r.duration / r.length
  64437. ;(r.time += r.direction * e),
  64438. r.mirroredLoop
  64439. ? (r.time > r.duration || r.time < 0) &&
  64440. ((r.direction *= -1),
  64441. r.time > r.duration && ((r.time = r.duration), (r.directionBackwards = !0)),
  64442. r.time < 0 && ((r.time = 0), (r.directionBackwards = !1)))
  64443. : ((r.time = r.time % r.duration), r.time < 0 && (r.time += r.duration))
  64444. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1),
  64445. s = r.weight
  64446. a !== r.currentFrame &&
  64447. ((this.morphTargetInfluences[r.lastFrame] = 0),
  64448. (this.morphTargetInfluences[r.currentFrame] = 1 * s),
  64449. (this.morphTargetInfluences[a] = 0),
  64450. (r.lastFrame = r.currentFrame),
  64451. (r.currentFrame = a))
  64452. var l = (r.time % o) / o
  64453. r.directionBackwards && (l = 1 - l),
  64454. r.currentFrame !== r.lastFrame
  64455. ? ((this.morphTargetInfluences[r.currentFrame] = l * s),
  64456. (this.morphTargetInfluences[r.lastFrame] = (1 - l) * s))
  64457. : (this.morphTargetInfluences[r.currentFrame] = s)
  64458. }
  64459. }
  64460. }),
  64461. 'undefined' != typeof i
  64462. ? ('undefined' != typeof t && t.exports && (i = t.exports = n), (i.THREE = n))
  64463. : (this.THREE = n)
  64464. window.THREE = n
  64465. getObjLoader()
  64466. initByTHREE(THREE)
  64467. //getWebXRManager()
  64468. },
  64469. {}
  64470. ]
  64471. },
  64472. {},
  64473. [116]
  64474. )
  64475. /*
  64476. function getWebXRManager(){
  64477. class ArrayCamera extends THREE.PerspectiveCamera {
  64478. constructor(array = []) {
  64479. super();
  64480. this.isArrayCamera = true;
  64481. this.cameras = array;
  64482. }
  64483. }
  64484. function WebGLAnimation() {
  64485. let context = null;
  64486. let isAnimating = false;
  64487. let animationLoop = null;
  64488. let requestId = null;
  64489. function onAnimationFrame(time, frame) {
  64490. animationLoop(time, frame);
  64491. requestId = context.requestAnimationFrame(onAnimationFrame);
  64492. }
  64493. return {
  64494. start: function () {
  64495. if (isAnimating === true) return;
  64496. if (animationLoop === null) return;
  64497. requestId = context.requestAnimationFrame(onAnimationFrame);
  64498. isAnimating = true;
  64499. },
  64500. stop: function () {
  64501. context.cancelAnimationFrame(requestId);
  64502. isAnimating = false;
  64503. },
  64504. setAnimationLoop: function (callback) {
  64505. animationLoop = callback;
  64506. },
  64507. setContext: function (value) {
  64508. context = value;
  64509. }
  64510. };
  64511. }
  64512. function WebXRManager( renderer, gl ) {
  64513. var scope = this;
  64514. var session = null;
  64515. // var framebufferScaleFactor = 1.0;
  64516. var referenceSpace = null;
  64517. var referenceSpaceType = 'local-floor';
  64518. var pose = null;
  64519. var controllers = [];
  64520. var sortedInputSources = [];
  64521. function isPresenting() {
  64522. return session !== null && referenceSpace !== null;
  64523. }
  64524. //
  64525. var cameraL = new THREE.PerspectiveCamera();
  64526. cameraL.layers.enable( 1 );
  64527. cameraL.viewport = new THREE.Vector4();
  64528. var cameraR = new THREE.PerspectiveCamera();
  64529. cameraR.layers.enable( 2 );
  64530. cameraR.viewport = new THREE.Vector4();
  64531. var cameraVR = new ArrayCamera( [ cameraL, cameraR ] );
  64532. cameraVR.layers.enable( 1 );
  64533. cameraVR.layers.enable( 2 );
  64534. //
  64535. this.enabled = false;
  64536. this.getController = function ( id ) {
  64537. var controller = controllers[ id ];
  64538. if ( controller === undefined ) {
  64539. controller = new THREE.Group();
  64540. controller.matrixAutoUpdate = false;
  64541. controller.visible = false;
  64542. controllers[ id ] = controller;
  64543. }
  64544. return controller;
  64545. };
  64546. //
  64547. function onSessionEvent( event ) {
  64548. for ( var i = 0; i < controllers.length; i ++ ) {
  64549. if ( sortedInputSources[ i ] === event.inputSource ) {
  64550. controllers[ i ].dispatchEvent( { type: event.type } );
  64551. }
  64552. }
  64553. }
  64554. function onSessionEnd() {
  64555. renderer.setFramebuffer( null );
  64556. renderer.setRenderTarget( renderer.getRenderTarget() ); // Hack #15830
  64557. animation.stop();
  64558. scope.dispatchEvent( { type: 'sessionend' } );
  64559. }
  64560. function onRequestReferenceSpace( value ) {
  64561. referenceSpace = value;
  64562. animation.setContext( session );
  64563. animation.start();
  64564. scope.dispatchEvent( { type: 'sessionstart' } );
  64565. }
  64566. this.setFramebufferScaleFactor = function ( ) {
  64567. // framebufferScaleFactor = value;
  64568. };
  64569. this.setReferenceSpaceType = function ( value ) {
  64570. referenceSpaceType = value;
  64571. };
  64572. this.getSession = function () {
  64573. return session;
  64574. };
  64575. this.setSession = function ( value ) {
  64576. session = value;
  64577. if ( session !== null ) {
  64578. session.addEventListener( 'select', onSessionEvent );
  64579. session.addEventListener( 'selectstart', onSessionEvent );
  64580. session.addEventListener( 'selectend', onSessionEvent );
  64581. session.addEventListener( 'end', onSessionEnd );
  64582. // eslint-disable-next-line no-undef
  64583. session.updateRenderState( { baseLayer: new XRWebGLLayer( session, gl, { antialias: false } ) } );
  64584. session.requestReferenceSpace( referenceSpaceType ).then( onRequestReferenceSpace );
  64585. //
  64586. session.addEventListener( 'inputsourceschange', updateInputSources );
  64587. updateInputSources();
  64588. }
  64589. };
  64590. function updateInputSources() {
  64591. for ( var i = 0; i < controllers.length; i ++ ) {
  64592. sortedInputSources[ i ] = findInputSource( i );
  64593. }
  64594. }
  64595. function findInputSource( id ) {
  64596. var inputSources = session.inputSources;
  64597. for ( var i = 0; i < inputSources.length; i ++ ) {
  64598. var inputSource = inputSources[ i ];
  64599. var handedness = inputSource.handedness;
  64600. if ( id === 0 && ( handedness === 'none' || handedness === 'right' ) ) return inputSource;
  64601. if ( id === 1 && ( handedness === 'left' ) ) return inputSource;
  64602. }
  64603. }
  64604. //
  64605. function updateCamera( camera, parent ) {
  64606. if ( parent === null ) {
  64607. camera.matrixWorld.copy( camera.matrix );
  64608. } else {
  64609. camera.matrixWorld.multiplyMatrices( parent.matrixWorld, camera.matrix );
  64610. }
  64611. camera.matrixWorldInverse.getInverse( camera.matrixWorld );
  64612. }
  64613. this.getCamera = function ( camera ) {
  64614. if ( isPresenting() ) {
  64615. var parent = camera.parent;
  64616. var cameras = cameraVR.cameras;
  64617. updateCamera( cameraVR, parent );
  64618. for ( var i = 0; i < cameras.length; i ++ ) {
  64619. updateCamera( cameras[ i ], parent );
  64620. }
  64621. // update camera and its children
  64622. camera.matrixWorld.copy( cameraVR.matrixWorld );
  64623. var children = camera.children;
  64624. for ( var i = 0, l = children.length; i < l; i ++ ) {
  64625. children[ i ].updateMatrixWorld( true );
  64626. }
  64627. setProjectionFromUnion( cameraVR, cameraL, cameraR );
  64628. return cameraVR;
  64629. }
  64630. return camera;
  64631. };
  64632. this.isPresenting = isPresenting;
  64633. // Animation Loop
  64634. var onAnimationFrameCallback = null;
  64635. function onAnimationFrame( time, frame ) {
  64636. pose = frame.getViewerPose( referenceSpace );
  64637. if ( pose !== null ) {
  64638. var views = pose.views;
  64639. var baseLayer = session.renderState.baseLayer;
  64640. renderer.setFramebuffer( baseLayer.framebuffer );
  64641. for ( var i = 0; i < views.length; i ++ ) {
  64642. var view = views[ i ];
  64643. var viewport = baseLayer.getViewport( view );
  64644. var viewMatrix = view.transform.inverse.matrix;
  64645. var camera = cameraVR.cameras[ i ];
  64646. camera.matrix.fromArray( viewMatrix ).getInverse( camera.matrix );
  64647. camera.projectionMatrix.fromArray( view.projectionMatrix );
  64648. camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );
  64649. if ( i === 0 ) {
  64650. cameraVR.matrix.copy( camera.matrix );
  64651. }
  64652. }
  64653. }
  64654. //
  64655. for ( var i = 0; i < controllers.length; i ++ ) {
  64656. var controller = controllers[ i ];
  64657. var inputSource = sortedInputSources[ i ];
  64658. if ( inputSource ) {
  64659. var inputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );
  64660. if ( inputPose !== null ) {
  64661. controller.matrix.fromArray( inputPose.transform.matrix );
  64662. controller.matrix.decompose( controller.position, controller.rotation, controller.scale );
  64663. controller.visible = true;
  64664. continue;
  64665. }
  64666. }
  64667. controller.visible = false;
  64668. }
  64669. if ( onAnimationFrameCallback ) onAnimationFrameCallback( time );
  64670. }
  64671. var animation = new WebGLAnimation();
  64672. animation.setAnimationLoop( onAnimationFrame );
  64673. this.setAnimationLoop = function ( callback ) {
  64674. onAnimationFrameCallback = callback;
  64675. };
  64676. this.dispose = function () {};
  64677. // DEPRECATED
  64678. this.getStandingMatrix = function () {
  64679. console.warn( 'THREE.WebXRManager: getStandingMatrix() is no longer needed.' );
  64680. return new THREE.Matrix4();
  64681. };
  64682. this.getDevice = function () {
  64683. console.warn( 'THREE.WebXRManager: getDevice() has been deprecated.' );
  64684. };
  64685. this.setDevice = function () {
  64686. console.warn( 'THREE.WebXRManager: setDevice() has been deprecated.' );
  64687. };
  64688. this.setFrameOfReferenceType = function () {
  64689. console.warn( 'THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.' );
  64690. };
  64691. this.submitFrame = function () {};
  64692. }
  64693. Object.assign( WebXRManager.prototype, THREE.EventDispatcher.prototype );
  64694. THREE.WebXRManager = WebXRManager
  64695. }
  64696. function getWebXRManager(){
  64697. class ArrayCamera extends THREE.PerspectiveCamera {
  64698. constructor(array = []) {
  64699. super();
  64700. this.isArrayCamera = true;
  64701. this.cameras = array;
  64702. }
  64703. }
  64704. class WebXRController {
  64705. constructor() {
  64706. this._targetRay = null;
  64707. this._grip = null;
  64708. this._hand = null;
  64709. }
  64710. getHandSpace() {
  64711. if (this._hand === null) {
  64712. this._hand = new THREE.Group();
  64713. this._hand.matrixAutoUpdate = false;
  64714. this._hand.visible = false;
  64715. this._hand.joints = {};
  64716. this._hand.inputState = {
  64717. pinching: false
  64718. };
  64719. }
  64720. return this._hand;
  64721. }
  64722. getTargetRaySpace() {
  64723. if (this._targetRay === null) {
  64724. this._targetRay = new THREE.Group();
  64725. this._targetRay.matrixAutoUpdate = false;
  64726. this._targetRay.visible = false;
  64727. this._targetRay.hasLinearVelocity = false;
  64728. this._targetRay.linearVelocity = new THREE.Vector3();
  64729. this._targetRay.hasAngularVelocity = false;
  64730. this._targetRay.angularVelocity = new THREE.Vector3();
  64731. }
  64732. return this._targetRay;
  64733. }
  64734. getGripSpace() {
  64735. if (this._grip === null) {
  64736. this._grip = new THREE.Group();
  64737. this._grip.matrixAutoUpdate = false;
  64738. this._grip.visible = false;
  64739. this._grip.hasLinearVelocity = false;
  64740. this._grip.linearVelocity = new THREE.Vector3();
  64741. this._grip.hasAngularVelocity = false;
  64742. this._grip.angularVelocity = new THREE.Vector3();
  64743. }
  64744. return this._grip;
  64745. }
  64746. dispatchEvent(event) {
  64747. if (this._targetRay !== null) {
  64748. this._targetRay.dispatchEvent(event);
  64749. }
  64750. if (this._grip !== null) {
  64751. this._grip.dispatchEvent(event);
  64752. }
  64753. if (this._hand !== null) {
  64754. this._hand.dispatchEvent(event);
  64755. }
  64756. return this;
  64757. }
  64758. disconnect(inputSource) {
  64759. this.dispatchEvent({
  64760. type: 'disconnected',
  64761. data: inputSource
  64762. });
  64763. if (this._targetRay !== null) {
  64764. this._targetRay.visible = false;
  64765. }
  64766. if (this._grip !== null) {
  64767. this._grip.visible = false;
  64768. }
  64769. if (this._hand !== null) {
  64770. this._hand.visible = false;
  64771. }
  64772. return this;
  64773. }
  64774. update(inputSource, frame, referenceSpace) {
  64775. let inputPose = null;
  64776. let gripPose = null;
  64777. let handPose = null;
  64778. const targetRay = this._targetRay;
  64779. const grip = this._grip;
  64780. const hand = this._hand;
  64781. if (inputSource && frame.session.visibilityState !== 'visible-blurred') {
  64782. if (hand && inputSource.hand) {
  64783. handPose = true;
  64784. for (const inputjoint of inputSource.hand.values()) {
  64785. // Update the joints groups with the XRJoint poses
  64786. const jointPose = frame.getJointPose(inputjoint, referenceSpace);
  64787. if (hand.joints[inputjoint.jointName] === undefined) {
  64788. // The transform of this joint will be updated with the joint pose on each frame
  64789. const joint = new THREE.Group();
  64790. joint.matrixAutoUpdate = false;
  64791. joint.visible = false;
  64792. hand.joints[inputjoint.jointName] = joint; // ??
  64793. hand.add(joint);
  64794. }
  64795. const joint = hand.joints[inputjoint.jointName];
  64796. if (jointPose !== null) {
  64797. joint.matrix.fromArray(jointPose.transform.matrix);
  64798. joint.matrix.decompose(joint.position, joint.rotation, joint.scale);
  64799. joint.jointRadius = jointPose.radius;
  64800. }
  64801. joint.visible = jointPose !== null;
  64802. } // Custom events
  64803. // Check pinchz
  64804. const indexTip = hand.joints['index-finger-tip'];
  64805. const thumbTip = hand.joints['thumb-tip'];
  64806. const distance = indexTip.position.distanceTo(thumbTip.position);
  64807. const distanceToPinch = 0.02;
  64808. const threshold = 0.005;
  64809. if (hand.inputState.pinching && distance > distanceToPinch + threshold) {
  64810. hand.inputState.pinching = false;
  64811. this.dispatchEvent({
  64812. type: 'pinchend',
  64813. handedness: inputSource.handedness,
  64814. target: this
  64815. });
  64816. } else if (!hand.inputState.pinching && distance <= distanceToPinch - threshold) {
  64817. hand.inputState.pinching = true;
  64818. this.dispatchEvent({
  64819. type: 'pinchstart',
  64820. handedness: inputSource.handedness,
  64821. target: this
  64822. });
  64823. }
  64824. } else {
  64825. if (grip !== null && inputSource.gripSpace) {
  64826. gripPose = frame.getPose(inputSource.gripSpace, referenceSpace);
  64827. if (gripPose !== null) {
  64828. grip.matrix.fromArray(gripPose.transform.matrix);
  64829. grip.matrix.decompose(grip.position, grip.rotation, grip.scale);
  64830. if (gripPose.linearVelocity) {
  64831. grip.hasLinearVelocity = true;
  64832. grip.linearVelocity.copy(gripPose.linearVelocity);
  64833. } else {
  64834. grip.hasLinearVelocity = false;
  64835. }
  64836. if (gripPose.angularVelocity) {
  64837. grip.hasAngularVelocity = true;
  64838. grip.angularVelocity.copy(gripPose.angularVelocity);
  64839. } else {
  64840. grip.hasAngularVelocity = false;
  64841. }
  64842. }
  64843. }
  64844. }
  64845. if (targetRay !== null) {
  64846. inputPose = frame.getPose(inputSource.targetRaySpace, referenceSpace); // Some runtimes (namely Vive Cosmos with Vive OpenXR Runtime) have only grip space and ray space is equal to it
  64847. if (inputPose === null && gripPose !== null) {
  64848. inputPose = gripPose;
  64849. }
  64850. if (inputPose !== null) {
  64851. targetRay.matrix.fromArray(inputPose.transform.matrix);
  64852. targetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale);
  64853. if (inputPose.linearVelocity) {
  64854. targetRay.hasLinearVelocity = true;
  64855. targetRay.linearVelocity.copy(inputPose.linearVelocity);
  64856. } else {
  64857. targetRay.hasLinearVelocity = false;
  64858. }
  64859. if (inputPose.angularVelocity) {
  64860. targetRay.hasAngularVelocity = true;
  64861. targetRay.angularVelocity.copy(inputPose.angularVelocity);
  64862. } else {
  64863. targetRay.hasAngularVelocity = false;
  64864. }
  64865. this.dispatchEvent(_moveEvent);
  64866. }
  64867. }
  64868. }
  64869. if (targetRay !== null) {
  64870. targetRay.visible = inputPose !== null;
  64871. }
  64872. if (grip !== null) {
  64873. grip.visible = gripPose !== null;
  64874. }
  64875. if (hand !== null) {
  64876. hand.visible = handPose !== null;
  64877. }
  64878. return this;
  64879. }
  64880. }
  64881. function WebGLAnimation() {
  64882. let context = null;
  64883. let isAnimating = false;
  64884. let animationLoop = null;
  64885. let requestId = null;
  64886. function onAnimationFrame(time, frame) {
  64887. animationLoop(time, frame);
  64888. requestId = context.requestAnimationFrame(onAnimationFrame);
  64889. }
  64890. return {
  64891. start: function () {
  64892. if (isAnimating === true) return;
  64893. if (animationLoop === null) return;
  64894. requestId = context.requestAnimationFrame(onAnimationFrame);
  64895. isAnimating = true;
  64896. },
  64897. stop: function () {
  64898. context.cancelAnimationFrame(requestId);
  64899. isAnimating = false;
  64900. },
  64901. setAnimationLoop: function (callback) {
  64902. animationLoop = callback;
  64903. },
  64904. setContext: function (value) {
  64905. context = value;
  64906. }
  64907. };
  64908. }
  64909. class WebXRManager extends THREE.EventDispatcher {
  64910. constructor(renderer, gl) {
  64911. super();
  64912. const scope = this;
  64913. let session = null;
  64914. let framebufferScaleFactor = 1.0;
  64915. let referenceSpace = null;
  64916. let referenceSpaceType = 'local-floor';
  64917. let customReferenceSpace = null;
  64918. let pose = null;
  64919. let glBinding = null;
  64920. let glProjLayer = null;
  64921. let glBaseLayer = null;
  64922. let xrFrame = null;
  64923. const attributes = gl.getContextAttributes();
  64924. let initialRenderTarget = null;
  64925. let newRenderTarget = null;
  64926. const controllers = [];
  64927. const controllerInputSources = []; //
  64928. const cameraL = new THREE.PerspectiveCamera();
  64929. cameraL.layers.enable(1);
  64930. cameraL.viewport = new THREE.Vector4();
  64931. const cameraR = new THREE.PerspectiveCamera();
  64932. cameraR.layers.enable(2);
  64933. cameraR.viewport = new THREE.Vector4();
  64934. const cameras = [cameraL, cameraR];
  64935. const cameraVR = new ArrayCamera();
  64936. cameraVR.layers.enable(1);
  64937. cameraVR.layers.enable(2);
  64938. let _currentDepthNear = null;
  64939. let _currentDepthFar = null; //
  64940. this.cameraAutoUpdate = true;
  64941. this.enabled = false;
  64942. this.isPresenting = false;
  64943. this.getController = function (index) {
  64944. let controller = controllers[index];
  64945. if (controller === undefined) {
  64946. controller = new WebXRController();
  64947. controllers[index] = controller;
  64948. }
  64949. return controller.getTargetRaySpace();
  64950. };
  64951. this.getControllerGrip = function (index) {
  64952. let controller = controllers[index];
  64953. if (controller === undefined) {
  64954. controller = new WebXRController();
  64955. controllers[index] = controller;
  64956. }
  64957. return controller.getGripSpace();
  64958. };
  64959. this.getHand = function (index) {
  64960. let controller = controllers[index];
  64961. if (controller === undefined) {
  64962. controller = new WebXRController();
  64963. controllers[index] = controller;
  64964. }
  64965. return controller.getHandSpace();
  64966. }; //
  64967. function onSessionEvent(event) {
  64968. const controllerIndex = controllerInputSources.indexOf(event.inputSource);
  64969. if (controllerIndex === -1) {
  64970. return;
  64971. }
  64972. const controller = controllers[controllerIndex];
  64973. if (controller !== undefined) {
  64974. controller.dispatchEvent({
  64975. type: event.type,
  64976. data: event.inputSource
  64977. });
  64978. }
  64979. }
  64980. function onSessionEnd() {
  64981. session.removeEventListener('select', onSessionEvent);
  64982. session.removeEventListener('selectstart', onSessionEvent);
  64983. session.removeEventListener('selectend', onSessionEvent);
  64984. session.removeEventListener('squeeze', onSessionEvent);
  64985. session.removeEventListener('squeezestart', onSessionEvent);
  64986. session.removeEventListener('squeezeend', onSessionEvent);
  64987. session.removeEventListener('end', onSessionEnd);
  64988. session.removeEventListener('inputsourceschange', onInputSourcesChange);
  64989. for (let i = 0; i < controllers.length; i++) {
  64990. const inputSource = controllerInputSources[i];
  64991. if (inputSource === null) continue;
  64992. controllerInputSources[i] = null;
  64993. controllers[i].disconnect(inputSource);
  64994. }
  64995. _currentDepthNear = null;
  64996. _currentDepthFar = null; // restore framebuffer/rendering state
  64997. renderer.setRenderTarget(initialRenderTarget);
  64998. glBaseLayer = null;
  64999. glProjLayer = null;
  65000. glBinding = null;
  65001. session = null;
  65002. newRenderTarget = null; //
  65003. animation.stop();
  65004. scope.isPresenting = false;
  65005. scope.dispatchEvent({
  65006. type: 'sessionend'
  65007. });
  65008. }
  65009. this.setFramebufferScaleFactor = function (value) {
  65010. framebufferScaleFactor = value;
  65011. if (scope.isPresenting === true) {
  65012. console.warn('THREE.WebXRManager: Cannot change framebuffer scale while presenting.');
  65013. }
  65014. };
  65015. this.setReferenceSpaceType = function (value) {
  65016. referenceSpaceType = value;
  65017. if (scope.isPresenting === true) {
  65018. console.warn('THREE.WebXRManager: Cannot change reference space type while presenting.');
  65019. }
  65020. };
  65021. this.getReferenceSpace = function () {
  65022. return customReferenceSpace || referenceSpace;
  65023. };
  65024. this.setReferenceSpace = function (space) {
  65025. customReferenceSpace = space;
  65026. };
  65027. this.getBaseLayer = function () {
  65028. return glProjLayer !== null ? glProjLayer : glBaseLayer;
  65029. };
  65030. this.getBinding = function () {
  65031. return glBinding;
  65032. };
  65033. this.getFrame = function () {
  65034. return xrFrame;
  65035. };
  65036. this.getSession = function () {
  65037. return session;
  65038. };
  65039. this.setSession = async function (value) {
  65040. session = value;
  65041. if (session !== null) {
  65042. initialRenderTarget = renderer.getCurrentRenderTarget();
  65043. session.addEventListener('select', onSessionEvent);
  65044. session.addEventListener('selectstart', onSessionEvent);
  65045. session.addEventListener('selectend', onSessionEvent);
  65046. session.addEventListener('squeeze', onSessionEvent);
  65047. session.addEventListener('squeezestart', onSessionEvent);
  65048. session.addEventListener('squeezeend', onSessionEvent);
  65049. session.addEventListener('end', onSessionEnd);
  65050. session.addEventListener('inputsourceschange', onInputSourcesChange);
  65051. if (attributes.xrCompatible !== true) {
  65052. await gl.makeXRCompatible();
  65053. }
  65054. if (session.renderState.layers === undefined || renderer.capabilities.isWebGL2 === false) {
  65055. const layerInit = {
  65056. antialias: session.renderState.layers === undefined ? attributes.antialias : true,
  65057. alpha: attributes.alpha,
  65058. depth: attributes.depth,
  65059. stencil: attributes.stencil,
  65060. framebufferScaleFactor: framebufferScaleFactor
  65061. };
  65062. glBaseLayer = new XRWebGLLayer(session, gl, layerInit);
  65063. session.updateRenderState({
  65064. baseLayer: glBaseLayer
  65065. });
  65066. newRenderTarget = new THREE.WebGLRenderTarget(glBaseLayer.framebufferWidth, glBaseLayer.framebufferHeight, {
  65067. format: THREE.RGBAFormat,
  65068. type: THREE.UnsignedByteType,
  65069. encoding: renderer.outputEncoding
  65070. });
  65071. } else {
  65072. let depthFormat = null;
  65073. let depthType = null;
  65074. let glDepthFormat = null;
  65075. if (attributes.depth) {
  65076. glDepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24;
  65077. depthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat;
  65078. depthType = attributes.stencil ? UnsignedInt248Type : UnsignedIntType;
  65079. }
  65080. const projectionlayerInit = {
  65081. colorFormat: gl.RGBA8,
  65082. depthFormat: glDepthFormat,
  65083. scaleFactor: framebufferScaleFactor
  65084. };
  65085. glBinding = new XRWebGLBinding(session, gl);
  65086. glProjLayer = glBinding.createProjectionLayer(projectionlayerInit);
  65087. session.updateRenderState({
  65088. layers: [glProjLayer]
  65089. });
  65090. newRenderTarget = new THREE.WebGLRenderTarget(glProjLayer.textureWidth, glProjLayer.textureHeight, {
  65091. format: THREE.RGBAFormat,
  65092. type: THREE.UnsignedByteType,
  65093. depthTexture: new THREE.DepthTexture(glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat),
  65094. stencilBuffer: attributes.stencil,
  65095. encoding: renderer.outputEncoding,
  65096. samples: attributes.antialias ? 4 : 0
  65097. });
  65098. const renderTargetProperties = renderer.properties.get(newRenderTarget);
  65099. renderTargetProperties.__ignoreDepthValues = glProjLayer.ignoreDepthValues;
  65100. }
  65101. newRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278
  65102. // Set foveation to maximum.
  65103. this.setFoveation(1.0);
  65104. customReferenceSpace = null;
  65105. referenceSpace = await session.requestReferenceSpace(referenceSpaceType);
  65106. animation.setContext(session);
  65107. animation.start();
  65108. scope.isPresenting = true;
  65109. scope.dispatchEvent({
  65110. type: 'sessionstart'
  65111. });
  65112. }
  65113. };
  65114. function onInputSourcesChange(event) {
  65115. // Notify disconnected
  65116. for (let i = 0; i < event.removed.length; i++) {
  65117. const inputSource = event.removed[i];
  65118. const index = controllerInputSources.indexOf(inputSource);
  65119. if (index >= 0) {
  65120. controllerInputSources[index] = null;
  65121. controllers[index].dispatchEvent({
  65122. type: 'disconnected',
  65123. data: inputSource
  65124. });
  65125. }
  65126. } // Notify connected
  65127. for (let i = 0; i < event.added.length; i++) {
  65128. const inputSource = event.added[i];
  65129. let controllerIndex = controllerInputSources.indexOf(inputSource);
  65130. if (controllerIndex === -1) {
  65131. // Assign input source a controller that currently has no input source
  65132. for (let i = 0; i < controllers.length; i++) {
  65133. if (i >= controllerInputSources.length) {
  65134. controllerInputSources.push(inputSource);
  65135. controllerIndex = i;
  65136. break;
  65137. } else if (controllerInputSources[i] === null) {
  65138. controllerInputSources[i] = inputSource;
  65139. controllerIndex = i;
  65140. break;
  65141. }
  65142. } // If all controllers do currently receive input we ignore new ones
  65143. if (controllerIndex === -1) break;
  65144. }
  65145. const controller = controllers[controllerIndex];
  65146. if (controller) {
  65147. controller.dispatchEvent({
  65148. type: 'connected',
  65149. data: inputSource
  65150. });
  65151. }
  65152. }
  65153. } //
  65154. const cameraLPos = new THREE.Vector3();
  65155. const cameraRPos = new THREE.Vector3();
  65156. function setProjectionFromUnion(camera, cameraL, cameraR) {
  65157. cameraLPos.setFromMatrixPosition(cameraL.matrixWorld);
  65158. cameraRPos.setFromMatrixPosition(cameraR.matrixWorld);
  65159. const ipd = cameraLPos.distanceTo(cameraRPos);
  65160. const projL = cameraL.projectionMatrix.elements;
  65161. const projR = cameraR.projectionMatrix.elements; // VR systems will have identical far and near planes, and
  65162. // most likely identical top and bottom frustum extents.
  65163. // Use the left camera for these values.
  65164. const near = projL[14] / (projL[10] - 1);
  65165. const far = projL[14] / (projL[10] + 1);
  65166. const topFov = (projL[9] + 1) / projL[5];
  65167. const bottomFov = (projL[9] - 1) / projL[5];
  65168. const leftFov = (projL[8] - 1) / projL[0];
  65169. const rightFov = (projR[8] + 1) / projR[0];
  65170. const left = near * leftFov;
  65171. const right = near * rightFov; // Calculate the new camera's position offset from the
  65172. // left camera. xOffset should be roughly half `ipd`.
  65173. const zOffset = ipd / (-leftFov + rightFov);
  65174. const xOffset = zOffset * -leftFov; // TODO: Better way to apply this offset?
  65175. cameraL.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale);
  65176. camera.translateX(xOffset);
  65177. camera.translateZ(zOffset);
  65178. camera.matrixWorld.compose(camera.position, camera.quaternion, camera.scale);
  65179. camera.matrixWorldInverse.copy(camera.matrixWorld).invert(); // Find the union of the frustum values of the cameras and scale
  65180. // the values so that the near plane's position does not change in world space,
  65181. // although must now be relative to the new union camera.
  65182. const near2 = near + zOffset;
  65183. const far2 = far + zOffset;
  65184. const left2 = left - xOffset;
  65185. const right2 = right + (ipd - xOffset);
  65186. const top2 = topFov * far / far2 * near2;
  65187. const bottom2 = bottomFov * far / far2 * near2;
  65188. camera.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2);
  65189. }
  65190. function updateCamera(camera, parent) {
  65191. if (parent === null) {
  65192. camera.matrixWorld.copy(camera.matrix);
  65193. } else {
  65194. camera.matrixWorld.multiplyMatrices(parent.matrixWorld, camera.matrix);
  65195. }
  65196. camera.matrixWorldInverse.copy(camera.matrixWorld).invert();
  65197. }
  65198. this.updateCamera = function (camera) {
  65199. if (session === null) return;
  65200. cameraVR.near = cameraR.near = cameraL.near = camera.near;
  65201. cameraVR.far = cameraR.far = cameraL.far = camera.far;
  65202. if (_currentDepthNear !== cameraVR.near || _currentDepthFar !== cameraVR.far) {
  65203. // Note that the new renderState won't apply until the next frame. See #18320
  65204. session.updateRenderState({
  65205. depthNear: cameraVR.near,
  65206. depthFar: cameraVR.far
  65207. });
  65208. _currentDepthNear = cameraVR.near;
  65209. _currentDepthFar = cameraVR.far;
  65210. }
  65211. const parent = camera.parent;
  65212. const cameras = cameraVR.cameras;
  65213. updateCamera(cameraVR, parent);
  65214. for (let i = 0; i < cameras.length; i++) {
  65215. updateCamera(cameras[i], parent);
  65216. }
  65217. cameraVR.matrixWorld.decompose(cameraVR.position, cameraVR.quaternion, cameraVR.scale); // update user camera and its children
  65218. camera.position.copy(cameraVR.position);
  65219. camera.quaternion.copy(cameraVR.quaternion);
  65220. camera.scale.copy(cameraVR.scale);
  65221. camera.matrix.copy(cameraVR.matrix);
  65222. camera.matrixWorld.copy(cameraVR.matrixWorld);
  65223. const children = camera.children;
  65224. for (let i = 0, l = children.length; i < l; i++) {
  65225. children[i].updateMatrixWorld(true);
  65226. } // update projection matrix for proper view frustum culling
  65227. if (cameras.length === 2) {
  65228. setProjectionFromUnion(cameraVR, cameraL, cameraR);
  65229. } else {
  65230. // assume single camera setup (AR)
  65231. cameraVR.projectionMatrix.copy(cameraL.projectionMatrix);
  65232. }
  65233. };
  65234. this.getCamera = function () {
  65235. return cameraVR;
  65236. };
  65237. this.getFoveation = function () {
  65238. if (glProjLayer !== null) {
  65239. return glProjLayer.fixedFoveation;
  65240. }
  65241. if (glBaseLayer !== null) {
  65242. return glBaseLayer.fixedFoveation;
  65243. }
  65244. return undefined;
  65245. };
  65246. this.setFoveation = function (foveation) {
  65247. // 0 = no foveation = full resolution
  65248. // 1 = maximum foveation = the edges render at lower resolution
  65249. if (glProjLayer !== null) {
  65250. glProjLayer.fixedFoveation = foveation;
  65251. }
  65252. if (glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined) {
  65253. glBaseLayer.fixedFoveation = foveation;
  65254. }
  65255. }; // Animation Loop
  65256. let onAnimationFrameCallback = null;
  65257. function onAnimationFrame(time, frame) {
  65258. pose = frame.getViewerPose(customReferenceSpace || referenceSpace);
  65259. xrFrame = frame;
  65260. if (pose !== null) {
  65261. const views = pose.views;
  65262. if (glBaseLayer !== null) {
  65263. renderer.setRenderTargetFramebuffer(newRenderTarget, glBaseLayer.framebuffer);
  65264. renderer.setRenderTarget(newRenderTarget);
  65265. }
  65266. let cameraVRNeedsUpdate = false; // check if it's necessary to rebuild cameraVR's camera list
  65267. if (views.length !== cameraVR.cameras.length) {
  65268. cameraVR.cameras.length = 0;
  65269. cameraVRNeedsUpdate = true;
  65270. }
  65271. for (let i = 0; i < views.length; i++) {
  65272. const view = views[i];
  65273. let viewport = null;
  65274. if (glBaseLayer !== null) {
  65275. viewport = glBaseLayer.getViewport(view);
  65276. } else {
  65277. const glSubImage = glBinding.getViewSubImage(glProjLayer, view);
  65278. viewport = glSubImage.viewport; // For side-by-side projection, we only produce a single texture for both eyes.
  65279. if (i === 0) {
  65280. renderer.setRenderTargetTextures(newRenderTarget, glSubImage.colorTexture, glProjLayer.ignoreDepthValues ? undefined : glSubImage.depthStencilTexture);
  65281. renderer.setRenderTarget(newRenderTarget);
  65282. }
  65283. }
  65284. let camera = cameras[i];
  65285. if (camera === undefined) {
  65286. camera = new THREE.PerspectiveCamera();
  65287. camera.layers.enable(i);
  65288. camera.viewport = new THREE.Vector4();
  65289. cameras[i] = camera;
  65290. }
  65291. camera.matrix.fromArray(view.transform.matrix);
  65292. camera.projectionMatrix.fromArray(view.projectionMatrix);
  65293. camera.viewport.set(viewport.x, viewport.y, viewport.width, viewport.height);
  65294. if (i === 0) {
  65295. cameraVR.matrix.copy(camera.matrix);
  65296. }
  65297. if (cameraVRNeedsUpdate === true) {
  65298. cameraVR.cameras.push(camera);
  65299. }
  65300. }
  65301. } //
  65302. for (let i = 0; i < controllers.length; i++) {
  65303. const inputSource = controllerInputSources[i];
  65304. const controller = controllers[i];
  65305. if (inputSource !== null && controller !== undefined) {
  65306. controller.update(inputSource, frame, customReferenceSpace || referenceSpace);
  65307. }
  65308. }
  65309. if (onAnimationFrameCallback) onAnimationFrameCallback(time, frame);
  65310. xrFrame = null;
  65311. }
  65312. const animation = new WebGLAnimation();
  65313. animation.setAnimationLoop(onAnimationFrame);
  65314. this.setAnimationLoop = function (callback) {
  65315. onAnimationFrameCallback = callback;
  65316. };
  65317. this.dispose = function () {};
  65318. }
  65319. }
  65320. THREE.WebXRManager = WebXRManager
  65321. } */
  65322. /*
  65323. var addMagnifier = function(){
  65324. class Magnifier extends THREE.Object3D {
  65325. constructor () {
  65326. super()
  65327. let circleGeo = new THREE.CircleGeometry(0.1, 100);
  65328. this.camera = new THREE.PerspectiveCamera(50, 1, 0.1, 1); //fov aspect near far
  65329. this.renderTarget = new THREE.WebGLRenderTarget(256,256, {
  65330. minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
  65331. format: THREE.RGBAFormat ,
  65332. //type: THREE.FloatType,
  65333. //minFilter: THREE.NearestFilter,
  65334. //magFilter: THREE.NearestFilter,
  65335. } )
  65336. this.mesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  65337. side: THREE.DoubleSide ,
  65338. map: this.renderTarget.texture ,
  65339. transparent:true,
  65340. depthTest: !1,
  65341. depthWrite: !1,
  65342. }))
  65343. this.overlayMesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  65344. side: THREE.DoubleSide ,
  65345. map: Texture.load('images/crosshair.png') ,
  65346. transparent:true,
  65347. depthTest: !1,
  65348. depthWrite: !1,
  65349. }))
  65350. this.add(this.mesh)
  65351. this.add(this.overlayMesh)
  65352. player.model.add(this);
  65353. player.magnifier = this;
  65354. }
  65355. update(aimPos){
  65356. const magDistance_ = 0.3;
  65357. var playerPos = player.position
  65358. var vec = playerPos.clone().sub(aimPos).normalize().multiplyScalar(magDistance_)
  65359. this.camera.position.copy(aimPos.clone().add(vec))
  65360. this.camera.lookAt(aimPos)
  65361. var playerCamera = player.camera
  65362. this.quaternion.copy(playerCamera.quaternion);
  65363. var pos2d = player.mouse.clone();
  65364. var shift = 400;
  65365. var clientHeight = player.domElement.clientHeight
  65366. var clientY = - (pos2d.y - 1) * clientHeight / 2;
  65367. pos2d.y = clientY < 300 ? pos2d.y - shift/clientHeight : pos2d.y + shift/clientHeight
  65368. let newPos = new THREE.Vector3(pos2d.x,pos2d.y,0.7).unproject(playerCamera);
  65369. this.position.copy(newPos)
  65370. var renderer = player.sceneRenderer.renderer
  65371. var oldAutoClear = renderer.autoClear
  65372. renderer.autoClear = false
  65373. //renderer.clear( true, true, true );
  65374. renderer.render(player.sceneRenderer.scene, this.camera, this.renderTarget, true)
  65375. renderer.autoClear = oldAutoClear
  65376. }
  65377. }
  65378. new Magnifier()
  65379. }
  65380. */
  65381. /*
  65382. 笔记:
  65383. 导览缩放的几处: 1 搜索smoothZoomFovTo 2 flightStepWalk里
  65384. {
  65385. //到导览中某个点位(假设点位不重复)
  65386. var id = 73
  65387. var p = player.model.heroLocations.find(e=>e.heroLocations && e.heroLocations.find(e=>e.panoId == id))
  65388. var i = player.model.heroLocations.indexOf(p)
  65389. var p1 = p.heroLocations.find(e=>e.panoId == id)
  65390. var j = p.heroLocations.indexOf(p1)
  65391. player.director.goToHighlight([i,j])
  65392. }
  65393. 展示版导览改为就近导览,所以一开始并非第一个。如果在最后一个点上会自动从头开始
  65394. 关于pc-nav 4k
  65395. 两种选择,1 按照正常流程,因为nav为4k所以直接使用4k的tiledPanoRenderTarget, 但useUltraHighResolutionPanos需要开启才能达到4k,否则是2k。这样的话第一个点位需要手动重新替换tiledPanoRenderTarget,所以废弃
  65396. 2 使zoomed一直为true,直接使用zoomRenderTarget。 参考之前写过的三屏的本地4k。 且创建的tiledPanoRenderTarget不能超过2048否则过渡卡顿;且直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  65397. 如果body使用transform旋转90度,需要改的地方:
  65398. convertScreenPositionToNDC: function(e, t, i) {//rotate 90 body: transform: rotate(90deg);
  65399. return i = i || new n.Vector2,
  65400. i.y = e / $("#player").height() * 2 - 1, //注意,当body旋转90度后,虽然clientX和clinetY是按照正常垂直视角,但player的长宽和原先一样,不会因为倒转而交换
  65401. i.x = t / $("#player").width() * 2 - 1,
  65402. i
  65403. },
  65404. outsideControl的 n.prototype.onTouchMove = function(e) {中的
  65405. this.pan(this.panDelta.x, this.panDelta.y) 改为 this.pan(this.panDelta.y, -this.panDelta.x), //rotate 90
  65406. 还有
  65407. this.rotateLeft(2 * Math.PI * this.rotateDelta.y / $("#player").width() * this.rotateSpeed), //rotate 90
  65408. this.rotateUp(2 * Math.PI * -this.rotateDelta.x / $("#player").height() * this.rotateSpeed),
  65409. ===================
  65410. 一些事件
  65411. player.model.on("floor.changed",(currentFloor, mode, oldFloor)=>{//楼层变化
  65412. player.on("pano.chosen", 旧的pano, 新的pano) //点位变化前
  65413. player.on("flying.ended", 新位置, 旧位置, 新的pano, 旧的pano) //点位变化后
  65414. 一些后缀
  65415. &panoLabel 加pano标签
  65416. */